[Elastix] How to use UseComplement in MultiMetric scenarios

S. Klein s.klein at erasmusmc.nl
Wed Apr 22 22:00:36 CEST 2015


In fact the default value for this parameter is "true", so you could just omit it.

In the theorteical case that you would want to specify it different for each metric, it works like this:

(Metric0UseComplement "false")
(Metric1UseComplement "true")
(Metric2UseComplement "false")

etc.
So you add a prefix. This works for most parameters.

Cheers,
Stefan

On 22-4-2015 19:29, Polfliet Mathias wrote:
The KappaStatistic is always a positive value between 0 and 1. Since all optimisers try to minimise the metric value it is a good idea to set the UseComplement to "true". In the case of no foreground alignment, the KappaStatistic would return 0 and increase to 1 for a perfect registration if the UseComplement is set to "false". The solution to your problem would be:

(UseComplement "true”)

Since the AdvancedMattesMutualInformation metric does not have this option/setting.

With kind regards,

Mathias Polfliet


On 22 Apr 2015, at 17:11, Fitze Thomas (fitz) <fitz at zhaw.ch<mailto:fitz at zhaw.ch>> wrote:

Hi there!

Im trying to do a multi metric registration with (Metric "AdvancedMattesMutualInformation" "AdvancedKappaStatistic”). As far as i understand those 2 metric, i’ll have to use the complement of the KappaStatistic but not of the MMI. I tried to do this by using (UseComplement "false" "true”), but it appears that this does not work. The registration log always reports metric 2 as positive value, regardless of the UseComplement setting.

Am i doing this wrong? Here’s the full config:
(FixedInternalImagePixelType "short")
(MovingInternalImagePixelType "short")
(FixedImageDimension 3)
(MovingImageDimension 3)
(UseDirectionCosines "true")

// Main Components
(Registration "MultiMetricMultiResolutionRegistration")
(Transform "AffineTransform")

// Multiresolution
(FixedImagePyramid "FixedSmoothingImagePyramid" "FixedSmoothingImagePyramid")
(MovingImagePyramid "MovingSmoothingImagePyramid" "MovingSmoothingImagePyramid")
(NumberOfResolutions 3 )
(ImagePyramidSchedule 4 4 1  2 2 1  1 1 1 )

// initial transformation
(AutomaticScalesEstimation "true")
(AutomaticTransformInitialization "true")
(AutomaticTransformInitializationMethod "GeometricalCenter")
//(HowToCombineTransforms "Compose")
(HowToCombineTransforms "Add")

// ******************* Optimizer ****************************
(Optimizer "AdaptiveStochasticGradientDescent")
(MaximumNumberOfIterations 500)
(MaximumStepLength 10.0)

// ****************** Metric *********************
(Metric "AdvancedMattesMutualInformation" "AdvancedKappaStatistic")
(UseForegroundValue "false")
(UseComplement "false" "true")
(UseRelativeWeights "false")
(Metric0Weight 0.3)
(Metric1Weight 0.7)
(NumberOfHistogramBins 32)
(ErodeMask "false")

// **************** Image sampling **********************
(NumberOfSpatialSamples 10000)
(ImageSampler "RandomCoordinate" "RandomCoordinate")
(UseRandomSampleRegion "false")
(NewSamplesEveryIteration "true")
(CheckNumberOfSamples "false")

// ************* Interpolation and Resampling ****************
(Interpolator "LinearInterpolator" "NearestNeighborInterpolator")
(ResampleInterpolator "FinalBSplineInterpolator" "FinalBSplineInterpolator")
(Resampler "DefaultResampler" "DefaultResampler")
(BSplineInterpolationOrder 1)
(FinalBSplineInterpolationOrder 3)
(FixedImageBSplineInterpolationOrder 3)
(DefaultPixelValue 0)
(WriteResultImage "true")
(ResultImagePixelType "short")
(ResultImageFormat "nrrd”)

And this is the CLI call:
elastix -f0 ${FIX_IMGP0} -f1 ${FIX_IMGP1} -m0 ${MOV_IMGP0} -m1 ${MOV_IMGP1} -p Affine.txt -out "${DATA_RESULT}0"

Thanks,
Thomas
_______________________________________________
Elastix mailing list
Elastix at bigr.nl<mailto:Elastix at bigr.nl>
http://lists.bigr.nl/cgi-bin/mailman/listinfo/elastix




_______________________________________________
Elastix mailing list
Elastix at bigr.nl<mailto:Elastix at bigr.nl>
http://lists.bigr.nl/cgi-bin/mailman/listinfo/elastix


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bigr.nl/pipermail/elastix/attachments/20150422/c0f95110/attachment-0001.html>


More information about the Elastix mailing list