Hi
I am trying to extract 16 bit image data from http://sf.anu.edu.au/~acl900/VolumeData/test.dcm .
Using ImageMagick 6.5.8-Q16 on windows, identify.exe reports 16bit depth, but imdisplay.exe
displays only 8bit version of the image. It seems dicom windowing is applied to the data before display as
well as before image.write(). I am using Magick++.
I have been able to extract 16 bit data from the file using version 6.2.9, but that version has a memory leak
(atleast while reading dicom files).
Thanks,
Ajay Limaye
extract 16bit data from dicom
Re: extract 16bit data from dicom
Add
- defineValue( "dcm", "display-range", "reset");
Re: extract 16bit data from dicom
Thanks for the immediate reply.
I must be doing something very silly, as I am still not extracting
the actual 16-bit data. Had a look at dcm.c and found that
setting "dcm:display-range" to "reset", sets window_width to 0,
which will give me exactly what I want.
This is what my code looks like (tmp is an unsigned char array):
Cheers,
Ajay
I must be doing something very silly, as I am still not extracting
the actual 16-bit data. Had a look at dcm.c and found that
setting "dcm:display-range" to "reset", sets window_width to 0,
which will give me exactly what I want.
This is what my code looks like (tmp is an unsigned char array):
Code: Select all
Image img(imageName);
img.defineValue("dcm", "display-range", "reset");
img.write(0, 0, img.columns(), img.rows(),"I", ShortPixel, tmp);
Ajay
Re: extract 16bit data from dicom
You need to define the value *before* you read the image. Declare you image, call defineSet() then read your DCM image with image.read().