#include <itkFastMarchingImageFilter.h>
Solve an Eikonal equation using Fast Marching.
Fast marching solves an Eikonal equation where the speed is always non-negative and depends on the position only. Starting from an initial position on the front, fast marching systematically moves the front forward one grid point at a time.
Updates are performed using an entropy satisfy scheme where only "upwind" neighborhoods are used. This implementation of Fast Marching uses a std::priority_queue to locate the next proper grid position to update.
Fast Marching sweeps through N grid points in (N log N) steps to obtain the arrival time value as the front propagates through the grid.
Implementation of this class is based on [96].
This class is templated over the level set image type and the speed image type. The initial front is specified by two containers: one containing the known points and one containing the trial points. Alive points are those that are already part of the object, and trial points are considered for inclusion. In order for the filter to evolve, at least some trial points must be specified. These can for instance be specified as the layer of pixels around the alive points.
The speed function can be specified as a speed image or a speed constant. The speed image is set using the method SetInput(). If the speed image is nullptr, a constant speed function is used and is specified using method the SetSpeedConstant().
If the speed function is constant and of value one, fast marching results in an approximate distance function from the initial alive points. FastMarchingImageFilter is used in the ReinitializeLevelSetImageFilter object to create a signed distance function from the zero level set.
The algorithm can be terminated early by setting an appropriate stopping value. The algorithm terminates when the current arrival time being processed is greater than the stopping value.
There are two ways to specify the output image information ( LargestPossibleRegion, Spacing, Origin): (a) it is copied directly from the input speed image or (b) it is specified by the user. Default values are used if the user does not specify all the information.
The output information is computed as follows. If the speed image is nullptr or if the OverrideOutputInformation is set to true, the output information is set from user specified parameters. These parameters can be specified using methods SetOutputRegion(), SetOutputSpacing(), SetOutputDirection(), and SetOutputOrigin(). Else if the speed image is not nullptr, the output information is copied from the input speed image.
For an alternative implementation, see itk::FastMarchingImageFilter.
Possible Improvements: In the current implementation, std::priority_queue only allows taking nodes out from the front and putting nodes in from the back. To update a value already on the heap, a new node is added to the heap. The defunct old node is left on the heap. When it is removed from the top, it will be recognized as invalid and not used. Future implementations can implement the heap in a different way allowing the values to be updated. This will generally require some sift-up and sift-down functions and an image of back-pointers going from the image to heap in order to locate the node which is to be updated.
Definition at line 133 of file itkFastMarchingImageFilter.h.
Classes | |
class | AxisNodeType |
Static Public Member Functions | |
static Pointer | New () |
![]() | |
static double | GetGlobalDefaultCoordinateTolerance () |
static double | GetGlobalDefaultDirectionTolerance () |
static void | SetGlobalDefaultCoordinateTolerance (double) |
static void | SetGlobalDefaultDirectionTolerance (double) |
![]() | |
static bool | GetGlobalWarningDisplay () |
static void | GlobalWarningDisplayOff () |
static void | GlobalWarningDisplayOn () |
static Pointer | New () |
static void | SetGlobalWarningDisplay (bool val) |
![]() | |
static void | BreakOnError () |
static Pointer | New () |
Static Public Attributes | |
static constexpr unsigned int | SetDimension = LevelSetType::SetDimension |
static constexpr unsigned int | SpeedImageDimension = SpeedImageType::ImageDimension |
![]() | |
static constexpr unsigned int | InputImageDimension = TInputImage::ImageDimension |
static constexpr unsigned int | OutputImageDimension = TOutputImage::ImageDimension |
![]() | |
static constexpr unsigned int | OutputImageDimension = TOutputImage::ImageDimension |
Protected Types | |
using | LevelSetIndexType = typename LevelSetImageType::IndexType |
![]() | |
using | InputToOutputRegionCopierType |
using | OutputToInputRegionCopierType |
Protected Attributes | |
OutputRegionType | m_BufferedRegion {} |
LevelSetIndexType | m_LastIndex {} |
LevelSetIndexType | m_StartIndex {} |
![]() | |
bool | m_DynamicMultiThreading { true } |
![]() | |
TimeStamp | m_OutputInformationMTime {} |
bool | m_Updating {} |
![]() | |
std::atomic< int > | m_ReferenceCount {} |
Private Types | |
using | HeapContainer = std::vector<AxisNodeType> |
using | HeapType = std::priority_queue<AxisNodeType, HeapContainer, NodeComparer> |
using | NodeComparer = std::greater<AxisNodeType> |
Private Attributes | |
NodeContainerPointer | m_AlivePoints {} |
bool | m_CollectPoints {} |
double | m_InverseSpeed {} |
LabelImagePointer | m_LabelImage {} |
LevelSetImageType::PixelType | m_LargeValue {} |
AxisNodeType | m_NodesUsed [SetDimension] {} |
double | m_NormalizationFactor {} |
OutputDirectionType | m_OutputDirection {} |
OutputPointType | m_OutputOrigin {} |
OutputRegionType | m_OutputRegion {} |
OutputSpacingType | m_OutputSpacing {} |
NodeContainerPointer | m_OutsidePoints {} |
bool | m_OverrideOutputInformation {} |
NodeContainerPointer | m_ProcessedPoints {} |
double | m_SpeedConstant {} |
double | m_StoppingValue {} |
HeapType | m_TrialHeap {} |
NodeContainerPointer | m_TrialPoints {} |
Additional Inherited Members | |
![]() | |
static const ImageRegionSplitterBase * | GetGlobalDefaultSplitter () |
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION | ThreaderCallback (void *arg) |
![]() | |
template<typename TSourceObject> | |
static void | MakeRequiredOutputs (TSourceObject &sourceObject, const DataObjectPointerArraySizeType numberOfRequiredOutputs) |
static constexpr float | progressFixedToFloat (uint32_t fixed) |
static uint32_t | progressFloatToFixed (float f) |
using itk::FastMarchingImageFilter< TLevelSet, TSpeedImage >::ConstPointer = SmartPointer<const Self> |
Definition at line 142 of file itkFastMarchingImageFilter.h.
|
private |
Trial points are stored in a min-heap. This allow efficient access to the trial point with minimum value which is the next grid point the algorithm processes.
Definition at line 458 of file itkFastMarchingImageFilter.h.
|
private |
Definition at line 460 of file itkFastMarchingImageFilter.h.
using itk::FastMarchingImageFilter< TLevelSet, TSpeedImage >::IndexType = Index<Self::SetDimension> |
Index type alias support
Definition at line 202 of file itkFastMarchingImageFilter.h.
using itk::FastMarchingImageFilter< TLevelSet, TSpeedImage >::LabelEnum = FastMarchingImageFilterEnums::Label |
Definition at line 204 of file itkFastMarchingImageFilter.h.
using itk::FastMarchingImageFilter< TLevelSet, TSpeedImage >::LabelImagePointer = typename LabelImageType::Pointer |
LabelImagePointer type alias support
Definition at line 218 of file itkFastMarchingImageFilter.h.
using itk::FastMarchingImageFilter< TLevelSet, TSpeedImage >::LabelImageType = Image<LabelEnum, Self::SetDimension> |
LabelImage type alias support
Definition at line 215 of file itkFastMarchingImageFilter.h.
using itk::FastMarchingImageFilter< TLevelSet, TSpeedImage >::LevelSetImageType = typename LevelSetType::LevelSetImageType |
Definition at line 152 of file itkFastMarchingImageFilter.h.
|
protected |
Definition at line 425 of file itkFastMarchingImageFilter.h.
using itk::FastMarchingImageFilter< TLevelSet, TSpeedImage >::LevelSetPointer = typename LevelSetType::LevelSetPointer |
Definition at line 153 of file itkFastMarchingImageFilter.h.
using itk::FastMarchingImageFilter< TLevelSet, TSpeedImage >::LevelSetType = LevelSetTypeDefault<TLevelSet> |
Typedef support of level set method types.
Definition at line 151 of file itkFastMarchingImageFilter.h.
|
private |
Definition at line 459 of file itkFastMarchingImageFilter.h.
using itk::FastMarchingImageFilter< TLevelSet, TSpeedImage >::NodeContainer = typename LevelSetType::NodeContainer |
Definition at line 157 of file itkFastMarchingImageFilter.h.
using itk::FastMarchingImageFilter< TLevelSet, TSpeedImage >::NodeContainerPointer = typename LevelSetType::NodeContainerPointer |
Definition at line 158 of file itkFastMarchingImageFilter.h.
using itk::FastMarchingImageFilter< TLevelSet, TSpeedImage >::NodeIndexType = typename NodeType::IndexType |
Definition at line 156 of file itkFastMarchingImageFilter.h.
using itk::FastMarchingImageFilter< TLevelSet, TSpeedImage >::NodeType = typename LevelSetType::NodeType |
Definition at line 155 of file itkFastMarchingImageFilter.h.
using itk::FastMarchingImageFilter< TLevelSet, TSpeedImage >::OutputDirectionType = typename LevelSetImageType::DirectionType |
Definition at line 162 of file itkFastMarchingImageFilter.h.
using itk::FastMarchingImageFilter< TLevelSet, TSpeedImage >::OutputPointType = typename LevelSetImageType::PointType |
Definition at line 163 of file itkFastMarchingImageFilter.h.
using itk::FastMarchingImageFilter< TLevelSet, TSpeedImage >::OutputRegionType = typename LevelSetImageType::RegionType |
Definition at line 160 of file itkFastMarchingImageFilter.h.
using itk::FastMarchingImageFilter< TLevelSet, TSpeedImage >::OutputSizeType = typename LevelSetImageType::SizeType |
Definition at line 159 of file itkFastMarchingImageFilter.h.
using itk::FastMarchingImageFilter< TLevelSet, TSpeedImage >::OutputSpacingType = typename LevelSetImageType::SpacingType |
Definition at line 161 of file itkFastMarchingImageFilter.h.
using itk::FastMarchingImageFilter< TLevelSet, TSpeedImage >::PixelType = typename LevelSetType::PixelType |
Definition at line 154 of file itkFastMarchingImageFilter.h.
using itk::FastMarchingImageFilter< TLevelSet, TSpeedImage >::Pointer = SmartPointer<Self> |
Definition at line 141 of file itkFastMarchingImageFilter.h.
using itk::FastMarchingImageFilter< TLevelSet, TSpeedImage >::Self = FastMarchingImageFilter |
Standard class typedefs.
Definition at line 139 of file itkFastMarchingImageFilter.h.
using itk::FastMarchingImageFilter< TLevelSet, TSpeedImage >::SpeedImageConstPointer = typename SpeedImageType::ConstPointer |
Definition at line 195 of file itkFastMarchingImageFilter.h.
using itk::FastMarchingImageFilter< TLevelSet, TSpeedImage >::SpeedImagePointer = typename SpeedImageType::Pointer |
SpeedImagePointer type alias support
Definition at line 194 of file itkFastMarchingImageFilter.h.
using itk::FastMarchingImageFilter< TLevelSet, TSpeedImage >::SpeedImageType = TSpeedImage |
SpeedImage type alias support
Definition at line 191 of file itkFastMarchingImageFilter.h.
using itk::FastMarchingImageFilter< TLevelSet, TSpeedImage >::Superclass = ImageToImageFilter<TSpeedImage, TLevelSet> |
Definition at line 140 of file itkFastMarchingImageFilter.h.
|
protected |
|
overrideprotecteddefault |
|
virtual |
Get the Const Collect Points flag.
|
virtual |
Get the Const Collect Points flag.
|
virtual |
Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.
Reimplemented from itk::LightObject.
Reimplemented in itk::FastMarchingUpwindGradientImageFilter< TLevelSet, TSpeedImage >, itk::FastMarchingUpwindGradientImageFilter< LevelSetImageType, SpeedImageType >, and itk::FastMarchingUpwindGradientImageFilter< LevelSetImageType, SpeedImageType >.
|
overrideprotectedvirtual |
Give the process object a chance to indicate that it will produce more output than it was requested to produce. For example, many imaging filters must compute the entire output at once or can only produce output in complete slices. Such filters cannot handle smaller requested regions. These filters must provide an implementation of this method, setting the output requested region to the size they will produce. By default, a process object does not modify the size of the output requested region.
Reimplemented from itk::ProcessObject.
|
overrideprotectedvirtual |
This method causes the filter to generate its output.
Reimplemented from itk::ProcessObject.
Reimplemented in itk::FastMarchingUpwindGradientImageFilter< TLevelSet, TSpeedImage >, itk::FastMarchingUpwindGradientImageFilter< LevelSetImageType, SpeedImageType >, and itk::FastMarchingUpwindGradientImageFilter< LevelSetImageType, SpeedImageType >.
|
overrideprotectedvirtual |
Generate the output image meta information.
Reimplemented from itk::ProcessObject.
|
inline |
Get the container of Alive Points representing the initial front.
Definition at line 272 of file itkFastMarchingImageFilter.h.
|
virtual |
Get the Const Collect Points flag.
|
inline |
Get the point type label image.
Definition at line 296 of file itkFastMarchingImageFilter.h.
|
protectedvirtual |
Get Large Value. This value is used to represent the concept of infinity for the time assigned to pixels that have not been visited. This value is set by default to half the max() of the pixel type used to represent the time-crossing map.
|
protectedvirtual |
|
overridevirtual |
Reimplemented from itk::LightObject.
Reimplemented in itk::FastMarchingUpwindGradientImageFilter< TLevelSet, TSpeedImage >, itk::FastMarchingUpwindGradientImageFilter< LevelSetImageType, SpeedImageType >, and itk::FastMarchingUpwindGradientImageFilter< LevelSetImageType, SpeedImageType >.
|
inlineprotected |
Definition at line 403 of file itkFastMarchingImageFilter.h.
|
virtual |
|
virtual |
The output largest possible, spacing and origin is computed as follows. If the speed image is nullptr or if the OverrideOutputInformation is true, the output information is set from user specified parameters. These parameters can be specified using methods SetOutputRegion(), SetOutputSpacing(), SetOutputDirection(), and SetOutputOrigin(). Else if the speed image is not nullptr, the output information is copied from the input speed image.
|
virtual |
The output largest possible, spacing and origin is computed as follows. If the speed image is nullptr or if the OverrideOutputInformation is true, the output information is set from user specified parameters. These parameters can be specified using methods SetOutputRegion(), SetOutputSpacing(), SetOutputDirection(), and SetOutputOrigin(). Else if the speed image is not nullptr, the output information is copied from the input speed image.
|
virtual |
The output largest possible, spacing and origin is computed as follows. If the speed image is nullptr or if the OverrideOutputInformation is true, the output information is set from user specified parameters. These parameters can be specified using methods SetOutputRegion(), SetOutputSpacing(), SetOutputDirection(), and SetOutputOrigin(). Else if the speed image is not nullptr, the output information is copied from the input speed image.
|
inlinevirtual |
The output largest possible, spacing and origin is computed as follows. If the speed image is nullptr or if the OverrideOutputInformation is true, the output information is set from user specified parameters. These parameters can be specified using methods SetOutputRegion(), SetOutputSpacing(), SetOutputDirection(), and SetOutputOrigin(). Else if the speed image is not nullptr, the output information is copied from the input speed image.
Definition at line 365 of file itkFastMarchingImageFilter.h.
|
virtual |
The output largest possible, spacing and origin is computed as follows. If the speed image is nullptr or if the OverrideOutputInformation is true, the output information is set from user specified parameters. These parameters can be specified using methods SetOutputRegion(), SetOutputSpacing(), SetOutputDirection(), and SetOutputOrigin(). Else if the speed image is not nullptr, the output information is copied from the input speed image.
|
virtual |
The output largest possible, spacing and origin is computed as follows. If the speed image is nullptr or if the OverrideOutputInformation is true, the output information is set from user specified parameters. These parameters can be specified using methods SetOutputRegion(), SetOutputSpacing(), SetOutputDirection(), and SetOutputOrigin(). Else if the speed image is not nullptr, the output information is copied from the input speed image.
|
inline |
Get the container of Processed Points. If the CollectPoints flag is set, the algorithm collects a container of all processed nodes. This is useful for defining creating Narrowbands for level set algorithms that supports narrow banding.
Definition at line 348 of file itkFastMarchingImageFilter.h.
|
virtual |
Get the Speed Constant.
|
protectedvirtual |
|
virtual |
Get the Fast Marching algorithm Stopping Value.
|
inline |
Get the container of Trial Points representing the initial front.
Definition at line 289 of file itkFastMarchingImageFilter.h.
|
protectedvirtual |
Reimplemented in itk::FastMarchingExtensionImageFilter< TLevelSet, TAuxValue, VAuxDimension, SpeedImageType >, itk::FastMarchingExtensionImageFilter< TLevelSet, TAuxValue, VAuxDimension, SpeedImageType >, itk::FastMarchingUpwindGradientImageFilter< TLevelSet, TSpeedImage >, itk::FastMarchingUpwindGradientImageFilter< LevelSetImageType, SpeedImageType >, and itk::FastMarchingUpwindGradientImageFilter< LevelSetImageType, SpeedImageType >.
|
static |
Method for creation through the object factory.
|
virtual |
The output largest possible, spacing and origin is computed as follows. If the speed image is nullptr or if the OverrideOutputInformation is true, the output information is set from user specified parameters. These parameters can be specified using methods SetOutputRegion(), SetOutputSpacing(), SetOutputDirection(), and SetOutputOrigin(). Else if the speed image is not nullptr, the output information is copied from the input speed image.
|
virtual |
The output largest possible, spacing and origin is computed as follows. If the speed image is nullptr or if the OverrideOutputInformation is true, the output information is set from user specified parameters. These parameters can be specified using methods SetOutputRegion(), SetOutputSpacing(), SetOutputDirection(), and SetOutputOrigin(). Else if the speed image is not nullptr, the output information is copied from the input speed image.
|
overrideprotectedvirtual |
Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from itk::LightObject.
Reimplemented in itk::FastMarchingUpwindGradientImageFilter< TLevelSet, TSpeedImage >, itk::FastMarchingUpwindGradientImageFilter< LevelSetImageType, SpeedImageType >, and itk::FastMarchingUpwindGradientImageFilter< LevelSetImageType, SpeedImageType >.
|
inline |
Set the container of Alive Points representing the initial front. Alive points are represented as a VectorContainer of LevelSetNodes.
Definition at line 263 of file itkFastMarchingImageFilter.h.
|
inline |
Definition at line 222 of file itkFastMarchingImageFilter.h.
|
virtual |
Set the Collect Points flag. Instrument the algorithm to collect a container of all nodes which it has visited. Useful for creating Narrowbands for level set algorithms that supports narrow banding.
|
virtual |
|
virtual |
The output largest possible, spacing and origin is computed as follows. If the speed image is nullptr or if the OverrideOutputInformation is true, the output information is set from user specified parameters. These parameters can be specified using methods SetOutputRegion(), SetOutputSpacing(), SetOutputDirection(), and SetOutputOrigin(). Else if the speed image is not nullptr, the output information is copied from the input speed image.
|
virtual |
The output largest possible, spacing and origin is computed as follows. If the speed image is nullptr or if the OverrideOutputInformation is true, the output information is set from user specified parameters. These parameters can be specified using methods SetOutputRegion(), SetOutputSpacing(), SetOutputDirection(), and SetOutputOrigin(). Else if the speed image is not nullptr, the output information is copied from the input speed image.
|
virtual |
The output largest possible, spacing and origin is computed as follows. If the speed image is nullptr or if the OverrideOutputInformation is true, the output information is set from user specified parameters. These parameters can be specified using methods SetOutputRegion(), SetOutputSpacing(), SetOutputDirection(), and SetOutputOrigin(). Else if the speed image is not nullptr, the output information is copied from the input speed image.
|
inlinevirtual |
The output largest possible, spacing and origin is computed as follows. If the speed image is nullptr or if the OverrideOutputInformation is true, the output information is set from user specified parameters. These parameters can be specified using methods SetOutputRegion(), SetOutputSpacing(), SetOutputDirection(), and SetOutputOrigin(). Else if the speed image is not nullptr, the output information is copied from the input speed image.
Definition at line 360 of file itkFastMarchingImageFilter.h.
|
virtual |
The output largest possible, spacing and origin is computed as follows. If the speed image is nullptr or if the OverrideOutputInformation is true, the output information is set from user specified parameters. These parameters can be specified using methods SetOutputRegion(), SetOutputSpacing(), SetOutputDirection(), and SetOutputOrigin(). Else if the speed image is not nullptr, the output information is copied from the input speed image.
|
inline |
Set the container of points that are not meant to be evaluated.
Definition at line 253 of file itkFastMarchingImageFilter.h.
|
virtual |
The output largest possible, spacing and origin is computed as follows. If the speed image is nullptr or if the OverrideOutputInformation is true, the output information is set from user specified parameters. These parameters can be specified using methods SetOutputRegion(), SetOutputSpacing(), SetOutputDirection(), and SetOutputOrigin(). Else if the speed image is not nullptr, the output information is copied from the input speed image.
|
inline |
Set the Speed Constant. If the Speed Image is nullptr, the SpeedConstant value is used for the whole level set. By default, the SpeedConstant is set to 1.0.
Definition at line 305 of file itkFastMarchingImageFilter.h.
|
virtual |
Set the Fast Marching algorithm Stopping Value. The Fast Marching algorithm is terminated when the value of the smallest trial point is greater than the stopping value.
|
inline |
Set the container of Trial Points representing the initial front. Trial points are represented as a VectorContainer of LevelSetNodes.
Definition at line 280 of file itkFastMarchingImageFilter.h.
|
protectedvirtual |
Reimplemented in itk::FastMarchingUpwindGradientImageFilter< TLevelSet, TSpeedImage >.
|
protectedvirtual |
|
private |
Definition at line 433 of file itkFastMarchingImageFilter.h.
|
protected |
Definition at line 424 of file itkFastMarchingImageFilter.h.
|
private |
Definition at line 443 of file itkFastMarchingImageFilter.h.
|
private |
Definition at line 440 of file itkFastMarchingImageFilter.h.
|
private |
Definition at line 437 of file itkFastMarchingImageFilter.h.
|
private |
Definition at line 452 of file itkFastMarchingImageFilter.h.
|
protected |
Definition at line 427 of file itkFastMarchingImageFilter.h.
|
private |
Definition at line 453 of file itkFastMarchingImageFilter.h.
|
private |
Definition at line 464 of file itkFastMarchingImageFilter.h.
|
private |
Definition at line 449 of file itkFastMarchingImageFilter.h.
|
private |
Definition at line 447 of file itkFastMarchingImageFilter.h.
|
private |
Definition at line 446 of file itkFastMarchingImageFilter.h.
|
private |
Definition at line 448 of file itkFastMarchingImageFilter.h.
|
private |
Definition at line 435 of file itkFastMarchingImageFilter.h.
|
private |
Definition at line 450 of file itkFastMarchingImageFilter.h.
|
private |
Definition at line 444 of file itkFastMarchingImageFilter.h.
|
private |
Definition at line 439 of file itkFastMarchingImageFilter.h.
|
protected |
Definition at line 426 of file itkFastMarchingImageFilter.h.
|
private |
Definition at line 441 of file itkFastMarchingImageFilter.h.
|
private |
Definition at line 462 of file itkFastMarchingImageFilter.h.
|
private |
Definition at line 434 of file itkFastMarchingImageFilter.h.
|
staticconstexpr |
Dimension of the level set and the speed image.
Definition at line 198 of file itkFastMarchingImageFilter.h.
|
staticconstexpr |
Definition at line 199 of file itkFastMarchingImageFilter.h.