QIICR / dcmqi

dcmqi (DICOM for Quantitative Imaging) is a free, open source C++ library for conversion between imaging research formats and the standard DICOM representation for image analysis results
https://qiicr.gitbook.io/dcmqi-guide/
BSD 3-Clause "New" or "Revised" License
232 stars 62 forks source link

"measurementItems" value as a string, DICOM SR tid1500 #406

Open ForgottenOneNyx opened 4 years ago

ForgottenOneNyx commented 4 years ago

Hello, I am new to DICOM SRs, and I was wondering if we could somehow write the value in measurementItems as a string.

Considering the example given in sr-tid1500-ct-liver-example.json we can't because the value in measurementItems corresponds to "DS" definition, in common-schema.json. Does it have to remain "DS" to adhere to the DICOM SR rules? Or can it be changed.

If yes, I would like it to be of a different definition which preferably includes long strings. Do you know how I can do that? I am presently using docker to create the DICOM SRs. The idea is to add the measurementItems but as "NaNs" if they don't exists, which can't be done by the "DS" defintion.

fedorov commented 4 years ago

@ForgottenOneNyx if a given measurement does not exist, it is definitely not a good idea to add a NaN as a measurement. You should just not add that measurement at all. This means that you cannot use a fixed structure dcmqi metadata JSON file and it will need to be customized depending on what measurements are present, which is more work at the time of generating the object, but it is the correct way to do it, I believe.

It is indeed the case that the numeric value communicating the measurement has DS VR (see definition of Numeric Measurement Macro, and Numeric Value). Yes, it has to remain DS, and, from what I know about the DICOM standard, at that level it cannot be changed.

It is a separate question what to do if the measurement you want to communicate is indeed a NaN. I do not have the answer to this question, but I will investigate.

fedorov commented 4 years ago

As clarified by @dclunie (see below), it is possible to communicate that a measurement is a NaN, but this will require new feature to be implemented.

Response from David Clunie:

That's what the Numeric Value Qualifier Code Sequence is for, and there is a dedicated code:

http://dicom.nema.org/medical/dicom/current/output/chtml/part16/sect_CID_42.html

See also this CP 2023:

ftp://medical.nema.org/medical/dicom/cp/cp2023_02_ClarifyUnknownNumericMeasurementValueInSR.pdf

jriesmeier commented 3 years ago

@fedorov In case, the DCMTK is used here somewhere: Adding support for CP-2023 is already on my to-do list.

By the way, this CP is a result of a discussion that I had with Stefan Allers in the newsgroup "comp.protocols.dicom".

jriesmeier commented 3 years ago

Support for CP-2023 has been added to the DCMTK by this commit.