Posted by
Fred Damen on
Aug 06, 2018; 9:34pm
URL: http://imagej.273.s1.nabble.com/DICOM-voxel-value-tp5021048p5021055.html
Thanks for the answer, but since it took me a while figure out what is going
on and it is not as I expected it, I thought I would scribble this down...
ShortProcessor stores values as unsigned 16 bit integers. It seems as though
when the DICOM datasets are read in from files and placed into ShortProcessor,
the values are treated as signed 16 bit integers and transformed according to
(0028,1052/0028,1053), i.e., calibrated, and then converted to unsigned 16 bit
integers and stored as such. The conversion back to the unsigned calibrated
value is stored and used in getPixelValue. Thus the 'raw' values technically
are no longer maintained, i.e., the raw value and uncalibrated value are not
the same thing.
So, even though there is technically no calibration of magnitude MRI DICOM
data, you want the calibrated values.
Enjoy,
Fred
On Mon, August 6, 2018 2:05 pm, Wayne Rasband wrote:
>> On Aug 5, 2018, at 11:51 PM, Fred Damen <
[hidden email]> wrote:
>>
>> Greetings,
>>
>> When dealing with MRI DICOM datasets I am getting what I consider to be an
>> incorrect value when fetching the voxel value using Java methods
>> ImageProcessor::get(x,y) or getf(x,y).
>
> Use ImageProcessor.getPixelValue(x,y) to retrieve values from signed 16-bit
> images (e.g., DICOM datasets). It is able to read calibrated pixels values and
> signed 16-bit images use a calibration function (y=-32768+x) to convert pixel
> values from unsigned to signed. This JavaScript example
>
> img = IJ.openImage("
http://wsr.imagej.net/images/ct.dcm.zip");
> ip = img.getProcessor();
> print("Uncalibrated value: "+ip.get(265,135));
> print("Calibrated value: "+ip.getPixelValue(265,135));
>
> outputs
>
> Uncalibrated value: 32328
> Calibrated value: -440
>
> -wayne
>
>
>> Case in point, when the status line on
>> the main ImageJ window reads "... value = 4691.00 (37459)", the value
>> returned
>> by get/getf is 37459 and not the correct value of 4691.
>>
>> What is this second value and how do I fetch the correct value?
>>
>> These DICOM datasets should not contain voxel intensity scaling, and, the
>> list
>> of tag/values produced on the 'Info' page for one of the slices does not
>> contain the tags: Rescale intercept, (0028|1052), and rescale slope
>> (0028|1053). The raw data stored in the files are 16 bit signed integers:
>> 0028,0100 Bits Allocated: 16
>> 0028,0101 Bits Stored: 16
>> 0028,0102 High Bit: 15
>> 0028,0103 Pixel Representation: 1
>> The values are always below 10K.
>>
>> The ImageJ image summary incorrectly indicates that the dataset is scaled:
>> Calibration function: y = a+bx
>> a: -32768.000000
>> b: 1.000000
>>
>> but this scaling would not produce the second value on the status line given
>> the correct value.
>>
>> Thanks in advance,
>>
>> Fred
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html