18 #ifndef itkMultiphaseSparseFiniteDifferenceImageFilter_h
19 #define itkMultiphaseSparseFiniteDifferenceImageFilter_h
176 template<
typename TInputImage,
typename TFeatureImage,
typename TOutputImage,
typename TFunction,
177 typename TIdCell =
unsigned int >
180 TFeatureImage, TOutputImage, TFunction, TIdCell >
189 TFeatureImage, TOutputImage, TFunction, TIdCell >;
199 static constexpr
unsigned int ImageDimension = Superclass::ImageDimension;
283 itkSetMacro(NumberOfLayers,
unsigned int);
284 itkGetConstMacro(NumberOfLayers,
unsigned int);
289 itkGetConstMacro(IsoSurfaceValue,
ValueType);
296 itkSetMacro(InterpolateSurfaceLocation,
bool);
297 itkGetConstMacro(InterpolateSurfaceLocation,
bool);
302 { this->SetInterpolateSurfaceLocation(
true); }
304 { this->SetInterpolateSurfaceLocation(
false); }
309 this->Superclass::SetFunctionCount(n);
311 m_SparseData.resize(this->m_FunctionCount,
nullptr);
313 for (
IdCellType i = 0; i < this->m_FunctionCount; i++ )
319 #ifdef ITK_USE_CONCEPT_CHECKING
334 while ( !m_SparseData.empty() )
336 delete m_SparseData.back();
337 m_SparseData.pop_back();
341 void PrintSelf(std::ostream & os,
Indent indent)
const override;
347 m_LayerNodeStore = LayerNodeStorageType::New();
348 m_LayerNodeStore->SetGrowthStrategyToExponential();
387 return ( value + dt * change );
393 void PostProcessOutput()
override;
399 virtual void InitializeBackgroundPixels();
402 void Initialize()
override;
408 void CopyInputToOutput()
override;
415 void ApplyUpdate(TimeStepType dt)
override;
419 TimeStepType CalculateChange()
override;
424 void ConstructLayer(SparseDataStruct *sparsePtr, StatusType from, StatusType
431 void ConstructActiveLayer();
434 void InitializeActiveLayerValues();
438 void InitializeBackgroundConstants();
447 void PropagateLayerValues(SparseDataStruct *sparsePtr, StatusType from,
448 StatusType to, StatusType promote,
int InOrOut);
454 void PropagateAllLayerValues();
456 void PropagateFunctionLayerValues(
unsigned int functionIndex);
461 void UpdateActiveLayerValues(TimeStepType dt, LayerType *StatusUpList,
462 LayerType *StatusDownList);
465 void ProcessStatusList(LayerType *InputList, LayerType *OutputList,
466 StatusType ChangeToStatus, StatusType SearchForStatus);
469 void ProcessOutsideList(LayerType *OutsideList, StatusType ChangeToStatus);
471 void InitializeIteration()
override;
473 virtual void UpdatePixel(
unsigned int itkNotUsed(functionIndex),
unsigned int itkNotUsed(idx),
476 bool & itkNotUsed(status) ){}
478 itkGetConstMacro(ValueZero, ValueType);
542 #ifndef ITK_MANUAL_INSTANTIATION
543 #include "itkMultiphaseSparseFiniteDifferenceImageFilter.hxx"
std::vector< SparseDataStruct * > m_SparseData
typename Superclass::FeatureImagePointer FeatureImagePointer
ValueType m_IsoSurfaceValue
typename Superclass::TimeStepType TimeStepType
typename InputImageType::ValueType ValueType
typename OutputImageType::Pointer OutputImagePointer
unsigned int m_NumberOfLayers
void InterpolateSurfaceLocationOn()
bool m_InterpolateSurfaceLocation
unsigned int m_CurrentFunctionIndex
typename NeighborListType::OffsetType OffsetType
static const ValueType m_ValueZero
typename Superclass::InputSpacingType InputSpacingType
ValueType m_BackgroundValue
std::vector< LayerPointerType > LayerListType
typename Superclass::InputImageType InputImageType
static const ValueType m_ValueOne
typename Superclass::FeatureSpacingType FeatureSpacingType
typename Superclass::InputImagePointer InputImagePointer
void SetFunctionCount(const IdCellType &n)
typename Superclass::InputSizeValueType InputSizeValueType
typename Superclass::InputIndexValueType InputIndexValueType
typename LayerListType::const_iterator LayerListConstIterator
typename Superclass::IdCellType IdCellType
typename Superclass::OutputPixelType OutputPixelType
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
~MultiphaseSparseFiniteDifferenceImageFilter() override
Base class for all process objects that output image data.
NeighborListType m_NeighborList
The non-const version of the ConstSparseFieldLayerIterator.
unsigned int m_RMSCounter
typename LayerType::ConstIterator LayerConstIterator
typename ZeroCrossingFilterType::Pointer ZeroCrossingFilterPointer
virtual void UpdatePixel(unsigned int, unsigned int, NeighborhoodIterator< InputImageType > &, ValueType &, bool &)
static const StatusType m_StatusBoundaryPixel
std::vector< ValueType > UpdateBufferType
LayerNodeStoragePointer m_LayerNodeStore
static double m_ConstantGradientValue
Splits an image into a main region and several "face" regions which are used to handle computations o...
typename Superclass::FeatureRegionType FeatureRegionType
typename NeighborhoodType::OffsetType OffsetType
typename Superclass::OutputRegionType OutputRegionType
typename Superclass::FeatureSizeType FeatureSizeType
typename StatusImageType::Pointer StatusImagePointer
typename Superclass::InputIndexType InputIndexType
typename Superclass::FeaturePointType FeaturePointType
typename FiniteDifferenceFunctionType::FloatOffsetType FiniteDifferenceFunctionFloatOffsetType
TOutputImage OutputImageType
typename LayerNodeStorageType::Pointer LayerNodeStoragePointer
typename Superclass::OutputSizeType OutputSizeType
static const StatusType m_StatusActiveChangingDown
void InterpolateSurfaceLocationOff()
virtual ValueType CalculateUpdateValue(const OutputIndexType &, const TimeStepType &dt, const ValueType &value, const ValueType &change)
typename Superclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType
void AllocateUpdateBuffer() override
This class implements a finite difference partial differential equation solver for evolving surfaces ...
typename UpdateBufferType::const_iterator UpdateBufferConstIterator
static const StatusType m_StatusNull
static const StatusType m_StatusChanging
typename Superclass::OutputIndexType OutputIndexType
typename Superclass::InputSizeType InputSizeType
typename Superclass::InputPointType InputPointType
typename LayerListType::iterator LayerListIterator
typename Superclass::InputOffsetValueType InputOffsetValueType
typename Superclass::FiniteDifferenceFunctionPointer FiniteDifferenceFunctionPointer
typename Superclass::InputRegionType InputRegionType
This filter finds the closest pixel to the zero-crossings (sign changes) in a signed itk::Image...
Control indentation during Print() invocation.
typename LayerType::Pointer LayerPointerType
typename Superclass::InputPixelType InputPixelType
SparseDataStruct(const IdCellType &index)
typename Superclass::OutputIndexValueType OutputIndexValueType
A very simple linked list that is used to manage nodes in a layer of a sparse field level-set solver...
#define itkConceptMacro(name, concept)
UpdateBufferType m_UpdateBuffer
A specialized memory management object for allocating and destroying contiguous blocks of objects...
std::vector< ValueType > m_PixelDistance
typename LayerType::Iterator LayerIterator
static const StatusType m_StatusActiveChangingUp
Defines iteration of a local N-dimensional neighborhood of pixels across an itk::Image.
Templated n-dimensional image class.
typename Superclass::FeatureImageType FeatureImageType
StatusImagePointer m_StatusImage
bool m_BoundsCheckingActive