Skip to content

Commit

Permalink
fix(DicomImageLoader): Returns options.loader (#1154)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlopes90 committed Mar 20, 2024
1 parent 049f609 commit 9a6c452
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/dicomImageLoader/src/imageLoader/wadouri/loadImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,15 @@ function loadImage(
): Types.IImageLoadObject {
const parsedImageId = parseImageId(imageId);

options = Object.assign({}, options);
// The loader isn't transferable, so ensure it is deleted
options = { ...options };

let schemeLoader = options.loader;

if (!(schemeLoader instanceof Function)) {
schemeLoader = getLoaderForScheme(parsedImageId.scheme);
}

delete options.loader;
// The options might have a loader above, but it is a loader into the cache,
// so not the scheme loader, which is separate and defined by the scheme here
const schemeLoader = getLoaderForScheme(parsedImageId.scheme);

// if the dataset for this url is already loaded, use it, in case of multiframe
// images, we need to extract the frame pixelData from the dataset although the
Expand Down

0 comments on commit 9a6c452

Please sign in to comment.