18 #ifndef __itkSparseFieldFourthOrderLevelSetImageFilter_h
19 #define __itkSparseFieldFourthOrderLevelSetImageFilter_h
37 template<
class TImageType >
49 typedef typename LevelSetImageType::IndexType
IndexType;
53 TImageType ::ImageDimension >
156 template<
class TInputImage,
class TOutputImage >
173 itkStaticConstMacro(ImageDimension,
unsigned int, Superclass::ImageDimension);
212 itkGetConstReferenceMacro(MaxRefitIteration,
unsigned int);
213 itkSetMacro(MaxRefitIteration,
unsigned int);
214 itkGetConstReferenceMacro(MaxNormalIteration,
unsigned int);
215 itkSetMacro(MaxNormalIteration,
unsigned int);
216 itkGetConstReferenceMacro(CurvatureBandWidth,
ValueType);
217 itkSetMacro(CurvatureBandWidth,
ValueType);
218 itkGetConstReferenceMacro(RMSChangeNormalProcessTrigger,
ValueType);
219 itkSetMacro(RMSChangeNormalProcessTrigger,
ValueType);
220 itkGetConstReferenceMacro(NormalProcessType,
int);
221 itkSetMacro(NormalProcessType,
int);
222 itkGetConstReferenceMacro(NormalProcessConductance,
ValueType);
223 itkSetMacro(NormalProcessConductance,
ValueType);
224 itkSetMacro(NormalProcessUnsharpFlag,
bool);
225 itkGetConstReferenceMacro(NormalProcessUnsharpFlag,
bool);
226 itkSetMacro(NormalProcessUnsharpWeight,
ValueType);
227 itkGetConstReferenceMacro(NormalProcessUnsharpWeight,
ValueType);
236 unsigned int GetMinimumNumberOfLayers()
const
238 return (
int)vcl_ceil( m_CurvatureBandWidth
239 + itkGetStaticConstMacro(ImageDimension) );
244 virtual void SetNumberOfLayers(
const unsigned int n)
246 unsigned int nm = vnl_math_max (this->GetMinimumNumberOfLayers (), n);
248 if ( nm != this->GetNumberOfLayers() )
250 Superclass::SetNumberOfLayers (nm);
257 virtual void InitializeIteration()
259 Superclass::InitializeIteration();
260 ValueType rmschange = this->GetRMSChange();
263 if ( ( this->GetElapsedIterations() == 0 )
264 || ( m_RefitIteration == m_MaxRefitIteration )
265 || ( rmschange <= m_RMSChangeNormalProcessTrigger )
266 || ( this->ActiveLayerCheckBand() ) )
268 if ( ( this->GetElapsedIterations() != 0 )
269 && ( rmschange <= m_RMSChangeNormalProcessTrigger )
270 && ( m_RefitIteration <= 1 ) )
272 m_ConvergenceFlag =
true;
275 m_RefitIteration = 0;
282 #ifdef ITK_USE_CONCEPT_CHECKING
293 virtual void PrintSelf(std::ostream & os,
Indent indent)
const;
297 ValueType ComputeCurvatureFromSparseImageNeighborhood
298 (SparseImageIteratorType & neighborhood)
const;
303 void ComputeCurvatureTarget(
const OutputImageType *distanceImage,
304 SparseImageType *sparseImage)
const;
307 void ProcessNormals();
313 bool ActiveLayerCheckBand()
const;
370 void operator=(
const Self &);
374 #ifndef ITK_MANUAL_INSTANTIATION
375 #include "itkSparseFieldFourthOrderLevelSetImageFilter.hxx"