ITK  4.4.0
Insight Segmentation and Registration Toolkit
itkCorrelationImageToImageMetricv4.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 __itkCorrelationImageToImageMetricv4_h
19 #define __itkCorrelationImageToImageMetricv4_h
20 
22 
25 
26 namespace itk
27 {
28 
72 template <class TFixedImage, class TMovingImage, class TVirtualImage = TFixedImage >
74 public ImageToImageMetricv4<TFixedImage, TMovingImage, TVirtualImage>
75 {
76 public:
82 
84  itkNewMacro(Self);
85 
88 
90  typedef typename Superclass::MeasureType MeasureType;
91  typedef typename Superclass::DerivativeType DerivativeType;
92 
93  typedef typename Superclass::FixedImagePointType FixedImagePointType;
94  typedef typename Superclass::FixedImagePixelType FixedImagePixelType;
95  typedef typename Superclass::FixedImageGradientType FixedImageGradientType;
96 
97  typedef typename Superclass::MovingImagePointType MovingImagePointType;
98  typedef typename Superclass::MovingImagePixelType MovingImagePixelType;
99  typedef typename Superclass::MovingImageGradientType MovingImageGradientType;
100 
101  typedef typename Superclass::MovingTransformType MovingTransformType;
102  typedef typename Superclass::JacobianType JacobianType;
103  typedef typename Superclass::VirtualImageType VirtualImageType;
104  typedef typename Superclass::VirtualIndexType VirtualIndexType;
105  typedef typename Superclass::VirtualPointType VirtualPointType;
106  typedef typename Superclass::VirtualPointSetType VirtualPointSetType;
107 
108  /* Image dimension accessors */
109  itkStaticConstMacro(VirtualImageDimension, ImageDimensionType,
110  TVirtualImage::ImageDimension);
111  itkStaticConstMacro(FixedImageDimension, ImageDimensionType,
112  TFixedImage::ImageDimension);
113  itkStaticConstMacro(MovingImageDimension, ImageDimensionType,
114  TMovingImage::ImageDimension);
115 
116 protected:
119 
124  virtual void InitializeForIteration() const;
125 
127  friend class ImageToImageMetricv4GetValueAndDerivativeThreaderBase< ThreadedIndexedContainerPartitioner, Self >;
128  friend class ImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedImageRegionPartitioner< Superclass::VirtualImageDimension >, Self >;
129  friend class ImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedIndexedContainerPartitioner, Self >;
130 
131  friend class CorrelationImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedImageRegionPartitioner< Superclass::VirtualImageDimension >, Superclass, Self >;
132  friend class CorrelationImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedIndexedContainerPartitioner, Superclass, Self >;
133  typedef CorrelationImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedImageRegionPartitioner< Superclass::VirtualImageDimension >, Superclass, Self >
135  typedef CorrelationImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedIndexedContainerPartitioner, Superclass, Self >
137 
138  friend class CorrelationImageToImageMetricv4HelperThreader< ThreadedImageRegionPartitioner< Superclass::VirtualImageDimension >, Superclass, Self >;
139  friend class CorrelationImageToImageMetricv4HelperThreader< ThreadedIndexedContainerPartitioner, Superclass, Self >;
140 
141  typedef CorrelationImageToImageMetricv4HelperThreader< ThreadedImageRegionPartitioner< Superclass::VirtualImageDimension >, Superclass, Self >
143  typedef CorrelationImageToImageMetricv4HelperThreader< ThreadedIndexedContainerPartitioner, Superclass, Self >
145 
146  typename CorrelationHelperDenseThreaderType::Pointer m_HelperDenseThreader;
147  typename CorrelationHelperSparseThreaderType::Pointer m_HelperSparseThreader;
148 
149  /* These values are computed during InitializeForIteration(),
150  * using the helper class
151  * */
152  mutable MeasureType m_AverageFix;
153  mutable MeasureType m_AverageMov;
154 
155  void PrintSelf(std::ostream& os, Indent indent) const;
156 
157 private:
158  CorrelationImageToImageMetricv4(const Self &); //purposely not implemented
159  void operator = (const Self &); //purposely not implemented
160 };
161 
162 } // end namespace itk
163 
164 #ifndef ITK_MANUAL_INSTANTIATION
165 #include "itkCorrelationImageToImageMetricv4.hxx"
166 #endif
167 
168 #endif
169