00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _itkLevelSetImageFilter_h
00018 #define _itkLevelSetImageFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "itkLevelSet.h"
00022
00023 namespace itk
00024 {
00025
00056 template <class TLevelSet>
00057 class ITK_EXPORT LevelSetImageFilter :
00058 public ImageToImageFilter<TLevelSet,TLevelSet>
00059 {
00060 public:
00062 typedef LevelSetImageFilter Self;
00063 typedef ImageToImageFilter<TLevelSet,TLevelSet> Superclass;
00064 typedef SmartPointer<Self> Pointer;
00065 typedef SmartPointer<const Self> ConstPointer;
00066
00068 itkTypeMacro(LevelSetImageFilter, ImageToImageFilter);
00069
00071 typedef LevelSetTypeDefault<TLevelSet> LevelSetType;
00072 typedef typename LevelSetType::LevelSetImageType LevelSetImageType;
00073 typedef typename LevelSetType::LevelSetPointer LevelSetPointer;
00074 typedef typename LevelSetType::LevelSetConstPointer LevelSetConstPointer;
00075 typedef typename LevelSetType::PixelType PixelType;
00076 typedef typename LevelSetType::NodeType NodeType;
00077 typedef typename LevelSetType::NodeContainer NodeContainer;
00078 typedef typename LevelSetType::NodeContainerPointer NodeContainerPointer;
00079
00081 enum { SetDimension = LevelSetType::SetDimension};
00082
00087 itkSetClampMacro( TimeStepSize, double, 0.0,
00088 NumericTraits<double>::max());
00089
00091 itkGetMacro( TimeStepSize, double );
00092
00098 itkSetMacro( NarrowBanding, bool );
00099 itkBooleanMacro( NarrowBanding );
00100
00102 itkGetMacro( NarrowBanding, bool );
00103
00105 itkSetClampMacro( NarrowBandwidth, double, 0.0,
00106 NumericTraits<double>::max());
00107
00109 itkGetMacro( NarrowBandwidth, double );
00110
00112 int GetNarrowBandSize()
00113 {
00114 if( !m_NarrowBanding ) return 0;
00115 return m_InputNarrowBand->Size();
00116 }
00117
00119 void SetInputNarrowBand( NodeContainer *ptr );
00120
00122 NodeContainerPointer GetInputNarrowBand( )
00123 { return m_InputNarrowBand; }
00124
00126 itkSetMacro( NumberOfIterations, unsigned int );
00127
00129 itkGetMacro( NumberOfIterations, unsigned int );
00130
00131 protected:
00132 LevelSetImageFilter();
00133 ~LevelSetImageFilter(){};
00134 void PrintSelf(std::ostream& os, Indent indent) const;
00135
00137 virtual void AllocateBuffers(bool outputOnly = false);
00138
00142 virtual void SwapBuffers();
00143
00146 virtual void CopyInputToInputBuffer();
00147
00150 virtual void CopyOutputBufferToOutput();
00151
00153 LevelSetPointer GetInputBuffer(void)
00154 { return m_InputBuffer; }
00155
00157 LevelSetPointer GetOutputBuffer(void)
00158 { return m_OutputBuffer; }
00159
00165 virtual void GenerateInputRequestedRegion();
00166
00172 virtual void EnlargeOutputRequestedRegion(DataObject * output);
00173
00174 private:
00175 LevelSetImageFilter(const Self&);
00176 void operator=(const Self&);
00177
00178 NodeContainerPointer m_InputNarrowBand;
00179 double m_TimeStepSize;
00180 bool m_NarrowBanding;
00181 double m_NarrowBandwidth;
00182
00183 unsigned int m_NumberOfIterations;
00184 LevelSetPointer m_InputBuffer;
00185 LevelSetPointer m_OutputBuffer;
00186
00187 };
00188
00189
00190 }
00191
00192 #ifndef ITK_MANUAL_INSTANTIATION
00193 #include "itkLevelSetImageFilter.txx"
00194 #endif
00195
00196 #endif