<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE></TITLE>
<META content="MSHTML 6.00.2900.2604" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=857355820-18052005><FONT face=Arial color=#0000ff
size=2>FixedArray is the superclass of Vector. Vectors (and Points and
Covariant vector) add semantics to a FixedArray. For instance, a Vector is used
to represent a direction. A Point is used to represent a position. A
FixedArray is just a collection of values with not
semantics.</FONT></SPAN></DIV>
<DIV><SPAN class=857355820-18052005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=857355820-18052005></SPAN> </DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Bradley Lowekamp
[mailto:blowekamp@mail.nih.gov]<BR><B>Sent:</B> Wednesday, May 18, 2005 12:33
PM<BR><B>To:</B> Miller, James V (Research)<BR><B>Cc:</B>
insight-users@itk.org<BR><B>Subject:</B> Re: [Insight-users] Bug with fix Mean
Image Filter<BR><BR></FONT></DIV><BR>
<P><I>it.Set( static_vast<OutputPixelType>(sum * ( 1.0 /
double(neighbothoodSize))) );</I> </P><BR>
<P>That should work too. But I think that it is an oversite that
NumericTraits<RGBPixel> does not have ScalarRealType. </P><BR>
<P>With regards to the added operator to RGBPixel (and likely for RGBAPixel
too), I am still confused about the differences between FixedArray and Vector
classes. I think I read in the Software Guide instances where each were used,
though I can't seemed to find an example of FixedArray at the moment. The
Vector class provides many math operators so I also don't understand why they
specific pixel types were not derived from the Vector class. </P><BR><BR>
<P>Thanks. </P><BR>
<P>======================================================== </P>
<P>Bradley Lowekamp </P>
<P>Management Systems Designers Contractor for </P>
<P>Office of High Performance Computing and Communications </P>
<P>National Library of Medicine </P>
<P>'blowekamp@mail.nih.gov </P><BR><BR>
<P>On May 18, 2005, at 9:22 AM, Miller, James V ((Research)) wrote: </P><BR>
<P><FONT face=Arial color=#0000ff size=2>Can you use:</FONT> </P>
<P> </P>
<P> </P>
<P><I>A better option is probably to add scalar division (by a floating point
type) to the RGBPixel type.</I> </P>
<P> </P>
<P><I>Jim</I> </P>
<P><FONT face=Tahoma size=2>-----Original Message-----</FONT> </P>
<P><B><FONT face=Tahoma size=2>From:</FONT></B><B></B><B></B><FONT face=Tahoma
size=2> insight-users-bounces+millerjv=crd.ge.com@itk.org
[mailto:insight-users-bounces+millerjv=crd.ge.com@itk.org]</FONT><B><FONT
face=Tahoma size=2>On Behalf Of</FONT></B> <FONT face=Tahoma size=2>Bradley
Lowekamp</FONT> </P>
<P><B><FONT face=Tahoma size=2>Sent:</FONT></B><B></B><B></B><FONT face=Tahoma
size=2> Tuesday, May 17, 2005 4:58 PM</FONT> </P>
<P><B><FONT face=Tahoma size=2>To:</FONT></B><B></B><B></B><FONT face=Tahoma
size=2> insight-users@itk.org</FONT> </P>
<P><B><FONT face=Tahoma size=2>Subject:</FONT></B><B></B><B></B><FONT
face=Tahoma size=2> [Insight-users] Bug with fix Mean Image Filter</FONT>
</P><BR><BR>
<P>I was trying to use mean Image Filter with RGBPixel Type. This failed
because this pixel type did not supported the needed operator. This was the
line </P><BR><BR><BR>
<P><I>// get the mean value</I> </P><BR>
<P><I>it.Set( static_vast<OutputPixelType>(sum /
double(neighbothoodSize)) );</I> </P><BR><BR><BR>
<P>RGBPixels do not support the divide by scalars operator. Perhaps because
this type may have only been designed to used with unsigned chars? Any way the
fix I coded up was: </P><BR><BR>
<P>// get the mean value<I></I> </P><BR>
<P><I>it.Set( static_vast<OutputPixelType>(sum *
(1.0/NumericTraits<OutputPixelType>::ScalarRealType(neighbothoodSize)))
);</I> </P><BR><BR><BR>
<P>However, that didn't work because NumericTraits<RGBPixel<unsigned
char>> does not have a ScalarRealType member, like every other numeric
traits. I actually am using RGBPixelType<double> but I implemented the
numeric traits my self. </P><BR><BR>
<P>Thanks. </P><BR><BR><BR><BR>
<P>======================================================== </P><BR>
<P>Bradley Lowekamp </P><BR>
<P>Management Systems Designers Contractor for </P><BR>
<P>Office of High Performance Computing and Communications </P><BR>
<P>National Library of Medicine </P><BR>
<P>'blowekamp@mail.nih.gov</P></BLOCKQUOTE></BODY></HTML>