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

itkFastMarchingUpwindGradientImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkFastMarchingUpwindGradientImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2006/03/31 14:31:05 $
00007   Version:   $Revision: 1.4 $
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 _itkFastMarchingUpwindGradientImageFilter_h
00019 #define _itkFastMarchingUpwindGradientImageFilter_h
00020 
00021 #include "itkFastMarchingImageFilter.h"
00022 #include "itkImage.h"
00023 
00024 namespace itk
00025 {
00057 template <
00058   class TLevelSet, 
00059   class TSpeedImage = Image<float,::itk::GetImageDimension<TLevelSet>::ImageDimension> >
00060 class ITK_EXPORT FastMarchingUpwindGradientImageFilter :
00061     public FastMarchingImageFilter<TLevelSet,TSpeedImage>
00062 {
00063 
00064 public:
00066   typedef FastMarchingUpwindGradientImageFilter Self;
00067   typedef FastMarchingImageFilter<TLevelSet,TSpeedImage> Superclass;
00068   typedef SmartPointer<Self> Pointer;
00069   typedef SmartPointer<const Self>  ConstPointer;
00070 
00072   itkNewMacro(Self);
00073 
00075   itkTypeMacro(FastMarchingUpwindGradientImageFilter, FastMarchingImageFilter);
00076 
00078   typedef typename Superclass::LevelSetType  LevelSetType;
00079   typedef typename Superclass::SpeedImageType SpeedImageType;
00080   typedef typename Superclass::LevelSetImageType  LevelSetImageType;
00081   typedef typename Superclass::LevelSetPointer  LevelSetPointer;
00082   typedef typename Superclass::SpeedImageConstPointer  SpeedImageConstPointer;
00083   typedef typename Superclass::LabelImageType  LabelImageType;
00084   typedef typename Superclass::PixelType  PixelType;
00085   typedef typename Superclass::AxisNodeType  AxisNodeType;
00086   typedef typename Superclass::NodeType  NodeType;
00087   typedef typename Superclass::NodeContainer  NodeContainer;
00088   typedef typename Superclass::NodeContainerPointer  NodeContainerPointer;
00089   typedef typename Superclass::IndexType  IndexType;
00090   typedef typename Superclass::OutputSpacingType  OutputSpacingType;
00091   typedef typename Superclass::LevelSetIndexType  LevelSetIndexType;
00092 
00094   itkStaticConstMacro(SetDimension, unsigned int,Superclass::SetDimension); 
00095 
00099   void SetTargetPoints( NodeContainer * points )
00100   { 
00101     m_TargetPoints = points;
00102     this->Modified();
00103   };
00105 
00107   NodeContainerPointer GetTargetPoints( )
00108   { return m_TargetPoints; };
00109 
00111   typedef CovariantVector<PixelType, 
00112           itkGetStaticConstMacro(SetDimension)> GradientPixelType;
00113 
00115   typedef Image<GradientPixelType, 
00116           itkGetStaticConstMacro(SetDimension)> GradientImageType;
00117 
00119   typedef typename GradientImageType::Pointer GradientImagePointer;
00120 
00122   GradientImagePointer GetGradientImage() const
00123   { return m_GradientImage; };
00124 
00127   itkSetMacro( GenerateGradientImage, bool );
00128 
00130   itkGetConstReferenceMacro( GenerateGradientImage, bool );
00131   itkBooleanMacro( GenerateGradientImage );
00133 
00137   itkSetMacro( TargetOffset, double );
00138 
00140   itkGetConstReferenceMacro( TargetOffset, double );
00141 
00145   itkSetMacro( TargetReachedMode, int );
00146   itkGetConstReferenceMacro( TargetReachedMode, int );
00147   void SetTargetReachedModeToNoTargets()
00148     { this->SetTargetReachedMode(NoTargets); }
00149   void SetTargetReachedModeToOneTarget() 
00150     { this->SetTargetReachedMode(OneTarget); }
00151   void SetTargetReachedModeToAllTargets() 
00152     { this->SetTargetReachedMode(AllTargets); }
00154 
00156   itkGetConstReferenceMacro( TargetValue, double );
00157 
00158   enum
00159     {
00160       NoTargets,
00161       OneTarget,
00162       AllTargets
00163     };
00164 
00165 #ifdef ITK_USE_CONCEPT_CHECKING
00166 
00167   itkConceptMacro(LevelSetDoubleDivisionOperatorsCheck,
00168     (Concept::DivisionOperators<typename TLevelSet::PixelType, double>));
00169 
00171 #endif
00172 
00173 protected:
00174   FastMarchingUpwindGradientImageFilter();
00175   ~FastMarchingUpwindGradientImageFilter(){};
00176   void PrintSelf( std::ostream& os, Indent indent ) const;
00177 
00178   virtual void Initialize( LevelSetImageType * );
00179 
00180   void GenerateData();
00181 
00182   virtual void UpdateNeighbors( const IndexType& index, 
00183                                 const SpeedImageType *, LevelSetImageType * );
00184 
00185   virtual void ComputeGradient( const IndexType& index ,
00186                               const LevelSetImageType * output, 
00187                               const LabelImageType * labelImage,
00188                               GradientImageType * gradientImage);
00189 
00190 private:
00191   FastMarchingUpwindGradientImageFilter(const Self&); //purposely not implemented
00192   void operator=(const Self&); //purposely not implemented
00193   
00194   NodeContainerPointer m_TargetPoints;
00195   NodeContainerPointer m_ReachedTargetPoints;
00196 
00197   GradientImagePointer m_GradientImage;
00198  
00199   bool m_GenerateGradientImage;
00200 
00201   double m_TargetOffset;
00202 
00203   int m_TargetReachedMode;
00204 
00205   double m_TargetValue;
00206 
00207 };
00208 
00209 } // namespace itk
00210 
00211 
00212 #ifndef ITK_MANUAL_INSTANTIATION
00213 #include "itkFastMarchingUpwindGradientImageFilter.txx"
00214 #endif
00215 
00216 #endif
00217 

Generated at Fri Sep 8 03:01:21 2006 for ITK by doxygen 1.4.7 written by Dimitri van Heesch, © 1997-2000