Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkWarpHarmonicEnergyCalculator.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkWarpHarmonicEnergyCalculator.h,v $
00005   Language:  C++
00006   Date:      $Date: 2008-09-30 18:07:03 $
00007   Version:   $Revision: 1.3 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 
00018 #ifndef __itkWarpHarmonicEnergyCalculator_h
00019 #define __itkWarpHarmonicEnergyCalculator_h
00020 
00021 #include "itkObject.h"
00022 #include "itkObjectFactory.h"
00023 #include "itkConstNeighborhoodIterator.h"
00024 #include "itkImage.h"
00025 #include "itkVector.h"
00026 
00027 namespace itk
00028 {
00029 
00045 template <class TInputImage>
00046 class ITK_EXPORT WarpHarmonicEnergyCalculator : public Object
00047 {
00048 public:
00050   typedef WarpHarmonicEnergyCalculator          Self;
00051   typedef Object                                Superclass;
00052   typedef SmartPointer<Self>                    Pointer;
00053   typedef SmartPointer<const Self>              ConstPointer;
00054 
00056   itkNewMacro(Self);
00057 
00059   itkTypeMacro(WarpHarmonicEnergyCalculator, Object);
00060 
00062   typedef TInputImage                           ImageType;
00063 
00065   typedef typename TInputImage::Pointer         ImagePointer;
00066 
00068   typedef typename TInputImage::ConstPointer    ImageConstPointer;
00069 
00071   typedef typename TInputImage::PixelType PixelType;
00072 
00074   typedef typename TInputImage::IndexType IndexType;
00075 
00077   typedef typename TInputImage::RegionType RegionType;
00078 
00080   itkStaticConstMacro(ImageDimension, unsigned int,
00081                       TInputImage::ImageDimension);
00082 
00084   itkStaticConstMacro(VectorDimension, unsigned int,
00085                       PixelType::Dimension);
00086 
00089   typedef ConstNeighborhoodIterator<ImageType> ConstNeighborhoodIteratorType;
00090   typedef typename ConstNeighborhoodIteratorType::RadiusType RadiusType;
00091 
00095   void SetUseImageSpacingOn()
00096     {
00097     this->SetUseImageSpacing(true);
00098     }
00099 
00103   void SetUseImageSpacingOff()
00104     {
00105     this->SetUseImageSpacing(false);
00106     }
00107 
00110   void SetUseImageSpacing(bool);
00111   itkGetMacro(UseImageSpacing, bool);
00113 
00116   void SetDerivativeWeights(double data[]);
00117   itkGetVectorMacro(DerivativeWeights, const double, ::itk::GetImageDimension<TInputImage>::ImageDimension);
00119 
00121   itkSetConstObjectMacro(Image,ImageType);
00122 
00124   void Compute(void);
00125 
00127   itkGetMacro(HarmonicEnergy,double);
00128 
00130   void SetRegion( const RegionType & region );
00131 
00132 protected:
00133   WarpHarmonicEnergyCalculator();
00134   virtual ~WarpHarmonicEnergyCalculator() {};
00135   void PrintSelf(std::ostream& os, Indent indent) const;
00136 
00138   itkGetConstReferenceMacro( NeighborhoodRadius, RadiusType );
00139   itkSetMacro( NeighborhoodRadius, RadiusType );
00141 
00142   double EvaluateAtNeighborhood( ConstNeighborhoodIteratorType &it ) const;
00143 
00144 private:
00145   WarpHarmonicEnergyCalculator(const Self&); //purposely not implemented
00146   void operator=(const Self&); //purposely not implemented
00147 
00148   double               m_HarmonicEnergy;
00149   ImageConstPointer    m_Image;
00150 
00151   RegionType           m_Region;
00152   bool                 m_RegionSetByUser;
00153 
00154   bool m_UseImageSpacing;
00155 
00157   double m_DerivativeWeights[::itk::GetImageDimension<TInputImage>::ImageDimension];
00158 
00159   RadiusType    m_NeighborhoodRadius;
00160 };
00161 
00162 } // end namespace itk
00163 
00164 #ifndef ITK_MANUAL_INSTANTIATION
00165 #include "itkWarpHarmonicEnergyCalculator.txx"
00166 #endif
00167 
00168 #endif /* __itkWarpHarmonicEnergyCalculator_h */
00169 

Generated at Thu Nov 6 00:59:17 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000