Mercurial > hg > orthanc
comparison OrthancExplorer/explorer.js @ 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 | cac8ffcb9cef |
children | 6dba4fa8a6cb |
comparison
equal
deleted
inserted
replaced
3575:1d403ecf3391 | 3576:35b4d56664a6 |
---|---|
161 return '?'; | 161 return '?'; |
162 else | 162 else |
163 return d.toString('dddd, MMMM d, yyyy'); | 163 return d.toString('dddd, MMMM d, yyyy'); |
164 } | 164 } |
165 | 165 |
166 function FormatFloatSequence(s) | |
167 { | |
168 if (s == undefined || s.length == 0) | |
169 return "-"; | |
170 | |
171 if (s.indexOf("\\") == -1) | |
172 return s; | |
173 | |
174 var oldValues = s.split("\\"); | |
175 var newValues = []; | |
176 for (var i = 0; i < oldValues.length; i++) | |
177 { | |
178 newValues.push(parseFloat(oldValues[i]).toFixed(3)); | |
179 } | |
180 return newValues.join("\\"); | |
181 } | |
166 | 182 |
167 function Sort(arr, fieldExtractor, isInteger, reverse) | 183 function Sort(arr, fieldExtractor, isInteger, reverse) |
168 { | 184 { |
169 var defaultValue; | 185 var defaultValue; |
170 if (isInteger) | 186 if (isInteger) |
274 } | 290 } |
275 else if (i == "DicomStudyInstanceUID" || | 291 else if (i == "DicomStudyInstanceUID" || |
276 i == "DicomSeriesInstanceUID") | 292 i == "DicomSeriesInstanceUID") |
277 { | 293 { |
278 v = SplitLongUid(v); | 294 v = SplitLongUid(v); |
295 } | |
296 else if (i == "ImagePositionPatient" || | |
297 i == "ImageOrientationPatient") | |
298 { | |
299 v = FormatFloatSequence(v); | |
279 } | 300 } |
280 | 301 |
281 target.append($('<p>') | 302 target.append($('<p>') |
282 .text(i + ': ') | 303 .text(i + ': ') |
283 .append($('<strong>').text(v))); | 304 .append($('<strong>').text(v))); |
369 | 390 |
370 FormatMainDicomTags(node, instance.MainDicomTags, [ | 391 FormatMainDicomTags(node, instance.MainDicomTags, [ |
371 "AcquisitionNumber", | 392 "AcquisitionNumber", |
372 "InstanceNumber", | 393 "InstanceNumber", |
373 "InstanceCreationDate", | 394 "InstanceCreationDate", |
374 "InstanceCreationTime", | 395 "InstanceCreationTime" |
375 "ImagePositionPatient" | |
376 ]); | 396 ]); |
377 | 397 |
378 return CompleteFormatting(node, link, isReverse); | 398 return CompleteFormatting(node, link, isReverse); |
379 } | 399 } |
380 | 400 |