question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find IO for nrrd file

See original GitHub issue

im trying to display an .nrrd file in the viewer from S3. i have a link for downloading the file.

when i download and copy the file to my project it load without any issues, how ever loading it directly from the s3 link throws an error from the piepline.worker that it cannot find IO for the file.

any idea or suggestions for the issue? (im trying to find a solution that will not require downloading the file to my server every time i want to display it)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
Jmenniuscommented, Sep 29, 2022

image.pathname.split('/').at(-1) looks great!

Do you have the time to open a PR?

I kind of went a bit further, really hope I didn’t go overboard and that function is not public API 😃

1reaction
Jmenniuscommented, Sep 29, 2022

Does the URL end in .nrrd? Yes: https://dandiarchive.s3.amazonaws.com/3d313fc2-0204-496d-bfa1-5c90951ee640.nrrd No: https://dandiarchive.s3.amazonaws.com/3d313fc2-0204-496d-bfa1-5c90951ee640

For debugging: here is the place passing a URL to ‘createViewer’ will reach:

https://github.com/Kitware/itk-vtk-viewer/blob/3e546aaab812c18877d43c163587647ad7eb6155/src/IO/toMultiscaleSpatialImage.js#L69

See it grabbing the last part of the URL after the / and treating it as the “filename”?

Hi there 😃

So can we replace this parsing with something more robust like

image.pathname.split('/').slice(-1)[0]

that would take care of any query parameters and so on? (assuming image is an instance of URL)

P.S. maybe even use at(-1) instead of slice(-1)[0] (depends on compatibility I guess)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot import nrrd - Support - 3D Slicer Community
Before analyzing with pyradiomics, I want to use a 3D slicer to read the nrrd file. But, error occurs during the process of...
Read more >
Include nrrd reader in project - Development - Image.sc Forum
So I tried to include the sc.fiji.io stuff to my pom (that has … ... I cannot find File > Import > Nrrd...
Read more >
Source code for ClearMap.IO.NRRD
Arguments --------- location : str The file nameof the nrrd source. ... if not line.startswith('NRRD'): raise NrrdError('Missing magic "NRRD" word.
Read more >
[Rtk-users] Could not create IO object when using ... - Kitware
[Rtk-users] Could not create IO object when using rtkForwardProjections application with NRRD file.
Read more >
Cannot open gzip-encoded nrrd files · Issue #397 - GitHub
A nrrd file with the header below throws an UnsupportedCompressionException Exception in thread "main" java.io.IOException: io.scif.img.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found