DICOM Export Rounding to Integer Values

Hi all,

I am assuming it is a setting I am not able to locate on Slicer, so I’m hopeful this will be an easy question to answer! The problem I am having is that all my DICOM exports seem to convert the values in my PK maps (e.g. K-trans) into whole integer numbers upon export. This is problematic when most values are lying between 0-1 and thus I can’t get an accurate measurement of my ROI’s.

I have attempted exporting in the same subject folder as the original images, adjusting the DICOM settings and re-opening in several other image analysis software’s (ImageJ, MATLAB etc.).

Any assistance on this will be highly appreciated!

Best,
Maddie

I’m not a DICOM expert but as far as I know integer is the only available scalar type for images. RT dose tackles this problem by specifying a scaling factor, which is applied when loading, and this is how it achieves floating point values.
What modality are you trying to export it to? Do you know if there is a DICOM modality specified for PK maps?

I originally import MRI sequences in DICOM format to Slicer. Then use the PKModeling Module to generate the maps. I don’t know of a specific modality for these maps, but know that prior to export, they definitely have float values included- Exporting loses the scaling factor implemented in the program. Slightly lost for ideas.

Until very recently DICOM did not support floating-point voxel types at all (its use is still extremely limited), but instead you store integer voxels and scaling information (rescale slope, intercept, and type values; or modality LUT) as @cpinter described above.

Are you sure you need the result in DICOM format? Do you have examples of PK maps stored in DICOM? What do you plan to do with the exported data set?

I can’t upload a .dcm file format here however below is a screenshot showing what happens: Between the conversion of the PK map in Slicer after generation (left-float variables)–> Re-opening the map in Slicer after DICOM export (right)–> Opening the same DICOM image in MATLAB (bottom) :

My analysis on the images I need to perform in MATLAB which has a simple DICOM reader function that I have used in the past. Perhaps saving in another format you’d suggest that keeps float variables and is easily implemented to MATLAB could be a better option (e.g. TIFF)?

To share data between Slicer and Matlab, I would not recommend using DICOM, especially if you want to minimize information loss and you don’t have a clear idea how PK maps should be stored in DICOM in a standard-compliant way.

Probably the most forward-looking solution is to not bother with Matlab anymore and implement your analysis in Python. See tutorials here.

Second option is to use Slicer’s MatlabBridge extension, which allows running a function implemented in Matlab directly from Slicer (the bridge takes care of passing data between Slicer and Matlab).

Third option is to save the image to a nrrd file and manually read it into Matlab using nrrdread.m.

Is there a way to check if you are losing data between Slicer and MATLAB? I found an alternative method using advice given from the Normalization/calibration - #5 by fedorov thread , and in particular using the ShiftScaleImageFilter on each of the maps. Since now I know DICOM format only accepts integer values on Slicer, then by scaling each map by 1000 (or to whichever accuracy needed) prior to export, then you can keep the decimal values and just re-scale back within MATLAB easy enough (see image below). Not sure about data-loss in this process though.

Both Slicer and Matlab supports floating-point voxels, so you can save the image as is into nrrd file in Slicer and load it into Matlab. No need to convert the voxels to integer.

I have got the nrrd reader up and running, and it is a much easier method to implement! Thank you Andras.

1 Like

Slicer can also load floating-point parametric map objects, if you install Quantitative Reporting extension. Those parametric maps are not very common, but DICOM does support floating point PixelData for parametric maps.