18 #ifndef itkSparseFieldFourthOrderLevelSetImageFilter_h
19 #define itkSparseFieldFourthOrderLevelSetImageFilter_h
37 template <
typename TImageType>
153 template <
typename TInputImage,
typename TOutputImage>
171 static constexpr
unsigned int ImageDimension = Superclass::ImageDimension;
174 using typename Superclass::OutputImageType;
175 using typename Superclass::ValueType;
177 using typename Superclass::LayerType;
178 using typename Superclass::RadiusType;
179 using typename Superclass::NeighborhoodScalesType;
206 itkGetConstReferenceMacro(MaxRefitIteration,
unsigned int);
207 itkSetMacro(MaxRefitIteration,
unsigned int);
208 itkGetConstReferenceMacro(MaxNormalIteration,
unsigned int);
209 itkSetMacro(MaxNormalIteration,
unsigned int);
210 itkGetConstReferenceMacro(CurvatureBandWidth,
ValueType);
211 itkSetMacro(CurvatureBandWidth,
ValueType);
212 itkGetConstReferenceMacro(RMSChangeNormalProcessTrigger,
ValueType);
213 itkSetMacro(RMSChangeNormalProcessTrigger,
ValueType);
214 itkGetConstReferenceMacro(NormalProcessType,
int);
215 itkSetMacro(NormalProcessType,
int);
216 itkGetConstReferenceMacro(NormalProcessConductance,
ValueType);
217 itkSetMacro(NormalProcessConductance,
ValueType);
218 itkSetMacro(NormalProcessUnsharpFlag,
bool);
219 itkGetConstReferenceMacro(NormalProcessUnsharpFlag,
bool);
220 itkBooleanMacro(NormalProcessUnsharpFlag);
221 itkSetMacro(NormalProcessUnsharpWeight,
ValueType);
222 itkGetConstReferenceMacro(NormalProcessUnsharpWeight,
ValueType);
235 return static_cast<int>(std::ceil(m_CurvatureBandWidth + Self::ImageDimension));
243 const unsigned int nm = std::max(this->GetMinimumNumberOfLayers(), n);
245 if (nm != this->GetNumberOfLayers())
247 Superclass::SetNumberOfLayers(nm);
257 Superclass::InitializeIteration();
258 const ValueType rmschange = this->GetRMSChange();
261 if ((this->GetElapsedIterations() == 0) || (m_RefitIteration == m_MaxRefitIteration) ||
262 (rmschange <= m_RMSChangeNormalProcessTrigger) || (this->ActiveLayerCheckBand()))
264 if ((this->GetElapsedIterations() != 0) && (rmschange <= m_RMSChangeNormalProcessTrigger) &&
265 (m_RefitIteration <= 1))
267 m_ConvergenceFlag =
true;
270 m_RefitIteration = 0;
277 #ifdef ITK_USE_CONCEPT_CHECKING
287 PrintSelf(std::ostream & os,
Indent indent)
const override;
292 ComputeCurvatureFromSparseImageNeighborhood(SparseImageIteratorType & it)
const;
298 ComputeCurvatureTarget(
const OutputImageType * distanceImage, SparseImageType * sparseImage)
const;
309 ActiveLayerCheckBand()
const;
314 unsigned int m_RefitIteration{};
319 unsigned int m_MaxRefitIteration{};
323 unsigned int m_MaxNormalIteration{};
332 bool m_ConvergenceFlag{};
346 int m_NormalProcessType{};
354 bool m_NormalProcessUnsharpFlag{};
366 #ifndef ITK_MANUAL_INSTANTIATION
367 # include "itkSparseFieldFourthOrderLevelSetImageFilter.hxx"