[Insight-developers] VectorLinearInterpolateImageFunction

Miller, James V (Research) millerjv at crd.ge.com
Wed, 12 May 2004 10:25:27 -0400


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C4382C.F86A08DC
Content-Type: text/plain;
	charset="iso-8859-1"

The documentation for VectorLinearInterpolateImageFunction says the
OutputType is
Vector<double, dimension>.  But it really gets the OutputType from its
superclass.
 
Its superclass, VectorInterpolateImageFunction says the OutputType is really
FixedArray<RealType, Dimension> (where RealType is the realtype of the input
image pixel component type).  
 
I want to perform linear interpolation on a image of Vector<float, 2>.  But
the return type from Evaluate(), gives me a FixedArray<double, 2>. Of
course, we have no conversion
operators that will take a FixedArray<double, 2> to a Vector<float, 2>.
 
I imagine in general, we cannot have the return type of Evaluate() be the
pixel type of the 
input image.  If someone has an image of Vector<short, 2> the interpolated
value should probably be a Vector<RealType, 2>.
 
However, since my image was already of Vector<float, 2>, I expected the
interpolated
value to be a Vector<float, 2>. I wasn't expecting to get a FixedArray. 
 
That being said, I understand why it written this way. As it is written now,
the VectorLinearInterpolateImageFunction can be applied to an image of
anything that supports the API of FixedArray (Vector, CovariantVector,
Point).  But the output is always a FixedArray<double, D>. (I assumed with a
name of VectorLinearInterpolateImageFunction, that the image function
interpolated images of Vectors.)
 
But if we wanted the output to be the same subclass of FixedArray with a
different component type (Vector<short, 2) --> Vector<RealType, 2>) then we
would probably need
separate ImageFunctions to interpolate Vectors, CovariantVectors, and
Points. Or we could use some scary non-portable template magic.
 
Aside from fixing the documentation, does anyone have any other suggestions
before I dive into compiler magic?
 

Jim Miller 
_____________________________________
Visualization & Computer Vision
GE Research
Bldg. KW, Room C218B
P.O. Box 8, Schenectady NY 12301

millerjv at research.ge.com <mailto:millerjv at research.ge.com> 

james.miller at research.ge.com
(518) 387-4005, Dial Comm: 8*833-4005, 
Cell: (518) 505-7065, Fax: (518) 387-6981 

 

------_=_NextPart_001_01C4382C.F86A08DC
Content-Type: text/html;
	charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 6.00.2800.1276" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Verdana size=2><SPAN class=803290514-12052004>The documentation 
for VectorLinearInterpolateImageFunction says the OutputType 
is</SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN class=803290514-12052004>Vector&lt;double, 
dimension&gt;.&nbsp; But it really gets the OutputType from its 
superclass.</SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN 
class=803290514-12052004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Verdana size=2><SPAN class=803290514-12052004>Its superclass, 
VectorInterpolateImageFunction says the OutputType is really 
FixedArray&lt;RealType, Dimension&gt; (where RealType is the realtype of the 
input image pixel component type).&nbsp; </SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN 
class=803290514-12052004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Verdana size=2><SPAN class=803290514-12052004>I want to perform 
linear interpolation on a image of Vector&lt;float, 2&gt;.&nbsp; But the return 
type from Evaluate(), gives me a FixedArray&lt;double, 2&gt;. Of course, we have 
no conversion</SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN class=803290514-12052004>operators that 
will take a FixedArray&lt;double, 2&gt; to a Vector&lt;float, 
2&gt;.</SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN 
class=803290514-12052004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Verdana size=2><SPAN class=803290514-12052004>I imagine in 
general, we cannot have the return type of Evaluate() be the pixel type of the 
</SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN class=803290514-12052004>input image.&nbsp; 
If someone has an image of Vector&lt;short, 2&gt; the interpolated value should 
probably be a Vector&lt;RealType, 2&gt;.</SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN 
class=803290514-12052004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Verdana size=2><SPAN class=803290514-12052004>However, since my 
image was already of Vector&lt;float, 2&gt;, I expected the 
interpolated</SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN class=803290514-12052004>value to be a 
Vector&lt;float, 2&gt;. I wasn't expecting to get a FixedArray. 
</SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN 
class=803290514-12052004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Verdana size=2><SPAN class=803290514-12052004>That being said, I 
understand why it written this way. </SPAN></FONT><FONT face=Verdana 
size=2><SPAN class=803290514-12052004>As it is written now, the 
VectorLinearInterpolateImageFunction can be applied to an </SPAN></FONT><FONT 
face=Verdana size=2><SPAN class=803290514-12052004>image of anything that 
supports the API of FixedArray (Vector, CovariantVector, Point).&nbsp; 
</SPAN></FONT><FONT face=Verdana size=2><SPAN class=803290514-12052004>But the 
output is always a FixedArray&lt;double, D&gt;. (I assumed with a name of 
VectorLinearInterpolateImageFunction, that the image function interpolated 
images of Vectors.)</SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN 
class=803290514-12052004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Verdana size=2><SPAN class=803290514-12052004>But if we wanted 
the output to be the same subclass of FixedArray with a different component type 
(Vector&lt;short, 2) --&gt; Vector&lt;RealType, 2&gt;) then we would probably 
need</SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN class=803290514-12052004>separate 
ImageFunctions to interpolate Vectors, CovariantVectors, and Points. Or we could 
use some scary non-portable template magic.</SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN 
class=803290514-12052004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Verdana size=2><SPAN class=803290514-12052004>Aside from fixing 
the documentation, does anyone have any other suggestions before I dive into 
compiler magic?</SPAN></FONT></DIV>
<DIV><FONT face=Verdana size=2><SPAN 
class=803290514-12052004></SPAN></FONT>&nbsp;</DIV>
<DIV>
<P style="MARGIN: 0in 0in 0pt"><B><SPAN 
style="COLOR: navy; FONT-FAMILY: 'Comic Sans MS'">Jim Miller</SPAN></B> 
<BR><B><I><SPAN 
style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: Arial">_____________________________________</SPAN></I></B><BR><EM><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Arial">Visualization &amp; 
Computer Vision</SPAN></EM><I><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Arial"><BR><EM>GE 
Research</EM><BR><EM>Bldg. KW, Room C218B</EM><BR><EM>P.O. Box 8, Schenectady NY 
12301</EM><BR><BR></SPAN></I><EM><U><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: blue"><A 
href="mailto:millerjv at research.ge.com">millerjv at research.ge.com</A></SPAN></U></EM></P>
<P style="MARGIN: 0in 0in 0pt"><EM><U><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: blue">james.miller at research.ge.com</SPAN></U></EM><BR><I><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Arial">(518) 387-4005, Dial 
Comm: 8*833-4005, </SPAN></I><BR><I><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Arial">Cell: (518) 505-7065, 
Fax: (518) 387-6981</SPAN></I> </P></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

------_=_NextPart_001_01C4382C.F86A08DC--