template<typename TInputImage, typename TOutputImage>
class itk::ParallelSparseFieldLevelSetImageFilter< TInputImage, TOutputImage >
This class implements a finite difference partial differential equation solver for evolving surfaces embedded in volumes as level-sets.
- The "sparse field" approach to the level-set model is a logical extension of the classical narrow band technique, which seeks to minimize computational effort by restricting calculations to those pixels in a region of interest around the moving surface (the \(k\)-level curve). The sparse field method uses a narrow band that is exactly the width needed to calculate changes on the level curve for the next time step. Because the band of grid points under consideration is so sparse, this approach has several advantages: the algorithm does exactly the number of calculations needed to determine the next position of the \(k\)-level curve, and the distance transform around the level curve can be recomputed at each iteration.
- The sparse field algorithm works by constructing a linked list of indices that are adjacent to the \(k\)-level set. These indices are called the "active set". The values at these active set indices define the position of the \(k\)-level curve. The active set indices are shifted to follow the distance transform embedding of the \(k\)-level curve as their values move in and out of a fixed numerical range about \(k\). In this way, the active set is maintained as only those pixels adjacent to the evolving surface. Calculations are then done only at indices contained in the active set.
- The city-block neighborhoods of the active set indices are maintained as separate lists called "layers". At each iteration, the values at the layers are reinitialized as the distance transform from the active set. The number of layers can be adjusted according to the footprint needed for the calculations on the level curve.
- Briefly, the sparse field solver algorithm is as follows:
- For each active layer index \(x_j\): Compute the change at \(u_{x_j}\), the grid point in the embedding, based on local geometry and external forces and using a stable numerical scheme.
- For each active layer index \(x_j\), add the change to the grid point value and redefine the active set indices and those of its layers based on any value changes which have moved outside of the numerical range allowed for the active set.
- Starting with the first layers adjacent to the active set and moving outwards, reconstruct the distance transform by setting values in the layers according to their neighbors. At the very outer layers, add or remove indices which have come into or moved out of the sparse field.
- HOW TO USE THIS CLASS
- Typically, this class should be subclassed with additional functionality for specific applications. It is possible, however to use this solver as a filter directly by instantiating it and supplying it with an appropriate LevelSetFunction object via the SetDifferenceFunction method. See the subclasses and their associated documentation for more information on using this class. Also see the FiniteDifferenceImageFilter documentation for a general overview of this class of solvers.
- INPUTS
- This filter takes an itk::Image as input. The appropriate type of input image is entirely determined by the application. As a rule, however, the input type is immediately converted to the output type before processing. This is because the input is not assumed to be a real value type and must be converted to signed, real values for the calculations. The input values will also be shifted by the \(k\) isosurface value so that the algorithm only needs to consider the zero level set.
- OUTPUTS
- The output of the filter is the distance transform embedding of the isosurface as the zero level set. Values outside the surface will be negative and values inside the surface will be positive. The distance transform only holds for those indices in layers around the active layer. Elsewhere, the values are a fixed positive or negative that is one greater than the layer of greatest magnitude. In other words, if there are three layers, then inside values increase only to 4.0 and outside values only to -4.0.
- PARAMETERS
- The NumberOfLayers parameter controls the number of layers inside and outside of the active set (see description above). The sparse field will contain 2*NumberOfLayers+1 lists of indices: the active set and city block neighbors inside and outside the active set. It is important to specify enough layers to cover the footprint of your calculations. Curvature calculations in three dimensions, for example, require 3 layers. In two dimensions, a minimum of 2 layers is probably required. Higher order derivatives and other geometrical measures may require more layers. If too few layers are specified, then the calculations will pull values from the background, which may consist of arbitrary or random values.
- The IsoSurfaceValue indicates which value in the input represents the interface of interest. By default, this value is zero. When the solver initializes, it will subtract the IsoSurfaceValue from all values, in the input, shifting the isosurface of interest to zero in the output.
- IMPORTANT!
- Read the documentation for FiniteDifferenceImageFilter before attempting to use this filter. The solver requires that you specify a FiniteDifferenceFunction to use for calculations. This is set using the method SetDifferenceFunction in the parent class.
- REFERENCES
- Whitaker, Ross. A Level-Set Approach to 3D Reconstruction from Range Data. International Journal of Computer Vision. V. 29 No. 3, 203-231. 1998.
- Sethian, J.A. Level Set Methods. Cambridge University Press. 1996.
Definition at line 256 of file itkParallelSparseFieldLevelSetImageFilter.h.
|
void | AllocateUpdateBuffer () override |
|
void | ApplyUpdate (const TimeStepType &) override |
|
TimeStepType | CalculateChange () override |
|
virtual void | CheckLoadBalance () |
|
void | ClearInterNeighborNodeTransferBufferLayers (ThreadIdType ThreadId, unsigned int InOrOut, unsigned int BufferLayerNumber) |
|
void | ClearList (ThreadIdType ThreadId, LayerPointerType ListPtr) |
|
void | ComputeInitialThreadBoundaries () |
|
void | ConstructActiveLayer () |
|
void | ConstructLayer (const StatusType &from, const StatusType &to) |
|
void | CopyInputToOutput () override |
|
void | CopyInsertInterNeighborNodeTransferBufferLayers (ThreadIdType ThreadId, LayerPointerType List, unsigned int InOrOut, unsigned int BufferLayerNumber) |
|
void | CopyInsertList (ThreadIdType ThreadId, LayerPointerType FromListPtr, LayerPointerType ToListPtr) |
|
void | DeallocateData () |
|
void | GenerateData () override |
|
unsigned int | GetThreadNumber (unsigned int splitAxisValue) |
|
void | GetThreadRegionSplitByBoundary (ThreadIdType ThreadId, ThreadRegionType &ThreadRegion) |
|
void | GetThreadRegionSplitUniformly (ThreadIdType ThreadId, ThreadRegionType &ThreadRegion) |
|
void | Initialize () override |
|
void | InitializeActiveLayerValues () |
|
virtual void | InitializeBackgroundPixels () |
|
void | Iterate () |
|
| itkAlignedTypedef (ITK_CACHE_LINE_ALIGNMENT, ThreadDataPadded, ThreadData) |
|
| itkPadStruct (ITK_CACHE_LINE_ALIGNMENT, ThreadDataUnaligned, ThreadDataPadded) |
|
| ParallelSparseFieldLevelSetImageFilter () |
|
void | PrintSelf (std::ostream &os, Indent indent) const override |
|
void | ProcessStatusList (LayerType *InputList, const StatusType &ChangeToStatus, const StatusType &SearchForStatus, ThreadIdType ThreadId) |
|
void | PropagateAllLayerValues () |
|
void | PropagateLayerValues (const StatusType &from, const StatusType &to, const StatusType &promote, unsigned int InOrOut) |
|
void | SignalNeighbor (unsigned int SemaphoreArrayNumber, ThreadIdType ThreadId) |
|
void | SignalNeighborsAndWait (ThreadIdType ThreadId) |
|
void | ThreadedAllocateData (ThreadIdType ThreadId) |
|
virtual void | ThreadedApplyUpdate (const TimeStepType &dt, ThreadIdType ThreadId) |
|
virtual TimeStepType | ThreadedCalculateChange (ThreadIdType ThreadId) |
|
virtual ValueType | ThreadedCalculateUpdateValue (const ThreadIdType, const IndexType, const TimeStepType &dt, const ValueType &value, const ValueType &change) |
|
void | ThreadedInitializeData (ThreadIdType ThreadId, const ThreadRegionType &ThreadRegion) |
|
virtual void | ThreadedInitializeIteration (ThreadIdType ThreadId) |
|
void | ThreadedPostProcessOutput (const ThreadRegionType ®ionToProcess) |
|
void | ThreadedProcessFirstLayerStatusLists (unsigned int InputLayerNumber, unsigned int OutputLayerNumber, const StatusType &SearchForStatus, unsigned int InOrOut, unsigned int BufferLayerNumber, ThreadIdType ThreadId) |
|
void | ThreadedProcessOutsideList (unsigned int InputLayerNumber, const StatusType &ChangeToStatus, unsigned int InOrOut, unsigned int BufferLayerNumber, ThreadIdType ThreadId) |
|
virtual void | ThreadedProcessPixelEnteringActiveLayer (const IndexType &, const ValueType &, ThreadIdType) |
|
void | ThreadedProcessStatusList (unsigned int InputLayerNumber, unsigned int OutputLayerNumber, const StatusType &ChangeToStatus, const StatusType &SearchForStatus, unsigned int InOrOut, unsigned int BufferLayerNumber, ThreadIdType ThreadId) |
|
void | ThreadedPropagateLayerValues (const StatusType &from, const StatusType &to, const StatusType &promote, unsigned int InOrOut, ThreadIdType ThreadId) |
|
void | ThreadedUpdateActiveLayerValues (const TimeStepType &dt, LayerType *UpList, LayerType *DownList, ThreadIdType ThreadId) |
|
void | WaitForNeighbor (unsigned int SemaphoreArrayNumber, ThreadIdType ThreadId) |
|
| ~ParallelSparseFieldLevelSetImageFilter () override=default |
|
|
void | ThreadedLoadBalance1 (ThreadIdType ThreadId) |
|
void | ThreadedLoadBalance2 (ThreadIdType ThreadId) |
|
| FiniteDifferenceImageFilter () |
|
void | GenerateInputRequestedRegion () override |
|
virtual bool | Halt () |
|
virtual void | InitializeIteration () |
|
virtual void | PostProcessOutput () |
|
virtual TimeStepType | ResolveTimeStep (const std::vector< TimeStepType > &timeStepList, const BooleanStdVectorType &valid) const |
|
virtual void | SetElapsedIterations (IdentifierType _arg) |
|
virtual bool | ThreadedHalt (void *) |
|
| ~FiniteDifferenceImageFilter () override=default |
|
virtual bool | GetRunningInPlace () const |
|
| InPlaceImageFilter ()=default |
|
void | ReleaseInputs () override |
|
| ~InPlaceImageFilter () override=default |
|
void | AllocateOutputs () override |
|
virtual void | CallCopyInputRegionToOutputRegion (OutputImageRegionType &destRegion, const InputImageRegionType &srcRegion) |
|
virtual void | CallCopyOutputRegionToInputRegion (InputImageRegionType &destRegion, const OutputImageRegionType &srcRegion) |
|
| ImageToImageFilter () |
|
void | VerifyInputInformation () const override |
|
| ~ImageToImageFilter () override=default |
|
virtual void | PushBackInput (const DataObject *input) |
|
virtual void | PushFrontInput (const DataObject *input) |
|
virtual void | AfterThreadedGenerateData () |
|
virtual void | BeforeThreadedGenerateData () |
|
void | ClassicMultiThread (ThreadFunctionType callbackFunction) |
|
virtual const ImageRegionSplitterBase * | GetImageRegionSplitter () const |
|
| ImageSource () |
|
virtual unsigned int | SplitRequestedRegion (unsigned int i, unsigned int pieces, OutputImageRegionType &splitRegion) |
|
| ~ImageSource () override=default |
|
virtual void | ThreadedGenerateData (const OutputImageRegionType ®ion, ThreadIdType threadId) |
|
virtual void | DynamicThreadedGenerateData (const OutputImageRegionType &outputRegionForThread) |
|
virtual bool | GetDynamicMultiThreading () const |
|
virtual void | SetDynamicMultiThreading (bool _arg) |
|
virtual void | DynamicMultiThreadingOn () |
|
virtual void | AddInput (DataObject *input) |
|
void | AddOptionalInputName (const DataObjectIdentifierType &) |
|
void | AddOptionalInputName (const DataObjectIdentifierType &, DataObjectPointerArraySizeType idx) |
|
virtual void | AddOutput (DataObject *output) |
|
bool | AddRequiredInputName (const DataObjectIdentifierType &) |
|
bool | AddRequiredInputName (const DataObjectIdentifierType &, DataObjectPointerArraySizeType idx) |
|
virtual void | CacheInputReleaseDataFlags () |
|
virtual void | GenerateOutputInformation () |
|
virtual void | GenerateOutputRequestedRegion (DataObject *output) |
|
DataObject * | GetInput (const DataObjectIdentifierType &key) |
|
const DataObject * | GetInput (const DataObjectIdentifierType &key) const |
|
virtual const DataObjectPointerArraySizeType & | GetNumberOfRequiredInputs () const |
|
virtual const DataObjectPointerArraySizeType & | GetNumberOfRequiredOutputs () const |
|
bool | IsIndexedInputName (const DataObjectIdentifierType &) const |
|
bool | IsIndexedOutputName (const DataObjectIdentifierType &) const |
|
bool | IsRequiredInputName (const DataObjectIdentifierType &) const |
|
DataObjectPointerArraySizeType | MakeIndexFromInputName (const DataObjectIdentifierType &name) const |
|
DataObjectPointerArraySizeType | MakeIndexFromOutputName (const DataObjectIdentifierType &name) const |
|
DataObjectIdentifierType | MakeNameFromInputIndex (DataObjectPointerArraySizeType idx) const |
|
DataObjectIdentifierType | MakeNameFromOutputIndex (DataObjectPointerArraySizeType idx) const |
|
| ProcessObject () |
|
virtual void | PropagateResetPipeline () |
|
virtual void | PushBackInput (const DataObject *input) |
|
virtual void | PushFrontInput (const DataObject *input) |
|
virtual void | RemoveInput (const DataObjectIdentifierType &key) |
|
virtual void | RemoveInput (DataObjectPointerArraySizeType) |
|
virtual void | RemoveOutput (const DataObjectIdentifierType &key) |
|
virtual void | RemoveOutput (DataObjectPointerArraySizeType idx) |
|
bool | RemoveRequiredInputName (const DataObjectIdentifierType &) |
|
virtual void | RestoreInputReleaseDataFlags () |
|
virtual void | SetInput (const DataObjectIdentifierType &key, DataObject *input) |
|
virtual void | SetNthInput (DataObjectPointerArraySizeType idx, DataObject *input) |
|
virtual void | SetNthOutput (DataObjectPointerArraySizeType idx, DataObject *output) |
|
void | SetNumberOfIndexedInputs (DataObjectPointerArraySizeType num) |
|
void | SetNumberOfIndexedOutputs (DataObjectPointerArraySizeType num) |
|
virtual void | SetNumberOfRequiredInputs (DataObjectPointerArraySizeType) |
|
virtual void | SetNumberOfRequiredOutputs (DataObjectPointerArraySizeType _arg) |
|
virtual void | SetOutput (const DataObjectIdentifierType &name, DataObject *output) |
|
virtual void | SetPrimaryInput (DataObject *object) |
|
virtual void | SetPrimaryOutput (DataObject *object) |
|
void | SetRequiredInputNames (const NameArray &) |
|
virtual void | VerifyPreconditions () const |
|
| ~ProcessObject () override |
|
DataObject * | GetInput (DataObjectPointerArraySizeType idx) |
|
const DataObject * | GetInput (DataObjectPointerArraySizeType idx) const |
|
DataObject * | GetPrimaryInput () |
|
const DataObject * | GetPrimaryInput () const |
|
virtual void | SetPrimaryInputName (const DataObjectIdentifierType &key) |
|
virtual const char * | GetPrimaryInputName () const |
|
DataObject * | GetOutput (const DataObjectIdentifierType &key) |
|
const DataObject * | GetOutput (const DataObjectIdentifierType &key) const |
|
virtual void | SetPrimaryOutputName (const DataObjectIdentifierType &key) |
|
virtual const char * | GetPrimaryOutputName () const |
|
DataObject * | GetOutput (DataObjectPointerArraySizeType i) |
|
const DataObject * | GetOutput (DataObjectPointerArraySizeType i) const |
|
DataObject * | GetPrimaryOutput () |
|
const DataObject * | GetPrimaryOutput () const |
|
virtual bool | GetThreaderUpdateProgress () const |
|
virtual void | ThreaderUpdateProgressOn () |
|
virtual void | SetThreaderUpdateProgress (bool arg) |
|
| Object () |
|
bool | PrintObservers (std::ostream &os, Indent indent) const |
|
virtual void | SetTimeStamp (const TimeStamp &timeStamp) |
|
| ~Object () override |
|
virtual LightObject::Pointer | InternalClone () const |
|
| LightObject () |
|
virtual void | PrintHeader (std::ostream &os, Indent indent) const |
|
virtual void | PrintTrailer (std::ostream &os, Indent indent) const |
|
virtual | ~LightObject () |
|