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 80a60a6
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 is8Bits = image.fileDirectory.BitsPerSample[0]===8
const is16Bits = image.fileDirectory.BitsPerSample[0]===16
const is32Bits = image.fileDirectory.BitsPerSample[0]===32
dataObj[channel] = (is8Bits && new Uint8Array(tile.data)) ||
(is16Bits && new Uint16Array(tile.data)) ||
(is32Bits && new Uint32Array(tile.data))
return dataObj
}

Expand Down

0 comments on commit 80a60a6

Please sign in to comment.