By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,777 Members | 1,499 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,777 IT Pros & Developers. It's quick & easy.

How to display 16bit dicom image

P: n/a
hi
I am working on dicom viewer. 8 bit raw dicom image working
properly.But 16 bit Dicom image is not showing.What Should i have to
do.You have any idea about That to convert it in 8bit .
regards
Neeraj

May 18 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Unfortunately the 16 bit image formats in GDI+ are all broken.

You will have to open the image, read it byte for byte and then write it to
a newly created image, perhaps a GIF in your case.

See the GDI+ FAQ for info on the LockBits method which will be essential and
the GIF palette article which will enable you to create a custom monochrome
palette.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Neeraj" <kn*******@gmail.com> wrote in message
news:11*********************@y43g2000cwc.googlegro ups.com...
hi
I am working on dicom viewer. 8 bit raw dicom image working
properly.But 16 bit Dicom image is not showing.What Should i have to
do.You have any idea about That to convert it in 8bit .
regards
Neeraj

May 18 '06 #2

P: n/a
Unfortunately the 16 bit image formats in GDI+ are all broken.

You will have to open the image, read it byte for byte and then write it to
a newly created image, perhaps a GIF in your case.

See the GDI+ FAQ for info on the LockBits method which will be essential and
the GIF palette article which will enable you to create a custom monochrome
palette.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Neeraj" <kn*******@gmail.com> wrote in message
news:11*********************@y43g2000cwc.googlegro ups.com...
hi
I am working on dicom viewer. 8 bit raw dicom image working
properly.But 16 bit Dicom image is not showing.What Should i have to
do.You have any idea about That to convert it in 8bit .
regards
Neeraj

May 18 '06 #3

P: n/a
"Bob Powell [MVP]" <bob@_spamkiller_.bobpowell.net> wrote:
Unfortunately the 16 bit image formats in GDI+ are all broken.
You will have to open the image, read it byte for byte and then write it to
a newly created image, perhaps a GIF in your case.
See the GDI+ FAQ for info on the LockBits method which will be essential and
the GIF palette article which will enable you to create a custom monochrome
palette.


I'm suspicious of a recommendation to use LockBits and read it byte
for byte. (But also I didn't understand the original question).

Bob, you say that the 16 bit formats are broken. Does that suggest
that the 32bit formats work, and that the original poster could have
done what they wanted if it were 32bit rather than 16bit?

If so, a better answer would be to use BitBlt to convert the 16bit
image to 32bit, and then go from there. After all, 16->32bit
conversions are already built into Windows and are very fast.

--
Lucian
May 18 '06 #4

P: n/a
Hi
actually 16 bit Dicom Image is opening in c# when i apply the
Format:-System.Drawing.Imaging.PixelFormat.Format16bppRgb5 55,
but output image is Not as good in the other commercial viewer images
..so it will be great if you can help me by providing a code snippet in
c# ,or please tell me how to convert from 16-bit to 32 bit.Please note
that i am new to dicom, and also as lucian suggested how to use BitBit
equivalent in c#.

May 23 '06 #5

P: n/a
Hi friends.
I just want to say that Instead Of Converting 16bit to 32bit is more
complicated than Converting into 64bit .
I already tried it and its works properly.and After using unsafe it is
fast also.

May 24 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.