Package org.itk.simple
Class LevelSetMotionRegistrationFilter
java.lang.Object
org.itk.simple.ProcessObject
org.itk.simple.ImageFilter
org.itk.simple.LevelSetMotionRegistrationFilter
Deformably register two images using level set motion.
LevelSetMotionFilter implements a deformable registration algorithm
that aligns a fixed and a moving image under level set motion. The
equations of motion are similar to those of the DemonsRegistrationFilter . The main differences are: (1) Gradients of the moving image are
calculated on a smoothed image while intensity difference are measured
on the original images (2) Magnitude of the motion vector is a
function of the differences in intensity between the fixed and moving
pixel. An adaptive timestep is calculated based on the maximum motion
vector over the entire field to ensure stability. The timestep also
implicitly converts the motion vector measured in units of intensity
to a vector measured in physical units. Demons, on the other hand,
defines its motion vectors as function of both the intensity
differences and gradient magnitude at each respective pixel. Consider
two separate pixels with the same intensity differences between the
corresponding fixed and moving pixel pairs. In demons, the motion
vector of the pixel over a low gradient region will be larger than the
motion vector of the pixel over a large gradient region. This leads to
an unstable vector field. In the levelset approach, the motion vectors
will be proportional to the gradients, scaled by the maximum gradient
over the entire field. The pixel with at the lower gradient position
will more less than the pixel at the higher gradient position. (3)
Gradients are calculated using minmod finite difference instead of
using central differences.
A deformation field is represented as a image whose pixel type is some
vector type with at least N elements, where N is the dimension of the
fixed image. The vector type must support element access via operator
[]. It is assumed that the vector elements behave like floating point
scalars.
This class is templated over the fixed image type, moving image type
and the deformation field type.
The input fixed and moving images are set via methods SetFixedImage
and SetMovingImage respectively. An initial deformation field maybe
set via SetInitialDisplacementField or SetInput. If no initial field
is set, a zero field is used as the initial condition.
The algorithm has one parameters: the number of iteration to be
performed.
The output deformation field can be obtained via methods GetOutput or
GetDisplacementField.
This class make use of the finite difference solver hierarchy. Update
for each iteration is computed in LevelSetMotionFunction.
WARNING:
This filter assumes that the fixed image type, moving image type and
deformation field type all have the same number of dimensions.
Ref: B.C. Vemuri, J. Ye, Y. Chen, C.M. Leonard. " Image registration via level-set motion: applications to atlas-based
segmentation". Medical Image Analysis. Vol. 7. pp. 1-20. 2003.
See:
LevelSetMotionRegistrationFunction
DemonsRegistrationFilter
itk::LevelSetMotionRegistrationFilter for the Doxygen on the original ITK class.
C++ includes: sitkLevelSetMotionRegistrationFilter.h
-
Field Summary
Fields inherited from class org.itk.simple.ProcessObject
swigCMemOwn
-
Constructor Summary
ConstructorsModifierConstructorDescriptionitk::simple::LevelSetMotionRegistrationFilter::LevelSetMotionRegistrationFilter() Default Constructor that takes no arguments and initializes default parametersprotected
LevelSetMotionRegistrationFilter
(long cPtr, boolean cMemoryOwn) -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete()
virtual itk::simple::LevelSetMotionRegistrationFilter::~LevelSetMotionRegistrationFilter() DestructorImage itk::simple::LevelSetMotionRegistrationFilter::Execute(const Image &fixedImage, const Image &movingImage, const Image &initialDisplacementField) Execute the filter on the input imageImage itk::simple::LevelSetMotionRegistrationFilter::Execute(const Image &fixedImage, const Image &movingImage, const Image &initialDisplacementField) Execute the filter on the input imageprotected void
finalize()
double
getAlpha()
double itk::simple::LevelSetMotionRegistrationFilter::GetAlpha() constprotected static long
long
uint32_t itk::simple::LevelSetMotionRegistrationFilter::GetElapsedIterations() const Number of iterations run.double
double itk::simple::LevelSetMotionRegistrationFilter::GetGradientMagnitudeThreshold() constdouble
double itk::simple::LevelSetMotionRegistrationFilter::GetGradientSmoothingStandardDeviations() constdouble
double itk::simple::LevelSetMotionRegistrationFilter::GetIntensityDifferenceThreshold() constdouble
double itk::simple::LevelSetMotionRegistrationFilter::GetMaximumError() const Set/Get the desired maximum error of the Guassian kernel approximate.long
unsigned int itk::simple::LevelSetMotionRegistrationFilter::GetMaximumKernelWidth() const Set/Get the desired limits of the Gaussian kernel width.double
double itk::simple::LevelSetMotionRegistrationFilter::GetMaximumRMSError() constdouble
double itk::simple::LevelSetMotionRegistrationFilter::GetMetric() const Get the metric value.getName()
std::string itk::simple::LevelSetMotionRegistrationFilter::GetName() const Name of this classlong
uint32_t itk::simple::LevelSetMotionRegistrationFilter::GetNumberOfIterations() constdouble
double itk::simple::LevelSetMotionRegistrationFilter::GetRMSChange() const The Root Mean Square of the levelset upon termination.boolean
bool itk::simple::LevelSetMotionRegistrationFilter::GetSmoothDisplacementField() const Set/Get whether the displacement field is smoothed (regularized).boolean
bool itk::simple::LevelSetMotionRegistrationFilter::GetSmoothUpdateField() const Set/Get whether the update field is smoothed (regularized).std::vector<double> itk::simple::LevelSetMotionRegistrationFilter::GetStandardDeviations() const Set/Get the Gaussian smoothing standard deviations for the displacement field.std::vector<double> itk::simple::LevelSetMotionRegistrationFilter::GetUpdateFieldStandardDeviations() const Set the Gaussian smoothing standard deviations for the update field.boolean
bool itk::simple::LevelSetMotionRegistrationFilter::GetUseImageSpacing() constvoid
setAlpha
(double Alpha) Self& itk::simple::LevelSetMotionRegistrationFilter::SetAlpha(double Alpha) Set/Get the parameter alpha.void
setGradientMagnitudeThreshold
(double GradientMagnitudeThreshold) Self& itk::simple::LevelSetMotionRegistrationFilter::SetGradientMagnitudeThreshold(double GradientMagnitudeThreshold) Set/Get the threshold below which the gradient magnitude is considered the zero vector.void
setGradientSmoothingStandardDeviations
(double GradientSmoothingStandardDeviations) Self& itk::simple::LevelSetMotionRegistrationFilter::SetGradientSmoothingStandardDeviations(double GradientSmoothingStandardDeviations) Set/Get the standard deviation used for smoothing the moving image prior to calculating gradients.void
setIntensityDifferenceThreshold
(double IntensityDifferenceThreshold) Self& itk::simple::LevelSetMotionRegistrationFilter::SetIntensityDifferenceThreshold(double IntensityDifferenceThreshold) Set/Get the threshold below which the absolute difference of intensity yields a match.void
setMaximumError
(double MaximumError) Self& itk::simple::LevelSetMotionRegistrationFilter::SetMaximumError(double MaximumError) Set/Get the desired maximum error of the Guassian kernel approximate.void
setMaximumKernelWidth
(long MaximumKernelWidth) Self& itk::simple::LevelSetMotionRegistrationFilter::SetMaximumKernelWidth(unsigned int MaximumKernelWidth) Set/Get the desired limits of the Gaussian kernel width.void
setMaximumRMSError
(double MaximumRMSError) Self& itk::simple::LevelSetMotionRegistrationFilter::SetMaximumRMSError(double MaximumRMSError)void
setNumberOfIterations
(long NumberOfIterations) Self& itk::simple::LevelSetMotionRegistrationFilter::SetNumberOfIterations(uint32_t NumberOfIterations)void
setSmoothDisplacementField
(boolean SmoothDisplacementField) Self& itk::simple::LevelSetMotionRegistrationFilter::SetSmoothDisplacementField(bool SmoothDisplacementField) Set/Get whether the displacement field is smoothed (regularized).void
setSmoothUpdateField
(boolean SmoothUpdateField) Self& itk::simple::LevelSetMotionRegistrationFilter::SetSmoothUpdateField(bool SmoothUpdateField) Set/Get whether the update field is smoothed (regularized).void
setStandardDeviations
(double value) Self& itk::simple::LevelSetMotionRegistrationFilter::SetStandardDeviations(std::vector< double > StandardDeviations) Set/Get the Gaussian smoothing standard deviations for the displacement field.void
setStandardDeviations
(VectorDouble StandardDeviations) Self& itk::simple::LevelSetMotionRegistrationFilter::SetStandardDeviations(std::vector< double > StandardDeviations) Set/Get the Gaussian smoothing standard deviations for the displacement field.void
setUpdateFieldStandardDeviations
(double value) Self& itk::simple::LevelSetMotionRegistrationFilter::SetUpdateFieldStandardDeviations(std::vector< double > UpdateFieldStandardDeviations) Set the Gaussian smoothing standard deviations for the update field.void
setUpdateFieldStandardDeviations
(VectorDouble UpdateFieldStandardDeviations) Self& itk::simple::LevelSetMotionRegistrationFilter::SetUpdateFieldStandardDeviations(std::vector< double > UpdateFieldStandardDeviations) Set the Gaussian smoothing standard deviations for the update field.void
setUseImageSpacing
(boolean UseImageSpacing) Self& itk::simple::LevelSetMotionRegistrationFilter::SetUseImageSpacing(bool UseImageSpacing)void
Self& itk::simple::LevelSetMotionRegistrationFilter::SmoothDisplacementFieldOff()void
Self& itk::simple::LevelSetMotionRegistrationFilter::SmoothDisplacementFieldOn() Set the value of SmoothDisplacementField to true or false respectfully.void
Self& itk::simple::LevelSetMotionRegistrationFilter::SmoothUpdateFieldOff()void
Self& itk::simple::LevelSetMotionRegistrationFilter::SmoothUpdateFieldOn() Set the value of SmoothUpdateField to true or false respectfully.protected static long
toString()
std::string itk::simple::LevelSetMotionRegistrationFilter::ToString() const Print ourselves outvoid
Self& itk::simple::LevelSetMotionRegistrationFilter::UseImageSpacingOff()void
Self& itk::simple::LevelSetMotionRegistrationFilter::UseImageSpacingOn() Set the value of UseImageSpacing to true or false respectfully.Methods 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
-
LevelSetMotionRegistrationFilter
protected LevelSetMotionRegistrationFilter(long cPtr, boolean cMemoryOwn) -
LevelSetMotionRegistrationFilter
public LevelSetMotionRegistrationFilter()itk::simple::LevelSetMotionRegistrationFilter::LevelSetMotionRegistrationFilter() 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::LevelSetMotionRegistrationFilter::~LevelSetMotionRegistrationFilter() Destructor- Overrides:
delete
in classImageFilter
-
setGradientSmoothingStandardDeviations
public void setGradientSmoothingStandardDeviations(double GradientSmoothingStandardDeviations) Self& itk::simple::LevelSetMotionRegistrationFilter::SetGradientSmoothingStandardDeviations(double GradientSmoothingStandardDeviations) Set/Get the standard deviation used for smoothing the moving image prior to calculating gradients. The standard deviation is measured in physical units (for instance mm). Note that this smoothing value is not to be confused with the PDEDeformableRegistrationFilter::SetStandardDeviations() method. The method in PDEDeformableRegistrationFilter is for setting the smoothing parameters for regularizing the deformation field between iterations. Those smoothing parameters are set in pixel units not physical units. Deformation field smoothing is not done by default in LevelSetMotionRegistration. This smoothing parameter is to condition the gradient calculation and parameter is specified in physical units. -
getGradientSmoothingStandardDeviations
public double getGradientSmoothingStandardDeviations()double itk::simple::LevelSetMotionRegistrationFilter::GetGradientSmoothingStandardDeviations() const -
setNumberOfIterations
public void setNumberOfIterations(long NumberOfIterations) Self& itk::simple::LevelSetMotionRegistrationFilter::SetNumberOfIterations(uint32_t NumberOfIterations) -
getNumberOfIterations
public long getNumberOfIterations()uint32_t itk::simple::LevelSetMotionRegistrationFilter::GetNumberOfIterations() const -
setMaximumRMSError
public void setMaximumRMSError(double MaximumRMSError) Self& itk::simple::LevelSetMotionRegistrationFilter::SetMaximumRMSError(double MaximumRMSError) -
getMaximumRMSError
public double getMaximumRMSError()double itk::simple::LevelSetMotionRegistrationFilter::GetMaximumRMSError() const -
setStandardDeviations
Self& itk::simple::LevelSetMotionRegistrationFilter::SetStandardDeviations(std::vector< double > StandardDeviations) Set/Get the Gaussian smoothing standard deviations for the displacement field. The values are set with respect to pixel coordinates. -
setStandardDeviations
public void setStandardDeviations(double value) Self& itk::simple::LevelSetMotionRegistrationFilter::SetStandardDeviations(std::vector< double > StandardDeviations) Set/Get the Gaussian smoothing standard deviations for the displacement field. The values are set with respect to pixel coordinates. -
getStandardDeviations
std::vector<double> itk::simple::LevelSetMotionRegistrationFilter::GetStandardDeviations() const Set/Get the Gaussian smoothing standard deviations for the displacement field. The values are set with respect to pixel coordinates. -
setSmoothDisplacementField
public void setSmoothDisplacementField(boolean SmoothDisplacementField) Self& itk::simple::LevelSetMotionRegistrationFilter::SetSmoothDisplacementField(bool SmoothDisplacementField) Set/Get whether the displacement field is smoothed (regularized). Smoothing the displacement yields a solution elastic in nature. If SmoothDisplacementField is on, then the displacement field is smoothed with a Gaussian whose standard deviations are specified with SetStandardDeviations() -
smoothDisplacementFieldOn
public void smoothDisplacementFieldOn()Self& itk::simple::LevelSetMotionRegistrationFilter::SmoothDisplacementFieldOn() Set the value of SmoothDisplacementField to true or false respectfully. -
smoothDisplacementFieldOff
public void smoothDisplacementFieldOff()Self& itk::simple::LevelSetMotionRegistrationFilter::SmoothDisplacementFieldOff() -
getSmoothDisplacementField
public boolean getSmoothDisplacementField()bool itk::simple::LevelSetMotionRegistrationFilter::GetSmoothDisplacementField() const Set/Get whether the displacement field is smoothed (regularized). Smoothing the displacement yields a solution elastic in nature. If SmoothDisplacementField is on, then the displacement field is smoothed with a Gaussian whose standard deviations are specified with SetStandardDeviations() -
setUpdateFieldStandardDeviations
Self& itk::simple::LevelSetMotionRegistrationFilter::SetUpdateFieldStandardDeviations(std::vector< double > UpdateFieldStandardDeviations) Set the Gaussian smoothing standard deviations for the update field. The values are set with respect to pixel coordinates. -
setUpdateFieldStandardDeviations
public void setUpdateFieldStandardDeviations(double value) Self& itk::simple::LevelSetMotionRegistrationFilter::SetUpdateFieldStandardDeviations(std::vector< double > UpdateFieldStandardDeviations) Set the Gaussian smoothing standard deviations for the update field. The values are set with respect to pixel coordinates. -
getUpdateFieldStandardDeviations
std::vector<double> itk::simple::LevelSetMotionRegistrationFilter::GetUpdateFieldStandardDeviations() const Set the Gaussian smoothing standard deviations for the update field. The values are set with respect to pixel coordinates. -
setSmoothUpdateField
public void setSmoothUpdateField(boolean SmoothUpdateField) Self& itk::simple::LevelSetMotionRegistrationFilter::SetSmoothUpdateField(bool SmoothUpdateField) Set/Get whether the update field is smoothed (regularized). Smoothing the update field yields a solution viscous in nature. If SmoothUpdateField is on, then the update field is smoothed with a Gaussian whose standard deviations are specified with SetUpdateFieldStandardDeviations() -
smoothUpdateFieldOn
public void smoothUpdateFieldOn()Self& itk::simple::LevelSetMotionRegistrationFilter::SmoothUpdateFieldOn() Set the value of SmoothUpdateField to true or false respectfully. -
smoothUpdateFieldOff
public void smoothUpdateFieldOff()Self& itk::simple::LevelSetMotionRegistrationFilter::SmoothUpdateFieldOff() -
getSmoothUpdateField
public boolean getSmoothUpdateField()bool itk::simple::LevelSetMotionRegistrationFilter::GetSmoothUpdateField() const Set/Get whether the update field is smoothed (regularized). Smoothing the update field yields a solution viscous in nature. If SmoothUpdateField is on, then the update field is smoothed with a Gaussian whose standard deviations are specified with SetUpdateFieldStandardDeviations() -
setMaximumKernelWidth
public void setMaximumKernelWidth(long MaximumKernelWidth) Self& itk::simple::LevelSetMotionRegistrationFilter::SetMaximumKernelWidth(unsigned int MaximumKernelWidth) Set/Get the desired limits of the Gaussian kernel width. -
getMaximumKernelWidth
public long getMaximumKernelWidth()unsigned int itk::simple::LevelSetMotionRegistrationFilter::GetMaximumKernelWidth() const Set/Get the desired limits of the Gaussian kernel width. -
setMaximumError
public void setMaximumError(double MaximumError) Self& itk::simple::LevelSetMotionRegistrationFilter::SetMaximumError(double MaximumError) Set/Get the desired maximum error of the Guassian kernel approximate. -
getMaximumError
public double getMaximumError()double itk::simple::LevelSetMotionRegistrationFilter::GetMaximumError() const Set/Get the desired maximum error of the Guassian kernel approximate. -
setAlpha
public void setAlpha(double Alpha) Self& itk::simple::LevelSetMotionRegistrationFilter::SetAlpha(double Alpha) Set/Get the parameter alpha. Alpha is added to the calculated gradient magnitude prior to normalizing the gradient to protect against numerical instability as the gradient magnitude approaches zero. This should be set as a small fraction of the intensity dynamic range, for instance 0.04%. Default is the absolute (not percentage) value of 0.1. -
getAlpha
public double getAlpha()double itk::simple::LevelSetMotionRegistrationFilter::GetAlpha() const -
setIntensityDifferenceThreshold
public void setIntensityDifferenceThreshold(double IntensityDifferenceThreshold) Self& itk::simple::LevelSetMotionRegistrationFilter::SetIntensityDifferenceThreshold(double IntensityDifferenceThreshold) Set/Get the threshold below which the absolute difference of intensity yields a match. When the intensities match between a moving and fixed image pixel, the update vector (for that iteration) will be the zero vector. Default is 0.001. -
getIntensityDifferenceThreshold
public double getIntensityDifferenceThreshold()double itk::simple::LevelSetMotionRegistrationFilter::GetIntensityDifferenceThreshold() const -
setGradientMagnitudeThreshold
public void setGradientMagnitudeThreshold(double GradientMagnitudeThreshold) Self& itk::simple::LevelSetMotionRegistrationFilter::SetGradientMagnitudeThreshold(double GradientMagnitudeThreshold) Set/Get the threshold below which the gradient magnitude is considered the zero vector. Default is 1e-9. -
getGradientMagnitudeThreshold
public double getGradientMagnitudeThreshold()double itk::simple::LevelSetMotionRegistrationFilter::GetGradientMagnitudeThreshold() const -
setUseImageSpacing
public void setUseImageSpacing(boolean UseImageSpacing) Self& itk::simple::LevelSetMotionRegistrationFilter::SetUseImageSpacing(bool UseImageSpacing) -
useImageSpacingOn
public void useImageSpacingOn()Self& itk::simple::LevelSetMotionRegistrationFilter::UseImageSpacingOn() Set the value of UseImageSpacing to true or false respectfully. -
useImageSpacingOff
public void useImageSpacingOff()Self& itk::simple::LevelSetMotionRegistrationFilter::UseImageSpacingOff() -
getUseImageSpacing
public boolean getUseImageSpacing()bool itk::simple::LevelSetMotionRegistrationFilter::GetUseImageSpacing() const -
getElapsedIterations
public long getElapsedIterations()uint32_t itk::simple::LevelSetMotionRegistrationFilter::GetElapsedIterations() const Number of iterations run. This is a measurement. Its value is updated in the Execute methods, so the value will only be valid after an execution. -
getRMSChange
public double getRMSChange()double itk::simple::LevelSetMotionRegistrationFilter::GetRMSChange() const The Root Mean Square of the levelset upon termination. This is a measurement. Its value is updated in the Execute methods, so the value will only be valid after an execution. -
getMetric
public double getMetric()double itk::simple::LevelSetMotionRegistrationFilter::GetMetric() const Get the metric value. The metric value is the mean square difference in intensity between the fixed image and transforming moving image computed over the the overlapping region between the two images. This is value is only available for the previous iteration and NOT the current iteration. This is a measurement. Its value is updated in the Execute methods, so the value will only be valid after an execution. -
getName
std::string itk::simple::LevelSetMotionRegistrationFilter::GetName() const Name of this class- Overrides:
getName
in classProcessObject
-
toString
std::string itk::simple::LevelSetMotionRegistrationFilter::ToString() const Print ourselves out- Overrides:
toString
in classProcessObject
-
execute
Image itk::simple::LevelSetMotionRegistrationFilter::Execute(const Image &fixedImage, const Image &movingImage, const Image &initialDisplacementField) Execute the filter on the input image -
execute
Image itk::simple::LevelSetMotionRegistrationFilter::Execute(const Image &fixedImage, const Image &movingImage, const Image &initialDisplacementField) Execute the filter on the input image
-