[ITK] Calculate Normalized Mutual Information between images outside registration scope
Eriksson, Mikael
mikael.k.eriksson at philips.com
Mon Jun 16 05:08:47 EDT 2014
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140616/205c0264/attachment.html>
More information about the Community
mailing list