[Insight-users] Problem with BoundingBox

Stephen R. Aylward aylward@unc.edu
Wed, 22 Jan 2003 17:14:37 -0500


--------------030507060601070709040307
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit


Thanks.

We can change the initial value to 
NumericTraits<valueType>::NonPositiveMin() and your problem should be fixed.

I will check the fix into cvs...

s

Parag Chandra wrote:

> I have a 2-D set of points that I want to compute the bounding box of. 
> Using itk::BoundingBox->ComputeBoundingBox() gives the correct values 
> for the first three points (xMin, xMax, yMin), but the fourth point 
> (yMax) is always 2.225e-308, the default value as returned by 
> NumericTraits<double>::min(). All the y-values in my point set are 
> negative, so of course, the following block:
>  
>         if ( point[i] > m_Bounds[2*i+1] )
>           {
>           m_Bounds[2*i+1] = point[i];
>           }
> will never be executed. Is this a bug that needs to be/has already 
> been addressed?
>  
> Thanks,
> -Parag


-- 
=======================================================================
Stephen R. Aylward, Ph.D.			www.cs.unc.edu/~aylward
Research Assistant Professor of Radiology		aylward@unc.edu
Adjunct Assistant Professor of Computer Science		  (919)966-9695



--------------030507060601070709040307
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title></title>
</head>
<body>
<br>
Thanks.<br>
<br>
We can change the initial value to NumericTraits&lt;valueType&gt;::NonPositiveMin()
and your problem should be fixed.<br>
<br>
I will check the fix into cvs...<br>
<br>
s<br>
<br>
Parag Chandra wrote:<br>
<blockquote type="cite"
 cite="mid001e01c2c260$e5260bc0$99221398@radonc.radonc.unc.edu">  
  <meta http-equiv="Content-Type" content="text/html; ">
 
  <meta content="MSHTML 6.00.2800.1126" name="GENERATOR">
 
  <style></style>  
  <div><font face="Arial" size="2">I have a 2-D set of points that I want
to compute  the bounding box of. Using itk::BoundingBox-&gt;ComputeBoundingBox()
gives the  correct values for the first three points (xMin, xMax, yMin),
but the fourth  point (yMax) is always 2.225e-308, the default value as returned
by  NumericTraits&lt;double&gt;::min(). All the y-values in my point set
are  negative, so of course, the following block:</font></div>
 
  <div>&nbsp;</div>
 
  <div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (  point[i] &gt; m_Bounds[2*i+1]
 )<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_Bounds[2*i+1] =  point[i];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  }<br>
  </font></div>
 
  <div><font face="Arial" size="2">will never be executed. Is this a bug
that needs to  be/has already been addressed?</font></div>
 
  <div>&nbsp;</div>
 
  <div><font face="Arial" size="2">Thanks,</font></div>
 
  <div><font face="Arial" size="2">-Parag</font></div>
</blockquote>
<br>
<pre class="moz-signature" cols="$mailwrapcol">-- 
=======================================================================
Stephen R. Aylward, Ph.D.			<a class="moz-txt-link-abbreviated" href="http://www.cs.unc.edu/~aylward">www.cs.unc.edu/~aylward</a>
Research Assistant Professor of Radiology		<a class="moz-txt-link-abbreviated" href="mailto:aylward@unc.edu">aylward@unc.edu</a>
Adjunct Assistant Professor of Computer Science		  (919)966-9695
</pre>
<br>
</body>
</html>

--------------030507060601070709040307--