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

[WIP] Add tool for analysing images using Bioimage AI models #1391

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

anuprulez
Copy link
Contributor

@anuprulez anuprulez commented Mar 1, 2024

images

Test files:
https://bioimage.io/#/?id=10.5281%2Fzenodo.5764892
https://zenodo.org/api/records/6647674

Remaining tasks:

  • Support for creating the original predicted image matrix
  • Add tool tests (imaging models are large (> 50 MB and sometimes as large as 500 MB) and it is unclear how to add sample data for tests)
  • Add support for TensorFlow
  • Take input as PNG, Tiff files if possible
  • Test with models of different input/output dimensions (3,4,5,...)
  • ...

</command>
<inputs>
<param name="input_imaging_model" type="data" format="zip" label="BioImage model" help="Please load a BioImage model from file uploader"/>
<param name="input_image_file" type="data" format="npz" label="Image to be analysed" help="Please provide an image"/>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NPZ is numpy isn't it? How do people create such image? Should we create an NPZ file from a tiff, png as part of this tool?

Copy link
Contributor Author

@anuprulez anuprulez Mar 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, NPZ is a numpy zipped file, I think. To show images as PNG or Tiff, we have to reduce the dimensionality of the original multi-dimensional image. Sometimes, these are 3 or 4 dimensional, containing several channels. To display as PNG, I am taking only the first channels where we lose some information from images. But my idea is to save these originally predicted matrices with all dimensions. I also need to think about taking PNG and Tiff as inputs and producing the original matrix along side displayable formats such as PNG, Tiff.

Copy link
Contributor Author

@anuprulez anuprulez Mar 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@beatrizserrano do you know how these NPY input/output files are generated to be used with bioimage models (e.g. https://bioimage.io/#/?id=10.5281%2Fzenodo.5764892)? Do we use some Galaxy tool to generate it? I tried to use TIFF files as input to a few models, but they do not contain a pixel matrix of images in the correct dimensions for the model to take as input. However, NPY files work fine with the models but could be tricky for the end users of this tool to generate such test/input NPY files. Or do you know someone who worked on such models?

Thank you!

Copy link

@FynnBe FynnBe Mar 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chiming in on this on @beatrizserrano 's request:
I'm unaware of the context of this PR, but can report from the bioimage.io side: We demand .npy test files to be provided alongside every model contributed to bioimage.io. Among the utility functions we provide in bioimageio.core there is
https://github.com/bioimage-io/core-bioimage-io-python/blob/f798344213c179a6c836938aff9e4f6c46f8d23c/bioimageio/core/utils/image_helper.py#L136
-- a util function using imageio to attempt to load any given image and then attempting to guess it's axes, see
https://github.com/bioimage-io/core-bioimage-io-python/blob/f798344213c179a6c836938aff9e4f6c46f8d23c/bioimageio/core/utils/image_helper.py#L42

Software using the model zoo (or even specifically bioimageio.core) should try to delegate this guesswork to the end user instead.

note: the links above are from a development branch. These updated functions will be available in the coming bioimageio.core release, currently this functionality is implemented here

anuprulez and others added 3 commits March 15, 2024 15:26
Fix suggestion in name

Co-authored-by: Leonid Kostrykin <void@evoid.de>
Fix suggestion to include edam annotation

Co-authored-by: Leonid Kostrykin <void@evoid.de>
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

Successfully merging this pull request may close these issues.

None yet

4 participants