@abasb75/dicom-pixel-decoder
Version:
a powerfull javascript dicom pixel data decoder
28 lines (27 loc) • 1.02 kB
JavaScript
import dicomRle from "dicom-rle";
var RLE = /** @class */ (function () {
function RLE() {
}
Object.defineProperty(RLE, "decode", {
enumerable: false,
configurable: true,
writable: true,
value: function (pixelData, options) {
var rows = options.rows, columns = options.columns, samplesPerPixel = options.samplesPerPixel, bitsAllocated = options.bitsAllocated, planarConfiguration = options.planarConfiguration;
if (!rows || !columns || !samplesPerPixel) {
return null;
}
var decoder = new dicomRle.RleDecoder();
var decoded = decoder.decode(new Uint8Array(pixelData.buffer), {
height: rows,
width: columns,
samplesPerPixel: samplesPerPixel,
bitsAllocated: bitsAllocated,
planarConfiguration: planarConfiguration,
});
return decoded;
}
});
return RLE;
}());
export default RLE;