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

Cellpose does not work with .TIF files #555

Closed
wheelern opened this issue Aug 19, 2022 · 2 comments
Closed

Cellpose does not work with .TIF files #555

wheelern opened this issue Aug 19, 2022 · 2 comments

Comments

@wheelern
Copy link

The IO script is case-sensitive for image extensions (see:

image_names.extend(glob.glob(folder + '/*%s.tif'%imf))
). Our imager automatically uses .TIF, which means we have to rename everything to .tif to get images to work with cellpose. It's not the end of the world, but seems like an easy-ish fix on the cellpose side.

More to the point, I spent a long time trying to figure out errors during training via the command line ('ERROR: no images in --dir folder'). The directory wasn't empty, but it was full of images named .TIF. I had to dig into the code to find what was going on. I think there are a few options:

  1. Make clear in the documentation that image extensions are case-sensitive.
  2. Include a more informative error in get_image_files() when no images are found.
  3. Add more potential extensions in get_image_files()
  4. Maybe switch to regex instead of glob? One problem with glob is it's going to behave differently across Windows/Linux. See here.
  5. Add a new argument that allows the user to provide the extension.

Using images with .TIF extensions hasn't caused me any problems elsewhere (i.e., cv2, scikit-image, etc.) so I doubt allowing them to be read would cause problems downstream, but I can't say for sure.

Thanks for the great tool! I'm excited to integrate it into our pipelines. Cheers.

@carsen-stringer
Copy link
Member

sorry for the trouble. I've fixed this now by implementing (2) and (3) by making extensions non case sensitive

@wheelern
Copy link
Author

wheelern commented Sep 9, 2022

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants