Package org.itk.simple
Class FastMarchingImageFilter
java.lang.Object
org.itk.simple.ProcessObject
org.itk.simple.ImageFilter
org.itk.simple.FastMarchingImageFilter
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 Chapter 8 of "Level Set
Methods and Fast Marching Methods", J.A. Sethian, Cambridge Press,
Second edition, 1999.
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.
See:
FastMarchingImageFilterBase
LevelSetTypeDefault
itk::simple::FastMarching for the procedural interface
itk::FastMarchingImageFilter for the Doxygen on the original ITK class.
C++ includes: sitkFastMarchingImageFilter.h
-
Field Summary
Fields inherited from class org.itk.simple.ProcessObject
swigCMemOwn
-
Constructor Summary
ConstructorsModifierConstructorDescriptionitk::simple::FastMarchingImageFilter::FastMarchingImageFilter() Default Constructor that takes no arguments and initializes default parametersprotected
FastMarchingImageFilter
(long cPtr, boolean cMemoryOwn) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTrialPoint
(VectorUInt32 point) Self& itk::simple::FastMarchingImageFilter::AddTrialPoint(std::vector< unsigned int > point) Add TrialPoints point.void
Self& itk::simple::FastMarchingImageFilter::ClearTrialPoints() Remove all TrialPoints points.void
delete()
virtual itk::simple::FastMarchingImageFilter::~FastMarchingImageFilter() DestructorImage itk::simple::FastMarchingImageFilter::Execute(const Image &image1) Execute the filter on the input imageprotected void
finalize()
protected static long
std::vector<double> itk::simple::FastMarchingImageFilter::GetInitialTrialValues() constgetName()
std::string itk::simple::FastMarchingImageFilter::GetName() const Name of this classdouble
double itk::simple::FastMarchingImageFilter::GetNormalizationFactor() const Set/Get the Normalization Factor for the Speed Image .double
double itk::simple::FastMarchingImageFilter::GetStoppingValue() const Get the Fast Marching algorithm Stopping Value.std::vector< std::vector< unsigned int > > itk::simple::FastMarchingImageFilter::GetTrialPoints() const Get the container of Trial Points representing the initial front.void
setInitialTrialValues
(VectorDouble InitialTrialValues) Self& itk::simple::FastMarchingImageFilter::SetInitialTrialValues(std::vector< double > InitialTrialValues) Set the initial seed values for corresponding trial points.void
setNormalizationFactor
(double NormalizationFactor) Self& itk::simple::FastMarchingImageFilter::SetNormalizationFactor(double NormalizationFactor) Set/Get the Normalization Factor for the Speed Image .void
setStoppingValue
(double StoppingValue) Self& itk::simple::FastMarchingImageFilter::SetStoppingValue(double StoppingValue) Set the Fast Marching algorithm Stopping Value.void
setTrialPoints
(VectorUIntList TrialPoints) Self& itk::simple::FastMarchingImageFilter::SetTrialPoints(std::vector< std::vector< unsigned int > > TrialPoints) Set the container of Trial Points representing the initial front.protected static long
toString()
std::string itk::simple::FastMarchingImageFilter::ToString() const Print ourselves outMethods inherited from class org.itk.simple.ImageFilter
getCPtr, swigRelease
Methods inherited from class org.itk.simple.ProcessObject
abort, addCommand, debugOff, debugOn, getCPtr, getDebug, getGlobalDefaultCoordinateTolerance, getGlobalDefaultDebug, getGlobalDefaultDirectionTolerance, getGlobalDefaultNumberOfThreads, getGlobalDefaultThreader, getGlobalWarningDisplay, getNumberOfThreads, getNumberOfWorkUnits, getProgress, globalDefaultDebugOff, globalDefaultDebugOn, globalWarningDisplayOff, globalWarningDisplayOn, hasCommand, removeAllCommands, setDebug, setGlobalDefaultCoordinateTolerance, setGlobalDefaultDebug, setGlobalDefaultDirectionTolerance, setGlobalDefaultNumberOfThreads, setGlobalDefaultThreader, setGlobalWarningDisplay, setNumberOfThreads, setNumberOfWorkUnits, swigRelease
-
Constructor Details
-
FastMarchingImageFilter
protected FastMarchingImageFilter(long cPtr, boolean cMemoryOwn) -
FastMarchingImageFilter
public FastMarchingImageFilter()itk::simple::FastMarchingImageFilter::FastMarchingImageFilter() Default Constructor that takes no arguments and initializes default parameters
-
-
Method Details
-
getCPtr
-
swigRelease
-
finalize
protected void finalize()- Overrides:
finalize
in classImageFilter
-
delete
public void delete()virtual itk::simple::FastMarchingImageFilter::~FastMarchingImageFilter() Destructor- Overrides:
delete
in classImageFilter
-
setTrialPoints
Self& itk::simple::FastMarchingImageFilter::SetTrialPoints(std::vector< std::vector< unsigned int > > TrialPoints) Set the container of Trial Points representing the initial front. Trial points are represented as a VectorContainer of LevelSetNodes. -
getTrialPoints
std::vector< std::vector< unsigned int > > itk::simple::FastMarchingImageFilter::GetTrialPoints() const Get the container of Trial Points representing the initial front. -
addTrialPoint
Self& itk::simple::FastMarchingImageFilter::AddTrialPoint(std::vector< unsigned int > point) Add TrialPoints point. -
clearTrialPoints
public void clearTrialPoints()Self& itk::simple::FastMarchingImageFilter::ClearTrialPoints() Remove all TrialPoints points. -
setNormalizationFactor
public void setNormalizationFactor(double NormalizationFactor) Self& itk::simple::FastMarchingImageFilter::SetNormalizationFactor(double NormalizationFactor) Set/Get the Normalization Factor for the Speed Image . The values in the Speed Image is divided by this factor. This allows the use of images with integer pixel types to represent the speed. -
getNormalizationFactor
public double getNormalizationFactor()double itk::simple::FastMarchingImageFilter::GetNormalizationFactor() const Set/Get the Normalization Factor for the Speed Image . The values in the Speed Image is divided by this factor. This allows the use of images with integer pixel types to represent the speed. -
setStoppingValue
public void setStoppingValue(double StoppingValue) Self& itk::simple::FastMarchingImageFilter::SetStoppingValue(double StoppingValue) 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. -
getStoppingValue
public double getStoppingValue()double itk::simple::FastMarchingImageFilter::GetStoppingValue() const Get the Fast Marching algorithm Stopping Value. -
setInitialTrialValues
Self& itk::simple::FastMarchingImageFilter::SetInitialTrialValues(std::vector< double > InitialTrialValues) Set the initial seed values for corresponding trial points. -
getInitialTrialValues
std::vector<double> itk::simple::FastMarchingImageFilter::GetInitialTrialValues() const -
getName
std::string itk::simple::FastMarchingImageFilter::GetName() const Name of this class- Overrides:
getName
in classProcessObject
-
toString
std::string itk::simple::FastMarchingImageFilter::ToString() const Print ourselves out- Overrides:
toString
in classProcessObject
-
execute
Image itk::simple::FastMarchingImageFilter::Execute(const Image &image1) Execute the filter on the input image
-