pixel values for image created with dicomwrite are different from the matrix pixel values?

I have a 3D matrix (say X) and want to write it as a 3D dicom, Y.dcm with meta data, meta (acquired using dicominfo on some other dicom file)
I conver my 3D matrix, X, into a 4D matrix Y (because the third dimension value of 1 is needed for photometric representation)
Here is the code : dicomwrite(Z,'name',meta,'CreateMode','Copy','MultiframeSingleFile',true) ;
This command WORKS, and gives me a dicom image. HOWEVER, when I look at the pixel intensities (using some other software or using dicomread to read the created dicom) I find that the pixel intensities DO NOT MATCH.
I'm using MRI dicoms . ..... Any thoughts? Suggestions? etc?

3 Comments

I have the same problem. did you find any answer for that?
Sorry it's been a while. I think Dicom images are int16 (or int32) where as matlab marix is in double so u need to convert from double to int before you use dicomwite.
Hope this helps
In general dicom images (at least CT images) will be saved in uint16, with only 12 bits used. The exact specifications are stored in the dicom header, see the dicom doc.

Sign in to comment.

Answers (0)

Categories

Products

Tags

Asked:

on 1 Apr 2014

Commented:

Rik
on 5 Oct 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!