template<typename TInputImage, typename TOutputImage>
class itk::SparseFieldLevelSetImageFilter< 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 INSIDE the surface will be NEGATIVE and values OUTSIDE 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 reach a minimum of -4.0 and outside values a maximum of 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 require a minimum of 2 layers. 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 244 of file itkSparseFieldLevelSetImageFilter.h.
|
void | AllocateUpdateBuffer () override |
|
void | ApplyUpdate (const TimeStepType &dt) override |
|
TimeStepType | CalculateChange () override |
|
virtual ValueType | CalculateUpdateValue (const IndexType &, const TimeStepType &dt, const ValueType &value, const ValueType &change) |
|
void | ConstructActiveLayer () |
|
void | ConstructLayer (StatusType from, StatusType to) |
|
void | CopyInputToOutput () override |
|
virtual ValueType | GetValueOne () const |
|
virtual ValueType | GetValueZero () const |
|
void | Initialize () override |
|
void | InitializeActiveLayerValues () |
|
virtual void | InitializeBackgroundPixels () |
|
void | PostProcessOutput () override |
|
void | PrintSelf (std::ostream &os, Indent indent) const override |
|
void | ProcessOutsideList (LayerType *OutsideList, StatusType ChangeToStatus) |
|
void | ProcessStatusList (LayerType *InputList, LayerType *OutputList, StatusType ChangeToStatus, StatusType SearchForStatus) |
|
void | PropagateAllLayerValues () |
|
void | PropagateLayerValues (StatusType from, StatusType to, StatusType promote, int InOrOut) |
|
| SparseFieldLevelSetImageFilter () |
|
void | UpdateActiveLayerValues (TimeStepType dt, LayerType *UpList, LayerType *DownList) |
|
| ~SparseFieldLevelSetImageFilter () override=default |
|
virtual void | AllocateUpdateBuffer ()=0 |
|
virtual void | ApplyUpdate (const TimeStepType &dt)=0 |
|
virtual TimeStepType | CalculateChange ()=0 |
|
virtual void | CopyInputToOutput ()=0 |
|
| FiniteDifferenceImageFilter () |
|
void | GenerateData () override |
|
void | GenerateInputRequestedRegion () override |
|
virtual bool | Halt () |
|
virtual void | Initialize () |
|
virtual void | InitializeIteration () |
|
virtual void | PostProcessOutput () |
|
void | PrintSelf (std::ostream &os, Indent indent) const override |
|
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 | PrintSelf (std::ostream &os, Indent indent) const override |
|
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) |
|
void | GenerateInputRequestedRegion () override |
|
| ImageToImageFilter () |
|
void | PrintSelf (std::ostream &os, Indent indent) const override |
|
void | VerifyInputInformation () const override |
|
| ~ImageToImageFilter () override=default |
|
virtual void | PushBackInput (const DataObject *input) |
|
virtual void | PushFrontInput (const DataObject *input) |
|
virtual void | AfterThreadedGenerateData () |
|
virtual void | AllocateOutputs () |
|
virtual void | BeforeThreadedGenerateData () |
|
void | ClassicMultiThread (ThreadFunctionType callbackFunction) |
|
void | GenerateData () override |
|
virtual const ImageRegionSplitterBase * | GetImageRegionSplitter () const |
|
| ImageSource () |
|
void | PrintSelf (std::ostream &os, Indent indent) const override |
|
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 | GenerateData () |
|
virtual void | GenerateInputRequestedRegion () |
|
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 |
|
virtual void | PopBackInput () |
|
virtual void | PopFrontInput () |
|
void | PrintSelf (std::ostream &os, Indent indent) const override |
|
| ProcessObject () |
|
virtual void | PropagateResetPipeline () |
|
virtual void | PushBackInput (const DataObject *input) |
|
virtual void | PushFrontInput (const DataObject *input) |
|
virtual void | ReleaseInputs () |
|
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 | VerifyInputInformation () const |
|
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 |
|
void | PrintSelf (std::ostream &os, Indent indent) const override |
|
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 | PrintSelf (std::ostream &os, Indent indent) const |
|
virtual void | PrintTrailer (std::ostream &os, Indent indent) const |
|
virtual | ~LightObject () |
|