Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(DicomImageLoader): Returns options.loader #1154

Merged
merged 1 commit into from
Mar 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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