ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.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 itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod_h
19 #define itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod_h
20 
22 
26 
27 namespace itk
28 {
29 
86 template<typename TFixedImage, typename TMovingImage, typename TOutputTransform =
87  TimeVaryingBSplineVelocityFieldTransform<double, TFixedImage::ImageDimension>,
88  typename TVirtualImage = TFixedImage,
89  typename TPointSet = PointSet<unsigned int, TFixedImage::ImageDimension> >
91 : public ImageRegistrationMethodv4<TFixedImage, TMovingImage, TOutputTransform, TVirtualImage, TPointSet>
92 {
93 public:
96  typedef ImageRegistrationMethodv4<TFixedImage, TMovingImage, TOutputTransform,
97  TVirtualImage, TPointSet> Superclass;
100 
102  itkNewMacro( Self );
103 
105  itkStaticConstMacro( ImageDimension, unsigned int, TFixedImage::ImageDimension );
106 
108  itkTypeMacro( TimeVaryingBSplineVelocityFieldImageRegistrationMethod, SimpleImageRegistrationMethod );
109 
111  typedef TFixedImage FixedImageType;
112  typedef typename FixedImageType::Pointer FixedImagePointer;
114  typedef TMovingImage MovingImageType;
115  typedef typename MovingImageType::Pointer MovingImagePointer;
117 
118  typedef TPointSet InputPointSetType;
119  typedef typename InputPointSetType::Pointer InputPointSetPointer;
121 
127 
131 
136 
145 
147  typedef TOutputTransform OutputTransformType;
148  typedef typename OutputTransformType::Pointer OutputTransformPointer;
149  typedef typename OutputTransformType::ScalarType RealType;
150  typedef typename OutputTransformType::DerivativeType DerivativeType;
151  typedef typename DerivativeType::ValueType DerivativeValueType;
152  typedef typename OutputTransformType::DisplacementFieldType DisplacementFieldType;
153  typedef typename DisplacementFieldType::PointType DisplacementFieldPointType;
154 
156 
157  typedef typename OutputTransformType::TimeVaryingVelocityFieldControlPointLatticeType TimeVaryingVelocityFieldControlPointLatticeType;
158  typedef typename OutputTransformType::TimeVaryingVelocityFieldControlPointLatticePointer TimeVaryingVelocityFieldControlPointLatticePointer;
159  typedef typename OutputTransformType::TimeVaryingVelocityFieldControlPointLatticeType TimeVaryingVelocityFieldType;
160  typedef typename OutputTransformType::TimeVaryingVelocityFieldControlPointLatticePointer TimeVaryingVelocityFieldPointer;
161  typedef typename TimeVaryingVelocityFieldControlPointLatticeType::PixelType DisplacementVectorType;
162 
165 
168 
170 
173 
182 
184  itkSetMacro( LearningRate, RealType );
185  itkGetConstMacro( LearningRate, RealType );
187 
189  itkSetMacro( NumberOfIterationsPerLevel, NumberOfIterationsArrayType );
190  itkGetConstMacro( NumberOfIterationsPerLevel, NumberOfIterationsArrayType );
192 
194  itkSetMacro( ConvergenceThreshold, RealType );
195  itkGetConstMacro( ConvergenceThreshold, RealType );
197 
199  itkSetMacro( ConvergenceWindowSize, unsigned int );
200  itkGetConstMacro( ConvergenceWindowSize, unsigned int );
202 
204  itkSetMacro( NumberOfTimePointSamples, SizeValueType );
205  itkGetConstMacro( NumberOfTimePointSamples, SizeValueType );
207 
208 protected:
211  virtual void PrintSelf( std::ostream & os, Indent indent ) const ITK_OVERRIDE;
212 
214  virtual void GenerateData() ITK_OVERRIDE;
215 
217  virtual void StartOptimization();
218 
221 
223  VelocityFieldPointSetType *, WeightsContainerType *, const FixedImagesContainerType,
225  const PointSetsContainerType, const TransformBaseType *, const FixedImageMasksContainerType );
226 
227 private:
228  TimeVaryingBSplineVelocityFieldImageRegistrationMethod( const Self & ) ITK_DELETE_FUNCTION;
229  void operator=( const Self & ) ITK_DELETE_FUNCTION;
230 
232 
233  RealType m_LearningRate;
234 
237 
239 
241 
243 };
244 } // end namespace itk
245 
246 #ifndef ITK_MANUAL_INSTANTIATION
247 #include "itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx"
248 #endif
249 
250 #endif
Transform< RealType, ImageDimension, ImageDimension > InitialTransformType
Implementation of an image mask as spatial object.
Light weight base class for most itk classes.
Superclass::MeasureType MeasureType
BSplineScatteredDataPointSetToImageFilter< VelocityFieldPointSetType, TimeVaryingVelocityFieldType > BSplineFilterType
Provides local/dense/high-dimensionaltiy transformation via a a displacement field.
void GetMetricDerivativePointSetForAllTimePoints(VelocityFieldPointSetType *, WeightsContainerType *)
ImageMetricType::FixedImageMaskType FixedImageMaskType
unsigned long SizeValueType
Definition: itkIntTypes.h:143
ImageRegistrationMethodv4< TFixedImage, TMovingImage, TOutputTransform, TVirtualImage, TPointSet > Superclass
std::vector< MovingImageMaskConstPointer > MovingImageMasksContainerType
ImageToImageMetricv4< FixedImageType, MovingImageType, VirtualImageType, RealType > ImageMetricType
OutputTransformType::TimeVaryingVelocityFieldControlPointLatticePointer TimeVaryingVelocityFieldControlPointLatticePointer
Interface method for the current registration framework using the time varying velocity field transfo...
std::vector< FixedImageMaskConstPointer > FixedImageMasksContainerType
Superclass::DerivativeType DerivativeType
ImageMetricType::MovingImageMaskType MovingImageMaskType
A superclass of the N-dimensional mesh structure; supports point (geometric coordinate and attribute)...
Definition: itkPointSet.h:84
OutputTransformType::TimeVaryingVelocityFieldControlPointLatticeType TimeVaryingVelocityFieldControlPointLatticeType
Image filter which provides a B-spline output approximation.
std::vector< MovingImagePointer > MovingImagesContainerType
ObjectToObjectMetricBaseTemplate< RealType > MetricType
A templated class holding a point in n-Dimensional image space.
OutputTransformType::TimeVaryingVelocityFieldControlPointLatticePointer TimeVaryingVelocityFieldPointer
Define a front-end to the STL &quot;vector&quot; container that conforms to the IndexedContainerInterface.
DataObjectDecorator< OutputTransformType > DecoratedOutputTransformType
Superclass::TransformType TransformType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
std::vector< FixedImagePointer > FixedImagesContainerType
VirtualImageBaseType::ConstPointer VirtualImageBaseConstPointer
Interface method for the current registration framework.
PointSetToPointSetMetricv4< PointSetType, PointSetType, RealType > PointSetMetricType
CompositeTransform< RealType, ImageDimension > CompositeTransformType
void AttachMetricGradientPointSetAtSpecificTimePoint(const RealType, VelocityFieldPointSetType *, WeightsContainerType *, const FixedImagesContainerType, const PointSetsContainerType, const TransformBaseType *, const MovingImagesContainerType, const PointSetsContainerType, const TransformBaseType *, const FixedImageMasksContainerType)
OutputTransformType::ScalarType RealType
std::vector< PointSetConstPointer > PointSetsContainerType
ObjectToObjectMultiMetricv4< ImageDimension, ImageDimension, VirtualImageType, RealType > MultiMetricType
ImageBase< ImageDimension > VirtualImageBaseType
ContinuousIndex< typename DisplacementFieldPointType::CoordRepType, ImageDimension > ContinuousIndexType
virtual void PrintSelf(std::ostream &os, Indent indent) const override
Templated n-dimensional image class.
Definition: itkImage.h:75
OutputTransformType::TimeVaryingVelocityFieldControlPointLatticeType TimeVaryingVelocityFieldType