go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkAdvancedKappaStatisticImageToImageMetric.h
Go to the documentation of this file.
1 /*======================================================================
2 
3  This file is part of the elastix software.
4 
5  Copyright (c) University Medical Center Utrecht. All rights reserved.
6  See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
7  details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notices for more information.
12 
13 ======================================================================*/
14 
15 #ifndef __itkAdvancedKappaStatisticImageToImageMetric_h
16 #define __itkAdvancedKappaStatisticImageToImageMetric_h
17 
19 
20 namespace itk
21 {
22 
52 template< class TFixedImage, class TMovingImage >
54  public AdvancedImageToImageMetric< TFixedImage, TMovingImage >
55 {
56 public:
57 
61  TFixedImage, TMovingImage > Superclass;
62  typedef SmartPointer< Self > Pointer;
63  typedef SmartPointer< const Self > ConstPointer;
64 
66  itkNewMacro( Self );
67 
70 
72  typedef typename
89  typedef typename Superclass::RealType RealType;
108  typedef typename
112  typedef typename
114  typedef typename
116  typedef typename
120 
122  itkStaticConstMacro( FixedImageDimension, unsigned int,
123  FixedImageType::ImageDimension );
124 
126  itkStaticConstMacro( MovingImageDimension, unsigned int,
127  MovingImageType::ImageDimension );
128 
130  virtual MeasureType GetValue( const TransformParametersType & parameters ) const;
131 
133  virtual void GetDerivative( const TransformParametersType & parameters,
134  DerivativeType & derivative ) const;
135 
138  const TransformParametersType & parameters,
139  MeasureType & Value, DerivativeType & Derivative ) const;
140 
141  virtual void GetValueAndDerivative(
142  const TransformParametersType & parameters,
143  MeasureType & Value, DerivativeType & Derivative ) const;
144 
146  virtual void ComputeGradient( void );
147 
149  itkSetMacro( ForegroundValue, RealType );
150  itkGetConstReferenceMacro( ForegroundValue, RealType );
151 
156  itkSetMacro( UseForegroundValue, bool );
157 
163  itkSetMacro( Complement, bool );
164  itkGetConstReferenceMacro( Complement, bool );
165  itkBooleanMacro( Complement );
166 
168  itkSetMacro( Epsilon, RealType );
169  itkGetConstReferenceMacro( Epsilon, RealType );
170 
171 protected:
172 
175 
177  void PrintSelf( std::ostream & os, Indent indent ) const;
178 
192 
197  const RealType & fixedImageValue,
198  const RealType & movingImageValue,
199  std::size_t & fixedForegroundArea,
200  std::size_t & movingForegroundArea,
201  std::size_t & intersection,
202  const DerivativeType & imageJacobian,
203  const NonZeroJacobianIndicesType & nzji,
204  DerivativeType & sum1,
205  DerivativeType & sum2 ) const;
206 
211  virtual void InitializeThreadingParameters( void ) const;
212 
214  inline void ThreadedGetValueAndDerivative( ThreadIdType threadID );
215 
218  MeasureType & value, DerivativeType & derivative ) const;
219 
221  static ITK_THREAD_RETURN_TYPE AccumulateDerivativesThreaderCallback( void * arg );
222 
223 private:
224 
225  AdvancedKappaStatisticImageToImageMetric( const Self & ); // purposely not implemented
226  void operator=( const Self & ); // purposely not implemented
227 
232 
239  {
241 
245  };
246 
248  {
250  SizeValueType st_AreaSum;
251  SizeValueType st_AreaIntersection;
255  };
256  itkPadStruct( ITK_CACHE_LINE_ALIGNMENT, KappaGetValueAndDerivativePerThreadStruct,
257  PaddedKappaGetValueAndDerivativePerThreadStruct );
258  itkAlignedTypedef( ITK_CACHE_LINE_ALIGNMENT, PaddedKappaGetValueAndDerivativePerThreadStruct,
259  AlignedKappaGetValueAndDerivativePerThreadStruct );
260  mutable AlignedKappaGetValueAndDerivativePerThreadStruct * m_KappaGetValueAndDerivativePerThreadVariables;
262 
263 };
264 
265 } // end namespace itk
266 
267 #ifndef ITK_MANUAL_INSTANTIATION
268 #include "itkAdvancedKappaStatisticImageToImageMetric.hxx"
269 #endif
270 
271 #endif // end #ifndef __itkAdvancedKappaStatisticImageToImageMetric_h
AdvancedTransformType::NumberOfParametersType NumberOfParametersType
void PrintSelf(std::ostream &os, Indent indent) const
LimiterFunctionBase< RealType, FixedImageDimension > FixedImageLimiterType
Superclass::CoordinateRepresentationType CoordinateRepresentationType
Superclass::TransformParametersType TransformParametersType
static ITK_THREAD_RETURN_TYPE AccumulateDerivativesThreaderCallback(void *arg)
Superclass::MovingImageType MovingImageType
Superclass::FixedImageMaskPointer FixedImageMaskPointer
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics...
virtual void GetValueAndDerivativeSingleThreaded(const TransformParametersType &parameters, MeasureType &Value, DerivativeType &Derivative) const
Superclass::GradientPixelType GradientPixelType
FixedImageLimiterType::OutputType FixedImageLimiterOutputType
Superclass::FixedImageRegionType FixedImageRegionType
ImageSamplerType::OutputVectorContainerType ImageSampleContainerType
void ThreadedGetValueAndDerivative(ThreadIdType threadID)
MovingImageType::IndexType MovingImageIndexType
Superclass::MovingImageDerivativeScalesType MovingImageDerivativeScalesType
InterpolatorType::ContinuousIndexType MovingImageContinuousIndexType
TransformType::InputPointType FixedImagePointType
FixedArray< double, Self::MovingImageDimension > MovingImageDerivativeScalesType
BSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double > BSplineInterpolatorType
ImageSamplerBase< FixedImageType > ImageSamplerType
AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
Superclass::InterpolatorPointer InterpolatorPointer
itkPadStruct(ITK_CACHE_LINE_ALIGNMENT, KappaGetValueAndDerivativePerThreadStruct, PaddedKappaGetValueAndDerivativePerThreadStruct)
FixedImageIndexType::IndexValueType FixedImageIndexValueType
TransformType::OutputPointType MovingImagePointType
Superclass::MovingImageMaskType MovingImageMaskType
LimiterFunctionBase< RealType, MovingImageDimension > MovingImageLimiterType
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
AdvancedImageToImageMetric< TFixedImage, TMovingImage > Superclass
Superclass::GradientImageType GradientImageType
Superclass::TransformPointer TransformPointer
Superclass::MovingImageContinuousIndexType MovingImageContinuousIndexType
virtual void GetValueAndDerivative(const TransformParametersType &parameters, MeasureType &Value, DerivativeType &Derivative) const
Superclass::GradientImageFilterType GradientImageFilterType
MovingImageType::RegionType MovingImageRegionType
Superclass::InterpolatorType InterpolatorType
itkAlignedTypedef(ITK_CACHE_LINE_ALIGNMENT, PaddedKappaGetValueAndDerivativePerThreadStruct, AlignedKappaGetValueAndDerivativePerThreadStruct)
Superclass::TransformJacobianType TransformJacobianType
virtual MeasureType GetValue(const TransformParametersType &parameters) const
Computes similarity between two objects to be registered.
virtual void GetDerivative(const TransformParametersType &parameters, DerivativeType &derivative) const
Superclass::MovingImagePixelType MovingImagePixelType
GradientImageFilter< MovingImageType, RealType, RealType > CentralDifferenceGradientFilterType
virtual void InitializeThreadingParameters(void) const
Superclass::MovingImageMaskPointer MovingImageMaskPointer
MovingImageLimiterType::OutputType MovingImageLimiterOutputType
ThreaderType::ThreadInfoStruct ThreadInfoType
ImageSamplerType::OutputVectorContainerPointer ImageSampleContainerPointer
Superclass::FixedImageMaskType FixedImageMaskType
Superclass::CentralDifferenceGradientFilterType CentralDifferenceGradientFilterType
void AfterThreadedGetValueAndDerivative(MeasureType &value, DerivativeType &derivative) const
BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
AlignedKappaGetValueAndDerivativePerThreadStruct * m_KappaGetValueAndDerivativePerThreadVariables
Superclass::FixedImageConstPointer FixedImageConstPointer
Superclass::MovingImageConstPointer MovingImageConstPointer
void UpdateValueAndDerivativeTerms(const RealType &fixedImageValue, const RealType &movingImageValue, std::vcl_size_t &fixedForegroundArea, std::vcl_size_t &movingForegroundArea, std::vcl_size_t &intersection, const DerivativeType &imageJacobian, const NonZeroJacobianIndicesType &nzji, DerivativeType &sum1, DerivativeType &sum2) const
Superclass::GradientImageFilterPointer GradientImageFilterPointer
Superclass::GradientImagePointer GradientImagePointer


Generated on 27-04-2014 for elastix by doxygen 1.8.6 elastix logo