[Insight-developers] DeformableRegistration6 Example failing : min() and Schizophrenia

Luis Ibanez luis.ibanez at kitware.com
Fri Oct 8 12:56:58 EDT 2004


Well, we are inheriting

   NumericTraits<float>   from  vcl_numeric_limits<float>

and we inherit their definition of min(),
that comes from std::numeric_limits and it
is defined (at least in gcc) as __FLT_MIN__


Is there any drawback in setting our own definition
of float, double min() in itkNumericTraits ?

We are already doing so for other types: char, unsigned char...



     Luis


----------------------------------
Miller, James V (Research) wrote:

> It's not a vcl issue.  It's a std::numeric_limits problem.
> 
> 
> 
> -----Original Message-----
> From: Luis Ibanez [mailto:luis.ibanez at kitware.com]
> Sent: Friday, October 08, 2004 11:50 AM
> To: Miller, James V (Research)
> Cc: Insight Developers List
> Subject: Re: [Insight-developers] DeformableRegistration6 Example
> failing : min() and Schizophrenia
> 
> 
> 
> This seems to be because VXL defined "min()" in this
> 'particular' way in vcl_numeric_limits and ITK inherited
> this definition in the NumericTraits ?
> 
> It seems that they used "min()" when they meant the
> "SmallestPositive()" number.
> 
> 
> E.g. for float, they use
> 
>        min() == 1.175 e-38.
> 
> and for double they use
> 
>        min() == 2.22 e-308
> 
> 
> 
> Nothing prevent us from skipping the vcl definition,
> and doing the right thing in itkNumericTraits...
> 
> 
>    Luis
> 
> 
> 
> --------------------------------
> Miller, James V (Research) wrote:
> 
> 
>>The problem is min() on signed integral types is the negative value in
>>dynamic range, min() on unsigned integral types is zero (still the 
>>minimum of the dynamic range) BUT min() ON FLOATING POINT NUMBERS IS THE
>>"Minimum positive normalized value"!!!
>>
>>UGGH
>>
>>
>>-----Original Message-----
>>From: Luis Ibanez [mailto:luis.ibanez at kitware.com]
>>Sent: Friday, October 08, 2004 10:03 AM
>>To: Lorensen, William E (Research)
>>Cc: Insight-developers (E-mail)
>>Subject: Re: [Insight-developers] DeformableRegistration6 Example
>>failing
>>
>>
>>
>>Bill,
>>
>>Thanks for tracking it down.
>>
>>I was naively assuming that min() was returning
>>the actual negative value.
>>
>>maybe we should rename "min()" as "PositiveMin()"
>>so we have
>>
>>
>>        PositiveMin();       and
>>        NonpositiveMin();
>>
>>
>>
>>    Luis
>>
>>
>>--------------------------------------
>>Lorensen, William E (Research) wrote:
>>
>>
>>
>>>Found it! You where using min() instead of NonpositiveMin(). I'll check it
>>>in oncc I run the tests.
>>>
>>>Bill
>>>
>>>-----Original Message-----
>>>From: Lorensen, William E (Research) [mailto:lorensen at crd.ge.com]
>>>Sent: Thursday, October 07, 2004 3:05 PM
>>>To: 'Luis Ibanez'
>>>Cc: Insight-developers (E-mail)
>>>Subject: [Insight-developers] DeformableRegistration6 Example failing
>>>
>>>
>>>Luis,
>>>The subject example has been failing for agout 9 days. This coincides with
>>>your changes to the BSplineDeformableTransform. However, I can't see how
>>>your changes could affect the results. I checked out the prior version and
>>>got the same bad results.
>>>
>>>Then I checkedout a prior verion of itkResampleImageFilter.txx and
>>
>>rebuilt,
>>
>>
>>>I get the good old answers. I think the clamping logic is flawed. I'll
>>
>>track
>>
>>
>>>it down unless you would rather do it.
>>>
>>>Bill
>>>
>>>_______________________________________________
>>>Insight-developers mailing list
>>>Insight-developers at itk.org
>>>http://www.itk.org/mailman/listinfo/insight-developers
>>>_______________________________________________
>>>Insight-developers mailing list
>>>Insight-developers at itk.org
>>>http://www.itk.org/mailman/listinfo/insight-developers
>>>
>>>
>>
>>
>>
>>
>>
>>_______________________________________________
>>Insight-developers mailing list
>>Insight-developers at itk.org
>>http://www.itk.org/mailman/listinfo/insight-developers
>>
>>
> 
> 
> 
> 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers
> 
> 






More information about the Insight-developers mailing list