18 #ifndef itkMultiphaseSparseFiniteDifferenceImageFilter_h
19 #define itkMultiphaseSparseFiniteDifferenceImageFilter_h
176 template <
typename TInputImage,
177 typename TFeatureImage,
178 typename TOutputImage,
180 typename TIdCell =
unsigned int>
201 static constexpr
unsigned int ImageDimension = Superclass::ImageDimension;
204 using typename Superclass::TimeStepType;
207 using typename Superclass::InputImageType;
208 using typename Superclass::InputImagePointer;
209 using typename Superclass::InputRegionType;
210 using typename Superclass::InputSizeType;
211 using typename Superclass::InputSizeValueType;
212 using typename Superclass::InputIndexType;
213 using typename Superclass::InputIndexValueType;
214 using typename Superclass::InputPixelType;
215 using typename Superclass::InputPointType;
216 using typename Superclass::InputSpacingType;
217 using typename Superclass::InputOffsetValueType;
219 using typename Superclass::FeatureImageType;
220 using typename Superclass::FeatureSizeType;
221 using typename Superclass::FeatureImagePointer;
222 using typename Superclass::FeatureRegionType;
223 using typename Superclass::FeatureSpacingType;
224 using typename Superclass::FeaturePointType;
226 using typename Superclass::OutputImageType;
227 using typename Superclass::OutputImagePointer;
228 using typename Superclass::OutputRegionType;
229 using typename Superclass::OutputSizeType;
230 using typename Superclass::OutputIndexType;
231 using typename Superclass::OutputIndexValueType;
232 using typename Superclass::OutputPixelType;
235 using typename Superclass::IdCellType;
237 using typename Superclass::FiniteDifferenceFunctionType;
238 using typename Superclass::FiniteDifferenceFunctionPointer;
283 itkSetMacro(NumberOfLayers,
unsigned int);
284 itkGetConstMacro(NumberOfLayers,
unsigned int);
289 itkGetConstMacro(IsoSurfaceValue,
ValueType);
296 itkSetMacro(InterpolateSurfaceLocation,
bool);
297 itkGetConstMacro(InterpolateSurfaceLocation,
bool);
298 itkBooleanMacro(InterpolateSurfaceLocation);
304 this->Superclass::SetFunctionCount(n);
306 m_SparseData.resize(this->m_FunctionCount,
nullptr);
308 for (
IdCellType i = 0; i < this->m_FunctionCount; ++i)
314 #ifdef ITK_USE_CONCEPT_CHECKING
326 while (!m_SparseData.empty())
328 delete m_SparseData.back();
329 m_SparseData.pop_back();
334 PrintSelf(std::ostream & os,
Indent indent)
const override;
342 m_LayerNodeStore->SetGrowthStrategyToExponential();
369 std::vector<ValueType> m_PixelDistance{};
375 inline virtual ValueType
381 return (value + dt * change);
388 PostProcessOutput()
override;
395 InitializeBackgroundPixels();
399 Initialize()
override;
406 CopyInputToOutput()
override;
416 ApplyUpdate(TimeStepType dt)
override;
421 CalculateChange()
override;
427 ConstructLayer(SparseDataStruct * sparsePtr, StatusType from, StatusType to);
434 ConstructActiveLayer();
438 InitializeActiveLayerValues();
443 InitializeBackgroundConstants();
453 PropagateLayerValues(SparseDataStruct * sparsePtr, StatusType from, StatusType to, StatusType promote,
int InOrOut);
460 PropagateAllLayerValues();
463 PropagateFunctionLayerValues(
unsigned int functionIndex);
469 UpdateActiveLayerValues(TimeStepType dt, LayerType * StatusUpList, LayerType * StatusDownList);
473 ProcessStatusList(LayerType * InputList,
474 LayerType * OutputList,
475 StatusType ChangeToStatus,
476 StatusType SearchForStatus);
480 ProcessOutsideList(LayerType * OutsideList, StatusType ChangeToStatus);
483 InitializeIteration()
override;
487 unsigned int itkNotUsed(idx),
490 bool & itkNotUsed(status))
493 itkGetConstMacro(ValueZero, ValueType);
494 itkGetConstMacro(ValueOne, ValueType);
526 std::vector<SparseDataStruct *> m_SparseData{};
531 unsigned int m_NumberOfLayers{};
543 bool m_InterpolateSurfaceLocation{};
546 unsigned int m_CurrentFunctionIndex{};
548 double m_RMSSum{ 0. };
549 unsigned int m_RMSCounter{ 0 };
553 bool m_BoundsCheckingActive{};
557 #ifndef ITK_MANUAL_INSTANTIATION
558 # include "itkMultiphaseSparseFiniteDifferenceImageFilter.hxx"