diff --git a/src/layers/microscopy-viewer-layer/data-utils/tiff-utils.js b/src/layers/microscopy-viewer-layer/data-utils/tiff-utils.js index 7ecf94f98..4f51058e1 100644 --- a/src/layers/microscopy-viewer-layer/data-utils/tiff-utils.js +++ b/src/layers/microscopy-viewer-layer/data-utils/tiff-utils.js @@ -3,12 +3,12 @@ import {fromUrl, Pool, getDecoder } from 'geotiff/dist/geotiff.bundle.min.js'; async function loadTile({image, channel, x, y, pool}) { var tile = await image.getTileOrStrip(x,y, 0, pool) var dataObj = {} - const bits8 = image.fileDirectory.BitsPerSample[0]===8 - const bits16 = image.fileDirectory.BitsPerSample[0]===16 - const bits32 = image.fileDirectory.BitsPerSample[0]===32 - dataObj[channel] = (bits8 && new Uint8Array(tile.data)) || - (bits16 && new Uint16Array(tile.data)) || - (bits32 && new Uint32Array(tile.data)) + const isBits8 = image.fileDirectory.BitsPerSample[0]===8 + const isBits16 = image.fileDirectory.BitsPerSample[0]===16 + const isBits32 = image.fileDirectory.BitsPerSample[0]===32 + dataObj[channel] = (isBits8 && new Uint8Array(tile.data)) || + (isBits16 && new Uint16Array(tile.data)) || + (isBits32 && new Uint32Array(tile.data)) return dataObj }