[Insight-developers] IO modifications

Miller, James V (Research) millerjv at crd.ge.com
Fri, 14 May 2004 11:32:12 -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_01C439C8.A09C965A
Content-Type: text/plain;
	charset="iso-8859-1"

I modified the IO mechanisms to distinguish an ImageIO PixelType from a
ComponentType. 
 
PixelType can be SCALAR, VECTOR, COVARIANTVECTOR, POINT, OFFSET, RGB, RGBA
 
ComponentType can be CHAR, UCHAR, SHORT, USHORT, INT, UINT, ....
 
The ImageFileReader now uses the ComponentType and NumberOfComponents to
determine whether an ImageIO buffer is compatible with a itkImage  as
opposed to PixelType.
 
Previously, pixel type and component type were semantically mixed.  By
separating them formally, the automated conversions in ImageFileReader can
use semantically specific conversions for vector to scalar and scalar to
vector conversions.  Currently, the buffer conversion assumes multiple
component pixels are RGB.  So vector to scalar conversions essentially
convert to luminance.  By using the specified context of PixelType, an RGB
to SCALAR conversion could use a luminance conversion while a VECTOR to
SCALAR conversion could use vector magnitude.
 
I also removed a bunch of ImageIOBase code that we were not using. I also
removed duplicated code in the ImageIO subclasses where the superclass
implementations will work fine.  
 
All the IO tests currently run. (Plus we can read MetaImages with multiple
components). But if our IO tests are not exhaustive, you may still run into
problems with specific files.  Just let me know if you run into a problem
and I'll track it down.  If you can send me the data that is failing, that
will help of course.  Most run-time compatibility problems I found while
debugging were due to missing the use of PixelType in an ImageIO where I
needed to have a ComponentType.
 
 

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_01C439C8.A09C965A
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=679371315-14052004><FONT face=Verdana size=2>I modified the IO 
mechanisms to distinguish an ImageIO PixelType from a ComponentType. 
</FONT></SPAN></DIV>
<DIV><SPAN class=679371315-14052004><FONT face=Verdana 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=679371315-14052004><FONT face=Verdana size=2>PixelType can be 
SCALAR, VECTOR, COVARIANTVECTOR, POINT, OFFSET, RGB, RGBA</FONT></SPAN></DIV>
<DIV><SPAN class=679371315-14052004><FONT face=Verdana 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=679371315-14052004><FONT face=Verdana size=2>ComponentType can 
be CHAR, UCHAR, SHORT, USHORT, INT, UINT, ....</FONT></SPAN></DIV>
<DIV><SPAN class=679371315-14052004><FONT face=Verdana 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=679371315-14052004><FONT face=Verdana size=2>The 
ImageFileReader now uses the ComponentType and NumberOfComponents to determine 
whether an ImageIO buffer is compatible with a itkImage&nbsp; as opposed to 
PixelType.</FONT></SPAN></DIV>
<DIV><SPAN class=679371315-14052004><FONT face=Verdana 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=679371315-14052004><FONT face=Verdana size=2>Previously, pixel 
type and component type were semantically mixed.&nbsp; By separating them 
formally, the automated conversions in ImageFileReader can use semantically 
specific conversions for vector to scalar and scalar to vector 
conversions.&nbsp; Currently, the buffer conversion assumes multiple component 
pixels are RGB.&nbsp; So vector to scalar conversions essentially convert to 
luminance.&nbsp; By using the specified context of PixelType, an RGB 
to&nbsp;SCALAR conversion could use a luminance conversion while a VECTOR to 
SCALAR conversion could use vector magnitude.</FONT></SPAN></DIV>
<DIV><SPAN class=679371315-14052004><FONT face=Verdana 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=679371315-14052004><FONT face=Verdana size=2>I also removed a 
bunch of ImageIOBase code that we were not using. I also removed duplicated code 
in the ImageIO subclasses where the superclass implementations will work 
fine.&nbsp; </FONT></SPAN></DIV>
<DIV><SPAN class=679371315-14052004><FONT face=Verdana 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=679371315-14052004><FONT face=Verdana size=2>All the IO tests 
currently run. (Plus we can read MetaImages with multiple components). But if 
our IO tests are not exhaustive, you may still run into problems with specific 
files.&nbsp; Just let me know if you run into a problem and I'll track it 
down.&nbsp; If you can send me the data that is failing, that will help of 
course.&nbsp; Most run-time compatibility problems I found while debugging were 
due to missing the use of PixelType in an ImageIO where I needed to have a 
ComponentType.</FONT></SPAN></DIV>
<DIV><SPAN class=679371315-14052004><FONT face=Verdana 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=679371315-14052004><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_01C439C8.A09C965A--