go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkGradientDifferenceImageToImageMetric2.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright UMC Utrecht and contributors
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/*=========================================================================
19
20 Program: Insight Segmentation & Registration Toolkit
21 Module: $RCSfile: itkGradientDifferenceImageToImageMetric2.h,v $
22 Language: C++
23 Date: $Date: 2011-29-04 14:33 $
24 Version: $Revision: 2.0 $
25
26 Copyright (c) Insight Software Consortium. All rights reserved.
27 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
28
29 This software is distributed WITHOUT ANY WARRANTY; without even
30 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
31 PURPOSE. See the above copyright notices for more information.
32
33=========================================================================*/
34#ifndef __itkGradientDifferenceImageToImageMetric2_h
35#define __itkGradientDifferenceImageToImageMetric2_h
36
38
39#include "itkSobelOperator.h"
40#include "itkNeighborhoodOperatorImageFilter.h"
41#include "itkPoint.h"
42#include "itkCastImageFilter.h"
43#include "itkResampleImageFilter.h"
44#include "itkOptimizer.h"
47
48namespace itk
49{
74template< class TFixedImage, class TMovingImage >
76 public AdvancedImageToImageMetric< TFixedImage, TMovingImage >
77{
78public:
79
83
85 typedef SmartPointer< const Self > ConstPointer;
86
88 itkNewMacro( Self );
89
91 itkTypeMacro( GradientDifferenceImageToImageMetric, ImageToImageMetric );
92
95 #if defined( _MSC_VER ) && ( _MSC_VER == 1300 )
96 typedef double RealType;
97 #else
99 #endif
100
102 typedef typename TransformType::ScalarType ScalarType;
107 typedef typename InterpolatorType::Pointer InterpolatorPointer;
114 typedef typename TFixedImage::PixelType FixedImagePixelType;
115 typedef typename TMovingImage::PixelType MovedImagePixelType;
116 typedef typename MovingImageType::RegionType MovingImageRegionType;
117 typedef typename itk::Optimizer OptimizerType;
118 typedef typename OptimizerType::ScalesType ScalesType;
119
120 itkStaticConstMacro( FixedImageDimension, unsigned int,
121 FixedImageType::ImageDimension );
122 itkStaticConstMacro( MovedImageDimension, unsigned int,
123 MovingImageType::ImageDimension );
124
128 typedef itk::Image< FixedImagePixelType, itkGetStaticConstMacro( FixedImageDimension ) >
130 typedef itk::ResampleImageFilter< MovingImageType, TransformedMovingImageType >
135 typedef itk::Image< RealType, itkGetStaticConstMacro( FixedImageDimension ) >
137 typedef itk::CastImageFilter< FixedImageType, FixedGradientImageType >
139 typedef typename CastFixedImageFilterType::Pointer CastFixedImageFilterPointer;
140 typedef typename FixedGradientImageType::PixelType FixedGradientPixelType;
141 typedef itk::Image< RealType, itkGetStaticConstMacro( MovedImageDimension ) >
143 typedef itk::CastImageFilter< TransformedMovingImageType, MovedGradientImageType >
145 typedef typename CastMovedImageFilterType::Pointer CastMovedImageFilterPointer;
146 typedef typename MovedGradientImageType::PixelType MovedGradientPixelType;
147
149 void GetDerivative( const TransformParametersType & parameters,
150 DerivativeType & derivative ) const override;
151
153 MeasureType GetValue( const TransformParametersType & parameters ) const override;
154
157 MeasureType & Value, DerivativeType & derivative ) const override;
158
159 void Initialize( void ) override;
160
162 void WriteGradientImagesToFiles( void ) const;
163
165 itkSetMacro( Scales, ScalesType );
166 itkGetConstReferenceMacro( Scales, ScalesType );
167
170 itkSetMacro( DerivativeDelta, double );
171 itkGetConstReferenceMacro( DerivativeDelta, double );
172
173protected:
174
177 void PrintSelf( std::ostream & os, Indent indent ) const override;
178
180 void ComputeMovedGradientRange( void ) const;
181
183 void ComputeVariance( void ) const;
184
187 const double * subtractionFactor ) const;
188
189 typedef NeighborhoodOperatorImageFilter<
191
192 typedef NeighborhoodOperatorImageFilter<
194
195private:
196
197 GradientDifferenceImageToImageMetric( const Self & ); // purposely not implemented
198 void operator=( const Self & ); // purposely not implemented
199
201 mutable MovedGradientPixelType m_Variance[ FixedImageDimension ];
202
204 mutable MovedGradientPixelType m_MinMovedGradient[ MovedImageDimension ];
205 mutable MovedGradientPixelType m_MaxMovedGradient[ MovedImageDimension ];
206
208 mutable FixedGradientPixelType m_MinFixedGradient[ FixedImageDimension ];
209 mutable FixedGradientPixelType m_MaxFixedGradient[ FixedImageDimension ];
210
212 typename TransformMovingImageFilterType::Pointer m_TransformMovingImageFilter;
213
216
217 SobelOperator< FixedGradientPixelType,
218 itkGetStaticConstMacro( FixedImageDimension ) >
219 m_FixedSobelOperators[ FixedImageDimension ];
220
221 typename FixedSobelFilter::Pointer m_FixedSobelFilters[ itkGetStaticConstMacro
222 ( FixedImageDimension ) ];
223
226
229
230 SobelOperator< MovedGradientPixelType,
231 itkGetStaticConstMacro( MovedImageDimension ) >
232 m_MovedSobelOperators[ MovedImageDimension ];
233
234 typename MovedSobelFilter::Pointer m_MovedSobelFilters[ itkGetStaticConstMacro
235 ( MovedImageDimension ) ];
236
241
242};
243
244} // end namespace itk
245
246#ifndef ITK_MANUAL_INSTANTIATION
247#include "itkGradientDifferenceImageToImageMetric2.hxx"
248#endif
249
250#endif
This class combines two transforms: an 'initial transform' with a 'current transform'.
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics.
Superclass::FixedImageConstPointer FixedImageConstPointer
Superclass::TransformParametersType TransformParametersType
Superclass::MovingImageConstPointer MovingImageConstPointer
Superclass::TransformJacobianType TransformJacobianType
Superclass::TransformPointer TransformPointer
Superclass::InterpolatorType InterpolatorType
Projective interpolation of an image at specified positions.
Computes similarity between two objects to be registered.
void GetValueAndDerivative(const TransformParametersType &parameters, MeasureType &Value, DerivativeType &derivative) const override
itk::Image< RealType, itkGetStaticConstMacro(MovedImageDimension) > MovedGradientImageType
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
ZeroFluxNeumannBoundaryCondition< FixedGradientImageType > m_FixedBoundCond
NeighborhoodOperatorImageFilter< FixedGradientImageType, FixedGradientImageType > FixedSobelFilter
AdvancedImageToImageMetric< TFixedImage, TMovingImage > Superclass
TransformMovingImageFilterType::Pointer m_TransformMovingImageFilter
MovedGradientPixelType m_Variance[FixedImageDimension]
itk::CastImageFilter< FixedImageType, FixedGradientImageType > CastFixedImageFilterType
FixedGradientPixelType m_MaxFixedGradient[FixedImageDimension]
itkStaticConstMacro(MovedImageDimension, unsigned int, MovingImageType::ImageDimension)
itk::ResampleImageFilter< MovingImageType, TransformedMovingImageType > TransformMovingImageFilterType
itk::CastImageFilter< TransformedMovingImageType, MovedGradientImageType > CastMovedImageFilterType
MovedGradientPixelType m_MinMovedGradient[MovedImageDimension]
SobelOperator< FixedGradientPixelType, itkGetStaticConstMacro(FixedImageDimension) > m_FixedSobelOperators[FixedImageDimension]
itk::AdvancedRayCastInterpolateImageFunction< MovingImageType, ScalarType > RayCastInterpolatorType
void PrintSelf(std::ostream &os, Indent indent) const override
NeighborhoodOperatorImageFilter< MovedGradientImageType, MovedGradientImageType > MovedSobelFilter
FixedSobelFilter::Pointer m_FixedSobelFilters[itkGetStaticConstMacro(FixedImageDimension)]
itk::Image< FixedImagePixelType, itkGetStaticConstMacro(FixedImageDimension) > TransformedMovingImageType
MovedGradientPixelType m_MaxMovedGradient[MovedImageDimension]
itk::AdvancedCombinationTransform< ScalarType, FixedImageDimension > CombinationTransformType
ZeroFluxNeumannBoundaryCondition< MovedGradientImageType > m_MovedBoundCond
FixedGradientPixelType m_MinFixedGradient[FixedImageDimension]
SobelOperator< MovedGradientPixelType, itkGetStaticConstMacro(MovedImageDimension) > m_MovedSobelOperators[MovedImageDimension]
void GetDerivative(const TransformParametersType &parameters, DerivativeType &derivative) const override
MeasureType GetValue(const TransformParametersType &parameters) const override
MeasureType ComputeMeasure(const TransformParametersType &parameters, const double *subtractionFactor) const
itk::Image< RealType, itkGetStaticConstMacro(FixedImageDimension) > FixedGradientImageType
MovedSobelFilter::Pointer m_MovedSobelFilters[itkGetStaticConstMacro(MovedImageDimension)]


Generated on 1667476801 for elastix by doxygen 1.9.4 elastix logo