[Insight-developers] PNG image index

Miller, James V (Research) millerjv@crd.ge.com
Tue, 25 Feb 2003 08:31:04 -0500


Unfortunately, the PNG and RAW readers follow the VTK convention
which specifies that the first pixel in the image buffer is the 
lower left corner. VTK does this so that imaging operations are
trivially aligned with the graphics coordinates.

I am not sure that this is the right thing for ITK. I want all the
readers (PNG, RAW, Meta, DICOM) to work consistently. Since ITK
is a medical imaging toolkit, I propose that ITK follow the 
conventions from the field (for instance, have all readers do what 
ever DICOM would do, etc.).  Will and I have talked about this a 
few times but haven't come to a consensus.

Jim




> -----Original Message-----
> From: Tolga Tasdizen [mailto:tolga@sci.utah.edu]
> Sent: Monday, February 24, 2003 8:27 PM
> To: insight-developers@public.kitware.com
> Subject: [Insight-developers] PNG image index
> 
> 
> Hi,
> I noticed that the y-index for images input with the PNG reader is 
> reversed, i.e. y=0 refers to the bottom row of an image (as viewed in 
> xv). Apparently the PNG writer reverses it again so the output is not 
> flipped.But, if I set rows 0 to 100 to all black pixels, in 
> the output 
> it is the bottom 100 rows not the top 100 that are black. Is there a 
> reason for this?
> 
> Tolga
> 
> 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-developers
>