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

[Bug] New nifti-volume-loader does not support object urls #1827

Open
attilasimko opened this issue Feb 13, 2025 · 0 comments
Open

[Bug] New nifti-volume-loader does not support object urls #1827

attilasimko opened this issue Feb 13, 2025 · 0 comments
Labels
bugs Something isn't working, verified by maintainers

Comments

@attilasimko
Copy link

Describe the Bug

Before 2.0 it was possible to pass in an object url into the NiftiImageVolumeLoader, this is no longer the case. I need to load in volumes from disk, so after loading the file as a blob, I would pass URL.createObjectURL(blob) into the volume loader and it worked well. I found the following two issues after migrating to 2.19.7:

  • Compressed nifti is no longer supported, because the compression is determined from the url. If the link ends with .gz it is considered compressed. This doesn't hold for object urls.
  • Some nifti files fail to load in the metadata properly, and fetchAndAllocateNiftiVolume throws an error,
  • While some files manage to load, but only the middle slice.

Steps to Reproduce

Load a local file as a blob
Convert it to an objectURL with URL.createObjectURL(blob)
Load in nifti volume using await createNiftiImageIdsAndCacheMetadata({ url: objectUrl });

The current behavior

Compressed nifti doesn't load. The metadata of other nifti files fails, while for other images, it loads incorrectly.

The expected behavior

It should look for compression when loading the file, as before, not from the url, and generally it shouldn't matter what the url looks like

OS

Windows 11

Node version

22.2.0

Browser

Chrome

@attilasimko attilasimko changed the title [Bug] New nifti-volume-loader does not support blob urls [Bug] New nifti-volume-loader does not support object urls Feb 13, 2025
@sedghi sedghi added the bugs Something isn't working, verified by maintainers label Feb 14, 2025 — with Linear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugs Something isn't working, verified by maintainers
Projects
None yet
Development

No branches or pull requests

2 participants