ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkBSplineSyNImageRegistrationMethod.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkBSplineSyNImageRegistrationMethod_h
19 #define itkBSplineSyNImageRegistrationMethod_h
20 
22 
24 
25 namespace itk
26 {
27 
45 template<typename TFixedImage, typename TMovingImage, typename TOutputTransform =
46  BSplineSmoothingOnUpdateDisplacementFieldTransform<double, TFixedImage::ImageDimension>,
47  typename TVirtualImage = TFixedImage,
48  typename TPointSet = PointSet<unsigned int, TFixedImage::ImageDimension> >
49 class ITK_TEMPLATE_EXPORT BSplineSyNImageRegistrationMethod
50 : public SyNImageRegistrationMethod<TFixedImage, TMovingImage, TOutputTransform, TVirtualImage, TPointSet>
51 {
52 public:
55  typedef SyNImageRegistrationMethod<TFixedImage, TMovingImage, TOutputTransform,
56  TVirtualImage, TPointSet> Superclass;
59 
61  itkNewMacro( Self );
62 
64  itkStaticConstMacro( ImageDimension, unsigned int, TFixedImage::ImageDimension );
65 
68 
70  typedef TFixedImage FixedImageType;
71  typedef typename FixedImageType::Pointer FixedImagePointer;
72  typedef typename Superclass::FixedImagesContainerType FixedImagesContainerType;
73  typedef TMovingImage MovingImageType;
74  typedef typename MovingImageType::Pointer MovingImagePointer;
75  typedef typename Superclass::MovingImagesContainerType MovingImagesContainerType;
76 
77  typedef typename Superclass::PointSetType PointSetType;
78  typedef typename Superclass::PointSetsContainerType PointSetsContainerType;
79 
81  typedef typename Superclass::ImageMetricType ImageMetricType;
82  typedef typename ImageMetricType::Pointer ImageMetricPointer;
83  typedef typename ImageMetricType::MeasureType MeasureType;
84 
85  typedef typename Superclass::ImageMaskSpatialObjectType ImageMaskSpatialObjectType;
86  typedef typename ImageMaskSpatialObjectType::ImageType MaskImageType;
87  typedef typename Superclass::FixedImageMaskType FixedImageMaskType;
88  typedef typename ImageMaskSpatialObjectType::ImageType FixedMaskImageType;
89  typedef typename Superclass::FixedImageMasksContainerType FixedImageMasksContainerType;
90  typedef typename Superclass::MovingImageMaskType MovingImageMaskType;
91  typedef typename ImageMaskSpatialObjectType::ImageType MovingMaskImageType;
92  typedef typename Superclass::MovingImageMasksContainerType MovingImageMasksContainerType;
93 
94  typedef typename Superclass::VirtualImageType VirtualImageType;
95  typedef typename Superclass::VirtualImageBaseType VirtualImageBaseType;
96  typedef typename Superclass::VirtualImageBaseConstPointer VirtualImageBaseConstPointer;
97 
98  typedef typename Superclass::MultiMetricType MultiMetricType;
99  typedef typename Superclass::MetricType MetricType;
100  typedef typename MetricType::Pointer MetricPointer;
101  typedef typename Superclass::PointSetMetricType PointSetMetricType;
102 
103  typedef typename Superclass::NumberOfIterationsArrayType NumberOfIterationsArrayType;
104 
105  typedef typename Superclass::InitialTransformType InitialTransformType;
106  typedef TOutputTransform OutputTransformType;
107  typedef typename OutputTransformType::Pointer OutputTransformPointer;
108  typedef typename OutputTransformType::ScalarType RealType;
109  typedef typename OutputTransformType::DerivativeType DerivativeType;
110  typedef typename DerivativeType::ValueType DerivativeValueType;
111  typedef typename OutputTransformType::DisplacementFieldType DisplacementFieldType;
112  typedef typename DisplacementFieldType::Pointer DisplacementFieldPointer;
113  typedef typename DisplacementFieldType::PixelType DisplacementVectorType;
114 
119 
120  typedef typename Superclass::CompositeTransformType CompositeTransformType;
121  typedef typename Superclass::DisplacementFieldTransformType DisplacementFieldTransformType;
122  typedef typename Superclass::DisplacementFieldTransformPointer DisplacementFieldTransformPointer;
123  typedef typename CompositeTransformType::TransformType TransformBaseType;
124 
125  typedef typename Superclass::DecoratedOutputTransformType DecoratedOutputTransformType;
126  typedef typename DecoratedOutputTransformType::Pointer DecoratedOutputTransformPointer;
127 
128 protected:
130  virtual ~BSplineSyNImageRegistrationMethod() ITK_OVERRIDE;
131 
133  virtual void StartOptimization() ITK_OVERRIDE;
134 
135  virtual void InitializeRegistrationAtEachLevel( const SizeValueType ) ITK_OVERRIDE;
136 
137  virtual DisplacementFieldPointer ComputeUpdateField( const FixedImagesContainerType, const PointSetsContainerType,
138  const TransformBaseType *, const MovingImagesContainerType, const PointSetsContainerType,
139  const TransformBaseType *, const FixedImageMasksContainerType, const MovingImageMasksContainerType,
140  MeasureType & ) ITK_OVERRIDE;
141  virtual DisplacementFieldPointer BSplineSmoothDisplacementField( const DisplacementFieldType *,
142  const ArrayType &, const WeightedMaskImageType *, const BSplinePointSetType * );
143 
144 private:
145  ITK_DISALLOW_COPY_AND_ASSIGN(BSplineSyNImageRegistrationMethod);
146 };
147 } // end namespace itk
148 
149 #ifndef ITK_MANUAL_INSTANTIATION
150 #include "itkBSplineSyNImageRegistrationMethod.hxx"
151 #endif
152 
153 #endif
Superclass::DecoratedOutputTransformType DecoratedOutputTransformType
Superclass::VirtualImageBaseConstPointer VirtualImageBaseConstPointer
Light weight base class for most itk classes.
Superclass::MovingImagesContainerType MovingImagesContainerType
Superclass::DisplacementFieldTransformType DisplacementFieldTransformType
Superclass::NumberOfIterationsArrayType NumberOfIterationsArrayType
Superclass::PointSetsContainerType PointSetsContainerType
unsigned long SizeValueType
Definition: itkIntTypes.h:143
ImageMaskSpatialObjectType::ImageType MaskImageType
Superclass::ImageMaskSpatialObjectType ImageMaskSpatialObjectType
Interface method for the performing greedy SyN image registration.
DecoratedOutputTransformType::Pointer DecoratedOutputTransformPointer
ImageMaskSpatialObjectType::ImageType MovingMaskImageType
CompositeTransformType::TransformType TransformBaseType
Superclass::MovingImageMasksContainerType MovingImageMasksContainerType
Superclass::FixedImagesContainerType FixedImagesContainerType
Superclass::DisplacementFieldTransformPointer DisplacementFieldTransformPointer
ImageMaskSpatialObjectType::ImageType FixedMaskImageType
Superclass::FixedImageMasksContainerType FixedImageMasksContainerType
SyNImageRegistrationMethod< TFixedImage, TMovingImage, TOutputTransform, TVirtualImage, TPointSet > Superclass
Interface method for the performing greedy B-spline SyN image registration.
Class which takes a dense displacement field image and/or a set of points with associated displacemen...
BSplineFilterType::InputPointSetType BSplinePointSetType
OutputTransformType::DisplacementFieldType DisplacementFieldType
Templated n-dimensional image class.
Definition: itkImage.h:75
DisplacementFieldToBSplineImageFilter< DisplacementFieldType > BSplineFilterType