[Insight-developers] ImageIO image orientations

Miller, James V (Research) millerjv at crd.ge.com
Thu Jul 29 11:10:27 EDT 2004


I just entered a bug into the bug tracker wrt to the ImageIO objects and
image orientation.
 
http://www.itk.org/Bug/bug.php?op=show
<http://www.itk.org/Bug/bug.php?op=show&bugid=1013&pos=3> &bugid=1013&pos=3
 
The issue is that if you load an image in one file format, write it in
another file format, the output image may appear "flipped".  
 
DICOM, JPEG, and PNG specify the first pixel in an image as the upper left
corner of the image.
 
Analyze and VTK specify the first pixel in an image as the lower left corner
of the image.
 
I am not sure what the other formats specify.
 
As it currently stands, all the ImageIO objects (seem to) make the image in
memory mirror the order of the image on disk and make the image on disk
mirror the order of the image in memory.  In other words, the first pixel in
the ITK image will be whatever the first pixel is in the image format (which
may be the upper left or the lower left).
 
If your program reads and writes images in the same format, this doesn't
matter.  But if you read an image in one format and write it in another, the
image may be implictly flipped. In other words, if you read a DICOM image
and write it out in Analyze format, then you load the output image into
Analyze, it will appear upside down. 
 
Do we 

1.	want to adopt a convention that ITK images in memory always have the
first pixel as the upper left pixel?
2.	want to modify the ImageIO objects that need to flip the data before
the 1.8 release?

 

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 

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.itk.org/mailman/private/insight-developers/attachments/20040729/df464921/attachment.htm


More information about the Insight-developers mailing list