00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkSegmentationLevelSetImageFilter_h_
00018 #define __itkSegmentationLevelSetImageFilter_h_
00019
00020 #include "itkSparseFieldLevelSetImageFilter.h"
00021 #include "itkSegmentationLevelSetFunction.h"
00022
00023 namespace itk {
00024
00099 template <class TInputImage, class TOutputImage>
00100 class ITK_EXPORT SegmentationLevelSetImageFilter
00101 : public SparseFieldLevelSetImageFilter<TInputImage, TOutputImage>
00102 {
00103 public:
00105 typedef SegmentationLevelSetImageFilter Self;
00106 typedef SparseFieldLevelSetImageFilter<TInputImage, TOutputImage> Superclass;
00107 typedef SmartPointer<Self> Pointer;
00108 typedef SmartPointer<const Self> ConstPointer;
00109
00111 typedef typename Superclass::ValueType ValueType;
00112 typedef typename Superclass::IndexType IndexType;
00113 typedef typename Superclass::TimeStepType TimeStepType;
00114 typedef typename Superclass::OutputImageType OutputImageType;
00115 typedef typename Superclass::InputImageType InputImageType;
00116
00118 typedef SegmentationLevelSetFunction<TOutputImage> SegmentationFunctionType;
00119
00121 typedef typename SegmentationFunctionType::FeatureImageType FeatureImageType;
00122
00124 itkTypeMacro(SegmentationLevelSetImageFilter, SparseFieldLevelSetImageFilter);
00125
00128 itkSetMacro(MaximumRMSError, ValueType);
00129 itkGetMacro(MaximumRMSError, ValueType);
00130
00133 itkSetMacro(MaximumIterations, unsigned int);
00134 itkGetMacro(MaximumIterations, unsigned int);
00135
00138 virtual void SetFeatureImage(FeatureImageType *f)
00139 {
00140 m_SegmentationFunction->SetFeatureImage(f);
00141 this->Modified();
00142 }
00143 virtual FeatureImageType * GetFeatureImage() const
00144 { return m_SegmentationFunction->GetFeatureImage(); }
00145
00146 virtual typename SegmentationFunctionType::ImageType *GetSpeedImage() const
00147 { return m_SegmentationFunction->GetSpeedImage(); }
00148
00149
00152 void SetUseNegativeFeaturesOn()
00153 {
00154 this->SetUseNegativeFeatures(true);
00155 }
00156 void SetUseNegativeFeaturesOff()
00157 {
00158 this->SetUseNegativeFeatures(false);
00159 }
00160
00165 itkSetMacro(UseNegativeFeatures, bool);
00166 itkGetMacro(UseNegativeFeatures, bool);
00167
00169 itkSetMacro(FeatureScaling, ValueType);
00170 itkGetMacro(FeatureScaling, ValueType);
00171
00173 itkSetMacro(CurvatureScaling, ValueType);
00174 itkGetMacro(CurvatureScaling, ValueType);
00175
00178 virtual void SetSegmentationFunction(SegmentationFunctionType *s);
00179 virtual SegmentationFunctionType *GetSegmentationFunction()
00180 { return m_SegmentationFunction; }
00181
00182 protected:
00183 virtual ~SegmentationLevelSetImageFilter() {}
00184 SegmentationLevelSetImageFilter();
00185
00186 virtual void PrintSelf(std::ostream& os, Indent indent) const;
00187
00189 virtual void InitializeIteration()
00190 {
00191 Superclass::InitializeIteration();
00192
00193 this->SetProgress( (float) ((float)this->GetElapsedIterations()
00194 / (float)this->GetMaximumIterations()) );
00195 }
00196
00197
00200 void GenerateData();
00201
00204 bool Halt();
00205
00207 bool m_UseNegativeFeatures;
00208
00210 ValueType m_FeatureScaling;
00211
00213 ValueType m_CurvatureScaling;
00214
00215 private:
00216 unsigned int m_MaximumIterations;
00217 SegmentationFunctionType *m_SegmentationFunction;
00218 ValueType m_MaximumRMSError;
00219
00220 };
00221
00222 }
00223
00224 #ifndef ITK_MANUAL_INSTANTIATION
00225 #include "itkSegmentationLevelSetImageFilter.txx"
00226 #endif
00227
00228 #endif
00229