Thread Subject: 16-bit CT image (DICOM) to jpeg conversion ?

Subject: 16-bit CT image (DICOM) to jpeg conversion ?

From: Ganesh

Date: 19 Mar, 2010 20:07:02

Message: 1 of 4

Hi,
 I have a stack of 2D Ct images (16-bit) in DICOM format that I would like to convert into tiff or jpeg format.
When I read each one individually, the range of intensities goes from -1024 to 3000 (approx). As imwrite doesnot like negative intensities, I added 1024 to the value of intensity at every pixel uniformly. Now, imwrite writes a jpeg file, however, I am not able to open it using any standard software. Can you help.

Command used:
            imwrite(temp,file_out,'jpeg','bitdepth',16,'Quality',100,'Mode','lossless');

I chose jpeg just because writing to tiff, one would make the image 8-bit and thereby loose information.

Thanks,
Ganesh

Subject: 16-bit CT image (DICOM) to jpeg conversion ?

From: ImageAnalyst

Date: 19 Mar, 2010 21:04:23

Message: 2 of 4

You CAN have high bit depth tiff images - check the help again.

Subject: 16-bit CT image (DICOM) to jpeg conversion ?

From: Matthew Whitaker

Date: 19 Mar, 2010 22:53:04

Message: 3 of 4

"Ganesh " <nganesh76@hotmail.com> wrote in message <ho0lh6$ev3$1@fred.mathworks.com>...
> Hi,
> I have a stack of 2D Ct images (16-bit) in DICOM format that I would like to convert into tiff or jpeg format.
> When I read each one individually, the range of intensities goes from -1024 to 3000 (approx). As imwrite doesnot like negative intensities, I added 1024 to the value of intensity at every pixel uniformly. Now, imwrite writes a jpeg file, however, I am not able to open it using any standard software. Can you help.
>
> Command used:
> imwrite(temp,file_out,'jpeg','bitdepth',16,'Quality',100,'Mode','lossless');
>
> I chose jpeg just because writing to tiff, one would make the image 8-bit and thereby loose information.
>
> Thanks,
> Ganesh

I think your problem is that most standard software can not read lossless jpeg which is actually a pretty obscure part of the JPEG standard

To illustrate:
Y = dicomread('CT-MONO2-16-ankle.dcm');
Y = mat2gray(Y);
imshow(Y,[]);
imwrite(Y,'save_loosless.jpg','Quality',100,'Mode','lossless');
imwrite(Y,'save_lossy.jpg','Quality',100,'Mode','lossy');


Opening the lossless file will fail on most commercial software while the lossy will open.

Hope this helps
Matt W.

Subject: 16-bit CT image (DICOM) to jpeg conversion ?

From: Matthew Whitaker

Date: 19 Mar, 2010 23:04:05

Message: 4 of 4

"Ganesh " <nganesh76@hotmail.com> wrote in message <ho0lh6$ev3$1@fred.mathworks.com>...
> Hi,
> I have a stack of 2D Ct images (16-bit) in DICOM format that I would like to convert into tiff or jpeg format.
> When I read each one individually, the range of intensities goes from -1024 to 3000 (approx). As imwrite doesnot like negative intensities, I added 1024 to the value of intensity at every pixel uniformly. Now, imwrite writes a jpeg file, however, I am not able to open it using any standard software. Can you help.
>
> Command used:
> imwrite(temp,file_out,'jpeg','bitdepth',16,'Quality',100,'Mode','lossless');
>
> I chose jpeg just because writing to tiff, one would make the image 8-bit and thereby loose information.
>
> Thanks,
> Ganesh

Also as ImageAnalyst says you can save 16 bit in tiff:

Y = dicomread('CT-MONO2-16-ankle.dcm');
Y = im2uint16(Y);
imwrite(Y,'lossless.tif','Compression','none')
Y2 = imread('lossless.tif');
isequal(Y,Y2)

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
lossless tiff Matthew Whitaker 19 Mar, 2010 19:09:07
lossless jpeg Matthew Whitaker 19 Mar, 2010 18:54:08
rssFeed for this Thread

Contact us at files@mathworks.com