# HG changeset patch # User Sebastien Jodogne # Date 1732635466 -3600 # Node ID eae006bfeea685360a940d22351058a5f57645bc # Parent 356ae7ad47e4c38d60b58e7853370d0353e18cf1 support images without the "Modality" tag diff -r 356ae7ad47e4 -r eae006bfeea6 Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp --- a/Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp Tue Nov 26 14:39:09 2024 +0100 +++ b/Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp Tue Nov 26 16:37:46 2024 +0100 @@ -516,13 +516,17 @@ for (size_t i = 0; i < dicom.GetSize(); i++) { - std::string studyInstanceUid, seriesInstanceUid, modality; + std::string modality; + if (!dicom.GetResource(i).LookupStringValue(modality, Orthanc::DICOM_TAG_MODALITY, false)) + { + modality = ""; // Arbitrary value if "Modality" is missing + } + + std::string studyInstanceUid, seriesInstanceUid; if (dicom.GetResource(i).LookupStringValue( studyInstanceUid, Orthanc::DICOM_TAG_STUDY_INSTANCE_UID, false) && dicom.GetResource(i).LookupStringValue( - seriesInstanceUid, Orthanc::DICOM_TAG_SERIES_INSTANCE_UID, false) && - dicom.GetResource(i).LookupStringValue( - modality, Orthanc::DICOM_TAG_MODALITY, false)) + seriesInstanceUid, Orthanc::DICOM_TAG_SERIES_INSTANCE_UID, false)) { // skip series that should not be displayed if (std::find(skipSeriesFromModalities_.begin(), skipSeriesFromModalities_.end(), modality) == skipSeriesFromModalities_.end())