ITK  4.4.0
Insight Segmentation and Registration Toolkit
itkDemonsImageToImageMetricv4.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 __itkDemonsImageToImageMetricv4_h
19 #define __itkDemonsImageToImageMetricv4_h
20 
22 
24 
25 namespace itk
26 {
27 
54 template <class TFixedImage, class TMovingImage, class TVirtualImage = TFixedImage >
55 class ITK_EXPORT DemonsImageToImageMetricv4 :
56 public ImageToImageMetricv4<TFixedImage, TMovingImage, TVirtualImage>
57 {
58 public:
64 
66  itkNewMacro(Self);
67 
70 
72  typedef typename Superclass::MeasureType MeasureType;
73  typedef typename Superclass::DerivativeType DerivativeType;
74 
75  typedef typename Superclass::FixedImagePointType FixedImagePointType;
76  typedef typename Superclass::FixedImagePixelType FixedImagePixelType;
77  typedef typename Superclass::FixedImageGradientType FixedImageGradientType;
78 
79  typedef typename Superclass::MovingImagePointType MovingImagePointType;
80  typedef typename Superclass::MovingImagePixelType MovingImagePixelType;
81  typedef typename Superclass::MovingImageGradientType MovingImageGradientType;
82 
83  typedef typename Superclass::MovingTransformType MovingTransformType;
84  typedef typename Superclass::JacobianType JacobianType;
85  typedef typename Superclass::VirtualImageType VirtualImageType;
86  typedef typename Superclass::VirtualIndexType VirtualIndexType;
87  typedef typename Superclass::VirtualPointType VirtualPointType;
88  typedef typename Superclass::VirtualPointSetType VirtualSPointSetType;
89  typedef typename Superclass::NumberOfParametersType NumberOfParametersType;
90 
91  typedef typename Superclass::InternalComputationValueType InternalComputationValueType;
92 
93  typedef typename Superclass::ImageDimensionType ImageDimensionType;
94 
95  /* Image dimension accessors */
96  itkStaticConstMacro(VirtualImageDimension, ImageDimensionType,
97  TVirtualImage::ImageDimension);
98  itkStaticConstMacro(FixedImageDimension, ImageDimensionType,
99  TFixedImage::ImageDimension);
100  itkStaticConstMacro(MovingImageDimension, ImageDimensionType,
101  TMovingImage::ImageDimension);
102 
103  virtual void Initialize(void) throw ( itk::ExceptionObject );
104 
107  itkGetConstMacro(IntensityDifferenceThreshold, InternalComputationValueType);
108  itkSetMacro(IntensityDifferenceThreshold, InternalComputationValueType);
110 
112  itkGetConstMacro(DenominatorThreshold, InternalComputationValueType);
113 
114 protected:
115  itkGetConstMacro(Normalizer, InternalComputationValueType);
116 
118  virtual ~DemonsImageToImageMetricv4();
119 
122  typedef DemonsImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedImageRegionPartitioner< Superclass::VirtualImageDimension >, Superclass, Self >
124  typedef DemonsImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedIndexedContainerPartitioner, Superclass, Self >
126 
127  void PrintSelf(std::ostream& os, Indent indent) const;
128 
129 private:
130 
133  InternalComputationValueType m_DenominatorThreshold;
134 
136  InternalComputationValueType m_IntensityDifferenceThreshold;
137 
138  /* Used to normalize derivative calculation. Automatically calculated */
139  InternalComputationValueType m_Normalizer;
140 
141  DemonsImageToImageMetricv4(const Self &); //purposely not implemented
142  void operator = (const Self &); //purposely not implemented
143 };
144 
145 } // end namespace itk
146 
147 #ifndef ITK_MANUAL_INSTANTIATION
148 #include "itkDemonsImageToImageMetricv4.hxx"
149 #endif
150 
151 #endif
152