Discussion:
[ITK-users] initialize same metric object multiple times
D'Isidoro Fabio
2017-05-12 12:26:46 UTC
Permalink
Hallo,

is it possible to initialize the same metric object multiple times (i.e. 50 times), with different fixed images and/or different masks?

For example:

metric = MattesMutualInformationImageToImageMetricv4[ImageType,ImageType].New()
metric.SetTransform(identityTransform)
metric.SetFixedImage( FixedImage1 )
metric.SetFixedImageMask(spatialObjectMask1 )
metric.SetMovingImage(MovingImage)
metric.Initialize()
metric.GetValue()
...
...
metric.SetFixedImage( FixedImage2 )
metric.SetFixedImageMask(spatialObjectMask2 )
metric.Initialize()
metric.GetValue()
...
...
metric.SetFixedImage( FixedImage3 )
metric.SetFixedImageMask(spatialObjectMask3 )
metric.Initialize()
metric.GetValue()


I read on the manual that "initialize() is for one-time initialization", but I m not sure what that means.

Thank you,
Fabio.
Francois Budin
2017-05-12 13:12:51 UTC
Permalink
Hello Fabio,

The "Initialize()" function in MattesMutualInformationImageToImageMetricv4
computes the lower and upper bound value that are used to compute the
histogram. If you change your fixed image, you should indeed call it again
as the bounding values may have changed.

Hope this helps,
Francois
Post by D'Isidoro Fabio
Hallo,
is it possible to initialize the same metric object multiple times (i.e.
50 times), with different fixed images and/or different masks?
metric = MattesMutualInformationImageToImageMetricv4[ImageType,
ImageType].New()
metric.SetTransform(identityTransform)
metric.SetFixedImage( FixedImage1 )
metric.SetFixedImageMask(spatialObjectMask1 )
metric.SetMovingImage(MovingImage)
metric.Initialize()
metric.GetValue()




metric.SetFixedImage( FixedImage2 )
metric.SetFixedImageMask(spatialObjectMask2 )
metric.Initialize()
metric.GetValue()




metric.SetFixedImage( FixedImage3 )
metric.SetFixedImageMask(spatialObjectMask3 )
metric.Initialize()
metric.GetValue()
I read on the manual that “initialize() is for one-time initialization”,
but I m not sure what that means.
Thank you,
Fabio.
_____________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
http://www.kitware.com/products/protraining.php
http://www.itk.org/Wiki/ITK_FAQ
http://public.kitware.com/mailman/listinfo/insight-users
Loading...