# HG changeset patch # User Alain Mazy # Date 1574159212 -3600 # Node ID 35b4d56664a69fd9bfc14690b7922a6048a3e4e2 # Parent 1d403ecf3391dae6f926356ddc36f3e72d2c3906 Explorer: display ImagePositionPatient (only ImageOrientationPatient was displayed) + format it to make it more readable diff -r 1d403ecf3391 -r 35b4d56664a6 OrthancExplorer/explorer.js --- a/OrthancExplorer/explorer.js Sun Nov 17 17:58:14 2019 +0100 +++ b/OrthancExplorer/explorer.js Tue Nov 19 11:26:52 2019 +0100 @@ -163,6 +163,22 @@ return d.toString('dddd, MMMM d, yyyy'); } +function FormatFloatSequence(s) +{ + if (s == undefined || s.length == 0) + return "-"; + + if (s.indexOf("\\") == -1) + return s; + + var oldValues = s.split("\\"); + var newValues = []; + for (var i = 0; i < oldValues.length; i++) + { + newValues.push(parseFloat(oldValues[i]).toFixed(3)); + } + return newValues.join("\\"); +} function Sort(arr, fieldExtractor, isInteger, reverse) { @@ -277,6 +293,11 @@ { v = SplitLongUid(v); } + else if (i == "ImagePositionPatient" || + i == "ImageOrientationPatient") + { + v = FormatFloatSequence(v); + } target.append($('

') .text(i + ': ') @@ -371,8 +392,7 @@ "AcquisitionNumber", "InstanceNumber", "InstanceCreationDate", - "InstanceCreationTime", - "ImagePositionPatient" + "InstanceCreationTime" ]); return CompleteFormatting(node, link, isReverse);