SimpleITK
|
An interface method to the modular ITKv4 registration framework. More...
#include <sitkImageRegistrationMethod.h>
An interface method to the modular ITKv4 registration framework.
This interface method class encapsulates typical registration usage by incorporating all the necessary elements for performing a simple image registration between two images. This method also allows for multistage registration whereby each stage is characterized by possibly different transforms and different image metrics. For example, many users will want to perform a linear registration followed by deformable registration where both stages are performed in multiple levels. Each level can be characterized by:
Multiple stages are handled by linking multiple instantiations of this class where the output transform is added to the optional composite transform input.
Definition at line 87 of file sitkImageRegistrationMethod.h.
Classes | |
struct | EvaluateMemberFunctionAddressor |
Public Types | |
enum | EstimateLearningRateType { Never, Once, EachIteration } |
enum | MetricSamplingStrategyType { NONE, REGULAR, RANDOM } |
Sampling strategies for obtaining points. More... | |
using | Self = ImageRegistrationMethod |
using | Superclass = ProcessObject |
Public Types inherited from itk::simple::ProcessObject | |
using | Self = ProcessObject |
Public Member Functions | |
Transform | Execute (const Image &fixed, const Image &moving) |
Optimize the configured registration problem. More... | |
unsigned int | GetCurrentLevel () const |
uint64_t | GetMetricNumberOfValidPoints () const |
const std::vector< double > & | GetMetricSamplingPercentagePerLevel () const |
Get the percentage of pixels used for metric evaluation. More... | |
double | GetMetricValue () const |
std::string | GetName () const override |
double | GetOptimizerConvergenceValue () const |
unsigned int | GetOptimizerIteration () const |
double | GetOptimizerLearningRate () const |
std::vector< double > | GetOptimizerPosition () const |
std::vector< double > | GetOptimizerScales () const |
Get the OptimizerScales. More... | |
std::string | GetOptimizerStopConditionDescription () const |
ImageRegistrationMethod () | |
double | MetricEvaluate (const Image &fixed, const Image &moving) |
Get the value of the metric given the state of the method. More... | |
void | SetInitialTransformAsBSpline (BSplineTransform &transform, bool inPlace=true, const std::vector< unsigned int > &scaleFactors=std::vector< unsigned int >()) |
Set an initial BSpline transform to optimize. More... | |
Self & | SetMetricAsANTSNeighborhoodCorrelation (unsigned int radius) |
Use normalized cross correlation using a small neighborhood for each voxel between two images, with speed optimizations for dense registration. More... | |
Self & | SetMetricAsCorrelation () |
Use negative normalized cross correlation image metric. More... | |
Self & | SetMetricAsDemons (double intensityDifferenceThreshold=0.001) |
Use demons image metric. More... | |
Self & | SetMetricAsJointHistogramMutualInformation (unsigned int numberOfHistogramBins=20, double varianceForJointPDFSmoothing=1.5) |
Use mutual information between two images. More... | |
Self & | SetMetricAsMattesMutualInformation (unsigned int numberOfHistogramBins=50) |
Use the mutual information between two images to be registered using the method of Mattes et al. More... | |
Self & | SetMetricAsMeanSquares () |
Use negative means squares image metric. More... | |
Self & | SetMetricFixedMask (const Image &binaryMask) |
Set an image mask in order to restrict the sampled points for the metric. More... | |
Self & | SetMetricMovingMask (const Image &binaryMask) |
Set an image mask in order to restrict the sampled points for the metric in the moving image space. More... | |
Self & | SetMetricSamplingStrategy (MetricSamplingStrategyType strategy) |
Set sampling strategy for sample generation. More... | |
Self & | SetOptimizerAsAmoeba (double simplexDelta, unsigned int numberOfIterations, double parametersConvergenceTolerance=1e-8, double functionConvergenceTolerance=1e-4, bool withRestarts=false) |
Set optimizer to Nelder-Mead downhill simplex algorithm. More... | |
Self & | SetOptimizerAsConjugateGradientLineSearch (double learningRate, unsigned int numberOfIterations, double convergenceMinimumValue=1e-6, unsigned int convergenceWindowSize=10, double lineSearchLowerLimit=0, double lineSearchUpperLimit=5.0, double lineSearchEpsilon=0.01, unsigned int lineSearchMaximumIterations=20, EstimateLearningRateType estimateLearningRate=Once, double maximumStepSizeInPhysicalUnits=0.0) |
Conjugate gradient descent optimizer with a golden section line search for nonlinear optimization. More... | |
Self & | SetOptimizerAsExhaustive (const std::vector< unsigned int > &numberOfSteps, double stepLength=1.0) |
Set the optimizer to sample the metric at regular steps. More... | |
Self & | SetOptimizerAsGradientDescent (double learningRate, unsigned int numberOfIterations, double convergenceMinimumValue=1e-6, unsigned int convergenceWindowSize=10, EstimateLearningRateType estimateLearningRate=Once, double maximumStepSizeInPhysicalUnits=0.0) |
Gradient descent optimizer. More... | |
Self & | SetOptimizerAsGradientDescentLineSearch (double learningRate, unsigned int numberOfIterations, double convergenceMinimumValue=1e-6, unsigned int convergenceWindowSize=10, double lineSearchLowerLimit=0, double lineSearchUpperLimit=5.0, double lineSearchEpsilon=0.01, unsigned int lineSearchMaximumIterations=20, EstimateLearningRateType estimateLearningRate=Once, double maximumStepSizeInPhysicalUnits=0.0) |
Gradient descent optimizer with a golden section line search. More... | |
Self & | SetOptimizerAsLBFGS2 (double solutionAccuracy=1e-5, unsigned int numberOfIterations=0, unsigned int hessianApproximateAccuracy=6, unsigned int deltaConvergenceDistance=0, double deltaConvergenceTolerance=1e-5, unsigned int lineSearchMaximumEvaluations=40, double lineSearchMinimumStep=1e-20, double lineSearchMaximumStep=1e20, double lineSearchAccuracy=1e-4) |
Limited memory Broyden Fletcher Goldfarb Shannon minimization without bounds. More... | |
Self & | SetOptimizerAsLBFGSB (double gradientConvergenceTolerance=1e-5, unsigned int numberOfIterations=500, unsigned int maximumNumberOfCorrections=5, unsigned int maximumNumberOfFunctionEvaluations=2000, double costFunctionConvergenceFactor=1e+7, double lowerBound=std::numeric_limits< double >::min(), double upperBound=std::numeric_limits< double >::max(), bool trace=false) |
Limited memory Broyden Fletcher Goldfarb Shannon minimization with simple bounds. More... | |
Self & | SetOptimizerAsOnePlusOneEvolutionary (unsigned int numberOfIterations=100, double epsilon=1.5e-4, double initialRadius=1.01, double growthFactor=-1.0, double shrinkFactor=-1.0, unsigned int seed=sitkWallClock) |
1+1 evolutionary optimizer strategy. More... | |
Self & | SetOptimizerAsPowell (unsigned int numberOfIterations=100, unsigned int maximumLineIterations=100, double stepLength=1, double stepTolerance=1e-6, double valueTolerance=1e-6) |
Powell optimization using Brent line search. More... | |
Self & | SetOptimizerAsRegularStepGradientDescent (double learningRate, double minStep, unsigned int numberOfIterations, double relaxationFactor=0.5, double gradientMagnitudeTolerance=1e-4, EstimateLearningRateType estimateLearningRate=Never, double maximumStepSizeInPhysicalUnits=0.0) |
Regular Step Gradient descent optimizer. More... | |
Self & | SetOptimizerScales (const std::vector< double > &scales) |
Manually set per parameter weighting for the transform parameters. More... | |
Self & | SetOptimizerScalesFromIndexShift (unsigned int centralRegionRadius=5, double smallParameterVariation=0.01) |
Estimate scales from maximum voxel shift in index space cause by parameter change. More... | |
Self & | SetOptimizerScalesFromJacobian (unsigned int centralRegionRadius=5) |
Estimate scales from Jacobian norms. More... | |
Self & | SetOptimizerScalesFromPhysicalShift (unsigned int centralRegionRadius=5, double smallParameterVariation=0.01) |
Estimating scales of transform parameters a step sizes, from the maximum voxel shift in physical space caused by a parameter change. More... | |
Self & | SetShrinkFactorsPerLevel (const std::vector< unsigned int > &shrinkFactors) |
Set the isotropic shrink factors for each level. More... | |
Self & | SetSmoothingSigmasPerLevel (const std::vector< double > &smoothingSigmas) |
Set the sigmas of Gaussian used for smoothing. More... | |
bool | StopRegistration () |
std::string | ToString () const override |
Print the information about the object to a string. More... | |
~ImageRegistrationMethod () override | |
InterpolatorEnum | GetInterpolator () |
Set and get the interpolator to use. More... | |
Self & | SetInterpolator (InterpolatorEnum Interpolator) |
Set and get the interpolator to use. More... | |
Self & | SetInitialTransform (const Transform &transform) |
Set the initial transform and parameters to optimize. More... | |
Self & | SetInitialTransform (Transform &transform, bool inPlace=true) |
Set the initial transform and parameters to optimize. More... | |
Transform | GetInitialTransform () |
Set the initial transform and parameters to optimize. More... | |
bool | GetInitialTransformInPlace () const |
Set the initial transform and parameters to optimize. More... | |
Self & | SetMovingInitialTransform (const Transform &transform) |
Set a fixed transform component towards moving domain. More... | |
Transform | GetMovingInitialTransform () const |
Set a fixed transform component towards moving domain. More... | |
Self & | SetFixedInitialTransform (const Transform &transform) |
Set transform mapping to the fixed domain. More... | |
Transform | GetFixedInitialTransform () const |
Set transform mapping to the fixed domain. More... | |
Self & | SetVirtualDomain (const std::vector< uint32_t > &virtualSize, const std::vector< double > &virtualOrigin, const std::vector< double > &virtualSpacing, const std::vector< double > &virtualDirection) |
Set the virtual domain used for sampling. More... | |
Self & | SetVirtualDomainFromImage (const Image &virtualImage) |
Set the virtual domain used for sampling. More... | |
Self & | SetOptimizerWeights (const std::vector< double > &weights) |
A per parameter weighting array for the optimizer. More... | |
std::vector< double > | GetOptimizerWeights () const |
A per parameter weighting array for the optimizer. More... | |
Self & | SetMetricSamplingPercentage (double percentage, unsigned int seed=sitkWallClock) |
Set percentage of pixels sampled for metric evaluation. More... | |
Self & | SetMetricSamplingPercentagePerLevel (const std::vector< double > &percentage, unsigned int seed=sitkWallClock) |
Set percentage of pixels sampled for metric evaluation. More... | |
Self & | SetMetricUseFixedImageGradientFilter (bool) |
Enable image gradient computation by a filter. More... | |
Self & | MetricUseFixedImageGradientFilterOn () |
Enable image gradient computation by a filter. More... | |
Self & | MetricUseFixedImageGradientFilterOff () |
Enable image gradient computation by a filter. More... | |
Self & | SetMetricUseMovingImageGradientFilter (bool) |
Enable image gradient computation by a filter. More... | |
Self & | MetricUseMovingImageGradientFilterOn () |
Enable image gradient computation by a filter. More... | |
Self & | MetricUseMovingImageGradientFilterOff () |
Enable image gradient computation by a filter. More... | |
Self & | SetSmoothingSigmasAreSpecifiedInPhysicalUnits (bool arg) |
Enable the smoothing sigmas for each level in physical units (default) or in terms of voxels. More... | |
Self & | SmoothingSigmasAreSpecifiedInPhysicalUnitsOn () |
Enable the smoothing sigmas for each level in physical units (default) or in terms of voxels. More... | |
Self & | SmoothingSigmasAreSpecifiedInPhysicalUnitsOff () |
Enable the smoothing sigmas for each level in physical units (default) or in terms of voxels. More... | |
Public Member Functions inherited from itk::simple::ProcessObject | |
virtual void | Abort () |
virtual int | AddCommand (itk::simple::EventEnum event, const std::function< void()> &func) |
Directly add a callback to observe an event. More... | |
virtual int | AddCommand (itk::simple::EventEnum event, itk::simple::Command &cmd) |
Add a Command Object to observer the event. More... | |
virtual float | GetProgress () const |
An Active Measurement of the progress of execution. More... | |
virtual bool | HasCommand (itk::simple::EventEnum event) const |
Query of this object has any registered commands for event. More... | |
ProcessObject () | |
virtual void | RemoveAllCommands () |
Remove all registered commands. More... | |
virtual | ~ProcessObject () |
virtual void | DebugOn () |
virtual void | DebugOff () |
virtual bool | GetDebug () const |
virtual void | SetDebug (bool debugFlag) |
virtual void | SetNumberOfThreads (unsigned int n) |
virtual unsigned int | GetNumberOfThreads () const |
virtual void | SetNumberOfWorkUnits (unsigned int n) |
virtual unsigned int | GetNumberOfWorkUnits () const |
Protected Member Functions | |
unsigned long | AddITKObserver (const itk::EventObject &, itk::Command *) override |
template<class TImageType > | |
itk::ImageToImageMetricv4< TImageType, TImageType, TImageType, double, itk::DefaultImageToImageMetricTraitsv4< TImageType, TImageType, TImageType, double > > * | CreateMetric () |
itk::ObjectToObjectOptimizerBaseTemplate< double > * | CreateOptimizer (unsigned int numberOfTransformParameters) |
template<typename TMetric > | |
itk::RegistrationParameterScalesEstimator< TMetric > * | CreateScalesEstimator () |
template<unsigned int VDimension> | |
itk::SpatialObject< VDimension > * | CreateSpatialObjectMask (const Image &mask) |
template<typename TTransformAdaptorPointer , typename TRegistrationMethod > | |
std::vector< TTransformAdaptorPointer > | CreateTransformParametersAdaptor (TRegistrationMethod *method) |
template<class TImage > | |
double | EvaluateInternal (const Image &fixed, const Image &moving) |
template<class TImage > | |
Transform | ExecuteInternal (const Image &fixed, const Image &moving) |
void | OnActiveProcessDelete () noexcept override |
void | PreUpdate (itk::ProcessObject *p) override |
void | RemoveITKObserver (EventCommand &e) override |
template<class TImageType > | |
void | SetupMetric (itk::ImageToImageMetricv4< TImageType, TImageType, TImageType, double, itk::DefaultImageToImageMetricTraitsv4< TImageType, TImageType, TImageType, double >> *, const TImageType *, const TImageType *) |
Protected Member Functions inherited from itk::simple::ProcessObject | |
virtual itk::ProcessObject * | GetActiveProcess () |
virtual void | onCommandDelete (const itk::simple::Command *cmd) noexcept |
Protected Member Functions inherited from itk::simple::NonCopyable | |
NonCopyable ()=default | |
NonCopyable (const NonCopyable &)=delete | |
NonCopyable & | operator= (const NonCopyable &)=delete |
Private Types | |
typedef double(ImageRegistrationMethod::* | EvaluateMemberFunctionType) (const Image &fixed, const Image &moving) |
typedef Transform(ImageRegistrationMethod::* | MemberFunctionType) (const Image &fixed, const Image &moving) |
enum | MetricType { ANTSNeighborhoodCorrelation, Correlation, Demons, JointHistogramMutualInformation, MeanSquares, MattesMutualInformation } |
enum | OptimizerScalesType { Manual, Jacobian, IndexShift, PhysicalShift } |
enum | OptimizerType { ConjugateGradientLineSearch, RegularStepGradientDescent, GradientDescent, GradientDescentLineSearch, LBFGSB, Exhaustive, Amoeba, Powell, OnePlusOneEvolutionary, LBFGS2 } |
Friends | |
struct | detail::MemberFunctionAddressor< MemberFunctionType > |
Additional Inherited Members | |
Static Public Member Functions inherited from itk::simple::ProcessObject | |
static bool | GetGlobalDefaultDebug () |
static void | GlobalDefaultDebugOff () |
static void | GlobalDefaultDebugOn () |
static void | SetGlobalDefaultDebug (bool debugFlag) |
static void | GlobalWarningDisplayOn () |
static void | GlobalWarningDisplayOff () |
static void | SetGlobalWarningDisplay (bool flag) |
static bool | GetGlobalWarningDisplay () |
static double | GetGlobalDefaultCoordinateTolerance () |
Access the global tolerance to determine congruent spaces. More... | |
static void | SetGlobalDefaultCoordinateTolerance (double) |
Access the global tolerance to determine congruent spaces. More... | |
static double | GetGlobalDefaultDirectionTolerance () |
Access the global tolerance to determine congruent spaces. More... | |
static void | SetGlobalDefaultDirectionTolerance (double) |
Access the global tolerance to determine congruent spaces. More... | |
static bool | SetGlobalDefaultThreader (const std::string &threader) |
Set/Get the default threader used for process objects. More... | |
static std::string | GetGlobalDefaultThreader () |
Set/Get the default threader used for process objects. More... | |
static void | SetGlobalDefaultNumberOfThreads (unsigned int n) |
static unsigned int | GetGlobalDefaultNumberOfThreads () |
Set/Get the default threader used for process objects. More... | |
Static Protected Member Functions inherited from itk::simple::ProcessObject | |
template<class TImageType > | |
static TImageType::ConstPointer | CastImageToITK (const Image &img) |
template<class TPixelType , unsigned int VImageDimension, unsigned int VLength, template< typename, unsigned int > class TVector> | |
static Image | CastITKToImage (itk::Image< TVector< TPixelType, VLength >, VImageDimension > *img) |
template<unsigned int VImageDimension, unsigned int VLength, template< unsigned int > class TVector> | |
static Image | CastITKToImage (itk::Image< TVector< VLength >, VImageDimension > *img) |
template<class TImageType > | |
static Image | CastITKToImage (TImageType *img) |
static const itk::EventObject & | GetITKEventObject (EventEnum e) |
template<typename T > | |
static std::ostream & | ToStringHelper (std::ostream &os, const T &v) |
static std::ostream & | ToStringHelper (std::ostream &os, const char &v) |
static std::ostream & | ToStringHelper (std::ostream &os, const signed char &v) |
static std::ostream & | ToStringHelper (std::ostream &os, const unsigned char &v) |
|
private |
Definition at line 838 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 837 of file sitkImageRegistrationMethod.h.
Definition at line 90 of file sitkImageRegistrationMethod.h.
Definition at line 91 of file sitkImageRegistrationMethod.h.
Enumerator | |
---|---|
Never | Never run estimation, use provided value. |
Once | Estimate learning once each level, ignore provided values. |
EachIteration | Estimate learning rate at each iteration. |
Definition at line 294 of file sitkImageRegistrationMethod.h.
Sampling strategies for obtaining points.
Enumerator | |
---|---|
NONE | |
REGULAR | |
RANDOM |
Definition at line 571 of file sitkImageRegistrationMethod.h.
|
private |
Enumerator | |
---|---|
ANTSNeighborhoodCorrelation | |
Correlation | |
Demons | |
JointHistogramMutualInformation | |
MeanSquares | |
MattesMutualInformation |
Definition at line 930 of file sitkImageRegistrationMethod.h.
Enumerator | |
---|---|
Manual | |
Jacobian | |
IndexShift | |
PhysicalShift |
Definition at line 917 of file sitkImageRegistrationMethod.h.
|
private |
Enumerator | |
---|---|
ConjugateGradientLineSearch | |
RegularStepGradientDescent | |
GradientDescent | |
GradientDescentLineSearch | |
LBFGSB | |
Exhaustive | |
Amoeba | |
Powell | |
OnePlusOneEvolutionary | |
LBFGS2 |
Definition at line 855 of file sitkImageRegistrationMethod.h.
|
override |
itk::simple::ImageRegistrationMethod::ImageRegistrationMethod | ( | ) |
|
overrideprotectedvirtual |
Reimplemented from itk::simple::ProcessObject.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Transform itk::simple::ImageRegistrationMethod::Execute | ( | const Image & | fixed, |
const Image & | moving | ||
) |
Optimize the configured registration problem.
|
protected |
unsigned int itk::simple::ImageRegistrationMethod::GetCurrentLevel | ( | ) | const |
|
inline |
Set transform mapping to the fixed domain.
This transform is used to map from the virtual domain to the fixed image domain.
By default this transform is an identity, and not used.
Definition at line 227 of file sitkImageRegistrationMethod.h.
|
inline |
Set the initial transform and parameters to optimize.
This transform is applied before the MovingInitialTransform, to map from the virtual image domain to the moving image domain.
If the inPlace flag is explicitly false, then the ITK registration will internally make a copy, and the transform will not be accessible during registration. Otherwise, the accessible InitialTransform value will be the same object used during registration, and will have a modified value upon completion.
Definition at line 153 of file sitkImageRegistrationMethod.h.
|
inline |
Set the initial transform and parameters to optimize.
This transform is applied before the MovingInitialTransform, to map from the virtual image domain to the moving image domain.
If the inPlace flag is explicitly false, then the ITK registration will internally make a copy, and the transform will not be accessible during registration. Otherwise, the accessible InitialTransform value will be the same object used during registration, and will have a modified value upon completion.
Definition at line 158 of file sitkImageRegistrationMethod.h.
|
inline |
Set and get the interpolator to use.
Definition at line 117 of file sitkImageRegistrationMethod.h.
uint64_t itk::simple::ImageRegistrationMethod::GetMetricNumberOfValidPoints | ( | ) | const |
Current number of points used of metric evaluation
This is a active measurement connected to the registration processes during registration. This number is number of point in the virtual domain which overlap the fixed image and the moving image. It is valid for sparse or dense sampling. After execution of registration this will contain the last value.
const std::vector<double>& itk::simple::ImageRegistrationMethod::GetMetricSamplingPercentagePerLevel | ( | ) | const |
Get the percentage of pixels used for metric evaluation.
double itk::simple::ImageRegistrationMethod::GetMetricValue | ( | ) | const |
|
inline |
Set a fixed transform component towards moving domain.
The InitialTransform is added to this transform to form the composite transform which maps from the virtual domain to the moving image's domain. The parameters of this transform are not optimized. This is an advanced option used when the output transformed with be composed into a composite transform.
By default this transform is an identity, and not used.
Definition at line 204 of file sitkImageRegistrationMethod.h.
|
inlineoverridevirtual |
return user readable name for the filter
Implements itk::simple::ProcessObject.
Definition at line 98 of file sitkImageRegistrationMethod.h.
double itk::simple::ImageRegistrationMethod::GetOptimizerConvergenceValue | ( | ) | const |
unsigned int itk::simple::ImageRegistrationMethod::GetOptimizerIteration | ( | ) | const |
Active measurements which can be obtained during call backs.
This is a measurement. Its value is updated in the Execute methods, so the value will only be valid after an execution.
double itk::simple::ImageRegistrationMethod::GetOptimizerLearningRate | ( | ) | const |
std::vector<double> itk::simple::ImageRegistrationMethod::GetOptimizerPosition | ( | ) | const |
std::vector<double> itk::simple::ImageRegistrationMethod::GetOptimizerScales | ( | ) | const |
Get the OptimizerScales.
If the scales are explicitly set then this method returns those values. If an estimator is used then this is an active measurement returning the scales estimated by the estimator and is only available during execution.
std::string itk::simple::ImageRegistrationMethod::GetOptimizerStopConditionDescription | ( | ) | const |
Measurement updated at the end of execution.
std::vector<double> itk::simple::ImageRegistrationMethod::GetOptimizerWeights | ( | ) | const |
A per parameter weighting array for the optimizer.
Allows setting of a per-local-parameter weighting array. If unset, the weights are treated as identity. Weights are multiplied by the gradient at the same time scaling is applied. Weights are similar to the scales but not estimated, and may be used, for example, to easily mask out a particular parameter during optimization to hold it constant. Or they may be used to apply another kind of prior knowledge.
double itk::simple::ImageRegistrationMethod::MetricEvaluate | ( | const Image & | fixed, |
const Image & | moving | ||
) |
Get the value of the metric given the state of the method.
Passing a fixed and moving image, this method constructs and configures a metric object to obtain the value. This will take into consideration the current transforms, metric, interpolator, and image masks. It does not take into consideration the sampling strategy, smoothing sigmas, or the shrink factors.
|
inline |
Enable image gradient computation by a filter.
By default the image gradient is computed by itk::GradientRecursiveGaussianImageFiter. If disabled then a central difference function with be computed as needed.
Definition at line 602 of file sitkImageRegistrationMethod.h.
|
inline |
Enable image gradient computation by a filter.
By default the image gradient is computed by itk::GradientRecursiveGaussianImageFiter. If disabled then a central difference function with be computed as needed.
Definition at line 597 of file sitkImageRegistrationMethod.h.
|
inline |
Enable image gradient computation by a filter.
By default the image gradient is computed by itk::GradientRecursiveGaussianImageFiter. If disabled then a central difference function will be computed for each sample as needed.
Definition at line 627 of file sitkImageRegistrationMethod.h.
|
inline |
Enable image gradient computation by a filter.
By default the image gradient is computed by itk::GradientRecursiveGaussianImageFiter. If disabled then a central difference function will be computed for each sample as needed.
Definition at line 622 of file sitkImageRegistrationMethod.h.
|
overrideprotectedvirtualnoexcept |
Reimplemented from itk::simple::ProcessObject.
|
overrideprotectedvirtual |
Reimplemented from itk::simple::ProcessObject.
|
overrideprotectedvirtual |
Reimplemented from itk::simple::ProcessObject.
|
inline |
Set transform mapping to the fixed domain.
This transform is used to map from the virtual domain to the fixed image domain.
By default this transform is an identity, and not used.
Definition at line 221 of file sitkImageRegistrationMethod.h.
Set the initial transform and parameters to optimize.
This transform is applied before the MovingInitialTransform, to map from the virtual image domain to the moving image domain.
If the inPlace flag is explicitly false, then the ITK registration will internally make a copy, and the transform will not be accessible during registration. Otherwise, the accessible InitialTransform value will be the same object used during registration, and will have a modified value upon completion.
Self& itk::simple::ImageRegistrationMethod::SetInitialTransform | ( | Transform & | transform, |
bool | inPlace = true |
||
) |
Set the initial transform and parameters to optimize.
This transform is applied before the MovingInitialTransform, to map from the virtual image domain to the moving image domain.
If the inPlace flag is explicitly false, then the ITK registration will internally make a copy, and the transform will not be accessible during registration. Otherwise, the accessible InitialTransform value will be the same object used during registration, and will have a modified value upon completion.
void itk::simple::ImageRegistrationMethod::SetInitialTransformAsBSpline | ( | BSplineTransform & | transform, |
bool | inPlace = true , |
||
const std::vector< unsigned int > & | scaleFactors = std::vector< unsigned int >() |
||
) |
Set an initial BSpline transform to optimize.
A specialization of SetInitialTransform for BSplineTransforms which can take an additional scaleFactors parameter. The scaleFactors specifies the a isotropic scaling factor per level for the BSpline transform mesh size with respect to the initial transform. For example to double the BSpline mesh resolution at each of 3 levels the vector [1,2,4] should be provided.
If a per level scale factor is 0 or omitted than no transform adapter will be created for that level.
|
inline |
Set and get the interpolator to use.
Definition at line 122 of file sitkImageRegistrationMethod.h.
Self& itk::simple::ImageRegistrationMethod::SetMetricAsANTSNeighborhoodCorrelation | ( | unsigned int | radius | ) |
Use normalized cross correlation using a small neighborhood for each voxel between two images, with speed optimizations for dense registration.
Self& itk::simple::ImageRegistrationMethod::SetMetricAsCorrelation | ( | ) |
Use negative normalized cross correlation image metric.
Self& itk::simple::ImageRegistrationMethod::SetMetricAsDemons | ( | double | intensityDifferenceThreshold = 0.001 | ) |
Use demons image metric.
Self& itk::simple::ImageRegistrationMethod::SetMetricAsJointHistogramMutualInformation | ( | unsigned int | numberOfHistogramBins = 20 , |
double | varianceForJointPDFSmoothing = 1.5 |
||
) |
Use mutual information between two images.
Self& itk::simple::ImageRegistrationMethod::SetMetricAsMattesMutualInformation | ( | unsigned int | numberOfHistogramBins = 50 | ) |
Use the mutual information between two images to be registered using the method of Mattes et al.
Self& itk::simple::ImageRegistrationMethod::SetMetricAsMeanSquares | ( | ) |
Use negative means squares image metric.
Set an image mask in order to restrict the sampled points for the metric.
The image is expected to be in the same physical space as the FixedImage, and if the pixel type is not UInt8 than the image will base cast.
Set an image mask in order to restrict the sampled points for the metric in the moving image space.
The image is expected to be in the same physical space as the MovingImage, and if the pixel type is not UInt8 than the image will base cast.
Self& itk::simple::ImageRegistrationMethod::SetMetricSamplingPercentage | ( | double | percentage, |
unsigned int | seed = sitkWallClock |
||
) |
Set percentage of pixels sampled for metric evaluation.
The percentage is of the number of pixels in the virtual domain per level after the shrink factor has been applied.
The seed parameter is used to seed the pseudo-random number generator used in generating the sampling set of points. If the seed parameter is 0, then the wall clock is used, otherwise the fixed seed is used for reproducible behavior.
When providing multiple values the number of entries must match the number of shrink factors and smoothing sigmas. If a single value is given, then the same percentage is used for all levels.
Self& itk::simple::ImageRegistrationMethod::SetMetricSamplingPercentagePerLevel | ( | const std::vector< double > & | percentage, |
unsigned int | seed = sitkWallClock |
||
) |
Set percentage of pixels sampled for metric evaluation.
The percentage is of the number of pixels in the virtual domain per level after the shrink factor has been applied.
The seed parameter is used to seed the pseudo-random number generator used in generating the sampling set of points. If the seed parameter is 0, then the wall clock is used, otherwise the fixed seed is used for reproducible behavior.
When providing multiple values the number of entries must match the number of shrink factors and smoothing sigmas. If a single value is given, then the same percentage is used for all levels.
Self& itk::simple::ImageRegistrationMethod::SetMetricSamplingStrategy | ( | MetricSamplingStrategyType | strategy | ) |
Set sampling strategy for sample generation.
Self& itk::simple::ImageRegistrationMethod::SetMetricUseFixedImageGradientFilter | ( | bool | ) |
Enable image gradient computation by a filter.
By default the image gradient is computed by itk::GradientRecursiveGaussianImageFiter. If disabled then a central difference function with be computed as needed.
Self& itk::simple::ImageRegistrationMethod::SetMetricUseMovingImageGradientFilter | ( | bool | ) |
Enable image gradient computation by a filter.
By default the image gradient is computed by itk::GradientRecursiveGaussianImageFiter. If disabled then a central difference function will be computed for each sample as needed.
|
inline |
Set a fixed transform component towards moving domain.
The InitialTransform is added to this transform to form the composite transform which maps from the virtual domain to the moving image's domain. The parameters of this transform are not optimized. This is an advanced option used when the output transformed with be composed into a composite transform.
By default this transform is an identity, and not used.
Definition at line 198 of file sitkImageRegistrationMethod.h.
Self& itk::simple::ImageRegistrationMethod::SetOptimizerAsAmoeba | ( | double | simplexDelta, |
unsigned int | numberOfIterations, | ||
double | parametersConvergenceTolerance = 1e-8 , |
||
double | functionConvergenceTolerance = 1e-4 , |
||
bool | withRestarts = false |
||
) |
Set optimizer to Nelder-Mead downhill simplex algorithm.
The simplexDelta is the value that is added and subtracted to the initial parameters to create the initial simplex. The simplexDelta can be indirectly set per parameter by the optimizer parameter scaling either manually or by using an estimator.
Self& itk::simple::ImageRegistrationMethod::SetOptimizerAsConjugateGradientLineSearch | ( | double | learningRate, |
unsigned int | numberOfIterations, | ||
double | convergenceMinimumValue = 1e-6 , |
||
unsigned int | convergenceWindowSize = 10 , |
||
double | lineSearchLowerLimit = 0 , |
||
double | lineSearchUpperLimit = 5.0 , |
||
double | lineSearchEpsilon = 0.01 , |
||
unsigned int | lineSearchMaximumIterations = 20 , |
||
EstimateLearningRateType | estimateLearningRate = Once , |
||
double | maximumStepSizeInPhysicalUnits = 0.0 |
||
) |
Conjugate gradient descent optimizer with a golden section line search for nonlinear optimization.
Self& itk::simple::ImageRegistrationMethod::SetOptimizerAsExhaustive | ( | const std::vector< unsigned int > & | numberOfSteps, |
double | stepLength = 1.0 |
||
) |
Set the optimizer to sample the metric at regular steps.
At each iteration the GetOptimizerIteration, can be used to index into the sampling grid along with the GetCurrentMetricValue.
The resulting transform and value at the end of execution is the best location.
The OptimizerScales can be used to perform anisotropic sampling.
Self& itk::simple::ImageRegistrationMethod::SetOptimizerAsGradientDescent | ( | double | learningRate, |
unsigned int | numberOfIterations, | ||
double | convergenceMinimumValue = 1e-6 , |
||
unsigned int | convergenceWindowSize = 10 , |
||
EstimateLearningRateType | estimateLearningRate = Once , |
||
double | maximumStepSizeInPhysicalUnits = 0.0 |
||
) |
Gradient descent optimizer.
Self& itk::simple::ImageRegistrationMethod::SetOptimizerAsGradientDescentLineSearch | ( | double | learningRate, |
unsigned int | numberOfIterations, | ||
double | convergenceMinimumValue = 1e-6 , |
||
unsigned int | convergenceWindowSize = 10 , |
||
double | lineSearchLowerLimit = 0 , |
||
double | lineSearchUpperLimit = 5.0 , |
||
double | lineSearchEpsilon = 0.01 , |
||
unsigned int | lineSearchMaximumIterations = 20 , |
||
EstimateLearningRateType | estimateLearningRate = Once , |
||
double | maximumStepSizeInPhysicalUnits = 0.0 |
||
) |
Gradient descent optimizer with a golden section line search.
Self& itk::simple::ImageRegistrationMethod::SetOptimizerAsLBFGS2 | ( | double | solutionAccuracy = 1e-5 , |
unsigned int | numberOfIterations = 0 , |
||
unsigned int | hessianApproximateAccuracy = 6 , |
||
unsigned int | deltaConvergenceDistance = 0 , |
||
double | deltaConvergenceTolerance = 1e-5 , |
||
unsigned int | lineSearchMaximumEvaluations = 40 , |
||
double | lineSearchMinimumStep = 1e-20 , |
||
double | lineSearchMaximumStep = 1e20 , |
||
double | lineSearchAccuracy = 1e-4 |
||
) |
Limited memory Broyden Fletcher Goldfarb Shannon minimization without bounds.
The default parameters utilize LBFGSB in unbounded mode. This version is from LibLBFGS.
There are upto 3 stopping criteria:
Self& itk::simple::ImageRegistrationMethod::SetOptimizerAsLBFGSB | ( | double | gradientConvergenceTolerance = 1e-5 , |
unsigned int | numberOfIterations = 500 , |
||
unsigned int | maximumNumberOfCorrections = 5 , |
||
unsigned int | maximumNumberOfFunctionEvaluations = 2000 , |
||
double | costFunctionConvergenceFactor = 1e+7 , |
||
double | lowerBound = std::numeric_limits< double >::min() , |
||
double | upperBound = std::numeric_limits< double >::max() , |
||
bool | trace = false |
||
) |
Limited memory Broyden Fletcher Goldfarb Shannon minimization with simple bounds.
The default parameters utilize LBFGSB in unbounded mode.
Self& itk::simple::ImageRegistrationMethod::SetOptimizerAsOnePlusOneEvolutionary | ( | unsigned int | numberOfIterations = 100 , |
double | epsilon = 1.5e-4 , |
||
double | initialRadius = 1.01 , |
||
double | growthFactor = -1.0 , |
||
double | shrinkFactor = -1.0 , |
||
unsigned int | seed = sitkWallClock |
||
) |
1+1 evolutionary optimizer strategy.
The seed parameter is used to seed the pseudo-random number generator. If the seed parameter is 0, then the wall clock is used to seed, otherwise the fixed seed is used for reproducible behavior.
Self& itk::simple::ImageRegistrationMethod::SetOptimizerAsPowell | ( | unsigned int | numberOfIterations = 100 , |
unsigned int | maximumLineIterations = 100 , |
||
double | stepLength = 1 , |
||
double | stepTolerance = 1e-6 , |
||
double | valueTolerance = 1e-6 |
||
) |
Powell optimization using Brent line search.
Self& itk::simple::ImageRegistrationMethod::SetOptimizerAsRegularStepGradientDescent | ( | double | learningRate, |
double | minStep, | ||
unsigned int | numberOfIterations, | ||
double | relaxationFactor = 0.5 , |
||
double | gradientMagnitudeTolerance = 1e-4 , |
||
EstimateLearningRateType | estimateLearningRate = Never , |
||
double | maximumStepSizeInPhysicalUnits = 0.0 |
||
) |
Regular Step Gradient descent optimizer.
Self& itk::simple::ImageRegistrationMethod::SetOptimizerScales | ( | const std::vector< double > & | scales | ) |
Manually set per parameter weighting for the transform parameters.
Self& itk::simple::ImageRegistrationMethod::SetOptimizerScalesFromIndexShift | ( | unsigned int | centralRegionRadius = 5 , |
double | smallParameterVariation = 0.01 |
||
) |
Estimate scales from maximum voxel shift in index space cause by parameter change.
Self& itk::simple::ImageRegistrationMethod::SetOptimizerScalesFromJacobian | ( | unsigned int | centralRegionRadius = 5 | ) |
Estimate scales from Jacobian norms.
This scales estimator works well with versor based transforms.
Self& itk::simple::ImageRegistrationMethod::SetOptimizerScalesFromPhysicalShift | ( | unsigned int | centralRegionRadius = 5 , |
double | smallParameterVariation = 0.01 |
||
) |
Estimating scales of transform parameters a step sizes, from the maximum voxel shift in physical space caused by a parameter change.
Self& itk::simple::ImageRegistrationMethod::SetOptimizerWeights | ( | const std::vector< double > & | weights | ) |
A per parameter weighting array for the optimizer.
Allows setting of a per-local-parameter weighting array. If unset, the weights are treated as identity. Weights are multiplied by the gradient at the same time scaling is applied. Weights are similar to the scales but not estimated, and may be used, for example, to easily mask out a particular parameter during optimization to hold it constant. Or they may be used to apply another kind of prior knowledge.
Self& itk::simple::ImageRegistrationMethod::SetShrinkFactorsPerLevel | ( | const std::vector< unsigned int > & | shrinkFactors | ) |
Set the isotropic shrink factors for each level.
The virtual domain image is shrunk by this factor relative to the full size of the original virtual domain.
Self& itk::simple::ImageRegistrationMethod::SetSmoothingSigmasAreSpecifiedInPhysicalUnits | ( | bool | arg | ) |
Enable the smoothing sigmas for each level in physical units (default) or in terms of voxels.
Self& itk::simple::ImageRegistrationMethod::SetSmoothingSigmasPerLevel | ( | const std::vector< double > & | smoothingSigmas | ) |
Set the sigmas of Gaussian used for smoothing.
The smoothing is applied to both the fixed and the moving images at each level. The number of smoothing sigmas must match the number of shrink factors.
|
protected |
Self& itk::simple::ImageRegistrationMethod::SetVirtualDomain | ( | const std::vector< uint32_t > & | virtualSize, |
const std::vector< double > & | virtualOrigin, | ||
const std::vector< double > & | virtualSpacing, | ||
const std::vector< double > & | virtualDirection | ||
) |
Set the virtual domain used for sampling.
Set the virtual domain used for sampling.
|
inline |
Enable the smoothing sigmas for each level in physical units (default) or in terms of voxels.
Definition at line 670 of file sitkImageRegistrationMethod.h.
|
inline |
Enable the smoothing sigmas for each level in physical units (default) or in terms of voxels.
Definition at line 664 of file sitkImageRegistrationMethod.h.
bool itk::simple::ImageRegistrationMethod::StopRegistration | ( | ) |
Stop Registration if actively running.
This is an active method which can be called during a callback. Invoking this method will halt the registration at the current iteration, if supported by the optimizer. The LBFGSB, LBFGS2, and the Amoeba optimizers do not support user stopping.
If user stopping is not supported or the optimizer is available ( not executed ), then false will be returned.
|
overridevirtual |
Print the information about the object to a string.
If called when the process is being executed ( during a callback ), the ITK Optimizer and Transform objects will be printed.
Reimplemented from itk::simple::ProcessObject.
|
friend |
Definition at line 839 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 964 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 841 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 847 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 844 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 845 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 843 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 961 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 840 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 945 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 941 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 946 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 942 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 940 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 948 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 950 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 949 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 939 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 952 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 953 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 960 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 943 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 846 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 962 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 880 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 881 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 885 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 905 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 906 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 898 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 876 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 893 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 882 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 879 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 900 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 904 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 899 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 869 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 910 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 874 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 872 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 907 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 875 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 909 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 908 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 873 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 886 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 895 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 883 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 884 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 877 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 870 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 871 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 889 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 892 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 878 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 925 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 926 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 927 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 924 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 902 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 901 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 891 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 903 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 890 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 896 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 888 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 868 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 887 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 897 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 915 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 894 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 820 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 814 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 813 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 812 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 809 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 811 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 810 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 815 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 816 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 817 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 822 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 955 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 957 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 956 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 959 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 913 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 852 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 850 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 849 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 851 of file sitkImageRegistrationMethod.h.