[ITK] Calculate Normalized Mutual Information between images outside registration scope

Bill Lorensen bill.lorensen at gmail.com
Mon Jun 16 07:32:42 EDT 2014


Apply
metric->Initialize();
before asking for values.


On Mon, Jun 16, 2014 at 5:08 AM, Eriksson, Mikael
<mikael.k.eriksson at philips.com> wrote:
> Hello,
>
>
>
> I’m having trouble trying to calculate the normalized mutual information of
> two images. I would like to do this without performing any registration,
> just calculate the value. This is the relevant part of my implementation:
>
>
>
>
>
>                 typedef
> itk::NormalizedMutualInformationHistogramImageToImageMetric<ImageType,
> ImageType >    NormalizedMetricType;
>
>
>
> NormalizedMetricType::Pointer metric = NormalizedMetricType::New();
>
>
>
>        unsigned int numberOfHistogramBins = 32;
>
>        NormalizedMetricType::HistogramType::SizeType histogramSize;
>
>        histogramSize.SetSize(2);
>
>        histogramSize[0] = numberOfHistogramBins;
>
>        histogramSize[1] = numberOfHistogramBins;
>
>        metric->SetHistogramSize( histogramSize );
>
>
>
>        metric->SetTransform(transform);
>
>
>
>        metric->SetFixedImage(fixedImage);
>
>        metric->SetMovingImage(movingImage);
>
>        metric->SetFixedImageRegion(fixedImage->GetLargestPossibleRegion());
>
>
>
>        metric->SetInterpolator(interpolator);
>
>
>
>        TranslationTransformType::ParametersType parameters;
>
>        parameters.SetSize(2);
>
>        parameters.Fill(0);
>
>
>
>        MetricType::MeasureType value = metric->GetValue(parameters);
>
>        std::cout << "Value: " << value << std::endl;
>
>
>
> With this code, the program crashes at the penultimate line, when I call
> GetValue. I have tried different workarounds (like connecting to a
> registration object and calling GetValue), but nothing I’ve tried has
> resulted in any success. I looked at the
> MutualInformationImageToImage-example
> (http://www.itk.org/Wiki/ITK/Examples/Broken/ImageProcessing/MutualInformationImageToImageFilter),
> and tried it out myself and it worked, my problems arise when I use the
> Normalized Mutual information.
>
>
>
> Can somebody shed some light on these issues?
>
>
>
> Cheers,
>
> Mikael
>
>
>
> ………………………………………………………………………………………….
>
> Mikael Eriksson
>
> R&D Physicist Trainee
>
> Philips Medical Systems MR Finland, Feasibility studies
>
> ………………………………………………………………………………………….
>
>
>
>
> ________________________________
> The information contained in this message may be confidential and legally
> protected under applicable law. The message is intended solely for the
> addressee(s). If you are not the intended recipient, you are hereby notified
> that any use, forwarding, dissemination, or reproduction of this message is
> strictly prohibited and may be unlawful. If you are not the intended
> recipient, please contact the sender by return e-mail and destroy all copies
> of the original message.
>
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/mailman/listinfo/community
>



-- 
Unpaid intern in BillsBasement at noware dot com



More information about the Community mailing list