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 GetValue( const TransformParametersType & parameters ) const;
136 
138  virtual void GetDerivative( const TransformParametersType & parameters,
139  DerivativeType & derivative ) const;
140 
142  void GetValueAndDerivativeSingleThreaded( const TransformParametersType & parameters,
143  MeasureType & value, DerivativeType & derivative ) const;
144 
145  virtual void GetValueAndDerivative( const TransformParametersType & parameters,
146  MeasureType & value, DerivativeType & derivative ) const;
147 
149  virtual void GetSelfHessian( const TransformParametersType & parameters, HessianType & H ) const;
150 
152  itkSetMacro( SelfHessianSmoothingSigma, double );
153  itkGetConstMacro( SelfHessianSmoothingSigma, double );
154 
156  itkSetMacro( SelfHessianNoiseRange, double );
157  itkGetConstMacro( SelfHessianNoiseRange, double );
158 
160  itkSetMacro( NumberOfSamplesForSelfHessian, unsigned int );
161  itkGetConstMacro( NumberOfSamplesForSelfHessian, unsigned int );
162 
167  virtual void Initialize( void ) throw ( ExceptionObject );
168 
176  itkSetMacro( UseNormalization, bool );
177  itkGetConstMacro( UseNormalization, bool );
178 
184  itkSetMacro( UseOpenMP, bool );
185 
186 protected:
187 
189  virtual ~AdvancedMeanSquaresImageToImageMetric(){}
190 
191  void PrintSelf( std::ostream & os, Indent indent ) const;
192 
206 
208  typedef SmoothingRecursiveGaussianImageFilter<
209  FixedImageType, FixedImageType > SmootherType;
210  typedef BSplineInterpolateImageFunction<
211  FixedImageType, CoordinateRepresentationType > FixedImageInterpolatorType;
212  typedef NearestNeighborInterpolateImageFunction<
213  FixedImageType, CoordinateRepresentationType > DummyFixedImageInterpolatorType;
215 
217 
221  const RealType fixedImageValue,
222  const RealType movingImageValue,
223  const DerivativeType & imageJacobian,
224  const NonZeroJacobianIndicesType & nzji,
225  MeasureType & measure,
226  DerivativeType & deriv ) const;
227 
231  const DerivativeType & imageJacobian,
232  const NonZeroJacobianIndicesType & nzji,
233  HessianType & H ) const;
234 
236  inline void ThreadedGetValueAndDerivative( ThreadIdType threadID );
237 
240  MeasureType & value, DerivativeType & derivative ) const;
241 
242 private:
243 
244  AdvancedMeanSquaresImageToImageMetric( const Self & ); // purposely not implemented
245  void operator=( const Self & ); // purposely not implemented
246 
251 
252 };
253 
254 } // end namespace itk
255 
256 #ifndef ITK_MANUAL_INSTANTIATION
257 #include "itkAdvancedMeanSquaresImageToImageMetric.hxx"
258 #endif
259 
260 #endif // end #ifndef __itkAdvancedMeanSquaresImageToImageMetric_h
Compute Mean square difference between two images, based on AdvancedImageToImageMetric...
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
void UpdateSelfHessianTerms(const DerivativeType &imageJacobian, const NonZeroJacobianIndicesType &nzji, HessianType &H) 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
void PrintSelf(std::ostream &os, Indent indent) const
void AfterThreadedGetValueAndDerivative(MeasureType &value, DerivativeType &derivative) const
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
BSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double > BSplineInterpolatorType
ImageSamplerBase< FixedImageType > ImageSamplerType
virtual MeasureType GetValue(const TransformParametersType &parameters) const
AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
Superclass::MovingImageLimiterOutputType MovingImageLimiterOutputType
Superclass::InterpolatorPointer InterpolatorPointer
BSplineInterpolateImageFunction< FixedImageType, CoordinateRepresentationType > FixedImageInterpolatorType
FixedImageIndexType::IndexValueType FixedImageIndexValueType
TransformType::OutputPointType MovingImagePointType
Superclass::MovingImageMaskType MovingImageMaskType
LimiterFunctionBase< RealType, MovingImageDimension > MovingImageLimiterType
Superclass::GradientImageType GradientImageType
Superclass::TransformPointer TransformPointer
Superclass::CoordinateRepresentationType CoordinateRepresentationType
virtual void GetSelfHessian(const TransformParametersType &parameters, HessianType &H) const
Superclass::GradientImageFilterType GradientImageFilterType
MovingImageType::RegionType MovingImageRegionType
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
Superclass::InterpolatorType InterpolatorType
Superclass::TransformJacobianType TransformJacobianType
Superclass::CentralDifferenceGradientFilterType CentralDifferenceGradientFilterType
void GetValueAndDerivativeSingleThreaded(const TransformParametersType &parameters, MeasureType &value, DerivativeType &derivative) const
NearestNeighborInterpolateImageFunction< FixedImageType, CoordinateRepresentationType > DummyFixedImageInterpolatorType
Superclass::MovingImagePixelType MovingImagePixelType
GradientImageFilter< MovingImageType, RealType, RealType > CentralDifferenceGradientFilterType
virtual void GetValueAndDerivative(const TransformParametersType &parameters, MeasureType &value, DerivativeType &derivative) const
Superclass::MovingImageDerivativeScalesType MovingImageDerivativeScalesType
Superclass::MovingImageMaskPointer MovingImageMaskPointer
SmoothingRecursiveGaussianImageFilter< FixedImageType, FixedImageType > SmootherType
MovingImageLimiterType::OutputType MovingImageLimiterOutputType
ThreaderType::ThreadInfoStruct ThreadInfoType
ImageSamplerType::OutputVectorContainerPointer ImageSampleContainerPointer
Superclass::FixedImageMaskType FixedImageMaskType
void ThreadedGetValueAndDerivative(ThreadIdType threadID)
BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
Samples image voxels on a regular grid.
Superclass::FixedImageConstPointer FixedImageConstPointer
Superclass::MovingImageConstPointer MovingImageConstPointer
virtual void GetDerivative(const TransformParametersType &parameters, DerivativeType &derivative) const
Superclass::GradientImageFilterPointer GradientImageFilterPointer
vnl_sparse_matrix< HessianValueType > HessianType
Superclass::GradientImagePointer GradientImagePointer


Generated on 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo