ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkNormalizedCorrelationImageToImageMetric.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 __itkNormalizedCorrelationImageToImageMetric_h
00019 #define __itkNormalizedCorrelationImageToImageMetric_h
00020 
00021 #include "itkImageToImageMetric.h"
00022 #include "itkPoint.h"
00023 
00024 namespace itk
00025 {
00041 template< class TFixedImage, class TMovingImage >
00042 class ITK_EXPORT NormalizedCorrelationImageToImageMetric:
00043   public ImageToImageMetric< TFixedImage, TMovingImage >
00044 {
00045 public:
00046 
00048   typedef NormalizedCorrelationImageToImageMetric         Self;
00049   typedef ImageToImageMetric< TFixedImage, TMovingImage > Superclass;
00050   typedef SmartPointer< Self >                            Pointer;
00051   typedef SmartPointer< const Self >                      ConstPointer;
00052 
00054   itkNewMacro(Self);
00055 
00057   itkTypeMacro(NormalizedCorrelationImageToImageMetric, Object);
00058 
00060   typedef typename Superclass::RealType                RealType;
00061   typedef typename Superclass::TransformType           TransformType;
00062   typedef typename Superclass::TransformPointer        TransformPointer;
00063   typedef typename Superclass::TransformParametersType TransformParametersType;
00064   typedef typename Superclass::TransformJacobianType   TransformJacobianType;
00065   typedef typename Superclass::GradientPixelType       GradientPixelType;
00066   typedef typename Superclass::OutputPointType         OutputPointType;
00067   typedef typename Superclass::InputPointType          InputPointType;
00068 
00069   typedef typename Superclass::MeasureType             MeasureType;
00070   typedef typename Superclass::DerivativeType          DerivativeType;
00071   typedef typename Superclass::FixedImageType          FixedImageType;
00072   typedef typename Superclass::MovingImageType         MovingImageType;
00073   typedef typename Superclass::FixedImageConstPointer  FixedImageConstPointer;
00074   typedef typename Superclass::MovingImageConstPointer MovingImageConstPointer;
00075 
00077   void GetDerivative(const TransformParametersType & parameters,
00078                      DerivativeType & Derivative) const;
00079 
00081   MeasureType GetValue(const TransformParametersType & parameters) const;
00082 
00084   void GetValueAndDerivative(const TransformParametersType & parameters,
00085                              MeasureType & Value, DerivativeType & Derivative) const;
00086 
00091   itkSetMacro(SubtractMean, bool);
00092   itkGetConstReferenceMacro(SubtractMean, bool);
00093   itkBooleanMacro(SubtractMean);
00094 protected:
00095   NormalizedCorrelationImageToImageMetric();
00096   virtual ~NormalizedCorrelationImageToImageMetric() {}
00097   void PrintSelf(std::ostream & os, Indent indent) const;
00099 
00100 private:
00101   NormalizedCorrelationImageToImageMetric(const Self &); //purposely not
00102                                                          // implemented
00103   void operator=(const Self &);                          //purposely not
00104                                                          // implemented
00105 
00106   bool m_SubtractMean;
00107 };
00108 } // end namespace itk
00109 
00110 #ifndef ITK_MANUAL_INSTANTIATION
00111 #include "itkNormalizedCorrelationImageToImageMetric.hxx"
00112 #endif
00113 
00114 #endif
00115