SimpleITK
2.0.0
|
An interface method to the modular ITKv4 registration framework. More...
#include <sitkImageRegistrationMethod.h>
Classes | |
struct | EvaluateMemberFunctionAddressor |
Public Types | |
enum | EstimateLearningRateType { Never, Once, EachIteration } |
enum | MetricSamplingStrategyType { NONE, REGULAR, RANDOM } |
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... | |
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<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) |
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 89 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 699 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 698 of file sitkImageRegistrationMethod.h.
Definition at line 94 of file sitkImageRegistrationMethod.h.
Definition at line 95 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 255 of file sitkImageRegistrationMethod.h.
Enumerator | |
---|---|
NONE | |
REGULAR | |
RANDOM |
Definition at line 498 of file sitkImageRegistrationMethod.h.
|
private |
Enumerator | |
---|---|
ANTSNeighborhoodCorrelation | |
Correlation | |
Demons | |
JointHistogramMutualInformation | |
MeanSquares | |
MattesMutualInformation |
Definition at line 788 of file sitkImageRegistrationMethod.h.
Enumerator | |
---|---|
Manual | |
Jacobian | |
IndexShift | |
PhysicalShift |
Definition at line 776 of file sitkImageRegistrationMethod.h.
|
private |
Enumerator | |
---|---|
ConjugateGradientLineSearch | |
RegularStepGradientDescent | |
GradientDescent | |
GradientDescentLineSearch | |
LBFGSB | |
Exhaustive | |
Amoeba | |
Powell | |
OnePlusOneEvolutionary | |
LBFGS2 |
Definition at line 716 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 198 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 142 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 144 of file sitkImageRegistrationMethod.h.
|
inline |
Set and get the interpolator to use.
Definition at line 115 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 182 of file sitkImageRegistrationMethod.h.
|
inlineoverridevirtual |
return user readable name for the filter
Implements itk::simple::ProcessObject.
Definition at line 101 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 521 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 520 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 537 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 536 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 196 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 117 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 180 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.
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 568 of file sitkImageRegistrationMethod.h.
|
inline |
Enable the smoothing sigmas for each level in physical units (default) or in terms of voxels.
Definition at line 567 of file sitkImageRegistrationMethod.h.
|
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 700 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 820 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 702 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 708 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 705 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 706 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 704 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 817 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 701 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 801 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 797 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 802 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 798 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 796 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 804 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 806 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 805 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 795 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 808 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 809 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 816 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 799 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 707 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 818 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 739 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 740 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 744 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 764 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 765 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 757 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 735 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 752 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 741 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 738 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 759 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 763 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 758 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 728 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 769 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 733 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 731 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 766 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 734 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 768 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 767 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 732 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 745 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 754 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 742 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 743 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 736 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 729 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 730 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 748 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 751 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 737 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 783 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 784 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 785 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 782 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 761 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 760 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 750 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 762 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 749 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 755 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 747 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 727 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 746 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 756 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 774 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 753 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 682 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 677 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 676 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 675 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 672 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 674 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 673 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 678 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 679 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 684 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 811 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 815 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 772 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 713 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 711 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 710 of file sitkImageRegistrationMethod.h.
|
private |
Definition at line 712 of file sitkImageRegistrationMethod.h.