ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkCorrelationCoefficientHistogramImageToImageMetric.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 __itkCorrelationCoefficientHistogramImageToImageMetric_h
00019 #define __itkCorrelationCoefficientHistogramImageToImageMetric_h
00020 
00021 #include "itkHistogramImageToImageMetric.h"
00022 
00023 namespace itk
00024 {
00038 template< class TFixedImage, class TMovingImage >
00039 class ITK_EXPORT CorrelationCoefficientHistogramImageToImageMetric:
00040   public HistogramImageToImageMetric< TFixedImage, TMovingImage >
00041 {
00042 public:
00044   typedef CorrelationCoefficientHistogramImageToImageMetric        Self;
00045   typedef HistogramImageToImageMetric< TFixedImage, TMovingImage > Superclass;
00046   typedef SmartPointer< Self >                                     Pointer;
00047   typedef SmartPointer< const Self >                               ConstPointer;
00048 
00050   itkNewMacro(Self);
00051 
00053   itkTypeMacro(CorrelationCoefficientHistogramImageToImageMetric,
00054                HistogramImageToImageMetric);
00055 
00057   typedef typename Superclass::RealType                RealType;
00058   typedef typename Superclass::TransformType           TransformType;
00059   typedef typename Superclass::TransformPointer        TransformPointer;
00060   typedef typename Superclass::TransformParametersType TransformParametersType;
00061   typedef typename Superclass::TransformJacobianType   TransformJacobianType;
00062   typedef typename Superclass::GradientPixelType       GradientPixelType;
00063 
00064   typedef typename Superclass::MeasureType             MeasureType;
00065   typedef typename Superclass::DerivativeType          DerivativeType;
00066   typedef typename Superclass::FixedImageType          FixedImageType;
00067   typedef typename Superclass::MovingImageType         MovingImageType;
00068   typedef typename Superclass::FixedImageConstPointer  FixedImageConstPointer;
00069   typedef typename Superclass::MovingImageConstPointer MovingImageConstPointer;
00070 
00071   typedef typename Superclass::HistogramType HistogramType;
00072 
00073   typedef typename HistogramType::AbsoluteFrequencyType HistogramAbsoluteFrequencyType;
00074   typedef HistogramAbsoluteFrequencyType                HistogramFrequencyType;
00075 
00076   typedef typename HistogramType::Iterator HistogramIteratorType;
00077   typedef typename HistogramType::MeasurementVectorType
00078   HistogramMeasurementVectorType;
00079 protected:
00082   CorrelationCoefficientHistogramImageToImageMetric(){}
00083   virtual ~CorrelationCoefficientHistogramImageToImageMetric(){}
00085 
00087   virtual MeasureType EvaluateMeasure(HistogramType & histogram) const;
00088 
00089 private:
00091   MeasureType MeanX(HistogramType & histogram) const;
00092 
00094   MeasureType MeanY(HistogramType & histogram) const;
00095 
00097   MeasureType VarianceX(HistogramType & histogram) const;
00098 
00100   MeasureType VarianceY(HistogramType & histogram) const;
00101 
00103   MeasureType Covariance(HistogramType & histogram) const;
00104 
00105   // Purposely not implemented.
00106   CorrelationCoefficientHistogramImageToImageMetric(Self const &);
00107   void operator=(Self const &); // Purposely not implemented.
00108 };
00109 } // End namespace itk.
00110 
00111 #ifndef ITK_MANUAL_INSTANTIATION
00112 #include "itkCorrelationCoefficientHistogramImageToImageMetric.hxx"
00113 #endif
00114 
00115 #endif // __itkCorrelationCoefficientHistogramImageToImageMetric_h
00116