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

registration failing when their are non-tiff files in the directory #154

Open
stephenlenzi opened this issue Jun 5, 2023 · 2 comments
Open
Labels
bug Something isn't working napari-plugin

Comments

@stephenlenzi
Copy link
Member

stephenlenzi commented Jun 5, 2023

Describe the bug
Metadata in the image directory (in my case a couple of irrelevant .mat files) cause brainreg-napari to crash at the point of downsampling.

To Reproduce
Fresh installation of brainreg-napari in a clean env on linux, python 3.10. Drag directory containing all raw data images and also a couple of .mat files into napari. Choose parameters and hit run.

Expected behaviour

I would expect such an issue to crash earlier - when the data are loaded or immediately after hitting run, with a message specifically about unexpected files.

Log file

The error message I receive is:
"ValueError: Could not find a backend to open stitchedSize.mat`` with iomode ri`."

@stephenlenzi stephenlenzi added the bug Something isn't working label Jun 5, 2023
@stephenlenzi
Copy link
Member Author

also.. deleting the offending .mat files does prevent the issue occurring.

@adamltyson
Copy link
Member

Thanks for raising @stephenlenzi, we should fix this. The problem is that the brainreg plugin doesn't operate directly upon the data loaded into napari (unlike the cellfinder plugin). The data is viewed, but then the data is loaded again, in a slightly different way by brainreg (using imio). I guess we have three options with increasing elegance (and complexity for us to implement):

  • Warn the user if there are other files in the directory (i.e. if we think brainreg will fail)
  • Prevent these files from interrupting loading data with imio
  • Pass the data directly from napari to brainreg
    • If brainreg recieves a file path, it should load, downscale and save
    • If brainreg recieves a numpy-like obkect, it should just downscale and save

@adamltyson adamltyson changed the title [BUG] registration failing when their are non-tiff files in the directory Jun 27, 2023
@willGraham01 willGraham01 transferred this issue from brainglobe/brainreg-napari Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working napari-plugin
Projects
Status: Backlog
Development

No branches or pull requests

3 participants