<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hello,<div class=""><br class=""></div><div class="">Just to follow up.</div><div class=""><br class=""></div><div class="">Your code seems to correct a long long time bug. That has had a work around [1] for at least one usage.</div><div class=""><br class=""></div><div class="">The truncation of the “size” variable to the MeasurementType, can easily result in a divide by zero when the number of bins is NumericTraints<MeasurementType>::max() + 1.</div><div class=""><br class=""></div><div class="">It may need to be noted in the release notes, that histogram calculations may change due to this correction, which can change the bounds of histograms.</div><div class=""><br class=""></div><div class="">Good job tracking down the problem.</div><div class=""><br class=""></div><div class="">Brad</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">[1] <a href="https://github.com/InsightSoftwareConsortium/ITK/commit/4011c5d85e77387f59cadc0b12b79fdaa3251339" class="">https://github.com/InsightSoftwareConsortium/ITK/commit/4011c5d85e77387f59cadc0b12b79fdaa3251339</a></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 19, 2016, at 9:09 AM, Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov" class="">blowekamp@mail.nih.gov</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hello Hyun,<div class=""><br class=""></div><div class="">From you description, I don’t understand what was the cause of the crass nor how this fixed the problem. Why was it the wrong type?</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Brad</div><div class=""><br class=""></div><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jan 18, 2016, at 12:20 PM, Hyun Jae Kang <<a href="mailto:hyunjae.kang@kitware.com" class="">hyunjae.kang@kitware.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi Bradley,<div class=""><br class=""></div><div class="">Thank you for your comments on the code. The lines you mentioned in <span style="font-size:12.8px" class="">itkHistogram.hxx generated the run-time crash on Mac OSX 10.6 with clang compiler (3.0).</span></div><div class=""><span style="font-size:12.8px" class=""><br class=""></span></div><div class=""><span style="font-size:12.8px" class="">When I found this error, I checked the data type of the local variable ( float </span><span style="font-size:12.8px" class="">interval ) and I put "float" in the lines to avoid the run-time error.</span></div><div class=""><span style="font-size:12.8px" class=""><br class=""></span></div><div class=""><span style="font-size:12.8px" class="">This is why I chose "float" as the data type of data-casting.</span></div><div class=""><span style="font-size:12.8px" class=""><br class=""></span></div><div class=""><span style="font-size:12.8px" class="">If I did something wrong, please let me know. I will fix it.</span></div><div class=""><span style="font-size:12.8px" class=""><br class=""></span></div><div class=""><span style="font-size:12.8px" class="">Thanks,</span></div><div class=""><span style="font-size:12.8px" class=""><br class=""></span></div><div class=""><span style="font-size:12.8px" class="">Hyun Jae </span></div><div class=""><br class=""></div><div class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Jan 18, 2016 at 12:00 PM,  <span dir="ltr" class=""><<a href="mailto:insight-developers-request@itk.org" target="_blank" class="">insight-developers-request@itk.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Send Insight-developers mailing list submissions to<br class="">
        <a href="mailto:insight-developers@itk.org" class="">insight-developers@itk.org</a><br class="">
<br class="">
To subscribe or unsubscribe via the World Wide Web, visit<br class="">
        <a href="http://public.kitware.com/mailman/listinfo/insight-developers" rel="noreferrer" target="_blank" class="">http://public.kitware.com/mailman/listinfo/insight-developers</a><br class="">
or, via email, send a message with subject or body 'help' to<br class="">
        <a href="mailto:insight-developers-request@itk.org" class="">insight-developers-request@itk.org</a><br class="">
<br class="">
You can reach the person managing the list at<br class="">
        <a href="mailto:insight-developers-owner@itk.org" class="">insight-developers-owner@itk.org</a><br class="">
<br class="">
When replying, please edit your Subject line so it is more specific<br class="">
than "Re: Contents of Insight-developers digest..."<br class="">
<br class="">
<br class="">
Today's Topics:<br class="">
<br class="">
   1. Re: [ITK]  Itk release branch demons registration<br class="">
      (Bradley Lowekamp)<br class="">
<br class="">
<br class="">
----------------------------------------------------------------------<br class="">
<br class="">
Message: 1<br class="">
Date: Sun, 17 Jan 2016 18:13:44 -0500<br class="">
From: Bradley Lowekamp <<a href="mailto:brad@lowekamp.net" class="">brad@lowekamp.net</a>><br class="">
To: Bradley Lowekamp <<a href="mailto:brad@lowekamp.net" class="">brad@lowekamp.net</a>><br class="">
Cc: ITK <<a href="mailto:insight-developers@itk.org" class="">insight-developers@itk.org</a>><br class="">
Subject: Re: [ITK-dev] [ITK]  Itk release branch demons registration<br class="">
Message-ID: <<a href="mailto:63AE857C-91FE-4B80-B31B-921A6CDAD2C6@lowekamp.net" class="">63AE857C-91FE-4B80-B31B-921A6CDAD2C6@lowekamp.net</a>><br class="">
Content-Type: text/plain; charset="utf-8"<br class="">
<br class="">
Just to follow up my git bisect narrowed the change down to this:<br class="">
commit 0fd462a3226e84bdce77b68830903b3888dab244<br class="">
Author: Hyun Jae Kang <<a href="mailto:hyunjae.kang@kitware.com" class="">hyunjae.kang@kitware.com</a>><br class="">
Date:   Thu Dec 31 10:56:25 2015 -0500<br class="">
<br class="">
    BUG: Fixed the runtime crash of ITKStatisticsTestDriver tests on OSX 10.6<br class="">
<br class="">
    - Fixed the runtime crash of the following ITKStatisticsTestDriver's tests on<br class="">
      OSX 10.6 ( clang 3.0 )  by modifying the itkHistogram's Initialize function<br class="">
      to handle a data value out of range of a specific data type with<br class="">
      type-casting operator.<br class="">
<br class="">
      - itkSampleToHistogramFilterTest3 (ILLEGAL)<br class="">
      - itkSampleToHistogramFilterTest7 (ILLEGAL)<br class="">
<br class="">
    - These crash were reported at the following page:<br class="">
      <a href="https://open.cdash.org/viewTest.php?onlyfailed&buildid=4170483" rel="noreferrer" target="_blank" class="">https://open.cdash.org/viewTest.php?onlyfailed&buildid=4170483</a><br class="">
<br class="">
    Change-Id: I2063912edee79422d88125ffd5f7513c31a9e98c<br class="">
<br class="">
diff --git a/Modules/Numerics/Statistics/include/itkHistogram.hxx b/Modules/Numerics/Statistics/include/itkHistogram.hxx<br class="">
index 380b8d0..d11d788 100644<br class="">
--- a/Modules/Numerics/Statistics/include/itkHistogram.hxx<br class="">
+++ b/Modules/Numerics/Statistics/include/itkHistogram.hxx<br class="">
@@ -248,8 +248,8 @@ Histogram< TMeasurement, TFrequencyContainer ><br class="">
     {<br class="">
     if ( size[i] > 0 )<br class="">
       {<br class="">
-      interval = static_cast<float>( upperBound[i] - lowerBound[i] )<br class="">
-        / static_cast< MeasurementType >( size[i] );<br class="">
+      interval = (static_cast<float>( upperBound[i] ) - static_cast<float>(lowerBound[i] ))<br class="">
+        / static_cast< float >( size[i] );<br class="">
<br class="">
<br class="">
Here is the failing example [1], which uses the HistogramMatching filter.<br class="">
<br class="">
I am not sure why float was choose at the type here. Are results being truncated now? When there was temporary double computation going on?<br class="">
<br class="">
 It needs more investigation, as it?s changing the results of some filters? not sure how significant yet.<br class="">
<br class="">
Brad<br class="">
<br class="">
<br class="">
<br class="">
<br class="">
[1] <a href="https://github.com/SimpleITK/SimpleITK/blob/master/Examples/DemonsRegistration1.py#L41" rel="noreferrer" target="_blank" class="">https://github.com/SimpleITK/SimpleITK/blob/master/Examples/DemonsRegistration1.py#L41</a><br class="">
> On Jan 16, 2016, at 2:58 PM, Bradley Lowekamp <<a href="mailto:brad@lowekamp.net" class="">brad@lowekamp.net</a>> wrote:<br class="">
><br class="">
> Thanks. I'll run a git bisect tonight to try to figure it out.<br class="">
><br class="">
>> On Jan 16, 2016, at 12:57 PM, Matt McCormick <<a href="mailto:matt.mccormick@kitware.com" class="">matt.mccormick@kitware.com</a>> wrote:<br class="">
>><br class="">
>> Hi,<br class="">
>><br class="">
>> Nothing comes to mind.<br class="">
>><br class="">
>> Here is the log for v4.9rc03..release:<br class="">
>><br class="">
>> Bill Hoffman (3):<br class="">
>>     COMP: fix 64 bit build warnings with windows auto-export on.<br class="">
>>     COMP: work around for VS 2015 optimizer bug causing test failures.<br class="">
>>     COMP: work around for VS 2015 optimizer bug causing test failures.<br class="">
>><br class="">
>> Bradley Lowekamp (1):<br class="">
>>     BUG: Fix precision with accumulation and scaling in AdaptiveHistogram<br class="">
>><br class="">
>> Davis Vigneault (1):<br class="">
>>     COMP: Include itkMacro.h in itkTestingMacros.h<br class="">
>><br class="">
>> Hans Johnson (2):<br class="">
>>     COMP: BSD command lines do not have --version<br class="">
>>     COMP: Respect CMAKE_CXX_STANDARD during config<br class="">
>><br class="">
>> Hyun Jae Kang (12):<br class="">
>>     COMP: Fixed the compiler error of ITKCommon2TestDriver on OSX 10.6<br class="">
>>     BUG: Fixed the runtime crash of vnl_test_complex on OSX 10.6<br class="">
>>     BUG: Fixed the runtime crash of itkTimeProbeTest2<br class="">
>>     BUG: Fixed the runtime crash of VideoSourceTest on OSX 10.6<br class="">
>>     BUG: Fixed the runtime crash of ITKReviewTestDriver on OSX 10.6<br class="">
>>     BUG: Fixed the runtime crash of ITKFastMarchingTestDriver's<br class="">
>> tests on OSX 10.6<br class="">
>>     COMP: Fixed the data conversion warning messages of itkResourceProbe<br class="">
>>     BUG: Fixed the runtime crash of ITKStatisticsTestDriver tests on OSX 10.6<br class="">
>>     BUG: Fixed the runtime crash of itkBinaryShapeOpeningImageFilterTest1<br class="">
>>     BUG: Fixed the runtime crash of test_pow_log on OSX 10.6<br class="">
>>     BUG: Fixed the runtime crash of vnl_test_numeric_traits<br class="">
>>     BUG: Exclude a test code of ITKLabelMapTestDriver on OSX 10.6<br class="">
>><br class="">
>> Isaiah Norton (1):<br class="">
>>     COMP: fix build with -std=c++11 when ITK/VXL initially configured without<br class="">
>><br class="">
>> Matthew McCormick (6):<br class="">
>>     BUG: Do not perform dynamic_cast in CompositeIOTransformIOHelper.<br class="">
>>     COMP: Do not set property on itkhdf5 with ITK_USE_SYSTEM_HDF5.<br class="">
>>     DOC: Update the location of the GNUPlot Software Guide scripts.<br class="">
>>     DOC: Update the Software Guide repo location in Examples/README.txt.<br class="">
>>     COMP: Add export specification for itk::ResourceProbe.<br class="">
>>     COMP: Require NO_MODULE with DCMTK find_package.<br class="">
>><br class="">
>> Michka Popoff (2):<br class="">
>>     ENH: Allow Python 3 wrapping for Glue and Review Modules with VTK 7<br class="">
>>     COMP: Re-enable review module for python 3 and older VTK's<br class="">
>><br class="">
>> Sean McBride (1):<br class="">
>>     DOC: Update some woefully out-of-date GDCM comments, and typos<br class="">
>><br class="">
>> Seun Odutola (1):<br class="">
>>     BUG: Improved itkAnalyzeImageIO to handle case insensitive extensions<br class="">
>><br class="">
>> HTH,<br class="">
>> Matt<br class="">
>><br class="">
>>> On Sat, Jan 16, 2016 at 12:18 PM, Bradley Lowekamp <<a href="mailto:brad@lowekamp.net" class="">brad@lowekamp.net</a>> wrote:<br class="">
>>> I just updated SimpleITK to the release branch yesterday and there are some changes in the result of the demons registration. I'm not going to get a chance to look at it until Monday. The only change potentially related I know of is the rounding related numeric traits, but that does not seem likely to me.<br class="">
>>><br class="">
>>> Any ideas why the Demons Registration would have changed fro rc3?<br class="">
>>><br class="">
>>>> On Jan 16, 2016, at 12:13 PM, Bradley Lowekamp <<a href="mailto:brad@lowekamp.net" class="">brad@lowekamp.net</a>> wrote:<br class="">
>>>><br class="">
>>>> Hello,<br class="">
>>>><br class="">
>>>> I updated SimpleITK<br class="">
>>>> _______________________________________________<br class="">
>>>> Powered by <a href="http://www.kitware.com/" rel="noreferrer" target="_blank" class="">www.kitware.com</a><br class="">
>>>><br class="">
>>>> Visit other Kitware open-source projects at<br class="">
>>>> <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank" class="">http://www.kitware.com/opensource/opensource.html</a><br class="">
>>>><br class="">
>>>> Kitware offers ITK Training Courses, for more information visit:<br class="">
>>>> <a href="http://kitware.com/products/protraining.php" rel="noreferrer" target="_blank" class="">http://kitware.com/products/protraining.php</a><br class="">
>>>><br class="">
>>>> Please keep messages on-topic and check the ITK FAQ at:<br class="">
>>>> <a href="http://www.itk.org/Wiki/ITK_FAQ" rel="noreferrer" target="_blank" class="">http://www.itk.org/Wiki/ITK_FAQ</a><br class="">
>>>><br class="">
>>>> Follow this link to subscribe/unsubscribe:<br class="">
>>>> <a href="http://public.kitware.com/mailman/listinfo/insight-developers" rel="noreferrer" target="_blank" class="">http://public.kitware.com/mailman/listinfo/insight-developers</a><br class="">
>>> _______________________________________________<br class="">
>>> Powered by <a href="http://www.kitware.com/" rel="noreferrer" target="_blank" class="">www.kitware.com</a><br class="">
>>><br class="">
>>> Visit other Kitware open-source projects at<br class="">
>>> <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank" class="">http://www.kitware.com/opensource/opensource.html</a><br class="">
>>><br class="">
>>> Kitware offers ITK Training Courses, for more information visit:<br class="">
>>> <a href="http://kitware.com/products/protraining.php" rel="noreferrer" target="_blank" class="">http://kitware.com/products/protraining.php</a><br class="">
>>><br class="">
>>> Please keep messages on-topic and check the ITK FAQ at:<br class="">
>>> <a href="http://www.itk.org/Wiki/ITK_FAQ" rel="noreferrer" target="_blank" class="">http://www.itk.org/Wiki/ITK_FAQ</a><br class="">
>>><br class="">
>>> Follow this link to subscribe/unsubscribe:<br class="">
>>> <a href="http://public.kitware.com/mailman/listinfo/insight-developers" rel="noreferrer" target="_blank" class="">http://public.kitware.com/mailman/listinfo/insight-developers</a><br class="">
> _______________________________________________<br class="">
> Powered by <a href="http://www.kitware.com/" rel="noreferrer" target="_blank" class="">www.kitware.com</a><br class="">
><br class="">
> Visit other Kitware open-source projects at<br class="">
> <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank" class="">http://www.kitware.com/opensource/opensource.html</a><br class="">
><br class="">
> Kitware offers ITK Training Courses, for more information visit:<br class="">
> <a href="http://kitware.com/products/protraining.php" rel="noreferrer" target="_blank" class="">http://kitware.com/products/protraining.php</a><br class="">
><br class="">
> Please keep messages on-topic and check the ITK FAQ at:<br class="">
> <a href="http://www.itk.org/Wiki/ITK_FAQ" rel="noreferrer" target="_blank" class="">http://www.itk.org/Wiki/ITK_FAQ</a><br class="">
><br class="">
> Follow this link to subscribe/unsubscribe:<br class="">
> <a href="http://public.kitware.com/mailman/listinfo/insight-developers" rel="noreferrer" target="_blank" class="">http://public.kitware.com/mailman/listinfo/insight-developers</a><br class="">
> _______________________________________________<br class="">
> Community mailing list<br class="">
> <a href="mailto:Community@itk.org" class="">Community@itk.org</a><br class="">
> <a href="http://public.kitware.com/mailman/listinfo/community" rel="noreferrer" target="_blank" class="">http://public.kitware.com/mailman/listinfo/community</a><br class="">
<br class="">
-------------- next part --------------<br class="">
An HTML attachment was scrubbed...<br class="">
URL: <<a href="http://public.kitware.com/pipermail/insight-developers/attachments/20160117/188815c1/attachment-0001.html" rel="noreferrer" target="_blank" class="">http://public.kitware.com/pipermail/insight-developers/attachments/20160117/188815c1/attachment-0001.html</a>><br class="">
<br class="">
------------------------------<br class="">
<br class="">
Subject: Digest Footer<br class="">
<br class="">
_______________________________________________<br class="">
Insight-developers mailing list<br class="">
<a href="mailto:Insight-developers@itk.org" class="">Insight-developers@itk.org</a><br class="">
<a href="http://public.kitware.com/mailman/listinfo/insight-developers" rel="noreferrer" target="_blank" class="">http://public.kitware.com/mailman/listinfo/insight-developers</a><br class="">
<br class="">
<br class="">
------------------------------<br class="">
<br class="">
End of Insight-developers Digest, Vol 141, Issue 10<br class="">
***************************************************<br class="">
</blockquote></div><br class=""></div></div></div>
_______________________________________________<br class="">Powered by <a href="http://www.kitware.com/" class="">www.kitware.com</a><br class=""><br class="">Visit other Kitware open-source projects at<br class=""><a href="http://www.kitware.com/opensource/opensource.html" class="">http://www.kitware.com/opensource/opensource.html</a><br class=""><br class="">Kitware offers ITK Training Courses, for more information visit:<br class=""><a href="http://kitware.com/products/protraining.php" class="">http://kitware.com/products/protraining.php</a><br class=""><br class="">Please keep messages on-topic and check the ITK FAQ at:<br class="">http://www.itk.org/Wiki/ITK_FAQ<br class=""><br class="">Follow this link to subscribe/unsubscribe:<br class="">http://public.kitware.com/mailman/listinfo/insight-developers<br class=""></div></blockquote></div><br class=""></div></div>_______________________________________________<br class="">Powered by <a href="http://www.kitware.com" class="">www.kitware.com</a><br class=""><br class="">Visit other Kitware open-source projects at<br class=""><a href="http://www.kitware.com/opensource/opensource.html" class="">http://www.kitware.com/opensource/opensource.html</a><br class=""><br class="">Kitware offers ITK Training Courses, for more information visit:<br class="">http://kitware.com/products/protraining.php<br class=""><br class="">Please keep messages on-topic and check the ITK FAQ at:<br class="">http://www.itk.org/Wiki/ITK_FAQ<br class=""><br class="">Follow this link to subscribe/unsubscribe:<br class="">http://public.kitware.com/mailman/listinfo/insight-developers<br class=""></div></blockquote></div><br class=""></div></body></html>