# HG changeset patch # User Sebastien Jodogne # Date 1648726464 -7200 # Node ID 00f123df5de34ce05c93da83ffd001c07f47a225 # Parent 82024e1f304fbf70e925a2e170588d778fa143a4 added more tolerance wrt. bad values of the Pixel Spacing (0028,0030) tag diff -r 82024e1f304f -r 00f123df5de3 Applications/StoneWebViewer/NEWS --- a/Applications/StoneWebViewer/NEWS Fri Mar 25 16:56:10 2022 +0100 +++ b/Applications/StoneWebViewer/NEWS Thu Mar 31 13:34:24 2022 +0200 @@ -1,6 +1,8 @@ Pending changes in the mainline =============================== +* More tolerance wrt. bad values of the Pixel Spacing (0028,0030) tag + Version 2.3 (2022-03-24) ======================== diff -r 82024e1f304f -r 00f123df5de3 OrthancStone/Sources/Toolbox/GeometryToolbox.cpp --- a/OrthancStone/Sources/Toolbox/GeometryToolbox.cpp Fri Mar 25 16:56:10 2022 +0100 +++ b/OrthancStone/Sources/Toolbox/GeometryToolbox.cpp Thu Mar 31 13:34:24 2022 +0200 @@ -311,22 +311,15 @@ { Vector v; - if (LinearAlgebra::ParseVector(v, dicom, Orthanc::DICOM_TAG_PIXEL_SPACING)) + if (LinearAlgebra::ParseVector(v, dicom, Orthanc::DICOM_TAG_PIXEL_SPACING) && + v.size() >= 2 && + v[0] > 0 && + v[1] > 0) { - if (v.size() != 2 || - v[0] <= 0 || - v[1] <= 0) - { - LOG(ERROR) << "Bad value for PixelSpacing tag"; - throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat); - } - else - { - // WARNING: X/Y are swapped (Y comes first) - spacingX = v[1]; - spacingY = v[0]; - return true; - } + // WARNING: X/Y are swapped (Y comes first) + spacingX = v[1]; + spacingY = v[0]; + return true; } else {