Skip to content

Commit

Permalink
fix: πŸ› fix array format regression from commit 70b2433 (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
Punzo authored Jan 19, 2022
1 parent 44850b3 commit f0bac36
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/adapters/Cornerstone/Segmentation_4X.js
Original file line number Diff line number Diff line change
Expand Up @@ -1209,11 +1209,22 @@ function checkIfPerpendicular(iop1, iop2, tolerance) {
function unpackPixelData(multiframe) {
const segType = multiframe.SegmentationType;

let data;
if (Array.isArray(multiframe.PixelData)) {
data = multiframe.PixelData[0];
} else {
data = multiframe.PixelData;
}

if (data === undefined) {
log.error("This segmentation pixeldata is undefined.");
}

if (segType === "BINARY") {
return BitArray.unpack(multiframe.PixelData);
return BitArray.unpack(data);
}

const pixelData = new Uint8Array(multiframe.PixelData);
const pixelData = new Uint8Array(data);

const max = multiframe.MaximumFractionalValue;
const onlyMaxAndZero =
Expand Down

0 comments on commit f0bac36

Please sign in to comment.