Mercurial > hg > orthanc
changeset 3576:35b4d56664a6
Explorer: display ImagePositionPatient (only ImageOrientationPatient was displayed) + format it to make it more readable
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Tue, 19 Nov 2019 11:26:52 +0100 |
parents | 1d403ecf3391 |
children | 8e9e0739d3e8 |
files | OrthancExplorer/explorer.js |
diffstat | 1 files changed, 22 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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($('<p>') .text(i + ': ') @@ -371,8 +392,7 @@ "AcquisitionNumber", "InstanceNumber", "InstanceCreationDate", - "InstanceCreationTime", - "ImagePositionPatient" + "InstanceCreationTime" ]); return CompleteFormatting(node, link, isReverse);