Skip to content

Commit

Permalink
Update name for bits flag
Browse files Browse the repository at this point in the history
  • Loading branch information
ilan-gold committed Feb 4, 2020
1 parent b717735 commit adee215
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/layers/microscopy-viewer-layer/data-utils/tiff-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit adee215

Please sign in to comment.