ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkMutualInformationImageToImageMetric.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 itkMutualInformationImageToImageMetric_h
19 #define itkMutualInformationImageToImageMetric_h
20 
21 #include "itkImageToImageMetric.h"
22 #include "itkPoint.h"
23 
24 #include "itkIndex.h"
25 #include "itkKernelFunctionBase.h"
26 
27 namespace itk
28 {
93 template< typename TFixedImage, typename TMovingImage >
95  public ImageToImageMetric< TFixedImage, TMovingImage >
96 {
97 public:
98 
104 
106  itkNewMacro(Self);
107 
110 
112  typedef typename Superclass::TransformType TransformType;
123 
125  typedef typename FixedImageType::IndexType FixedImageIndexType;
127  typedef typename MovingImageType::IndexType MovingImageIndexType;
130 
132 
134  itkStaticConstMacro(MovingImageDimension, unsigned int,
135  MovingImageType::ImageDimension);
136 
138  void GetDerivative(
139  const ParametersType & parameters,
140  DerivativeType & Derivative) const ITK_OVERRIDE;
141 
143  MeasureType GetValue(const ParametersType & parameters) const ITK_OVERRIDE;
144 
146  void GetValueAndDerivative(const ParametersType & parameters,
147  MeasureType & Value, DerivativeType & Derivative) const ITK_OVERRIDE;
148 
153  void SetNumberOfSpatialSamples(unsigned int num);
154 
156  itkGetConstReferenceMacro(NumberOfSpatialSamples, unsigned int);
157 
163  itkSetClampMacro( MovingImageStandardDeviation, double,
165  itkGetConstReferenceMacro(MovingImageStandardDeviation, double);
167 
173  itkSetClampMacro( FixedImageStandardDeviation, double,
175  itkGetConstMacro(FixedImageStandardDeviation, double);
177 
180  itkSetObjectMacro(KernelFunction, KernelFunctionType);
181  itkGetModifiableObjectMacro(KernelFunction, KernelFunctionType);
183 
193  void ReinitializeSeed();
194 
195  void ReinitializeSeed(int);
196 
197 protected:
200  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
201 
202 private:
203  MutualInformationImageToImageMetric(const Self &) ITK_DELETE_FUNCTION;
204  void operator=(const Self &) ITK_DELETE_FUNCTION;
205 
212  {
213 public:
214  SpatialSample():FixedImageValue(0.0), MovingImageValue(0.0)
215  { FixedImagePointValue.Fill(0.0); }
217 
221  };
222 
224  typedef std::vector< SpatialSample > SpatialSampleContainer;
225 
229 
233 
238 
240 
246  virtual void SampleFixedImageDomain(SpatialSampleContainer & samples) const;
247 
252 
257 
259 
262 };
263 } // end namespace itk
264 
265 #ifndef ITK_MANUAL_INSTANTIATION
266 #include "itkMutualInformationImageToImageMetric.hxx"
267 #endif
268 
269 #endif
Array class with size defined at construction time.
Definition: itkArray.h:50
Light weight base class for most itk classes.
void CalculateDerivatives(const FixedImagePointType &, DerivativeType &, TransformJacobianType &) const
Superclass::ParametersValueType CoordinateRepresentationType
ImageToImageMetric< TFixedImage, TMovingImage > Superclass
void GetValueAndDerivative(const ParametersType &parameters, MeasureType &Value, DerivativeType &Derivative) const override
signed long IndexValueType
Definition: itkIntTypes.h:150
TransformType::Pointer TransformPointer
Superclass::DerivativeType DerivativeType
MovingImageType::ConstPointer MovingImageConstPointer
Calculate the derivative by central differencing.
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:82
Array2D class representing a 2D array with size defined at construction time.
Definition: itkArray2D.h:45
Computes the mutual information between two images to be registered.
Superclass::ParametersType ParametersType
KernelFunction is for backward compatibility with ITKv3.
Superclass::CoordinateRepresentationType CoordinateRepresentationType
virtual void SampleFixedImageDomain(SpatialSampleContainer &samples) const
MeasureType GetValue(const ParametersType &parameters) const override
void PrintSelf(std::ostream &os, Indent indent) const override
void SetNumberOfSpatialSamples(unsigned int num)
TransformType::JacobianType TransformJacobianType
CentralDifferenceImageFunction< MovingImageType, CoordinateRepresentationType > DerivativeFunctionType
InterpolateImageFunction< MovingImageType, CoordinateRepresentationType > InterpolatorType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
FixedImageType::ConstPointer FixedImageConstPointer
Define additional traits for native types such as int or float.
Superclass::MeasureType MeasureType
Computes similarity between regions of two images.
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:52
void GetDerivative(const ParametersType &parameters, DerivativeType &Derivative) const override