dicom-microscopy-viewer icon indicating copy to clipboard operation
dicom-microscopy-viewer copied to clipboard

fix(viewer.js): Avoid rounding zoom factors that are too close to avoid duplicated resolution errors

Open igoroctaviano opened this issue 1 year ago • 1 comments

Address Error caused by rounding the zoom factor:: https://github.com/ImagingDataCommons/slim/issues/175

(level 0) baseTotalPixelMatrixColumns / totalPixelMatrixColumns = 30920 / 30920 = 1 (level 1) baseTotalPixelMatrixColumns / totalPixelMatrixColumns = 30920 / 1932 = 16.00414078674948 (16) (level 2) baseTotalPixelMatrixColumns / totalPixelMatrixColumns = 30920 / 1920 = 16.104166666666668 (16)

This way the resolutions array will be [16, 16, 1], and although its descending OpenLayers assertion doesn't allow equivalent numbers, the resolutions array should be composed of unique resolutions in descending order.

Removing the rounding here: https://github.com/ImagingDataCommons/dicom-microscopy-viewer/blob/bda0cfea6f906a7c46f525cad2a5210d0722869b/src/pyramid.js#L211

Results: Screenshot 2023-10-30 at 19 21 13

igoroctaviano avatar Oct 31 '23 13:10 igoroctaviano

@igoroctaviano following the discussion and review by @dclunie, let's hold this until we have a chance to review together.

fedorov avatar Nov 21 '23 18:11 fedorov