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.
00001 /*======================================================================
00002 
00003   This file is part of the elastix software.
00004 
00005   Copyright (c) University Medical Center Utrecht. All rights reserved.
00006   See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
00007   details.
00008 
00009      This software is distributed WITHOUT ANY WARRANTY; without even
00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00011      PURPOSE. See the above copyright notices for more information.
00012 
00013 ======================================================================*/
00014 
00015 
00016 #ifndef __itkAdvancedKappaStatisticImageToImageMetric_h
00017 #define __itkAdvancedKappaStatisticImageToImageMetric_h
00018 
00019 #include "itkAdvancedImageToImageMetric.h"
00020 
00021 namespace itk
00022 {
00023 
00053 template < class TFixedImage, class TMovingImage >
00054 class AdvancedKappaStatisticImageToImageMetric :
00055     public AdvancedImageToImageMetric< TFixedImage, TMovingImage>
00056 {
00057 public:
00058 
00060   typedef AdvancedKappaStatisticImageToImageMetric    Self;
00061   typedef AdvancedImageToImageMetric<
00062     TFixedImage, TMovingImage >                   Superclass;
00063   typedef SmartPointer<Self>                      Pointer;
00064   typedef SmartPointer<const Self>                ConstPointer;
00065 
00067   itkNewMacro( Self );
00068 
00070   itkTypeMacro( AdvancedKappaStatisticImageToImageMetric, AdvancedImageToImageMetric );
00071 
00073   typedef typename
00074     Superclass::CoordinateRepresentationType              CoordinateRepresentationType;
00075   typedef typename Superclass::MovingImageType            MovingImageType;
00076   typedef typename Superclass::MovingImagePixelType       MovingImagePixelType;
00077   typedef typename Superclass::MovingImageConstPointer    MovingImageConstPointer;
00078   typedef typename Superclass::FixedImageType             FixedImageType;
00079   typedef typename Superclass::FixedImageConstPointer     FixedImageConstPointer;
00080   typedef typename Superclass::FixedImageRegionType       FixedImageRegionType;
00081   typedef typename Superclass::TransformType              TransformType;
00082   typedef typename Superclass::TransformPointer           TransformPointer;
00083   typedef typename Superclass::InputPointType             InputPointType;
00084   typedef typename Superclass::OutputPointType            OutputPointType;
00085   typedef typename Superclass::TransformParametersType    TransformParametersType;
00086   typedef typename Superclass::TransformJacobianType      TransformJacobianType;
00087   typedef typename Superclass::InterpolatorType           InterpolatorType;
00088   typedef typename Superclass::InterpolatorPointer        InterpolatorPointer;
00089   typedef typename Superclass::RealType                   RealType;
00090   typedef typename Superclass::GradientPixelType          GradientPixelType;
00091   typedef typename Superclass::GradientImageType          GradientImageType;
00092   typedef typename Superclass::GradientImagePointer       GradientImagePointer;
00093   typedef typename Superclass::GradientImageFilterType    GradientImageFilterType;
00094   typedef typename Superclass::GradientImageFilterPointer GradientImageFilterPointer;
00095   typedef typename Superclass::FixedImageMaskType         FixedImageMaskType;
00096   typedef typename Superclass::FixedImageMaskPointer      FixedImageMaskPointer;
00097   typedef typename Superclass::MovingImageMaskType        MovingImageMaskType;
00098   typedef typename Superclass::MovingImageMaskPointer     MovingImageMaskPointer;
00099   typedef typename Superclass::MeasureType                MeasureType;
00100   typedef typename Superclass::DerivativeType             DerivativeType;
00101   typedef typename Superclass::DerivativeValueType        DerivativeValueType;
00102   typedef typename Superclass::ParametersType             ParametersType;
00103   typedef typename Superclass::FixedImagePixelType        FixedImagePixelType;
00104   typedef typename Superclass::MovingImageRegionType      MovingImageRegionType;
00105   typedef typename Superclass::ImageSamplerType           ImageSamplerType;
00106   typedef typename Superclass::ImageSamplerPointer        ImageSamplerPointer;
00107   typedef typename Superclass::ImageSampleContainerType   ImageSampleContainerType;
00108   typedef typename
00109     Superclass::ImageSampleContainerPointer               ImageSampleContainerPointer;
00110   typedef typename Superclass::FixedImageLimiterType      FixedImageLimiterType;
00111   typedef typename Superclass::MovingImageLimiterType     MovingImageLimiterType;
00112   typedef typename
00113     Superclass::FixedImageLimiterOutputType               FixedImageLimiterOutputType;
00114   typedef typename
00115     Superclass::MovingImageLimiterOutputType              MovingImageLimiterOutputType;
00116   typedef typename
00117     Superclass::MovingImageDerivativeScalesType           MovingImageDerivativeScalesType;
00118 
00120   itkStaticConstMacro( FixedImageDimension, unsigned int,
00121     FixedImageType::ImageDimension );
00122 
00124   itkStaticConstMacro( MovingImageDimension, unsigned int,
00125     MovingImageType::ImageDimension );
00126 
00128   virtual MeasureType GetValue( const TransformParametersType & parameters ) const;
00129 
00131   virtual void GetDerivative( const TransformParametersType & parameters,
00132     DerivativeType & derivative ) const;
00133 
00135   virtual void GetValueAndDerivative( const TransformParametersType & parameters,
00136     MeasureType& Value, DerivativeType& Derivative ) const;
00137 
00139   virtual void ComputeGradient( void );
00140 
00142   itkSetMacro( ForegroundValue, RealType );
00143   itkGetConstReferenceMacro( ForegroundValue, RealType );
00144 
00150   itkSetMacro( Complement, bool );
00151   itkGetConstReferenceMacro( Complement, bool );
00152   itkBooleanMacro( Complement );
00153 
00155   itkSetMacro( Epsilon, RealType );
00156   itkGetConstReferenceMacro( Epsilon, RealType );
00157 
00158 protected:
00159   AdvancedKappaStatisticImageToImageMetric();
00160   virtual ~AdvancedKappaStatisticImageToImageMetric() {};
00161 
00163   void PrintSelf( std::ostream & os, Indent indent ) const;
00164 
00168   typedef typename Superclass::FixedImageIndexType                FixedImageIndexType;
00169   typedef typename Superclass::FixedImageIndexValueType           FixedImageIndexValueType;
00170   typedef typename Superclass::MovingImageIndexType               MovingImageIndexType;
00171   typedef typename Superclass::FixedImagePointType                FixedImagePointType;
00172   typedef typename Superclass::MovingImagePointType               MovingImagePointType;
00173   typedef typename Superclass::MovingImageContinuousIndexType     MovingImageContinuousIndexType;
00174   typedef typename Superclass::BSplineInterpolatorType            BSplineInterpolatorType;
00175   typedef typename Superclass::CentralDifferenceGradientFilterType  CentralDifferenceGradientFilterType;
00176   typedef typename Superclass::MovingImageDerivativeType          MovingImageDerivativeType;
00177   typedef typename Superclass::NonZeroJacobianIndicesType         NonZeroJacobianIndicesType;
00178 
00183   void EvaluateMovingImageAndTransformJacobianInnerProduct(
00184     const TransformJacobianType & jacobian,
00185     const MovingImageDerivativeType & movingImageDerivative,
00186     DerivativeType & innerProduct ) const;
00187 
00191   void UpdateValueAndDerivativeTerms(
00192     const RealType & fixedImageValue,
00193     const RealType & movingImageValue,
00194     std::size_t & fixedForegroundArea,
00195     std::size_t & movingForegroundArea,
00196     std::size_t & intersection,
00197     const DerivativeType & imageJacobian,
00198     const NonZeroJacobianIndicesType & nzji,
00199     DerivativeType & sum1,
00200     DerivativeType & sum2 ) const;
00201 
00202 private:
00203   AdvancedKappaStatisticImageToImageMetric(const Self&); //purposely not implemented
00204   void operator=(const Self&); //purposely not implemented
00205 
00206   RealType   m_ForegroundValue;
00207   RealType   m_Epsilon;
00208   bool       m_Complement;
00209 
00210 }; // end class AdvancedKappaStatisticImageToImageMetric
00211 
00212 } // end namespace itk
00213 
00214 #ifndef ITK_MANUAL_INSTANTIATION
00215 #include "itkAdvancedKappaStatisticImageToImageMetric.hxx"
00216 #endif
00217 
00218 #endif // end #ifndef __itkAdvancedKappaStatisticImageToImageMetric_h
00219 


Generated on 11-05-2012 for elastix by doxygen 1.7.6.1 elastix logo