Skip to content

Commit

Permalink
fix: decodeConfig was passed incorrectly to decode (#502)
Browse files Browse the repository at this point in the history
  • Loading branch information
sedghi committed Dec 21, 2022
1 parent 1b47073 commit ed4de89
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/dicomImageLoader/src/shared/decodeImageFrame.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import decodeJPEGLS from './decoders/decodeJPEGLS.js';
import decodeJPEG2000 from './decoders/decodeJPEG2000.js';
import decodeHTJ2K from './decoders/decodeHTJ2K.js';
import scaleArray from './scaling/scaleArray.js';
import { getOptions } from '../imageLoader/internal/options.js';

function decodeImageFrame(
imageFrame,
Expand Down Expand Up @@ -140,17 +141,17 @@ function decodeImageFrame(

decodePromise
.then((imageFrame) => {
callbackFn(
postProcessDecodedPixels(imageFrame, options, start, decodeConfig)
);
callbackFn(postProcessDecodedPixels(imageFrame, options, start));
})
.catch((err) => {
throw err;
});
}

function postProcessDecodedPixels(imageFrame, options, start, decodeConfig) {
const { use16BitDataType } = decodeConfig;
function postProcessDecodedPixels(imageFrame, options, start) {
const {
decodeConfig: { use16BitDataType },
} = getOptions();

const shouldShift =
imageFrame.pixelRepresentation !== undefined &&
Expand Down

0 comments on commit ed4de89

Please sign in to comment.