dicom-microscopy-viewer
dicom-microscopy-viewer copied to clipboard
fix(viewer.js): Avoid rounding zoom factors that are too close to avoid duplicated resolution errors
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:
@igoroctaviano following the discussion and review by @dclunie, let's hold this until we have a chance to review together.