[Insight-users] Possible bug in MinimumMaximumImageFilter and MinimumMaximumImageCalculator

Parag Chandra pchandra@radonc.unc.edu
Mon, 7 Apr 2003 14:39:14 -0400


This is a multi-part message in MIME format.

------=_NextPart_000_000A_01C2FD13.75EC1F90
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,

I think I've caught this before in StatisticsImageFilter, but neither of =
the two classes mentioned in the subject line seem to calculate the =
minimum value correctly for an image that contains negative values. I =
think the following two lines in both classes:

  m_Maximum =3D NumericTraits<InputPixelType>::min() ;
  m_Minimum =3D NumericTraits<InputPixelType>::max() ;

need to be changed to the following:

  m_Minimum =3D NumericTraits<RealType>::max();
  m_Maximum =3D NumericTraits<RealType>::NonpositiveMin();

-Parag

------=_NextPart_000_000A_01C2FD13.75EC1F90
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1141" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I think I've caught this before in=20
StatisticsImageFilter, but neither of the two classes mentioned in the =
subject=20
line seem to calculate the minimum value correctly for an image that =
contains=20
negative values. I think the following two lines in both =
classes:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; m_Maximum =3D=20
NumericTraits&lt;InputPixelType&gt;::min() ;<BR>&nbsp; m_Minimum =3D=20
NumericTraits&lt;InputPixelType&gt;::max() ;<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>need to be changed to the =
following:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; m_Minimum =3D=20
NumericTraits&lt;RealType&gt;::max();<BR>&nbsp; m_Maximum =3D=20
NumericTraits&lt;RealType&gt;::NonpositiveMin();<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>-Parag</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;</DIV></FONT></BODY></HTML>

------=_NextPart_000_000A_01C2FD13.75EC1F90--