[Elastix] Using a mask for image registration; RE: binary image (segmentation image) registration

Floris Berendsen floris at isi.uu.nl
Wed Feb 11 14:01:23 CET 2015

hi Ori, Hi Litiantian,

Your questions have overlap, that’s why I try to combine my answers.

By adding a fixed mask, the sampler draws the required number of samples
from within the valid region of the fixed image. However, if a moving mask
was added as well, any sample that maps to masked-out positions in the
moving image will be discarded from the sample container. The sampler will
not augment any new samples, so effectively the number of samples can be
smaller than the NumberOfSpatialSamples that was set. If the number of
samples drops below a certain threshold an entirely new set of samples is
drawn: see http://elastix.isi.uu.nl/FAQ.php#Q_TooManySamples for more info.

Registration is generally driven by gradients (e.g. edges) in the image. If
a mask is too tight around the structure of interest, the edges of the
structure with respect to a background effectively disappear and
registration accuracy might decrease. For example, dilating the mask (i.e.
the valid fixed region) could include this important edge information.

@Ori, I’m not sure what you mean by a scaled binary representation.

@Ori: All and only those control points of a B-spline transformation that
have their local support zone reaching to a valid sample image sample are
updated by the optimizer.

I hope this answers the questions of both of you.



*From:* elastix-bounces at bigr.nl [mailto:elastix-bounces at bigr.nl] *On Behalf
Of *???? ???
*Sent:* vrijdag 6 februari 2015 10:40
*To:* elastix at bigr.nl
*Subject:* [Elastix] Using a mask for image registration

Hi good Elastix users,

I'm using a fixed mask which is a slightly scaled binary representation of
the fixed image non zero values, to improve registration computation

I wonder what effect the mask has of the registration as the results are
slightly less accurate.

Is it only sample values within the mask (I'm using Grid sampling mehanism)?

Is it only choosing control points within the mask (I'm using
RandomCoordinate && NewSamplesEveryIteration==true &&

Any other effect on the registration?



*From:* elastix-bounces at bigr.nl [mailto:elastix-bounces at bigr.nl] *On Behalf
Of *litiantian
*Sent:* maandag 9 februari 2015 8:32
*To:* elastix at bigr.nl
*Subject:* [MOGELIJK SPAM ! ******] [Elastix] binary image (segmentation
image) registration

Dear Sir/Mandam,

i came across a problem when i tried to register the binary
image(segmentation result).

The registration algorithm preformed well when no mask was used. However,
when i added mask on both fixed image and/or moved image the registration
result became worse.

' If a mask is given, the sampler tries to find samples within the mask. '
---> From the mannual

i thought if i added mask and kept the *NumberOfSpatialSamples* unchanged,
the registration result should be better. Am i right??

Here is my Parameter file:


(FixedInternalImagePixelType "float")

(FixedImageDimension 3)

(MovingInternalImagePixelType "float")

(MovingImageDimension 3)


(Registration "MultiResolutionRegistration")

(FixedImagePyramid "FixedSmoothingImagePyramid")

(MovingImagePyramid "MovingSmoothingImagePyramid")

(Interpolator "BSplineInterpolator")

(Metric "AdvancedMattesMutualInformation")

(Optimizer "StandardGradientDescent")

(ResampleInterpolator "FinalBSplineInterpolator")

(Resampler "DefaultResampler")

(Transform "BSplineTransform")

// ********** Pyramid

// Total number of resolutions

(NumberOfResolutions 2)

// ********** Transform

// ********** Transform

(FinalGridSpacingInPhysicalUnits 4.0 4.0 4.0)

(GridSpacingSchedule 1.0 1.0 1.0 1.0 1.0 1.0)

(HowToCombineTransforms "Compose")

// ********** Optimizer

// Maximum number of iterations in each resolution level:

(MaximumNumberOfIterations 1000)

//SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha

(SP_a 10000.0)

//SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha

(SP_alpha 0.602)

//SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha

(SP_A 50.0)

// ********** Metric

//Number of grey level bins in each resolution level:

(NumberOfHistogramBins 32)

(FixedLimitRangeRatio 0.0)

(MovingLimitRangeRatio 0.0)

(FixedKernelBSplineOrder 3)

(MovingKernelBSplineOrder 3)

// ********** Several

(WriteTransformParametersEachIteration "false")

(WriteTransformParametersEachResolution "true")

(WriteResultImage "true")

(ShowExactMetricValue "false")

(ErodeFixedMask "false")

(ErodeMovingMask "false")

(UseDifferentiableOverlap "false")

// ********** ImageSampler

//Number of spatial samples used to compute the mutual information in each
resolution level:

(ImageSampler "Random")

(NumberOfSpatialSamples 10000)

(NewSamplesEveryIteration "true")

// ********** Interpolator and Resampler

//Order of B-Spline interpolation used in each resolution level:

(BSplineInterpolationOrder 3)

//Order of B-Spline interpolation used for applying the final deformation:

(FinalBSplineInterpolationOrder 1)

//Default pixel value for pixels that come from outside the picture:

(DefaultPixelValue 0)

(ResultImagePixelType "float")

(ResultImageFormat "hdr")
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bigr.nl/pipermail/elastix/attachments/20150211/eed60e84/attachment-0001.html>

More information about the Elastix mailing list