Mercurial > hg > orthanc-stone
diff Framework/Toolbox/DicomFrameConverter.cpp @ 120:063f7f3d9f14 wasm
fix 3d locations of the doses
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 04 Oct 2017 15:51:34 +0200 |
parents | ba83e38cf3ff |
children | e2fe9352f240 |
line wrap: on
line diff
--- a/Framework/Toolbox/DicomFrameConverter.cpp Mon Oct 02 22:01:41 2017 +0200 +++ b/Framework/Toolbox/DicomFrameConverter.cpp Wed Oct 04 15:51:34 2017 +0200 @@ -81,6 +81,26 @@ isRTDose = true; rescaleIntercept_ = 0; rescaleSlope_ = doseGridScaling; + + if (!dicom.ParseInteger32(tmp, Orthanc::DICOM_TAG_BITS_STORED)) + { + // Type 1 tag, must be present + throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat); + } + + switch (tmp) + { + case 16: + expectedPixelFormat_ = Orthanc::PixelFormat_Grayscale16; + break; + + case 32: + expectedPixelFormat_ = Orthanc::PixelFormat_Grayscale32; + break; + + default: + throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); + } } std::string photometric; @@ -100,21 +120,20 @@ // TODO Add more checks, e.g. on the number of bytes per value // (cf. DicomImageInformation.h in Orthanc) - if (isRTDose) - { - expectedPixelFormat_ = Orthanc::PixelFormat_Grayscale32; - } - else if (isColor_) + if (!isRTDose) { - expectedPixelFormat_ = Orthanc::PixelFormat_RGB24; - } - else if (isSigned_) - { - expectedPixelFormat_ = Orthanc::PixelFormat_SignedGrayscale16; - } - else - { - expectedPixelFormat_ = Orthanc::PixelFormat_Grayscale16; + if (isColor_) + { + expectedPixelFormat_ = Orthanc::PixelFormat_RGB24; + } + else if (isSigned_) + { + expectedPixelFormat_ = Orthanc::PixelFormat_SignedGrayscale16; + } + else + { + expectedPixelFormat_ = Orthanc::PixelFormat_Grayscale16; + } } }