Skip to content

Commit f8c444d

Browse files
author
hackermd
committed
Fix calculation of point resolution
1 parent 01d77cb commit f8c444d

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

build/dicom-microscopy-viewer.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49717,14 +49717,12 @@
4971749717
code: "NONE",
4971849718
units: 'm',
4971949719
extent: extent,
49720-
// FIXME: is point resolution computed correctly?
4972149720
getPointResolution: function(pixelRes, point) {
4972249721
/*
49723-
* Pixel spacing has in millimeter unit while the projection has
49722+
* DICOM pixel spacing has millimeter unit while the projection has
4972449723
* has meter unit.
4972549724
*/
49726-
// FIXME: is this correct?
49727-
let spacing = levels[levels.length-1].pixelSpacing[1] * 10**3;
49725+
let spacing = levels[0].pixelSpacing[1] / 10**3;
4972849726
let metricRes = pixelRes * spacing;
4972949727
return(metricRes);
4973049728
}

src/api.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,14 +301,12 @@ class MicroscopyViewer {
301301
code: "NONE",
302302
units: 'm',
303303
extent: extent,
304-
// FIXME: is point resolution computed correctly?
305304
getPointResolution: function(pixelRes, point) {
306305
/*
307-
* Pixel spacing has in millimeter unit while the projection has
306+
* DICOM pixel spacing has millimeter unit while the projection has
308307
* has meter unit.
309308
*/
310-
// FIXME: is this correct?
311-
let spacing = levels[levels.length-1].pixelSpacing[1] * 10**3;
309+
let spacing = levels[0].pixelSpacing[1] / 10**3;
312310
let metricRes = pixelRes * spacing;
313311
return(metricRes);
314312
}

0 commit comments

Comments
 (0)