DICOM voxel value????

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

DICOM voxel value????

Fred Damen
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).  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
Reply | Threaded
Open this post in threaded view
|

Re: DICOM voxel value????

Herbie
Good day Fred,

this effect maybe due to signed and unsigned 16bit gray-scale.

2^15 = 32768;
32768 + 4691 = 37359;

HTH

Herbie

::::::::::::::::::::::::::::::::::::::::
Am 06.08.18 um 05:51 schrieb Fred Damen:

> 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).  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
Reply | Threaded
Open this post in threaded view
|

Re: DICOM voxel value????

Fred Damen
Greetings,

Thanks, but why is this being done?  And more importantly how am I supposed to
get the raw stored value in the DICOM dataset?

Note: the positive values in both the signed and unsigned integers are
logically and physically the same, i.e., no conversion. The negative signed
values are physically the same as the large positive (>32768) unsigned values,
conversion depends on why the logical and physical representations are
different.  In the case of MRI DICOM the values are positive and <10K, so no
conversion (either signed/unsigned), thus no header values for conversion.

The way the status line displays these values suggests to me that the raw and
converted values are known to ImageJ.  I'd prefer not to have to guess as to
how the voxel values were manipulated.

Thanks,

Fred

On Mon, August 6, 2018 2:25 am, Herbie wrote:

> Good day Fred,
>
> this effect maybe due to signed and unsigned 16bit gray-scale.
>
> 2^15 = 32768;
> 32768 + 4691 = 37359;
>
> HTH
>
> Herbie
>
> ::::::::::::::::::::::::::::::::::::::::
> Am 06.08.18 um 05:51 schrieb Fred Damen:
>> 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).  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
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: DICOM voxel value????

Herbie
"Thanks, but why is this being done?"

I don't know, and as long as we can't see your data things remain
opaque. Personally I've no experience with DICOM images.

"I'd prefer not to have to guess as to how the voxel values were
manipulated."

I don't think that you have to guess. You have to find out how your data
is interpreted by ImageJ or by BioFormats, if you use the latter to
import DICOM images.

Good luck

Herbie

:::::::::::::::::::::::::::::::::::::::::::
Am 06.08.18 um 16:52 schrieb [hidden email]:

> Greetings,
>
> Thanks, but why is this being done?  And more importantly how am I supposed to
> get the raw stored value in the DICOM dataset?
>
> Note: the positive values in both the signed and unsigned integers are
> logically and physically the same, i.e., no conversion. The negative signed
> values are physically the same as the large positive (>32768) unsigned values,
> conversion depends on why the logical and physical representations are
> different.  In the case of MRI DICOM the values are positive and <10K, so no
> conversion (either signed/unsigned), thus no header values for conversion.
>
> The way the status line displays these values suggests to me that the raw and
> converted values are known to ImageJ.  I'd prefer not to have to guess as to
> how the voxel values were manipulated.
>
> Thanks,
>
> Fred
>
> On Mon, August 6, 2018 2:25 am, Herbie wrote:
>> Good day Fred,
>>
>> this effect maybe due to signed and unsigned 16bit gray-scale.
>>
>> 2^15 = 32768;
>> 32768 + 4691 = 37359;
>>
>> HTH
>>
>> Herbie
>>
>> ::::::::::::::::::::::::::::::::::::::::
>> Am 06.08.18 um 05:51 schrieb Fred Damen:
>>> 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).  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
>>
>
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: DICOM voxel value????

Wayne Rasband-2
In reply to this post by Fred Damen
> 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
Reply | Threaded
Open this post in threaded view
|

Re: DICOM voxel value????

Fred Damen
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