How to display 16bit dicom image

  • Thread starter Thread starter Neeraj
  • Start date Start date
N

Neeraj

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
 
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.
 
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.
 
Bob Powell said:
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.
 
Hi
actually 16 bit Dicom Image is opening in c# when i apply the
Format:-System.Drawing.Imaging.PixelFormat.Format16bppRgb555,
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#.
 
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.
 
Back
Top