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

itkUpwindDerivativeImageFunction.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkUpwindDerivativeImageFunction.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/09/11 19:57:13 $
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 _itkUpwindDerivativeImageFunction_h
00018 #define _itkUpwindDerivativeImageFunction_h
00019 
00020 #include "itkImageFunction.h"
00021 
00022 namespace itk
00023 {
00024 
00048 template <class TInputImage, class TCoordRep = float >
00049 class ITK_EXPORT UpwindDerivativeImageFunction :
00050   public ImageFunction< TInputImage, double, TCoordRep >
00051 {
00052 public:
00054   typedef UpwindDerivativeImageFunction Self;
00055   typedef ImageFunction<TInputImage, double,TCoordRep> Superclass;
00056   typedef SmartPointer<Self> Pointer;
00057   typedef SmartPointer<const Self>  ConstPointer;
00058   
00060   itkNewMacro(Self);
00061 
00063   itkTypeMacro(UpwindDerivativeImageFunction, ImageFunction);
00064 
00066   typedef TInputImage InputImageType;
00067 
00069   itkStaticConstMacro(ImageDimension, unsigned int,
00070                       InputImageType::ImageDimension);
00071 
00073   typedef typename Superclass::IndexType IndexType;
00074 
00076   typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
00077 
00079   typedef typename Superclass::PointType PointType;
00080  
00082   virtual void SetInputImage( const InputImageType * ptr );
00083 
00085   virtual void SetSpeed( double value )
00086     { m_Speed = value; }
00087 
00089   virtual double GetSpeed() const
00090     { return m_Speed; }
00091 
00093   virtual double EvaluateAtIndex( const IndexType& index ) const
00094     { return ( this->EvaluateNthDerivativeAtIndex( index, 0 ) ); }
00095 
00097   virtual double Evaluate( const PointType& point ) const
00098     { 
00099       IndexType index;
00100       this->ConvertPointToNearestIndex( point, index );
00101       return this->EvaluateAtIndex( index ); 
00102     }
00103   virtual double EvaluateAtContinuousIndex( 
00104     const ContinuousIndexType& cindex ) const
00105     { 
00106       IndexType index;
00107       this->ConvertContinuousIndexToNearestIndex( cindex, index );
00108       return this->EvaluateAtIndex( index ) ; 
00109     }
00110   
00112   virtual double EvaluateNthDerivativeAtIndex( const IndexType& index, 
00113                            unsigned int dim = 0 ) const;
00114 
00116   virtual double GetDerivative() const
00117     { return m_Derivative; }
00118 
00119 protected:
00120   UpwindDerivativeImageFunction(){};
00121   ~UpwindDerivativeImageFunction(){};
00122   void PrintSelf(std::ostream& os, Indent indent) const;
00123 
00124   double                  m_Speed;
00125   mutable double          m_Derivative;
00126 
00127 private:
00128   UpwindDerivativeImageFunction(const Self&); //purposely not implemented
00129   void operator=(const Self&); //purposely not implemented
00130 
00131   signed long             m_ImageSize[ImageDimension];
00132   bool                    m_ImageSizeOK;
00133 
00134   mutable IndexType       m_NeighIndex;
00135   mutable double          m_CenterValue;
00136   mutable double          m_DiffValue;
00137 
00138 };
00139 
00140 } // namespace itk
00141 
00142 #ifndef ITK_MANUAL_INSTANTIATION
00143 #include "itkUpwindDerivativeImageFunction.txx"
00144 #endif
00145 
00146 #endif
00147 

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