You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having trouble registering my 3D images (xyz of brain tissue) that I am trying to register to a 2D image (xy ) of the same brain before it experienced a procedure. I would greatly appreciate and be thankful for any insight regarding 3D to 2D registration. I will continue to try to make this work.
Between the two images/procedure the cells changed in z but all the cells should be in the 3D data.
I have had success with registering 2D to 2D and I'm rather new to using Elastix so I apologize If my question is easy to address.
I have tried the following to get 3D to 2D work but get some errors that I don't normally get when doing 2D to 2D:
elastix runs at: F0BGZC3
Windows Professional (x64), (Build 9200)
with 16099 MB memory, and 8 cores @ 2904 MHz.
Running elastix with parameter file 0: "Parameters_BSpline.txt".
Current time: Wed Mar 27 13:45:52 2024.
Reading the elastix parameters from file ...
Installing all components.
InstallingComponents was successful.
ELASTIX version: 5.1.0
Command line options from ElastixBase:
-f fixed.mhd
-m moving.mhd
-fMask unspecified, so no fixed mask used
-mMask unspecified, so no moving mask used
-out .
-p Parameters_BSpline.txt
-priority unspecified, so NORMAL process priority
-threads unspecified, so all available threads are used
Command line options from TransformBase:
-t0 unspecified, so no initial transform used
WARNING: The parameter "BSplineTransformSplineOrder", requested at entry number 0, does not exist at all.
The default value "3" is used instead.
WARNING: The parameter "UseCyclicTransform", requested at entry number 0, does not exist at all.
The default value "false" is used instead.
Reading images...
Reading images took 18 ms.
WARNING: the fixed pyramid schedule is not fully specified!
A default pyramid schedule is used.
WARNING: the moving pyramid schedule is not fully specified!
A default pyramid schedule is used.
Initialization of all components (before registration) took: 5 ms.
Preparation of the image pyramids took: 104 ms.
Resolution: 0
WARNING: The parameter "ShowExactMetricValue", requested at entry number 0, does not exist at all.
The default value "false" is used instead.
WARNING: The parameter "CheckNumberOfSamples", requested at entry number 0, does not exist at all.
The default value "true" is used instead.
WARNING: The parameter "UseMultiThreadingForMetrics", requested at entry number 0, does not exist at all.
The default value "true" is used instead.
Setting the fixed masks took: 0 ms.
Setting the moving masks took: 0 ms.
WARNING: The parameter "NumberOfFixedHistogramBins", requested at entry number 0, does not exist at all.
The default value "32" is used instead.
WARNING: The parameter "NumberOfMovingHistogramBins", requested at entry number 0, does not exist at all.
The default value "32" is used instead.
WARNING: The parameter "FixedLimitRangeRatio", requested at entry number 0, does not exist at all.
The default value "0.01" is used instead.
WARNING: The parameter "MovingLimitRangeRatio", requested at entry number 0, does not exist at all.
The default value "0.01" is used instead.
WARNING: The parameter "FixedKernelBSplineOrder", requested at entry number 0, does not exist at all.
The default value "0" is used instead.
WARNING: The parameter "MovingKernelBSplineOrder", requested at entry number 0, does not exist at all.
The default value "3" is used instead.
WARNING: The parameter "UseFastAndLowMemoryVersion", requested at entry number 0, does not exist at all.
The default value "true" is used instead.
WARNING: The parameter "UseJacobianPreconditioning", requested at entry number 0, does not exist at all.
The default value "false" is used instead.
WARNING: The parameter "FiniteDifferenceDerivative", requested at entry number 0, does not exist at all.
The default value "false" is used instead.
WARNING: The parameter "SP_A", requested at entry number 0, does not exist at all.
The default value "20" is used instead.
WARNING: The parameter "MaximumNumberOfSamplingAttempts", requested at entry number 0, does not exist at all.
The default value "0" is used instead.
WARNING: The parameter "SigmoidInitialTime", requested at entry number 0, does not exist at all.
The default value "0" is used instead.
WARNING: The parameter "MaxBandCovSize", requested at entry number 0, does not exist at all.
The default value "192" is used instead.
WARNING: The parameter "NumberOfBandStructureSamples", requested at entry number 0, does not exist at all.
The default value "10" is used instead.
WARNING: The parameter "UseAdaptiveStepSizes", requested at entry number 0, does not exist at all.
The default value "true" is used instead.
WARNING: The parameter "AutomaticParameterEstimation", requested at entry number 0, does not exist at all.
The default value "true" is used instead.
WARNING: The parameter "UseConstantStep", requested at entry number 0, does not exist at all.
The default value "false" is used instead.
WARNING: The parameter "MaximumStepLengthRatio", requested at entry number 0, does not exist at all.
The default value "1" is used instead.
WARNING: The parameter "MaximumStepLength", requested at entry number 0, does not exist at all.
The default value "1" is used instead.
WARNING: The parameter "NumberOfGradientMeasurements", requested at entry number 0, does not exist at all.
The default value "0" is used instead.
WARNING: The parameter "NumberOfJacobianMeasurements", requested at entry number 0, does not exist at all.
The default value "1452" is used instead.
WARNING: The parameter "NumberOfSamplesForExactGradient", requested at entry number 0, does not exist at all.
The default value "100000" is used instead.
WARNING: The parameter "SigmoidScaleFactor", requested at entry number 0, does not exist at all.
The default value "0.1" is used instead.
Elastix initialization of all components (for this resolution) took: 9 ms.
Computing the fixed image extrema took 0 ms.
Computing the moving image extrema took 0 ms.
Initialization of AdvancedMattesMutualInformation metric took: 30 ms.
Starting automatic parameter estimation for AdaptiveStochasticGradientDescent ...
WARNING: The parameter "ASGDParameterEstimationMethod", requested at entry number 0, does not exist at all.
The default value "Original" is used instead.
Computing JacobianTerms ...
Computing the Jacobian terms took 0.362179s
NumberOfGradientMeasurements to estimate sigma_i: 2
Sampling gradients ...
Progress: 100% Sampling the gradients took 0.064839s
Automatic parameter estimation took 0.43s
1:ItNr 2:Metric 3a:Time 3b:StepSize 4:||Gradient|| Time[ms]
0 -0.138379 0.000000 648.750108 0.008051 461.3
1 -0.224486 0.000000 648.750108 0.008147 1.6
2 -0.380932 1.000000 619.261477 0.014319 1.4
Time spent in resolution 0 (ITK initialization and iterating): 0.466 s.
Stopping condition: Error in metric.
Settings of AdaptiveStochasticGradientDescent in resolution 0:
( SP_a 13623.752271 )
( SP_A 20.000000 )
( SP_alpha 1.000000 )
( SigmoidMax 1.000000 )
( SigmoidMin -0.208320 )
( SigmoidScale 0.000000 )
Full Parameters file:
// Example parameter file for B-spline registration
// C-style comments: //
// The internal pixel type, used for internal computations
// Leave to float in general.
// NB: this is not the type of the input images! The pixel
// type of the input images is automatically read from the
// images themselves.
// This setting can be changed to "short" to save some memory
// in case of very large 3D images.
(FixedInternalImagePixelType "float")
(MovingInternalImagePixelType "float")
// The dimensions of the fixed and moving image
// NB: This has to be specified by the user. The dimension of
// the images is currently NOT read from the images.
// Also note that some other settings may have to specified
// for each dimension separately.
(FixedImageDimension 3)
(MovingImageDimension 3)
// Specify whether you want to take into account the so-called
// direction cosines of the images. Recommended: true.
// In some cases, the direction cosines of the image are corrupt,
// due to image format conversions for example. In that case, you
// may want to set this option to "false".
(UseDirectionCosines "true")
// **************** Main Components **************************
// The following components should usually be left as they are:
(Registration "MultiResolutionRegistration")
(Interpolator "BSplineInterpolator")
(ResampleInterpolator "FinalBSplineInterpolator")
(Resampler "DefaultResampler")
// These may be changed to Fixed/MovingSmoothingImagePyramid.
// See the manual.
(FixedImagePyramid "FixedRecursiveImagePyramid")
(MovingImagePyramid "MovingRecursiveImagePyramid")
// The following components are most important:
// The optimizer AdaptiveStochasticGradientDescent (ASGD) works
// quite ok in general. The Transform and Metric are important
// and need to be chosen careful for each application. See manual.
(Optimizer "AdaptiveStochasticGradientDescent")
(Transform "BSplineTransform")
(Metric "AdvancedMattesMutualInformation")
// The control point spacing of the bspline transformation in
// the finest resolution level. Can be specified for each
// dimension differently. Unit: mm.
// The lower this value, the more flexible the deformation.
// Low values may improve the accuracy, but may also cause
// unrealistic deformations. This is a very important setting!
// We recommend tuning it for every specific application. It is
// difficult to come up with a good 'default' value.
//(FinalGridSpacingInPhysicalUnits 32)
// Alternatively, the grid spacing can be specified in voxel units.
// To do that, uncomment the following line and comment/remove
// the FinalGridSpacingInPhysicalUnits definition.
(FinalGridSpacingInVoxels 32 32 32)
// By default the grid spacing is halved after every resolution,
// such that the final grid spacing is obtained in the last
// resolution level. You can also specify your own schedule,
// if you uncomment the following line:
//(GridSpacingSchedule 4.0 4.0 2.0 1.0)
// This setting can also be supplied per dimension.
// Whether transforms are combined by composition or by addition.
// In generally, Compose is the best option in most cases.
// It does not influence the results very much.
(HowToCombineTransforms "Compose")
// Number of grey level bins in each resolution level,
// for the mutual information. 16 or 32 usually works fine.
// You could also employ a hierarchical strategy:
//(NumberOfHistogramBins 16 32 64)
(NumberOfHistogramBins 32)
// If you use a mask, this option is important.
// If the mask serves as region of interest, set it to false.
// If the mask indicates which pixels are valid, then set it to true.
// If you do not use a mask, the option doesn't matter.
(ErodeMask "false")
// The number of resolutions. 1 Is only enough if the expected
// deformations are small. 3 or 4 mostly works fine. For large
// images and large deformations, 5 or 6 may even be useful.
(NumberOfResolutions 2)
// The downsampling/blurring factors for the image pyramids.
// By default, the images are downsampled by a factor of 2
// compared to the next resolution.
// So, in 2D, with 4 resolutions, the following schedule is used:
//(ImagePyramidSchedule 8 8 4 4 2 2 1 1 )
// And in 3D:
//(ImagePyramidSchedule 8 8 8 4 4 4 2 2 2 1 1 1 )
// You can specify any schedule, for example:
//(ImagePyramidSchedule 4 4 4 3 2 1 1 1 )
// Make sure that the number of elements equals the number
// of resolutions times the image dimension.
// Maximum number of iterations in each resolution level:
// 200-2000 works usually fine for nonrigid registration.
// The more, the better, but the longer computation time.
// This is an important parameter!
(MaximumNumberOfIterations 3000 3000 3000)
// The step size of the optimizer, in mm. By default the voxel size is used.
// which usually works well. In case of unusual high-resolution images
// (eg histology) it is necessary to increase this value a bit, to the size
// of the "smallest visible structure" in the image:
//(MaximumStepLength 1.0)
// Number of spatial samples used to compute the mutual
// information (and its derivative) in each iteration.
// With an AdaptiveStochasticGradientDescent optimizer,
// in combination with the two options below, around 2000
// samples may already suffice.
(NumberOfSpatialSamples 2048)
// Refresh these spatial samples in every iteration, and select
// them randomly. See the manual for information on other sampling
// strategies.
(NewSamplesEveryIteration "true")
(ImageSampler "Random")
// ************* Interpolation and Resampling ****************
// Order of B-Spline interpolation used during registration/optimisation.
// It may improve accuracy if you set this to 3. Never use 0.
// An order of 1 gives linear interpolation. This is in most
// applications a good choice.
(BSplineInterpolationOrder 3)
// Order of B-Spline interpolation used for applying the final
// deformation.
// 3 gives good accuracy; recommended in most cases.
// 1 gives worse accuracy (linear interpolation)
// 0 gives worst accuracy, but is appropriate for binary images
// (masks, segmentations); equivalent to nearest neighbor interpolation.
(FinalBSplineInterpolationOrder 3)
//Default pixel value for pixels that come from outside the picture:
(DefaultPixelValue 0)
// Choose whether to generate the deformed moving image.
// You can save some time by setting this to false, if you are
// not interested in the final deformed moving image, but only
// want to analyze the deformation field for example.
(WriteResultImage "true")
// The pixel type and format of the resulting deformed moving image
(ResultImagePixelType "short")
(ResultImageFormat "mhd")
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I run Elastix 5.1.0 on Windows 10
I am having trouble registering my 3D images (xyz of brain tissue) that I am trying to register to a 2D image (xy ) of the same brain before it experienced a procedure. I would greatly appreciate and be thankful for any insight regarding 3D to 2D registration. I will continue to try to make this work.
Between the two images/procedure the cells changed in z but all the cells should be in the 3D data.
I have had success with registering 2D to 2D and I'm rather new to using Elastix so I apologize If my question is easy to address.
I have tried the following to get 3D to 2D work but get some errors that I don't normally get when doing 2D to 2D:
What I've tried:
Fixed.mhd to:
ObjectType = Image
NDims = 3
BinaryData = True
BinaryDataByteOrderMSB = True
ElementSpacing = 1 1 1
DimSize = 512 512 1
ElementType = MET_USHORT
ElementDataFile = fixed.raw
Moving.mhd to:
ObjectType = Image
NDims = 3
BinaryData = True
BinaryDataByteOrderMSB = True
ElementSpacing = 1 1 1
DimSize = 512 512 19
ElementType = MET_USHORT
ElementDataFile = moving.raw
Parameters_Bspline.txt (shortened version, full version past Windows PowerShell error) to:
(FixedImageDimension 3)
(MovingImageDimension 3)
The error I get on my Windows PowerShell:
elastix is started at Wed Mar 27 13:45:52 2024.
which elastix: C:\Users\Lab User\Desktop\Elastix\elastix.exe
elastix version: 5.1.0
Git revision SHA: d652938
Git revision date: Thu Jan 12 14:20:18 2023 +0100
Build date: Jan 12 2023 13:52:33
Compiler: Visual C++ version 192930147.0
Memory address size: 64-bit
CMake version: 3.18.3
ITK version: 5.3.0
Command-line arguments:
-f fixed.mhd -m moving.mhd -p Parameters_BSpline.txt -out .
elastix runs at: F0BGZC3
Windows Professional (x64), (Build 9200)
with 16099 MB memory, and 8 cores @ 2904 MHz.
Running elastix with parameter file 0: "Parameters_BSpline.txt".
Current time: Wed Mar 27 13:45:52 2024.
Reading the elastix parameters from file ...
Installing all components.
InstallingComponents was successful.
ELASTIX version: 5.1.0
Command line options from ElastixBase:
-f fixed.mhd
-m moving.mhd
-fMask unspecified, so no fixed mask used
-mMask unspecified, so no moving mask used
-out .
-p Parameters_BSpline.txt
-priority unspecified, so NORMAL process priority
-threads unspecified, so all available threads are used
Command line options from TransformBase:
-t0 unspecified, so no initial transform used
WARNING: The parameter "BSplineTransformSplineOrder", requested at entry number 0, does not exist at all.
The default value "3" is used instead.
WARNING: The parameter "UseCyclicTransform", requested at entry number 0, does not exist at all.
The default value "false" is used instead.
Reading images...
Reading images took 18 ms.
WARNING: the fixed pyramid schedule is not fully specified!
A default pyramid schedule is used.
WARNING: the moving pyramid schedule is not fully specified!
A default pyramid schedule is used.
Initialization of all components (before registration) took: 5 ms.
Preparation of the image pyramids took: 104 ms.
Resolution: 0
WARNING: The parameter "ShowExactMetricValue", requested at entry number 0, does not exist at all.
The default value "false" is used instead.
WARNING: The parameter "CheckNumberOfSamples", requested at entry number 0, does not exist at all.
The default value "true" is used instead.
WARNING: The parameter "UseMultiThreadingForMetrics", requested at entry number 0, does not exist at all.
The default value "true" is used instead.
Setting the fixed masks took: 0 ms.
Setting the moving masks took: 0 ms.
WARNING: The parameter "NumberOfFixedHistogramBins", requested at entry number 0, does not exist at all.
The default value "32" is used instead.
WARNING: The parameter "NumberOfMovingHistogramBins", requested at entry number 0, does not exist at all.
The default value "32" is used instead.
WARNING: The parameter "FixedLimitRangeRatio", requested at entry number 0, does not exist at all.
The default value "0.01" is used instead.
WARNING: The parameter "MovingLimitRangeRatio", requested at entry number 0, does not exist at all.
The default value "0.01" is used instead.
WARNING: The parameter "FixedKernelBSplineOrder", requested at entry number 0, does not exist at all.
The default value "0" is used instead.
WARNING: The parameter "MovingKernelBSplineOrder", requested at entry number 0, does not exist at all.
The default value "3" is used instead.
WARNING: The parameter "UseFastAndLowMemoryVersion", requested at entry number 0, does not exist at all.
The default value "true" is used instead.
WARNING: The parameter "UseJacobianPreconditioning", requested at entry number 0, does not exist at all.
The default value "false" is used instead.
WARNING: The parameter "FiniteDifferenceDerivative", requested at entry number 0, does not exist at all.
The default value "false" is used instead.
WARNING: The parameter "SP_A", requested at entry number 0, does not exist at all.
The default value "20" is used instead.
WARNING: The parameter "MaximumNumberOfSamplingAttempts", requested at entry number 0, does not exist at all.
The default value "0" is used instead.
WARNING: The parameter "SigmoidInitialTime", requested at entry number 0, does not exist at all.
The default value "0" is used instead.
WARNING: The parameter "MaxBandCovSize", requested at entry number 0, does not exist at all.
The default value "192" is used instead.
WARNING: The parameter "NumberOfBandStructureSamples", requested at entry number 0, does not exist at all.
The default value "10" is used instead.
WARNING: The parameter "UseAdaptiveStepSizes", requested at entry number 0, does not exist at all.
The default value "true" is used instead.
WARNING: The parameter "AutomaticParameterEstimation", requested at entry number 0, does not exist at all.
The default value "true" is used instead.
WARNING: The parameter "UseConstantStep", requested at entry number 0, does not exist at all.
The default value "false" is used instead.
WARNING: The parameter "MaximumStepLengthRatio", requested at entry number 0, does not exist at all.
The default value "1" is used instead.
WARNING: The parameter "MaximumStepLength", requested at entry number 0, does not exist at all.
The default value "1" is used instead.
WARNING: The parameter "NumberOfGradientMeasurements", requested at entry number 0, does not exist at all.
The default value "0" is used instead.
WARNING: The parameter "NumberOfJacobianMeasurements", requested at entry number 0, does not exist at all.
The default value "1452" is used instead.
WARNING: The parameter "NumberOfSamplesForExactGradient", requested at entry number 0, does not exist at all.
The default value "100000" is used instead.
WARNING: The parameter "SigmoidScaleFactor", requested at entry number 0, does not exist at all.
The default value "0.1" is used instead.
Elastix initialization of all components (for this resolution) took: 9 ms.
Computing the fixed image extrema took 0 ms.
Computing the moving image extrema took 0 ms.
Initialization of AdvancedMattesMutualInformation metric took: 30 ms.
Starting automatic parameter estimation for AdaptiveStochasticGradientDescent ...
WARNING: The parameter "ASGDParameterEstimationMethod", requested at entry number 0, does not exist at all.
The default value "Original" is used instead.
Computing JacobianTerms ...
Computing the Jacobian terms took 0.362179s
NumberOfGradientMeasurements to estimate sigma_i: 2
Sampling gradients ...
Progress: 100% Sampling the gradients took 0.064839s
Automatic parameter estimation took 0.43s
1:ItNr 2:Metric 3a:Time 3b:StepSize 4:||Gradient|| Time[ms]
0 -0.138379 0.000000 648.750108 0.008051 461.3
1 -0.224486 0.000000 648.750108 0.008147 1.6
2 -0.380932 1.000000 619.261477 0.014319 1.4
Time spent in resolution 0 (ITK initialization and iterating): 0.466 s.
Stopping condition: Error in metric.
Settings of AdaptiveStochasticGradientDescent in resolution 0:
( SP_a 13623.752271 )
( SP_A 20.000000 )
( SP_alpha 1.000000 )
( SigmoidMax 1.000000 )
( SigmoidMin -0.208320 )
( SigmoidScale 0.000000 )
itk::ExceptionObject (000000DE360FC680)
Location: "ElastixTemplate - Run()"
File: D:\a\elastix\elastix\Elastix-source\Common\CostFunctions\itkAdvancedImageToImageMetric.hxx
Line: 916
Description: ITK ERROR: AdvancedMattesMutualInformationMetric(000002B9249F1600): Too many samples map outside moving image buffer: 331 / 2048
Error occurred during actual registration.
Errors occurred!
Full Parameters file:
// Example parameter file for B-spline registration
// C-style comments: //
// The internal pixel type, used for internal computations
// Leave to float in general.
// NB: this is not the type of the input images! The pixel
// type of the input images is automatically read from the
// images themselves.
// This setting can be changed to "short" to save some memory
// in case of very large 3D images.
(FixedInternalImagePixelType "float")
(MovingInternalImagePixelType "float")
// The dimensions of the fixed and moving image
// NB: This has to be specified by the user. The dimension of
// the images is currently NOT read from the images.
// Also note that some other settings may have to specified
// for each dimension separately.
(FixedImageDimension 3)
(MovingImageDimension 3)
// Specify whether you want to take into account the so-called
// direction cosines of the images. Recommended: true.
// In some cases, the direction cosines of the image are corrupt,
// due to image format conversions for example. In that case, you
// may want to set this option to "false".
(UseDirectionCosines "true")
// **************** Main Components **************************
// The following components should usually be left as they are:
(Registration "MultiResolutionRegistration")
(Interpolator "BSplineInterpolator")
(ResampleInterpolator "FinalBSplineInterpolator")
(Resampler "DefaultResampler")
// These may be changed to Fixed/MovingSmoothingImagePyramid.
// See the manual.
(FixedImagePyramid "FixedRecursiveImagePyramid")
(MovingImagePyramid "MovingRecursiveImagePyramid")
// The following components are most important:
// The optimizer AdaptiveStochasticGradientDescent (ASGD) works
// quite ok in general. The Transform and Metric are important
// and need to be chosen careful for each application. See manual.
(Optimizer "AdaptiveStochasticGradientDescent")
(Transform "BSplineTransform")
(Metric "AdvancedMattesMutualInformation")
// ***************** Transformation **************************
// The control point spacing of the bspline transformation in
// the finest resolution level. Can be specified for each
// dimension differently. Unit: mm.
// The lower this value, the more flexible the deformation.
// Low values may improve the accuracy, but may also cause
// unrealistic deformations. This is a very important setting!
// We recommend tuning it for every specific application. It is
// difficult to come up with a good 'default' value.
//(FinalGridSpacingInPhysicalUnits 32)
// Alternatively, the grid spacing can be specified in voxel units.
// To do that, uncomment the following line and comment/remove
// the FinalGridSpacingInPhysicalUnits definition.
(FinalGridSpacingInVoxels 32 32 32)
// By default the grid spacing is halved after every resolution,
// such that the final grid spacing is obtained in the last
// resolution level. You can also specify your own schedule,
// if you uncomment the following line:
//(GridSpacingSchedule 4.0 4.0 2.0 1.0)
// This setting can also be supplied per dimension.
// Whether transforms are combined by composition or by addition.
// In generally, Compose is the best option in most cases.
// It does not influence the results very much.
(HowToCombineTransforms "Compose")
// ******************* Similarity measure *********************
// Number of grey level bins in each resolution level,
// for the mutual information. 16 or 32 usually works fine.
// You could also employ a hierarchical strategy:
//(NumberOfHistogramBins 16 32 64)
(NumberOfHistogramBins 32)
// If you use a mask, this option is important.
// If the mask serves as region of interest, set it to false.
// If the mask indicates which pixels are valid, then set it to true.
// If you do not use a mask, the option doesn't matter.
(ErodeMask "false")
// ******************** Multiresolution **********************
// The number of resolutions. 1 Is only enough if the expected
// deformations are small. 3 or 4 mostly works fine. For large
// images and large deformations, 5 or 6 may even be useful.
(NumberOfResolutions 2)
// The downsampling/blurring factors for the image pyramids.
// By default, the images are downsampled by a factor of 2
// compared to the next resolution.
// So, in 2D, with 4 resolutions, the following schedule is used:
//(ImagePyramidSchedule 8 8 4 4 2 2 1 1 )
// And in 3D:
//(ImagePyramidSchedule 8 8 8 4 4 4 2 2 2 1 1 1 )
// You can specify any schedule, for example:
//(ImagePyramidSchedule 4 4 4 3 2 1 1 1 )
// Make sure that the number of elements equals the number
// of resolutions times the image dimension.
// ******************* Optimizer ****************************
// Maximum number of iterations in each resolution level:
// 200-2000 works usually fine for nonrigid registration.
// The more, the better, but the longer computation time.
// This is an important parameter!
(MaximumNumberOfIterations 3000 3000 3000)
// The step size of the optimizer, in mm. By default the voxel size is used.
// which usually works well. In case of unusual high-resolution images
// (eg histology) it is necessary to increase this value a bit, to the size
// of the "smallest visible structure" in the image:
//(MaximumStepLength 1.0)
// **************** Image sampling **********************
// Number of spatial samples used to compute the mutual
// information (and its derivative) in each iteration.
// With an AdaptiveStochasticGradientDescent optimizer,
// in combination with the two options below, around 2000
// samples may already suffice.
(NumberOfSpatialSamples 2048)
// Refresh these spatial samples in every iteration, and select
// them randomly. See the manual for information on other sampling
// strategies.
(NewSamplesEveryIteration "true")
(ImageSampler "Random")
// ************* Interpolation and Resampling ****************
// Order of B-Spline interpolation used during registration/optimisation.
// It may improve accuracy if you set this to 3. Never use 0.
// An order of 1 gives linear interpolation. This is in most
// applications a good choice.
(BSplineInterpolationOrder 3)
// Order of B-Spline interpolation used for applying the final
// deformation.
// 3 gives good accuracy; recommended in most cases.
// 1 gives worse accuracy (linear interpolation)
// 0 gives worst accuracy, but is appropriate for binary images
// (masks, segmentations); equivalent to nearest neighbor interpolation.
(FinalBSplineInterpolationOrder 3)
//Default pixel value for pixels that come from outside the picture:
(DefaultPixelValue 0)
// Choose whether to generate the deformed moving image.
// You can save some time by setting this to false, if you are
// not interested in the final deformed moving image, but only
// want to analyze the deformation field for example.
(WriteResultImage "true")
// The pixel type and format of the resulting deformed moving image
(ResultImagePixelType "short")
(ResultImageFormat "mhd")
Beta Was this translation helpful? Give feedback.
All reactions