ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkMeanSquaresImageToImageMetric.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 itkMeanSquaresImageToImageMetric_h
19 #define itkMeanSquaresImageToImageMetric_h
20 
21 #include "itkImageToImageMetric.h"
22 #include "itkPoint.h"
23 #include "itkIndex.h"
24 
25 
26 namespace itk
27 {
28 
38 template< typename TFixedImage, typename TMovingImage >
40  public ImageToImageMetric< TFixedImage, TMovingImage >
41 {
42 public:
43 
49 
51  itkNewMacro(Self);
52 
55 
74 
75  // Needed for evaluation of Jacobian.
77 
79  itkStaticConstMacro(MovingImageDimension, unsigned int,
80  MovingImageType::ImageDimension);
81 
89  virtual void Initialize(void) throw ( ExceptionObject ) ITK_OVERRIDE;
90 
92  MeasureType GetValue(const ParametersType & parameters) const ITK_OVERRIDE;
93 
95  void GetDerivative(const ParametersType & parameters,
96  DerivativeType & Derivative) const ITK_OVERRIDE;
97 
99  void GetValueAndDerivative(const ParametersType & parameters,
100  MeasureType & Value,
101  DerivativeType & Derivative) const ITK_OVERRIDE;
102 
103 protected:
104 
106  virtual ~MeanSquaresImageToImageMetric();
107  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
108 
109 private:
110 
111  MeanSquaresImageToImageMetric(const Self &) ITK_DELETE_FUNCTION;
112  void operator=(const Self &) ITK_DELETE_FUNCTION;
113 
114  inline bool GetValueThreadProcessSample(ThreadIdType threadId,
115  SizeValueType fixedImageSample,
116  const MovingImagePointType & mappedPoint,
117  double movingImageValue) const ITK_OVERRIDE;
118 
120  SizeValueType fixedImageSample,
121  const MovingImagePointType & mappedPoint,
122  double movingImageValue,
123  const ImageDerivativesType &
124  movingImageGradientValue) const ITK_OVERRIDE;
125 
126  struct PerThreadS
127  {
131  };
132 
133  itkAlignedTypedef( 64, PerThreadS, AlignedPerThreadType );
134  AlignedPerThreadType *m_PerThread;
135 };
136 } // end namespace itk
137 
138 #ifndef ITK_MANUAL_INSTANTIATION
139 #include "itkMeanSquaresImageToImageMetric.hxx"
140 #endif
141 
142 #endif
Array class with size defined at construction time.
Definition: itkArray.h:50
Superclass::CoordinateRepresentationType CoordinateRepresentationType
Light weight base class for most itk classes.
bool GetValueAndDerivativeThreadProcessSample(ThreadIdType threadId, SizeValueType fixedImageSample, const MovingImagePointType &mappedPoint, double movingImageValue, const ImageDerivativesType &movingImageGradientValue) const override
void GetValueAndDerivative(const ParametersType &parameters, MeasureType &Value, DerivativeType &Derivative) const override
Superclass::ParametersValueType CoordinateRepresentationType
Superclass::TransformJacobianType TransformJacobianType
TransformType::Pointer TransformPointer
CovariantVector< double, itkGetStaticConstMacro(MovingImageDimension) > ImageDerivativesType
void GetDerivative(const ParametersType &parameters, DerivativeType &Derivative) const override
MeasureType GetValue(const ParametersType &parameters) const override
Superclass::FixedImagePointType FixedImagePointType
Superclass::DerivativeType DerivativeType
MovingImageType::ConstPointer MovingImageConstPointer
TransformType::OutputPointType MovingImagePointType
unsigned long SizeValueType
Definition: itkIntTypes.h:143
itkAlignedTypedef(64, PerThreadS, AlignedPerThreadType)
void PrintSelf(std::ostream &os, Indent indent) const override
virtual void Initialize(void) override
Array2D class representing a 2D array with size defined at construction time.
Definition: itkArray2D.h:45
Superclass::MovingImageConstPointer MovingImageConstPointer
Superclass::ParametersType ParametersType
Superclass::ImageDerivativesType ImageDerivativesType
Standard exception handling object.
Superclass::MovingImagePointType MovingImagePointType
BSplineTransformIndexArrayType::ValueType IndexValueType
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
bool GetValueThreadProcessSample(ThreadIdType threadId, SizeValueType fixedImageSample, const MovingImagePointType &mappedPoint, double movingImageValue) const override
std::vector< FixedImageSamplePoint > FixedImageSampleContainer
TransformType::JacobianType TransformJacobianType
BSplineTransformWeightsType::ValueType WeightsValueType
InterpolateImageFunction< MovingImageType, CoordinateRepresentationType > InterpolatorType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
FixedImageType::ConstPointer FixedImageConstPointer
TransformType::InputPointType FixedImagePointType
ImageToImageMetric< TFixedImage, TMovingImage > Superclass
Superclass::MeasureType MeasureType
Transform< CoordinateRepresentationType, itkGetStaticConstMacro(MovingImageDimension), itkGetStaticConstMacro(FixedImageDimension) > TransformType
Computes similarity between regions of two images.
Superclass::FixedImageConstPointer FixedImageConstPointer
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:52
Superclass::FixedImageSampleContainer FixedImageSampleContainer
A templated class holding a n-Dimensional covariant vector.