[Insight-users] Reading and writing 16bit grayscale images

Sims Richard (RKB) Clinical Scientist Richard.Sims at uhcw.nhs.uk
Tue Feb 20 09:18:54 EST 2007


Hi

 

I am using the example code ImageReadCastWrite.cxx from /ITK/Examples/IO/ to
read uint16 data in the form of a raw data file and attempting to write a
uint16 dcm file. It appears to work ok but when I attempt to visualise the
contents of the dcm file there is a problem with the pixel values. 

 

I edited the original example code to change the following line:

 

filter->SetOutputMaximum( 255 );

 

to:

 

filter->SetOutputMaximum( 65535 );

 

to ensure that the output is 16bit and not 8bit... but this unfortunately
doesn't change the dcm file - it's the same size and the value remains as
uint8.

 

If I convert the raw data file to uint8 at the very beginning, and leave the
filter maximum at 255, the dcm file looks fine.

 

Can anyone help? Am I missing something simple?

 

Thanks in advance,

Richard.

 

 

 

 

DISCLAIMER: This e-mail and any attachments hereto are confidential and may
contain proprietary information or be legally privileged. This e-mail is for
the exclusive use of the intended recipient(s) only. If you are not the
intended recipient(s) you must not use, copy, print or rely on this message
or any attachment or disclose the content to any other person. If you have
received this e-mail in error please notify the author by replying to this
e-mail or contact us on info at uhcw.nhs.uk. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20070220/68fa6ce2/attachment.htm


More information about the Insight-users mailing list