18#ifndef itkMultiphaseSparseFiniteDifferenceImageFilter_h
19#define itkMultiphaseSparseFiniteDifferenceImageFilter_h
173template <
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);
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();
339 m_LayerNodeStore->SetGrowthStrategyToExponential();
366 std::vector<ValueType> m_PixelDistance{};
372 inline virtual ValueType
378 return (value + dt * change);
484 unsigned int itkNotUsed(idx),
487 bool & itkNotUsed(status))
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"
Base class for all process objects that output image data.
Templated n-dimensional image class.
Control indentation during Print() invocation.
typename OutputImageType::IndexType OutputIndexType
typename FiniteDifferenceFunctionType::TimeStepType TimeStepType
This class implements a finite difference partial differential equation solver for evolving surfaces ...
typename FiniteDifferenceFunctionType::FloatOffsetType FiniteDifferenceFunctionFloatOffsetType
typename LayerListType::const_iterator LayerListConstIterator
TimeStepType CalculateChange() override
void PostProcessOutput() override
typename LayerType::Pointer LayerPointerType
typename NeighborListType::OffsetType OffsetType
void ApplyUpdate(TimeStepType dt) override
void InitializeIteration() override
static const ValueType m_ValueZero
typename LayerType::ConstIterator LayerConstIterator
typename ZeroCrossingFilterType::Pointer ZeroCrossingFilterPointer
static const StatusType m_StatusNull
void PrintSelf(std::ostream &os, Indent indent) const override
void ConstructActiveLayer()
typename UpdateBufferType::const_iterator UpdateBufferConstIterator
void PropagateLayerValues(SparseDataStruct *sparsePtr, StatusType from, StatusType to, StatusType promote, int InOrOut)
virtual void UpdatePixel(unsigned int, unsigned int, NeighborhoodIterator< InputImageType > &, ValueType &, bool &)
virtual ValueType CalculateUpdateValue(const OutputIndexType &, const TimeStepType &dt, const ValueType &value, const ValueType &change)
MultiphaseSparseFiniteDifferenceImageFilter()
void ProcessStatusList(LayerType *InputList, LayerType *OutputList, StatusType ChangeToStatus, StatusType SearchForStatus)
typename InputImageType::ValueType ValueType
virtual void InitializeBackgroundPixels()
typename LayerListType::iterator LayerListIterator
static const StatusType m_StatusChanging
std::vector< ValueType > UpdateBufferType
void InitializeBackgroundConstants()
typename LayerNodeStorageType::Pointer LayerNodeStoragePointer
~MultiphaseSparseFiniteDifferenceImageFilter() override
std::vector< LayerPointerType > LayerListType
typename LayerType::Iterator LayerIterator
static const StatusType m_StatusBoundaryPixel
void AllocateUpdateBuffer() override
void PropagateAllLayerValues()
void Initialize() override
void UpdateActiveLayerValues(TimeStepType dt, LayerType *StatusUpList, LayerType *StatusDownList)
void ConstructLayer(SparseDataStruct *sparsePtr, StatusType from, StatusType to)
static const ValueType m_ValueOne
void PropagateFunctionLayerValues(unsigned int functionIndex)
static const StatusType m_StatusActiveChangingDown
void ProcessOutsideList(LayerType *OutsideList, StatusType ChangeToStatus)
void CopyInputToOutput() override
static const StatusType m_StatusActiveChangingUp
void InitializeActiveLayerValues()
void SetFunctionCount(const IdCellType &n)
static double m_ConstantGradientValue
typename StatusImageType::Pointer StatusImagePointer
Defines iteration of a local N-dimensional neighborhood of pixels across an itk::Image.
A specialized memory management object for allocating and destroying contiguous blocks of objects.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
typename NeighborhoodType::OffsetType OffsetType
The non-const version of the ConstSparseFieldLayerIterator.
A very simple linked list that is used to manage nodes in a layer of a sparse field level-set solver.
This filter finds the closest pixel to the zero-crossings (sign changes) in a signed itk::Image.
SmartPointer< Self > Pointer
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
LayerNodeStoragePointer m_LayerNodeStore
UpdateBufferType m_UpdateBuffer
StatusImagePointer m_StatusImage
SparseDataStruct(const IdCellType &index)
Splits an image into a main region and several "face" regions which are used to handle computations o...