[Insight-users] RGB images from Visible Human Dataset
Luis Ibanez
luis . ibanez at kitware . com
Fri, 31 Oct 2003 16:43:54 -0500
Hi Stefan,
It's good to know that the data reordering
is working better now.
The mirror effect may be an issue that we have
with the PNG file format. Images may appear
up-side-down in PNG with respect to other formats.
One easy way for you to verify if the mirror
effect is only a PNG issue, is to save the color
image in MetaImage format. Simply provide a filename
with extension ".mhd" to the ImageFileWriter.
You can visualize MetaImages using the application
ImageViewer distributed with the InsightApplications
checkout. You simply need to check if in the resulting
image the nose is pointing up in the head sections.
If the nose happens to be pointing down, then you need
to reflect the image. There are several ways of doing
this reflection, for example
A) In the python script.. but note that is not simply
running the loop backwards because that will also
mirror left-right. You will have to do a double
loop like in the old days of image processing :-)
B) The best option: use the itkFlipImageFilter
http://www . itk . org/Insight/Doxygen/html/classitk_1_1FlipImageFilter . html
put this filter inbetween the reader and the writer.
The MetaImage header that you are using should be ok.
The header doesn't hold any information that could
reflect an image.
Please let us know what you find,
Thanks
Luis
------------------------
Stefan Lindenau wrote:
> Hi Luis,
>
> the several lengths are:
> RDATA: 167
> GDATA: 20
> BDATA: 167
>
> It is just as you expected. By choosing the 'rb' and 'wb' option while
> opening the files, all is going as expected.
> When I load the new reordered image in the itk and write it to the PNG I
> get a wonderful color image.
> The only problem is that the image is still mirror-inverted.
> Is this caused by another difference of the Visible Human Data? In this
> case I would just run the for-loop of the python script in the other
> direction.
>
> Otherwise something in my MetaImage Header must be wrong and I think it
> would be best to correct the Header.
>
> My MetaHeader:
> -------------------
> NDims = 2
> DimSize = 2048 1216
> ElementSpacing = 0.333 0.333
> Position = 0 0
> ElementByteOrderMSB = False
> ElementNumberOfChannels = 3
> ElementType = MET_UCHAR
> ElementDataFile = vw1262aRGB.raw
> -------------------
>
> It's just beginning to work and that's really cool.
>
> Thank You
> Stefan
>
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk . org
> http://www . itk . org/mailman/listinfo/insight-users
>