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
base: master
Are you sure you want to change the base?
Conversation
</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"/> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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
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>
Test files:
https://bioimage.io/#/?id=10.5281%2Fzenodo.5764892
https://zenodo.org/api/records/6647674
Remaining tasks: