I'm very happy with the continued improvement of the Dicom import and export functionality and speed. However, there is one issue with the current implementation that makes it very unuseful if you do quantitative image analysis. It might be that I miss an option if not I think this should be fixed.
In the Mathematica documentation and examples, Dicom data is typically shown and imported as images which I understand for display purposes. But I consider the information in Dicom files as data, very well curated and standardized. For many (MRI) applications, the actual quantitative values of voxels stored in Dicom actually have meaning, values, and even units. For example in the image below each voxel value is actually a quantitative measure of T2 relaxation time in the heart, where the values are stored in milliseconds as voxel values as is also mentioned in the metadata.


To get from the stored values to quantitative values (WV, DV or FP) the fields from the header and the equations are well defined.
Header values:
- SV = stored value of DICOM PIXEL DATA without scaling
- WS = RealWorldValue slope (0040,9225) "RWVSlope"
- WI = RealWorldValue intercept (0040,9224) "RWVIntercept"
- RS = rescale slope (0028,1053) "RescaleSlope"
- RI = rescale intercept (0028,1052) "RescaleIntercept"
- SS = scale slope (2005,100E) "ScaleSlope"
Outputs:
- WV = real world value
- FP = precise value
- DV = displayed value
Formulas:
- WV = SV * WS + WI
- DV = SV * RS + RI
- FP = DV / (RS * SS)
So my first try was that I want to obtain the "RawData" to access the SV pixel data, which does not output anything.

Eventually, if I import this Dicom file into Mathematica I have to use a lot of tricks to get to the correct stored values. The Dicom images I use are stored as 12-bit Integers but are converted by Mathematica to a Numerical array with type Int16. Also, I have to specifically specify that I don't want any "DataTransformation" which by default rescales the data and actually changes some voxel values!!!!
In[1]:= << QMRITools`
{meta, data, bd} =
Import[file, {"dicom", {"MetaInformation", "Data", "BitDepth"}},
"DataTransformation" -> None];
dataT = Import[file, {"dicom", {"Data"}}];
{dd = ToExpression[
StringJoin @@
StringCases[NumericArrayType[data], DigitCharacter]], bd}
{ss, rs, ri} =
meta /@ {"2005_100e", "RescaleSlope", "RescaleIntercept"}
{data, dataT} = Normal@{data, dataT};
svT = 2.^bd (dataT/(2.^dd));
pfT = (rs svT + ri)/(rs ss);
sv = 2.^bd (data/(2.^dd));
pf = (rs sv + ri)/(rs ss);
PlotData[pfT, pf]
Out[3]= {16, 12}
Out[4]= {1.99854, 0.500366, -2.}
For my current research, I need the PF values and to get them correctly I have to:
- Use "DataTransformation"->None, which is not really well documented what it actually does. But based on what I see actual values of the data are changed by clipping the histogram, which for default handling of medical data is never OK!!

- As far as I am aware the only way to obtain the actual stored values of my Dicom data (the actual binary values stored in the file itself) I have to find the actual BiteDepth and the imported data type and rescale my data accordingly.
Below are the obtained PF valued data I need with and without DataTransformation. Although the image on the right might look less appealing with default range and scaling it is actually correct when scaled apropriately.

Am I missing a correct option for getting the actual data stored? If not this should definitely be changed. Dicom is the international standard to transmit, store, retrieve, print, process, and display medical imaging information. With the current implementation, it is impossible to Import and Export such files without actually changing the stored data.
Thanks, Martijn