[Insight-developers] Reading vector images

Miller, James V (Research) millerjv at crd.ge.com
Wed, 12 May 2004 17:32:36 -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_01C43868.A4B05F74
Content-Type: text/plain;
	charset="iso-8859-1"

I just tried to read an image of two component vectors into ITK using the
Meta format.
 
I get all zeros.
 
It looks to me that in ImageFileReader::GenerateData() there is a test for 
 
      m_ImageIO->GetPixelType() == typeid(TOutputImage::PixelType) 
 
TOutputImage::PixelType should be Vector<float, 2>
 
m_ImageIO->GetPixelType() returns float
 
The above check for equality fails and a data conversion occurs.  The result
is all zeros.
 
It looks as though people have asked this on the list before but I did not
find a response.
I seem to recall people reading vectors as RGB pixels.
 
Perhaps if I add a GetPixelType() method to MetaImageIO that checks the
m_PixelType to be VECTOR?
 
 
 

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_01C43868.A4B05F74
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><SPAN class=950332521-12052004><FONT face=Verdana size=2>I just tried to 
read an image of two component vectors into ITK using the Meta 
format.</FONT></SPAN></DIV>
<DIV><SPAN class=950332521-12052004><FONT face=Verdana 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=950332521-12052004><FONT face=Verdana size=2>I get all 
zeros.</FONT></SPAN></DIV>
<DIV><SPAN class=950332521-12052004><FONT face=Verdana 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=950332521-12052004><FONT face=Verdana size=2>It looks to me 
that in ImageFileReader::GenerateData() there is a test for </FONT></SPAN></DIV>
<DIV><SPAN class=950332521-12052004><FONT face=Verdana 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=950332521-12052004><FONT face=Verdana 
size=2>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;m_ImageIO-&gt;GetPixelType() == 
typeid(TOutputImage::PixelType) </FONT></SPAN></DIV>
<DIV><SPAN class=950332521-12052004><FONT face=Verdana 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=950332521-12052004><FONT face=Verdana 
size=2>TOutputImage::PixelType should be Vector&lt;float, 
2&gt;</FONT></SPAN></DIV>
<DIV><SPAN class=950332521-12052004><FONT face=Verdana 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=950332521-12052004><FONT face=Verdana 
size=2>m_ImageIO-&gt;GetPixelType() returns float</FONT></SPAN></DIV>
<DIV><SPAN class=950332521-12052004><FONT face=Verdana 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=950332521-12052004><FONT face=Verdana size=2>The above check 
for equality fails and a data conversion occurs.&nbsp; The result is all 
zeros.</FONT></SPAN></DIV>
<DIV><SPAN class=950332521-12052004><FONT face=Verdana 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=950332521-12052004><FONT face=Verdana size=2>It looks as though 
people have asked this on the list before but I did not find a 
response.</FONT></SPAN></DIV>
<DIV><SPAN class=950332521-12052004><FONT face=Verdana size=2>I seem to recall 
people reading vectors as RGB pixels.</FONT></SPAN></DIV>
<DIV><SPAN class=950332521-12052004><FONT face=Verdana 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=950332521-12052004><FONT face=Verdana size=2>Perhaps if I add a 
GetPixelType() method to MetaImageIO that checks the m_PixelType to be 
VECTOR?</FONT></SPAN></DIV>
<DIV><SPAN class=950332521-12052004><FONT face=Verdana 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=950332521-12052004><FONT face=Verdana 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=950332521-12052004><FONT face=Verdana 
size=2></FONT></SPAN>&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_01C43868.A4B05F74--