00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _itkShapeDetectionLevelSetFilter_h
00018 #define _itkShapeDetectionLevelSetFilter_h
00019
00020 #include "itkLevelSet.h"
00021 #include "itkLevelSetImageFilter.h"
00022 #include "itkExtensionVelocitiesImageFilter.h"
00023 #include "itkNumericTraits.h"
00024
00025 namespace itk
00026 {
00091 template <class TLevelSet, class TEdgeImage>
00092 class ITK_EXPORT ShapeDetectionLevelSetFilter :
00093 public LevelSetImageFilter<TLevelSet>
00094 {
00095 public:
00097 typedef ShapeDetectionLevelSetFilter Self;
00098 typedef LevelSetImageFilter<TLevelSet> Superclass;
00099 typedef SmartPointer<Self> Pointer;
00100 typedef SmartPointer<const Self> ConstPointer;
00101
00103 itkNewMacro(Self);
00104
00106 itkTypeMacro(ShapeDetectionLevelSetFilter, LevelSetImageFilter);
00107
00109 typedef LevelSetTypeDefault<TLevelSet> LevelSetType;
00110 typedef typename LevelSetType::LevelSetImageType LevelSetImageType;
00111 typedef typename LevelSetType::LevelSetPointer LevelSetPointer;
00112 typedef typename LevelSetType::PixelType PixelType;
00113 typedef typename LevelSetType::NodeType NodeType;
00114 typedef typename LevelSetType::NodeContainer NodeContainer;
00115 typedef typename LevelSetType::NodeContainerPointer NodeContainerPointer;
00116
00118 typedef TEdgeImage EdgeImageType;
00119
00121 typedef typename EdgeImageType::Pointer EdgeImagePointer;
00122 typedef typename EdgeImageType::ConstPointer EdgeImageConstPointer;
00123
00125 void SetEdgeImage( const EdgeImageType * ptr );
00126 const EdgeImageType * GetEdgeImage(void);
00127
00134 itkSetClampMacro( LengthPenaltyStrength, double, 0.0,
00135 NumericTraits<double>::max() );
00136 itkGetMacro( LengthPenaltyStrength, double );
00137
00142 itkSetMacro( PropagateOutwards, bool );
00143 itkGetMacro( PropagateOutwards, bool );
00144
00146 NodeContainerPointer GetOutputNarrowBand()
00147 { return m_OutputNarrowBand; }
00148
00149 protected:
00150 ShapeDetectionLevelSetFilter();
00151 ~ShapeDetectionLevelSetFilter(){};
00152 void PrintSelf(std::ostream& os, Indent indent) const;
00153
00154 virtual void AllocateOutput();
00155 void GenerateData();
00156 virtual void GenerateDataFull();
00157 virtual void GenerateDataNarrowBand();
00158 virtual void GenerateInputRequestedRegion();
00159
00160 void SetOutputNarrowBand( NodeContainer *ptr )
00161 { m_OutputNarrowBand = ptr; }
00162
00163 private:
00164 ShapeDetectionLevelSetFilter(const Self&);
00165 void operator=(const Self&);
00166
00167 typedef typename TEdgeImage::PixelType EdgePixelType;
00168 typedef ExtensionVelocitiesImageFilter<TLevelSet,EdgePixelType,1>
00169 ExtenderType;
00170
00171 double m_LengthPenaltyStrength;
00172 bool m_PropagateOutwards;
00173 typename ExtenderType::Pointer m_Extender;
00174 NodeContainerPointer m_OutputNarrowBand;
00175
00176 };
00177
00178 }
00179
00180 #ifndef ITK_MANUAL_INSTANTIATION
00181 #include "itkShapeDetectionLevelSetFilter.txx"
00182 #endif
00183
00184 #endif