18 #ifndef itkParallelSparseFieldLevelSetImageFilter_h
19 #define itkParallelSparseFieldLevelSetImageFilter_h
36 template<
typename TNodeIndexType >
74 template<
typename TNeighborhoodType >
91 return m_ArrayIndex[i];
96 return m_NeighborhoodOffset[i];
106 return m_StrideTable[i];
113 m_ArrayIndex.clear();
114 m_NeighborhoodOffset.clear();
117 void Print(std::ostream & os)
const;
248 template<
typename TInputImage,
typename TOutputImage >
277 itkStaticConstMacro(ImageDimension,
unsigned int, TOutputImage::ImageDimension);
319 itkGetConstMacro(IsoSurfaceValue,
ValueType);
325 const unsigned int indexZ = index[m_SplitAxis];
327 const unsigned int ThreadNum = this->GetThreadNumber (indexZ);
330 return m_Data[ThreadNum].m_Layers[0];
333 #ifdef ITK_USE_CONCEPT_CHECKING
347 virtual void PrintSelf(std::ostream & os,
Indent indent)
const ITK_OVERRIDE;
423 virtual void GenerateData() ITK_OVERRIDE;
429 void CopyInputToOutput() ITK_OVERRIDE;
432 void AllocateUpdateBuffer() ITK_OVERRIDE {}
436 void Initialize() ITK_OVERRIDE;
442 void ConstructActiveLayer();
445 void InitializeActiveLayerValues();
450 void ConstructLayer(const StatusType& from, const StatusType& to);
453 void ProcessStatusList(LayerType *InputList, const StatusType& ChangeToStatus,
454 const StatusType& SearchForStatus,
ThreadIdType ThreadId);
460 void PropagateAllLayerValues();
469 void PropagateLayerValues(const StatusType& from, const StatusType& to,
470 const StatusType& promote,
unsigned int InOrOut);
476 virtual
void InitializeBackgroundPixels();
483 void ThreadedInitializeData(
ThreadIdType ThreadId, const ThreadRegionType & ThreadRegion);
494 void ComputeInitialThreadBoundaries();
497 unsigned int GetThreadNumber(
unsigned int splitAxisValue);
500 void GetThreadRegionSplitByBoundary(
ThreadIdType ThreadId, ThreadRegionType & ThreadRegion);
504 void DeallocateData();
532 return ( value + static_cast< ValueType >( dt ) * change );
539 virtual void ThreadedProcessPixelEnteringActiveLayer(
const IndexType& itkNotUsed(index),
540 const ValueType& itkNotUsed(value),
548 virtual void ThreadedApplyUpdate(
const TimeStepType& dt,
ThreadIdType ThreadId);
558 virtual TimeStepType ThreadedCalculateChange(
ThreadIdType ThreadId);
566 void ThreadedUpdateActiveLayerValues(
const TimeStepType& dt,
567 LayerType *StatusUpList,
568 LayerType *StatusDownList,
574 LayerPointerType FromListPtr,
575 LayerPointerType ToListPtr);
578 void ClearList(
ThreadIdType ThreadId, LayerPointerType ListPtr);
582 void CopyInsertInterNeighborNodeTransferBufferLayers(
584 LayerPointerType InputList,
585 unsigned int InOrOut,
586 unsigned int BufferLayerNumber);
590 void ClearInterNeighborNodeTransferBufferLayers(
592 unsigned int BufferLayerNumber);
601 void ThreadedProcessFirstLayerStatusLists(
602 unsigned int InputLayerNumber,
603 unsigned int OutputLayerNumber,
604 const StatusType& SearchForStatus,
605 unsigned int InOrOut,
606 unsigned int BufferLayerNumber,
614 void ThreadedProcessStatusList(
615 unsigned int InputLayerNumber,
616 unsigned int OutputLayerNumber,
617 const StatusType& ChangeToStatus,
618 const StatusType& SearchForStatus,
619 unsigned int InOrOut,
620 unsigned int BufferLayerNumber,
626 void ThreadedProcessOutsideList(
627 unsigned int InputLayerNumber,
628 const StatusType& ChangeToStatus,
629 unsigned int InOrOut,
630 unsigned int BufferLayerNumber,
634 void ThreadedPropagateLayerValues(
635 const StatusType& from,
636 const StatusType& to,
637 const StatusType& promote,
638 unsigned int InorOut,
643 void GetThreadRegionSplitUniformly(
644 ThreadIdType ThreadId, ThreadRegionType & ThreadRegion);
651 void ThreadedPostProcessOutput(
const ThreadRegionType & regionToProcess);
663 virtual void CheckLoadBalance();
667 virtual void ThreadedLoadBalance(
ThreadIdType ThreadId);
674 void SignalNeighbor(
unsigned int SemaphoreArrayNumber,
ThreadIdType ThreadId);
676 void WaitForNeighbor(
unsigned int SemaphoreArrayNumber,
ThreadIdType ThreadId);
680 virtual void ThreadedInitializeIteration(
ThreadIdType ThreadId);
788 #ifndef ITK_MANUAL_INSTANTIATION
789 #include "itkParallelSparseFieldLevelSetImageFilter.hxx"
A convenience class for storing indices which reference neighbor pixels within a neighborhood.
TOutputImage OutputImageType
bool m_InterpolateSurfaceLocation
std::vector< TimeStepType > TimeStepList
const OffsetType & GetNeighborhoodOffset(unsigned int i) const
const RadiusType & GetRadius() const
LayerNodeStorageType::Pointer m_LayerNodeStore
Barrier::Pointer m_Barrier
ParallelSparseFieldLevelSetImageFilter * Filter
OutputImageType::Pointer m_OutputImageTemp
static StatusType m_StatusNull
ThreadIdType m_NumOfThreads
static StatusType m_StatusChanging
static StatusType m_StatusBoundaryPixel
Superclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType
unsigned int GetStride(unsigned int i)
StatusImageType::Pointer m_StatusImageTemp
SmartPointer< Self > Pointer
bool m_BoundsCheckingActive
NeighborhoodType::RadiusType RadiusType
ParallelSparseFieldLevelSetNode< IndexType > LayerNodeType
TNeighborhoodType NeighborhoodType
ParallelSparseFieldCityBlockNeighborList< NeighborhoodIterator< OutputImageType > > m_NeighborList
OutputImageType::Pointer m_OutputImage
ParallelSparseFieldLevelSetImageFilter Self
LayerNodeStorageType::Pointer m_LayerNodeStore
ValueType m_IsoSurfaceValue
Base class for all process objects that output image data.
SmartPointer< const Self > ConstPointer
Offset< itkGetStaticConstMacro(ImageDimension) > OffsetType
OutputImageType::IndexType IndexType
#define ITK_THREAD_RETURN_TYPE
int * m_ZCumulativeFrequency
~ParallelSparseFieldCityBlockNeighborList()
static StatusType m_StatusActiveChangingUp
OutputImageType::PixelType PixelType
const unsigned int & GetArrayIndex(unsigned int i) const
OutputImageType::ValueType ValueType
ParallelSparseFieldLevelSetNode * Previous
ParallelSparseFieldLevelSetNode * Next
static StatusType m_StatusActiveChangingDown
virtual ValueType ThreadedCalculateUpdateValue(const ThreadIdType, const IndexType, const TimeStepType &dt, const ValueType &value, const ValueType &change)
This class implements a finite difference partial differential equation solver for evolving surfaces ...
LayerListType * m_LoadTransferBufferLayers
Superclass::NeighborhoodScalesType NeighborhoodScalesType
std::vector< bool > ValidTimeStepList
FiniteDifferenceImageFilter< TInputImage, TOutputImage > Superclass
std::vector< unsigned int > m_ArrayIndex
ThreadRegionType ThreadRegion
OutputImageType::Pointer m_ShiftedImage
const unsigned int Dimension
std::vector< LayerPointerType > LayerListType
Superclass::RadiusType RadiusType
static ValueType m_ValueZero
~ParallelSparseFieldLevelSetImageFilter() override
unsigned int m_SemaphoreArrayNumber
unsigned int ThreadIdType
void ApplyUpdate(const TimeStepType &) override
FiniteDifferenceFunctionType::TimeStepType TimeStepType
StatusImageType::Pointer m_StatusImage
NeighborhoodType::OffsetType OffsetType
double m_ConstantGradientValue
LayerType::Pointer LayerPointerType
OutputImageType::RegionType ThreadRegionType
LayerPointerType GetActiveListForIndex(const IndexType index)
std::vector< OffsetType > m_NeighborhoodOffset
ObjectStore< LayerNodeType > LayerNodeStorageType
Control indentation during Print() invocation.
unsigned int * m_MapZToThreadNumber
static ValueType m_ValueOne
Superclass::TimeStepType TimeStepType
SparseFieldLayer< LayerNodeType > LayerType
TimeStepType CalculateChange() override
TInputImage InputImageType
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)
Image< StatusType, itkGetStaticConstMacro(ImageDimension) > StatusImageType
const unsigned int & GetSize() const
A specialized memory management object for allocating and destroying contiguous blocks of objects...
unsigned int * m_Boundary
Templated n-dimensional image class.
Superclass::RadiusType RadiusType
ImageBaseType::IndexType IndexType
StatusType m_NumberOfLayers
Simple mutual exclusion locking class.