ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkKappaStatisticImageToImageMetric.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkKappaStatisticImageToImageMetric_h
00019 #define __itkKappaStatisticImageToImageMetric_h
00020 
00021 #include "itkImageToImageMetric.h"
00022 
00023 namespace itk
00024 {
00053 template< class TFixedImage, class TMovingImage >
00054 class ITK_EXPORT KappaStatisticImageToImageMetric:
00055   public ImageToImageMetric< TFixedImage, TMovingImage >
00056 {
00057 public:
00058 
00060   typedef KappaStatisticImageToImageMetric                Self;
00061   typedef ImageToImageMetric< TFixedImage, TMovingImage > Superclass;
00062   typedef SmartPointer< Self >                            Pointer;
00063   typedef SmartPointer< const Self >                      ConstPointer;
00064 
00066   itkNewMacro(Self);
00067 
00069   itkTypeMacro(KappaStatisticImageToImageMetric, ImageToImageMetric);
00070 
00072   typedef typename Superclass::RealType                RealType;
00073   typedef typename Superclass::TransformType           TransformType;
00074   typedef typename Superclass::TransformPointer        TransformPointer;
00075   typedef typename Superclass::TransformParametersType TransformParametersType;
00076   typedef typename Superclass::TransformJacobianType   TransformJacobianType;
00077   typedef typename Superclass::GradientImageType       GradientImageType;
00078   typedef typename Superclass::GradientPixelType       GradientPixelType;
00079   typedef typename Superclass::InputPointType          InputPointType;
00080   typedef typename Superclass::OutputPointType         OutputPointType;
00081 
00082   typedef typename Superclass::MeasureType             MeasureType;
00083   typedef typename Superclass::DerivativeType          DerivativeType;
00084   typedef typename Superclass::FixedImageType          FixedImageType;
00085   typedef typename Superclass::MovingImageType         MovingImageType;
00086   typedef typename Superclass::FixedImageConstPointer  FixedImageConstPointer;
00087   typedef typename Superclass::MovingImageConstPointer MovingImageConstPointer;
00088   typedef typename Superclass::FixedImageRegionType    FixedImageRegionType;
00089 
00091   void ComputeGradient();
00092 
00094   void GetDerivative(const TransformParametersType &,
00095                      DerivativeType & derivative) const;
00096 
00102   MeasureType GetValue(const TransformParametersType & parameters) const;
00103 
00106   void GetValueAndDerivative(const TransformParametersType & parameters,
00107                              MeasureType & Value, DerivativeType & Derivative) const;
00108 
00111   itkSetMacro(ForegroundValue, RealType);
00112   itkGetConstMacro(ForegroundValue, RealType);
00114 
00119   itkSetMacro(Complement, bool);
00120   itkBooleanMacro(Complement);
00121   itkGetConstMacro(Complement, bool);
00122 protected:
00123   KappaStatisticImageToImageMetric();
00124   virtual ~KappaStatisticImageToImageMetric() {}
00125   void PrintSelf(std::ostream & os, Indent indent) const;
00127 
00128 private:
00129   KappaStatisticImageToImageMetric(const Self &); //purposely not implemented
00130   void operator=(const Self &);                   //purposely not implemented
00131 
00132   RealType m_ForegroundValue;
00133   bool     m_Complement;
00134 };
00135 } // end namespace itk
00136 
00137 #ifndef ITK_MANUAL_INSTANTIATION
00138 #include "itkKappaStatisticImageToImageMetric.hxx"
00139 #endif
00140 
00141 #endif
00142