00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _itkLevelSetVelocityNeighborhoodExtractor_h
00018 #define _itkLevelSetVelocityNeighborhoodExtractor_h
00019
00020 #include "itkLevelSetNeighborhoodExtractor.h"
00021 #include "itkLevelSet.h"
00022 #include "itkIndex.h"
00023
00024 namespace itk
00025 {
00026
00054 template <
00055 class TLevelSet,
00056 class TAuxValue,
00057 unsigned int VAuxDimension = 1
00058 >
00059 class ITK_EXPORT LevelSetVelocityNeighborhoodExtractor :
00060 public LevelSetNeighborhoodExtractor<TLevelSet>
00061 {
00062 public:
00064 typedef LevelSetVelocityNeighborhoodExtractor Self;
00065 typedef LevelSetNeighborhoodExtractor<TLevelSet> Superclass;
00066 typedef SmartPointer<Self> Pointer;
00067 typedef SmartPointer<const Self> ConstPointer;
00068
00070 itkNewMacro(Self);
00071
00073 itkTypeMacro(LevelSetVelocityNeighborhoodExtractor,
00074 LevelSetNeighborhoodExtractor);
00075
00077 typedef LevelSetTypeDefault<TLevelSet> LevelSetType;
00078
00080 itkStaticConstMacro(SetDimension, unsigned int,
00081 LevelSetType::SetDimension);
00082
00084 typedef ::itk::Index<itkGetStaticConstMacro(SetDimension)> Index;
00085
00087 typedef AuxVarTypeDefault<TAuxValue,VAuxDimension,itkGetStaticConstMacro(SetDimension)> AuxVarType;
00088 typedef typename AuxVarType::AuxValueType AuxValueType;
00089 typedef typename AuxVarType::AuxValueVectorType AuxValueVectorType;
00090 typedef typename AuxVarType::AuxValueContainer AuxValueContainer;
00091 typedef typename AuxVarType::AuxImageType AuxImageType;
00092 typedef typename AuxVarType::AuxImagePointer AuxImagePointer;
00093 typedef typename AuxVarType::AuxImageConstPointer AuxImageConstPointer;
00094
00096 void SetAuxImage( const AuxImageType * ptr, unsigned int idx = 0 )
00097 {
00098 if ( idx < VAuxDimension && m_AuxImage[idx] != ptr )
00099 {
00100 m_AuxImage[idx] = ptr;
00101 }
00102 this->Modified();
00103 }
00105
00107 AuxImageConstPointer GetAuxImage( unsigned int idx = 0 )
00108 {
00109 if ( idx >= VAuxDimension )
00110 {
00111 return NULL;
00112 }
00113 else
00114 {
00115 return m_AuxImage[idx];
00116 }
00117 }
00119
00122 itkGetObjectMacro( AuxInsideValues, AuxValueContainer );
00123
00126 itkGetObjectMacro( AuxOutsideValues, AuxValueContainer );
00127
00128 protected:
00129 LevelSetVelocityNeighborhoodExtractor();
00130 ~LevelSetVelocityNeighborhoodExtractor(){};
00131 void PrintSelf( std::ostream& os, Indent indent ) const;
00132
00133 virtual void Initialize();
00134 virtual double CalculateDistance( Index & index );
00135
00136 private:
00137 LevelSetVelocityNeighborhoodExtractor(const Self&);
00138 void operator=(const Self&);
00139
00140 typename AuxValueContainer::Pointer m_AuxInsideValues;
00141 typename AuxValueContainer::Pointer m_AuxOutsideValues;
00142 AuxImageConstPointer m_AuxImage[VAuxDimension];
00143
00144 };
00145
00146 }
00147
00148 #ifndef ITK_MANUAL_INSTANTIATION
00149 #include "itkLevelSetVelocityNeighborhoodExtractor.txx"
00150 #endif
00151
00152 #endif
00153
00154
00155