ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkNormalizedCorrelationPointSetToImageMetric.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 __itkNormalizedCorrelationPointSetToImageMetric_h
00019 #define __itkNormalizedCorrelationPointSetToImageMetric_h
00020 
00021 #include "itkPointSetToImageMetric.h"
00022 #include "itkCovariantVector.h"
00023 #include "itkPoint.h"
00024 
00025 namespace itk
00026 {
00043 template< class TFixedPointSet, class TMovingImage >
00044 class ITK_EXPORT NormalizedCorrelationPointSetToImageMetric:
00045   public PointSetToImageMetric< TFixedPointSet, TMovingImage >
00046 {
00047 public:
00048 
00050   typedef NormalizedCorrelationPointSetToImageMetric            Self;
00051   typedef PointSetToImageMetric< TFixedPointSet, TMovingImage > Superclass;
00052   typedef SmartPointer< Self >                                  Pointer;
00053   typedef SmartPointer< const Self >                            ConstPointer;
00054 
00056   itkNewMacro(Self);
00057 
00059   itkTypeMacro(NormalizedCorrelationPointSetToImageMetric,
00060                PointSetToImageMetric);
00061 
00063   typedef typename Superclass::RealType                RealType;
00064   typedef typename Superclass::TransformType           TransformType;
00065   typedef typename Superclass::TransformPointer        TransformPointer;
00066   typedef typename Superclass::TransformParametersType TransformParametersType;
00067   typedef typename Superclass::TransformJacobianType   TransformJacobianType;
00068   typedef typename Superclass::GradientPixelType       GradientPixelType;
00069 
00070   typedef typename Superclass::MeasureType               MeasureType;
00071   typedef typename Superclass::DerivativeType            DerivativeType;
00072   typedef typename Superclass::FixedPointSetType         FixedPointSetType;
00073   typedef typename Superclass::MovingImageType           MovingImageType;
00074   typedef typename Superclass::FixedPointSetConstPointer FixedPointSetConstPointer;
00075   typedef typename Superclass::MovingImageConstPointer   MovingImageConstPointer;
00076 
00077   typedef typename Superclass::PointIterator     PointIterator;
00078   typedef typename Superclass::PointDataIterator PointDataIterator;
00079   typedef typename Superclass::InputPointType    InputPointType;
00080   typedef typename Superclass::OutputPointType   OutputPointType;
00081 
00083   void GetDerivative(const TransformParametersType & parameters,
00084                      DerivativeType & Derivative) const;
00085 
00087   MeasureType GetValue(const TransformParametersType & parameters) const;
00088 
00090   void GetValueAndDerivative(const TransformParametersType & parameters,
00091                              MeasureType & Value, DerivativeType & Derivative) const;
00092 
00097   itkSetMacro(SubtractMean, bool);
00098   itkGetConstReferenceMacro(SubtractMean, bool);
00099   itkBooleanMacro(SubtractMean);
00100 protected:
00101   NormalizedCorrelationPointSetToImageMetric();
00102   virtual ~NormalizedCorrelationPointSetToImageMetric() {}
00103   void PrintSelf(std::ostream & os, Indent indent) const;
00105 
00106 private:
00107   NormalizedCorrelationPointSetToImageMetric(const Self &); //purposely not
00108                                                             // implemented
00109   void operator=(const Self &);                             //purposely not
00110                                                             // implemented
00111 
00112   bool m_SubtractMean;
00113 };
00114 } // end namespace itk
00115 
00116 #ifndef ITK_MANUAL_INSTANTIATION
00117 #include "itkNormalizedCorrelationPointSetToImageMetric.hxx"
00118 #endif
00119 
00120 #endif
00121