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

itkEntropyPreservingGradientMagnitudeImageFunction.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkEntropyPreservingGradientMagnitudeImageFunction.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/09/30 15:24:40 $
00007   Version:   $Revision: 1.24 $
00008 
00009   Copyright (c) 2002 Insight 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 #ifndef _itkEntropyPreservingGradientMagnitudeImageFunction_h
00018 #define _itkEntropyPreservingGradientMagnitudeImageFunction_h
00019 
00020 #include "itkImageFunction.h"
00021 
00022 namespace itk
00023 {
00024 
00055 template < class TInputImage, class TCoordRep = float >
00056 class ITK_EXPORT EntropyPreservingGradientMagnitudeImageFunction :
00057   public ImageFunction< TInputImage, double, TCoordRep >
00058 {
00059 public:
00061   typedef EntropyPreservingGradientMagnitudeImageFunction Self;
00062   typedef ImageFunction<TInputImage, double, TCoordRep> Superclass;
00063   typedef SmartPointer<Self> Pointer;
00064   typedef SmartPointer<const Self>  ConstPointer;
00065   
00067   itkNewMacro(Self);
00068 
00070   itkTypeMacro(EntropyPreservingGradientMagnitudeImageFunction, ImageFunction);
00071 
00073   typedef TInputImage InputImageType;
00074   typedef typename InputImageType::ConstPointer InputImageConstPointer;
00075 
00077   itkStaticConstMacro(ImageDimension, unsigned int,
00078                       InputImageType::ImageDimension);
00079 
00081   typedef typename Superclass::IndexType IndexType;
00082 
00084   typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
00085 
00087   typedef typename Superclass::PointType PointType;
00088 
00090   virtual void SetInputImage( const InputImageType * ptr );
00091 
00093   void SetSpeed( double value )
00094     { m_Speed = value; }
00095 
00097   double GetSpeed() const
00098     { return m_Speed; }
00099 
00101   virtual double EvaluateAtIndex( const IndexType& index ) const;
00102 
00104   virtual double Evaluate( const PointType& point ) const
00105     { 
00106       IndexType index;
00107       this->ConvertPointToNearestIndex( point, index );
00108       return this->EvaluateAtIndex( index ); 
00109     }
00110 
00112   virtual double EvaluateAtContinuousIndex( 
00113     const ContinuousIndexType& cindex ) const
00114     { 
00115       IndexType index;
00116       this->ConvertContinuousIndexToNearestIndex( cindex, index );
00117       return this->EvaluateAtIndex( index ) ; 
00118     }
00119 
00121   double GetMagnitude() const
00122     { return m_Magnitude; }
00123 
00124 protected:
00125   EntropyPreservingGradientMagnitudeImageFunction(){};
00126   ~EntropyPreservingGradientMagnitudeImageFunction(){};
00127   void PrintSelf(std::ostream& os, Indent indent) const;
00128 
00129 private:
00130   EntropyPreservingGradientMagnitudeImageFunction ( const Self& ); //purposely not implemented
00131   void operator=( const Self& ); //purposely not implemented
00132 
00133   signed long             m_ImageSize[ImageDimension];
00134   bool                    m_ImageSizeOK;
00135 
00136   double                  m_Speed;
00137   mutable double          m_Magnitude;
00138 
00139   mutable IndexType       m_NeighIndex;
00140   mutable double          m_CenterValue;
00141   mutable double          m_DiffValue;
00142 
00143 };
00144 
00145 } // namespace itk
00146 
00147 #ifndef ITK_MANUAL_INSTANTIATION
00148 #include "itkEntropyPreservingGradientMagnitudeImageFunction.txx"
00149 #endif
00150 
00151 #endif

Generated at Wed Mar 12 01:12:53 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000