[ITK] [ITK-users] Bug in itkMattesMutualInformationImageToImageMetric.hxx ?

Bradley Lowekamp blowekamp at mail.nih.gov
Fri May 1 08:16:32 EDT 2015


Hello,

The numeric_limits::lowest() seems to be a new C++11 method [1].

I believe NumericTraits::NonpositiveMin() will work.

Thanks for finding this issue! Please include a test :)

Brad


[1] http://en.cppreference.com/w/cpp/types/numeric_limits/lowest

On May 1, 2015, at 8:04 AM, Bill Lorensen <bill.lorensen at gmail.com> wrote:

> Looks like you found a bug. Please submit a patch through gerrit:
> http://www.itk.org/Wiki/ITK/Git/Develop
> 
> Thanks
> 
> 
> On Fri, May 1, 2015 at 2:54 AM, Ivan Setiawan <ivans at yahoo.co.jp> wrote:
>> Hi all,
>> My name is Ivan, and currently I am developing an image registration
>> software based on ITK.
>> Thank you for providing such a good library!
>> 
>> I think, I found a bug for determining the voxel's value range in
>> itkMattesMutualInformationImageToImageMetric.hxx.
>> 
>> In the ::Initialize(void) method, the initial value of
>> this->m_FixedImageTrueMax and this->m_MovingImageTrueMax should be set to
>>    std::numeric_limits<typename TFixedImage::PixelType>::lowest()  /* i.e.,
>> the most negative value, = -340282346638528860000000000000000000000.000000
>> for float-type image */
>> instead of
>>    std::numeric_limits<typename TFixedImage::PixelType>::min() /* =
>> 1.17549e-038 for float-type image. */
>> 
>> The code lines are:
>>    this->m_FixedImageTrueMax = std::numeric_limits<typename
>> TFixedImage::PixelType>::min(); // should be lowest() instead of min()?
>>    this->m_MovingImageTrueMax = std::numeric_limits<typename
>> TMovingImage::PixelType>::min(); // should be lowest() instead of min()?
>> 
>> Problem will not appear when using short-type image, but when a float-type
>> image with all negative voxel's value is used as input, then the initial
>> m_FixedImageTrueMax will NOT be updated to the correct negative maximum
>> value.
>> 
>> Could you please tell me your opinion?
>> 
>> Thank you very much for your attention.
>> 
>> Best regards,
>> Ivan
>> 
>> 
>> _____________________________________
>> Powered by www.kitware.com
>> 
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>> 
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.php
>> 
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>> 
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/insight-users
>> 
> 
> 
> 
> -- 
> Unpaid intern in BillsBasement at noware dot com
> _____________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
> 
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-users
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/mailman/listinfo/community

_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users


More information about the Community mailing list