From 30a64686465e7e88d385063b980183ac620971aa Mon Sep 17 00:00:00 2001 From: Marc Ruiz Date: Mon, 19 Jun 2017 17:12:31 +0200 Subject: [PATCH 1/2] ENH: Implement a hack to decode DICOM tags with VR UN (unknown) as Latin-1 strings. #2146 (cherry picked from commit 0920805d245a2898ebf4d0ceb5058db393da0782) --- starviewer/src/core/dicomtagreader.cpp | 6 ++++++ starviewer/src/core/dicomvalueattribute.cpp | 19 ++++++++++++++++++- starviewer/src/core/dicomvalueattribute.h | 1 - 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/starviewer/src/core/dicomtagreader.cpp b/starviewer/src/core/dicomtagreader.cpp index 7e22dc5e6c..eb7eeacac8 100644 --- a/starviewer/src/core/dicomtagreader.cpp +++ b/starviewer/src/core/dicomtagreader.cpp @@ -376,6 +376,12 @@ DICOMValueAttribute* DICOMTagReader::convertToDICOMValueAttribute(DcmElement *dc } dicomValueAttribute->setValue(string); + + // HACK for wrong VR (#2146) + if (dcmtkDICOMElement->getVR() == EVR_UN) + { + dicomValueAttribute->setValueRepresentation(DICOMValueAttribute::Unknown); + } } else { diff --git a/starviewer/src/core/dicomvalueattribute.cpp b/starviewer/src/core/dicomvalueattribute.cpp index 24fef19927..71bce75e37 100644 --- a/starviewer/src/core/dicomvalueattribute.cpp +++ b/starviewer/src/core/dicomvalueattribute.cpp @@ -18,6 +18,7 @@ #include #include +#include namespace udg { @@ -119,7 +120,23 @@ double DICOMValueAttribute::getValueAsDouble() QString DICOMValueAttribute::getValueAsQString() { - return m_value.toString(); + // HACK for wrong VR (#2146) + if (m_valueRepresentation == Unknown) + { + QString hexString = m_value.toString(); + const auto &hexBytes = hexString.splitRef("\\"); + QByteArray byteArray; + byteArray.reserve(hexBytes.size()); + foreach (const auto &hexByte, hexBytes) + { + byteArray.append(hexByte.toInt(nullptr, 16)); + } + return QString::fromLatin1(byteArray); // most likely Latin-1 + } + else + { + return m_value.toString(); + } } QByteArray DICOMValueAttribute::getValueAsByteArray() diff --git a/starviewer/src/core/dicomvalueattribute.h b/starviewer/src/core/dicomvalueattribute.h index a6914fe32b..ab71412dea 100644 --- a/starviewer/src/core/dicomvalueattribute.h +++ b/starviewer/src/core/dicomvalueattribute.h @@ -65,7 +65,6 @@ class DICOMValueAttribute : public DICOMAttribute { /// Retorna el tipus del valor ValueRepresentation getValueRepresentation(); -protected: /// Assigna el tipus del valor void setValueRepresentation(ValueRepresentation value); From 7fdd0791b03b30684ed8502799a1a49c63a37f82 Mon Sep 17 00:00:00 2001 From: Marc Ruiz Date: Tue, 14 Jul 2020 14:05:46 +0200 Subject: [PATCH 2/2] ENH: Update changelog, version number and release date for 1.0.1. #2872 --- starviewer/releasenotes/changelog.html | 11 +++++++++++ starviewer/src/core/starviewerapplication.h | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/starviewer/releasenotes/changelog.html b/starviewer/releasenotes/changelog.html index ac073c909d..06eaf9636f 100644 --- a/starviewer/releasenotes/changelog.html +++ b/starviewer/releasenotes/changelog.html @@ -59,6 +59,17 @@

Starviewer Changelog

+
+
+ Starviewer 1.0.1 + (Publicat el 14 de juliol de 2020) +
+
+
    +
  • Es resol un problema pel qual no es calculava el SUV en algunes images de PET d'un centre especĂ­fic. 2146
  • +
+
+
Starviewer 1.0.0 diff --git a/starviewer/src/core/starviewerapplication.h b/starviewer/src/core/starviewerapplication.h index a3601d892b..5c9b9d31f1 100644 --- a/starviewer/src/core/starviewerapplication.h +++ b/starviewer/src/core/starviewerapplication.h @@ -25,8 +25,8 @@ namespace udg { #define CE_SUFFIX "" #endif -const QString StarviewerVersionString("1.0.0" CE_SUFFIX); -const QString StarviewerBuildID("2020022100"); +const QString StarviewerVersionString("1.0.1" CE_SUFFIX); +const QString StarviewerBuildID("2020071400"); #undef CE_SUFFIX