go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkAdvancedMeanSquaresImageToImageMetric.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright UMC Utrecht and contributors
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 __itkAdvancedMeanSquaresImageToImageMetric_h
19 #define __itkAdvancedMeanSquaresImageToImageMetric_h
20 
22 
23 #include "itkSmoothingRecursiveGaussianImageFilter.h" // needed for SelfHessian
24 #include "itkImageGridSampler.h" // needed for SelfHessian
25 #include "itkNearestNeighborInterpolateImageFunction.h" // needed for SelfHessian
26 
27 namespace itk
28 {
29 
55 template< class TFixedImage, class TMovingImage >
57  public AdvancedImageToImageMetric< TFixedImage, TMovingImage >
58 {
59 public:
60 
64  TFixedImage, TMovingImage > Superclass;
66  typedef SmartPointer< const Self > ConstPointer;
67 
69  itkNewMacro( Self );
70 
73 
75  typedef typename
92  typedef typename Superclass::RealType RealType;
111  typedef typename
115  typedef typename
117  typedef typename
119  typedef typename
125 
127  itkStaticConstMacro( FixedImageDimension, unsigned int,
128  FixedImageType::ImageDimension );
129 
131  itkStaticConstMacro( MovingImageDimension, unsigned int,
132  MovingImageType::ImageDimension );
133 
135  virtual MeasureType GetValueSingleThreaded( const TransformParametersType & parameters ) const;
136 
137  virtual MeasureType GetValue( const TransformParametersType & parameters ) const;
138 
140  virtual void GetDerivative( const TransformParametersType & parameters,
141  DerivativeType & derivative ) const;
142 
144  void GetValueAndDerivativeSingleThreaded( const TransformParametersType & parameters,
145  MeasureType & value, DerivativeType & derivative ) const;
146 
147  virtual void GetValueAndDerivative( const TransformParametersType & parameters,
148  MeasureType & value, DerivativeType & derivative ) const;
149 
151  virtual void GetSelfHessian( const TransformParametersType & parameters, HessianType & H ) const;
152 
154  itkSetMacro( SelfHessianSmoothingSigma, double );
155  itkGetConstMacro( SelfHessianSmoothingSigma, double );
156 
158  itkSetMacro( SelfHessianNoiseRange, double );
159  itkGetConstMacro( SelfHessianNoiseRange, double );
160 
162  itkSetMacro( NumberOfSamplesForSelfHessian, unsigned int );
163  itkGetConstMacro( NumberOfSamplesForSelfHessian, unsigned int );
164 
169  virtual void Initialize( void ) throw ( ExceptionObject );
170 
178  itkSetMacro( UseNormalization, bool );
179  itkGetConstMacro( UseNormalization, bool );
180 
186  itkSetMacro( UseOpenMP, bool );
187 
188 protected:
189 
192 
193  void PrintSelf( std::ostream & os, Indent indent ) const;
194 
208 
210  typedef SmoothingRecursiveGaussianImageFilter<
211  FixedImageType, FixedImageType > SmootherType;
212  typedef BSplineInterpolateImageFunction<
213  FixedImageType, CoordinateRepresentationType > FixedImageInterpolatorType;
214  typedef NearestNeighborInterpolateImageFunction<
215  FixedImageType, CoordinateRepresentationType > DummyFixedImageInterpolatorType;
217 
219 
223  const RealType fixedImageValue,
224  const RealType movingImageValue,
225  const DerivativeType & imageJacobian,
226  const NonZeroJacobianIndicesType & nzji,
227  MeasureType & measure,
228  DerivativeType & deriv ) const;
229 
233  const DerivativeType & imageJacobian,
234  const NonZeroJacobianIndicesType & nzji,
235  HessianType & H ) const;
236 
238  inline void ThreadedGetValue( ThreadIdType threadID );
239 
241  inline void AfterThreadedGetValue( MeasureType & value ) const;
242 
244  inline void ThreadedGetValueAndDerivative( ThreadIdType threadID );
245 
248  MeasureType & value, DerivativeType & derivative ) const;
249 
250 private:
251 
252  AdvancedMeanSquaresImageToImageMetric( const Self & ); // purposely not implemented
253  void operator=( const Self & ); // purposely not implemented
254 
259 
260 };
261 
262 } // end namespace itk
263 
264 #ifndef ITK_MANUAL_INSTANTIATION
265 #include "itkAdvancedMeanSquaresImageToImageMetric.hxx"
266 #endif
267 
268 #endif // end #ifndef __itkAdvancedMeanSquaresImageToImageMetric_h
Compute Mean square difference between two images, based on AdvancedImageToImageMetric...
virtual MeasureType GetValue(const TransformParametersType &parameters) const
AdvancedTransformType::NumberOfParametersType NumberOfParametersType
Superclass::ImageSampleContainerPointer ImageSampleContainerPointer
void UpdateValueAndDerivativeTerms(const RealType fixedImageValue, const RealType movingImageValue, const DerivativeType &imageJacobian, const NonZeroJacobianIndicesType &nzji, MeasureType &measure, DerivativeType &deriv) const
LimiterFunctionBase< RealType, FixedImageDimension > FixedImageLimiterType
Superclass::CoordinateRepresentationType CoordinateRepresentationType
Superclass::TransformParametersType TransformParametersType
virtual void GetDerivative(const TransformParametersType &parameters, DerivativeType &derivative) const
Superclass::FixedImageMaskPointer FixedImageMaskPointer
Superclass::FixedImageLimiterOutputType FixedImageLimiterOutputType
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics...
Superclass::GradientPixelType GradientPixelType
FixedImageLimiterType::OutputType FixedImageLimiterOutputType
Superclass::FixedImageRegionType FixedImageRegionType
AdvancedImageToImageMetric< TFixedImage, TMovingImage > Superclass
ImageSamplerType::OutputVectorContainerType ImageSampleContainerType
MovingImageType::IndexType MovingImageIndexType
Superclass::MovingImageContinuousIndexType MovingImageContinuousIndexType
InterpolatorType::ContinuousIndexType MovingImageContinuousIndexType
TransformType::InputPointType FixedImagePointType
Superclass::GradientImageFilterPointer GradientImageFilterPointer
FixedArray< double, Self::MovingImageDimension > MovingImageDerivativeScalesType
void UpdateSelfHessianTerms(const DerivativeType &imageJacobian, const NonZeroJacobianIndicesType &nzji, HessianType &H) const
BSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double > BSplineInterpolatorType
ImageSamplerBase< FixedImageType > ImageSamplerType
AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
void ThreadedGetValue(ThreadIdType threadID)
Superclass::MovingImageLimiterOutputType MovingImageLimiterOutputType
void AfterThreadedGetValueAndDerivative(MeasureType &value, DerivativeType &derivative) const
Superclass::InterpolatorPointer InterpolatorPointer
BSplineInterpolateImageFunction< FixedImageType, CoordinateRepresentationType > FixedImageInterpolatorType
virtual void GetValueAndDerivative(const TransformParametersType &parameters, MeasureType &value, DerivativeType &derivative) const
void GetValueAndDerivativeSingleThreaded(const TransformParametersType &parameters, MeasureType &value, DerivativeType &derivative) const
FixedImageIndexType::IndexValueType FixedImageIndexValueType
TransformType::OutputPointType MovingImagePointType
Superclass::MovingImageMaskType MovingImageMaskType
void AfterThreadedGetValue(MeasureType &value) const
LimiterFunctionBase< RealType, MovingImageDimension > MovingImageLimiterType
Superclass::GradientImageType GradientImageType
Superclass::TransformPointer TransformPointer
Superclass::CoordinateRepresentationType CoordinateRepresentationType
Superclass::GradientImageFilterType GradientImageFilterType
MovingImageType::RegionType MovingImageRegionType
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
Superclass::InterpolatorType InterpolatorType
Superclass::TransformJacobianType TransformJacobianType
Superclass::CentralDifferenceGradientFilterType CentralDifferenceGradientFilterType
NearestNeighborInterpolateImageFunction< FixedImageType, CoordinateRepresentationType > DummyFixedImageInterpolatorType
Superclass::MovingImagePixelType MovingImagePixelType
GradientImageFilter< MovingImageType, RealType, RealType > CentralDifferenceGradientFilterType
virtual void GetSelfHessian(const TransformParametersType &parameters, HessianType &H) const
Superclass::MovingImageDerivativeScalesType MovingImageDerivativeScalesType
Superclass::MovingImageMaskPointer MovingImageMaskPointer
SmoothingRecursiveGaussianImageFilter< FixedImageType, FixedImageType > SmootherType
MovingImageLimiterType::OutputType MovingImageLimiterOutputType
ThreaderType::ThreadInfoStruct ThreadInfoType
virtual MeasureType GetValueSingleThreaded(const TransformParametersType &parameters) const
ImageSamplerType::OutputVectorContainerPointer ImageSampleContainerPointer
Superclass::FixedImageMaskType FixedImageMaskType
void ThreadedGetValueAndDerivative(ThreadIdType threadID)
BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
void PrintSelf(std::ostream &os, Indent indent) const
Samples image voxels on a regular grid.
Superclass::FixedImageConstPointer FixedImageConstPointer
Superclass::MovingImageConstPointer MovingImageConstPointer
Superclass::GradientImageFilterPointer GradientImageFilterPointer
vnl_sparse_matrix< HessianValueType > HessianType
Superclass::GradientImagePointer GradientImagePointer


Generated on OURCE_DATE_EPOCH for elastix by doxygen 1.8.13 elastix logo