<html><body><div style="color:; background-color:; font-family:MS Gothic, monospace, sans-serif;font-size:12pt"><div><span>Hi Brad, Bill,</span></div><div><span><br></span></div><div><span>Following your suggestions, I've changed the initial ImageTrueMin to NumericTraits::NonpositiveMin().</span></div><div><span>Also, I've change the initial ImageTrueMax to NumericeTraits::max(), to unify it with the above.</span></div><div><span style="font-size: 12pt;">Three files were modified.</span><br></div><div><br></div><div>This is the first time for me to submit a patch, and I don't know the best-fit reviewers, so I chose both of you.</div><div><br></div><div>Thank you and best regards,</div><div>Ivan Setiawan</div><div><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;"> <div style="font-family: 'MS Gothic', monospace, sans-serif; font-size: 12pt;"> <div style="font-family: 'MS
PGothic', sans-serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> ----- Original Message -----<br> <b><span style="font-weight:bold;">From:</span></b> Bradley Lowekamp <blowekamp@mail.nih.gov><br> <b><span style="font-weight: bold;">To:</span></b> Bill Lorensen <bill.lorensen@gmail.com> <br><b><span style="font-weight: bold;">Cc:</span></b> Ivan Setiawan <ivans@yahoo.co.jp>; insight-users <insight-users@itk.org><br> <b><span style="font-weight: bold;">Date:</span></b> 2015/5/1, Fri 21:16<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [ITK] [ITK-users] Bug in itkMattesMutualInformationImageToImageMetric.hxx ?<br> </font> </div> <br>Hello,<br><br>The numeric_limits::lowest() seems to be a new C++11 method [1].<br><br>I believe
NumericTraits::NonpositiveMin() will work.<br><br>Thanks for finding this issue! Please include a test :)<br><br>Brad<br><br><br>[1] <a href="http://en.cppreference.com/w/cpp/types/numeric_limits/lowest" target="_blank">http://en.cppreference.com/w/cpp/types/numeric_limits/lowest</a><br><br>On May 1, 2015, at 8:04 AM, Bill Lorensen <<a ymailto="mailto:bill.lorensen@gmail.com" href="mailto:bill.lorensen@gmail.com" target="_self">bill.lorensen@gmail.com</a>> wrote:<br><br>> Looks like you found a bug. Please submit a patch through gerrit:<br>> <a href="http://www.itk.org/Wiki/ITK/Git/Develop" target="_blank">http://www.itk.org/Wiki/ITK/Git/Develop</a><br>> <br>> Thanks<br>> <br>> <br>> On Fri, May 1, 2015 at 2:54 AM, Ivan Setiawan <<a ymailto="mailto:ivans@yahoo.co.jp" href="mailto:ivans@yahoo.co.jp" target="_self">ivans@yahoo.co.jp</a>> wrote:<br>>> Hi all,<br>>> My name is Ivan, and currently I am developing
an image registration<br>>> software based on ITK.<br>>> Thank you for providing such a good library!<br>>> <br>>> I think, I found a bug for determining the voxel's value range in<br>>> itkMattesMutualInformationImageToImageMetric.hxx.<br>>> <br>>> In the ::Initialize(void) method, the initial value of<br>>> this->m_FixedImageTrueMax and this->m_MovingImageTrueMax should be set to<br>>> std::numeric_limits<typename TFixedImage::PixelType>::lowest() /* i.e.,<br>>> the most negative value, = -340282346638528860000000000000000000000.000000<br>>> for float-type image */<br>>> instead of<br>>> std::numeric_limits<typename TFixedImage::PixelType>::min() /* =<br>>> 1.17549e-038 for float-type image. */<br>>> <br>>> The code lines are:<br>>> this->m_FixedImageTrueMax =
std::numeric_limits<typename<br>>> TFixedImage::PixelType>::min(); // should be lowest() instead of min()?<br>>> this->m_MovingImageTrueMax = std::numeric_limits<typename<br>>> TMovingImage::PixelType>::min(); // should be lowest() instead of min()?<br>>> <br>>> Problem will not appear when using short-type image, but when a float-type<br>>> image with all negative voxel's value is used as input, then the initial<br>>> m_FixedImageTrueMax will NOT be updated to the correct negative maximum<br>>> value.<br>>> <br>>> Could you please tell me your opinion?<br>>> <br>>> Thank you very much for your attention.<br>>> <br>>> Best regards,<br>>> Ivan<br>>> <br>>> <br>>> _____________________________________<br>>> Powered by www.kitware.com<br>>> <br>>> Visit other Kitware open-source projects at<br>>> <a
href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>>> <br>>> Kitware offers ITK Training Courses, for more information visit:<br>>> <a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>>> <br>>> Please keep messages on-topic and check the ITK FAQ at:<br>>> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>>> <br>>> Follow this link to subscribe/unsubscribe:<br>>> <a href="http://public.kitware.com/mailman/listinfo/insight-users" target="_blank">http://public.kitware.com/mailman/listinfo/insight-users</a><br>>> <br>> <br>> <br>> <br>> -- <br>> Unpaid intern in BillsBasement at noware dot com<br>> _____________________________________<br>> Powered by www.kitware.com<br>>
<br>> Visit other Kitware open-source projects at<br>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>> <br>> Kitware offers ITK Training Courses, for more information visit:<br>> <a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>> <br>> Please keep messages on-topic and check the ITK FAQ at:<br>> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>> <br>> Follow this link to subscribe/unsubscribe:<br>> <a href="http://public.kitware.com/mailman/listinfo/insight-users" target="_blank">http://public.kitware.com/mailman/listinfo/insight-users</a><br>> _______________________________________________<br>> Community mailing list<br>> <a ymailto="mailto:Community@itk.org" href="mailto:Community@itk.org"
target="_self">Community@itk.org</a><br>> <a href="http://public.kitware.com/mailman/listinfo/community" target="_blank">http://public.kitware.com/mailman/listinfo/community</a><br><br><br><br> </div> </div> </blockquote></div> </div></body></html>