[Insight-users] Cost function value over a region
Luis Ibanez
luis.ibanez at kitware.com
Sat Dec 18 22:19:01 EST 2004
Hi Martin,
Your code seems to be ok.
How small is the region in your mask ?
Note that Mutual Information is actually computed by
selecting a small number of pixel samples from your
image. That number is typically as low as 50. In your
case it may be happening that the 50 samples are still
falling inside the region of your mask, and therefore
there is no difference between using the mask or not.
If you only want to compute the Mutual Information
between two images, you should rather use the example
in the Statistics directory:
Insight/Examples/Statistics/
ImageMutualInformation1.cxx
In this example, Mutual Information is computed from the
full joint histogram without attemting to do estimation
from a subset of samples. This approach is not efficient
for registration because the computational time is too
long. However, for your application, time doesn't seem
to be a critical factor.
Please let us know if you have further questions,
Thanks
Luis
------------------------------
kavec at messi.uku.fi wrote:
> Hi.
>
> I am trying to calculate normalized mutual information of two images (no
> registration). Additionaly, I want the value only from a region defined by a
> movingImageMask. The movingImageMask is an image with intensities 0 and 1.
>
> However, it seems that the mask has no effect on the result; if I set 1s for the
> whole image or just a part of it. This is how I set the region:
>
> // Define the region over which the metric will be computed.
> metric->SetFixedImageRegion(fixedImageReader->GetOutput()->GetBufferedRegion());
> metric->SetMovingImageMask( spatialObjectMask );
>
> Is there something wrong with it?
>
> The whole code is attached in case some would like to looked at it.
>
> Thanks.
>
> Martin
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
More information about the Insight-users
mailing list