[Insight-users] RGB images from Visible Human Dataset

Stefan Lindenau stefan . lindenau at gmx . de
Mon, 03 Nov 2003 16:33:26 -0500


Hi Luis,

ok I have just tried what you proposed and used the Image viewer to have 
a look a at the metaImage of the output. The image is just upside down.

As I have used the ImageViewer the first time, I also had a look at the 
"input" data and this one is upside down too. So I will just use the 
FlipImageFilter for my further approaches.

Thank you
stefan

Luis Ibanez wrote:

>
>
> 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
>>
>
>
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk . org
> http://www . itk . org/mailman/listinfo/insight-users
>
>