Mercurial > hg > orthanc-stone
changeset 1091:5a18e6a395bc toa2019102301
Added DoseUnit tag retrieval to DicomInstanceParameters
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Wed, 23 Oct 2019 15:34:39 +0200 |
parents | b8521df3944a |
children | 5a35688c4874 |
files | Framework/Toolbox/DicomInstanceParameters.cpp Framework/Toolbox/DicomInstanceParameters.h |
diffstat | 2 files changed, 15 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/Framework/Toolbox/DicomInstanceParameters.cpp Tue Oct 22 17:51:25 2019 +0200 +++ b/Framework/Toolbox/DicomInstanceParameters.cpp Wed Oct 23 15:34:39 2019 +0200 @@ -110,6 +110,15 @@ if (sopClassUid_ == SopClassUid_RTDose) { ComputeDoseOffsets(dicom); + + static const Orthanc::DicomTag DICOM_TAG_DOSE_UNITS(0x3004, 0x0002); + + if (!dicom.LookupStringValue(doseUnits_, DICOM_TAG_DOSE_UNITS, false)) + { + LOG(WARNING) << "Tag DoseUnits (0x3004, 0x0002) is missing in " << sopInstanceUid_; + doseUnits_ = ""; + } + } isColor_ = (imageInformation_.GetPhotometricInterpretation() != Orthanc::PhotometricInterpretation_Monochrome1 &&
--- a/Framework/Toolbox/DicomInstanceParameters.h Tue Oct 22 17:51:25 2019 +0200 +++ b/Framework/Toolbox/DicomInstanceParameters.h Wed Oct 23 15:34:39 2019 +0200 @@ -59,6 +59,7 @@ Orthanc::PixelFormat expectedPixelFormat_; bool hasIndexInSeries_; unsigned int indexInSeries_; + std::string doseUnits_; void ComputeDoseOffsets(const Orthanc::DicomMap& dicom); @@ -199,5 +200,10 @@ } unsigned int GetIndexInSeries() const; + + const std::string& GetDoseUnits() const + { + return data_.doseUnits_; + } }; }