18 #ifndef itkMultiphaseSparseFiniteDifferenceImageFilter_h
19 #define itkMultiphaseSparseFiniteDifferenceImageFilter_h
173 template <
typename TInputImage,
174 typename TFeatureImage,
175 typename TOutputImage,
177 typename TIdCell =
unsigned int>
198 static constexpr
unsigned int ImageDimension = Superclass::ImageDimension;
201 using typename Superclass::TimeStepType;
204 using typename Superclass::InputImageType;
205 using typename Superclass::InputImagePointer;
206 using typename Superclass::InputRegionType;
207 using typename Superclass::InputSizeType;
208 using typename Superclass::InputSizeValueType;
209 using typename Superclass::InputIndexType;
210 using typename Superclass::InputIndexValueType;
211 using typename Superclass::InputPixelType;
212 using typename Superclass::InputPointType;
213 using typename Superclass::InputSpacingType;
214 using typename Superclass::InputOffsetValueType;
216 using typename Superclass::FeatureImageType;
217 using typename Superclass::FeatureSizeType;
218 using typename Superclass::FeatureImagePointer;
219 using typename Superclass::FeatureRegionType;
220 using typename Superclass::FeatureSpacingType;
221 using typename Superclass::FeaturePointType;
223 using typename Superclass::OutputImageType;
224 using typename Superclass::OutputImagePointer;
225 using typename Superclass::OutputRegionType;
226 using typename Superclass::OutputSizeType;
227 using typename Superclass::OutputIndexType;
228 using typename Superclass::OutputIndexValueType;
229 using typename Superclass::OutputPixelType;
232 using typename Superclass::IdCellType;
234 using typename Superclass::FiniteDifferenceFunctionType;
235 using typename Superclass::FiniteDifferenceFunctionPointer;
280 itkSetMacro(NumberOfLayers,
unsigned int);
281 itkGetConstMacro(NumberOfLayers,
unsigned int);
286 itkGetConstMacro(IsoSurfaceValue,
ValueType);
293 itkSetMacro(InterpolateSurfaceLocation,
bool);
294 itkGetConstMacro(InterpolateSurfaceLocation,
bool);
295 itkBooleanMacro(InterpolateSurfaceLocation);
301 this->Superclass::SetFunctionCount(n);
303 m_SparseData.resize(this->m_FunctionCount,
nullptr);
305 for (
IdCellType i = 0; i < this->m_FunctionCount; ++i)
311 #ifdef ITK_USE_CONCEPT_CHECKING
323 while (!m_SparseData.empty())
325 delete m_SparseData.back();
326 m_SparseData.pop_back();
331 PrintSelf(std::ostream & os,
Indent indent)
const override;
339 m_LayerNodeStore->SetGrowthStrategyToExponential();
366 std::vector<ValueType> m_PixelDistance{};
372 inline virtual ValueType
378 return (value + dt * change);
385 PostProcessOutput()
override;
392 InitializeBackgroundPixels();
396 Initialize()
override;
403 CopyInputToOutput()
override;
413 ApplyUpdate(TimeStepType dt)
override;
418 CalculateChange()
override;
424 ConstructLayer(SparseDataStruct * sparsePtr, StatusType from, StatusType to);
431 ConstructActiveLayer();
435 InitializeActiveLayerValues();
440 InitializeBackgroundConstants();
450 PropagateLayerValues(SparseDataStruct * sparsePtr, StatusType from, StatusType to, StatusType promote,
int InOrOut);
457 PropagateAllLayerValues();
460 PropagateFunctionLayerValues(
unsigned int functionIndex);
466 UpdateActiveLayerValues(TimeStepType dt, LayerType * StatusUpList, LayerType * StatusDownList);
470 ProcessStatusList(LayerType * InputList,
471 LayerType * OutputList,
472 StatusType ChangeToStatus,
473 StatusType SearchForStatus);
477 ProcessOutsideList(LayerType * OutsideList, StatusType ChangeToStatus);
480 InitializeIteration()
override;
484 unsigned int itkNotUsed(idx),
487 bool & itkNotUsed(status))
490 itkGetConstMacro(ValueZero, ValueType);
491 itkGetConstMacro(ValueOne, ValueType);
523 std::vector<SparseDataStruct *> m_SparseData{};
528 unsigned int m_NumberOfLayers{};
540 bool m_InterpolateSurfaceLocation{};
543 unsigned int m_CurrentFunctionIndex{};
545 double m_RMSSum{ 0. };
546 unsigned int m_RMSCounter{ 0 };
550 bool m_BoundsCheckingActive{};
554 #ifndef ITK_MANUAL_INSTANTIATION
555 # include "itkMultiphaseSparseFiniteDifferenceImageFilter.hxx"