ITK  4.6.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)
90  throw ( ExceptionObject );
91 
93  MeasureType GetValue(const ParametersType & parameters) const;
94 
96  void GetDerivative(const ParametersType & parameters,
97  DerivativeType & Derivative) const;
98 
100  void GetValueAndDerivative(const ParametersType & parameters,
101  MeasureType & Value,
102  DerivativeType & Derivative) const;
103 
104 protected:
105 
107  virtual ~MeanSquaresImageToImageMetric();
108  void PrintSelf(std::ostream & os, Indent indent) const;
109 
110 private:
111 
112  //purposely not implemented
113  MeanSquaresImageToImageMetric(const Self &);
114  //purposely not implemented
115  void operator=(const Self &);
116 
117  inline bool GetValueThreadProcessSample(ThreadIdType threadId,
118  SizeValueType fixedImageSample,
119  const MovingImagePointType & mappedPoint,
120  double movingImageValue) const;
121 
123  SizeValueType fixedImageSample,
124  const MovingImagePointType & mappedPoint,
125  double movingImageValue,
126  const ImageDerivativesType &
127  movingImageGradientValue) const;
128 
129  struct PerThreadS
130  {
134  };
135 
136  itkAlignedTypedef( 64, PerThreadS, AlignedPerThreadType );
137  AlignedPerThreadType *m_PerThread;
138 };
139 } // end namespace itk
140 
141 #ifndef ITK_MANUAL_INSTANTIATION
142 #include "itkMeanSquaresImageToImageMetric.hxx"
143 #endif
144 
145 #endif
Array class with size defined at construction time.
Definition: itkArray.h:50
Superclass::CoordinateRepresentationType CoordinateRepresentationType
Light weight base class for most itk classes.
void GetDerivative(const ParametersType &parameters, DerivativeType &Derivative) const
bool GetValueAndDerivativeThreadProcessSample(ThreadIdType threadId, SizeValueType fixedImageSample, const MovingImagePointType &mappedPoint, double movingImageValue, const ImageDerivativesType &movingImageGradientValue) const
Superclass::ParametersValueType CoordinateRepresentationType
Superclass::TransformJacobianType TransformJacobianType
TransformType::Pointer TransformPointer
CovariantVector< double, itkGetStaticConstMacro(MovingImageDimension) > ImageDerivativesType
Superclass::FixedImagePointType FixedImagePointType
Superclass::DerivativeType DerivativeType
MovingImageType::ConstPointer MovingImageConstPointer
TransformType::OutputPointType MovingImagePointType
unsigned long SizeValueType
Definition: itkIntTypes.h:143
itkAlignedTypedef(64, PerThreadS, AlignedPerThreadType)
Array2D class representing a 2D array with size defined at construction time.
Definition: itkArray2D.h:44
Superclass::MovingImageConstPointer MovingImageConstPointer
Superclass::ParametersType ParametersType
Superclass::ImageDerivativesType ImageDerivativesType
Standard exception handling object.
Superclass::MovingImagePointType MovingImagePointType
void GetValueAndDerivative(const ParametersType &parameters, MeasureType &Value, DerivativeType &Derivative) const
BSplineTransformIndexArrayType::ValueType IndexValueType
std::vector< FixedImageSamplePoint > FixedImageSampleContainer
void PrintSelf(std::ostream &os, Indent indent) const
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
MeasureType GetValue(const ParametersType &parameters) const
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:51
Superclass::FixedImageSampleContainer FixedImageSampleContainer
A templated class holding a n-Dimensional covariant vector.
bool GetValueThreadProcessSample(ThreadIdType threadId, SizeValueType fixedImageSample, const MovingImagePointType &mappedPoint, double movingImageValue) const
unsigned int ThreadIdType
Definition: itkIntTypes.h:159