-
Notifications
You must be signed in to change notification settings - Fork 263
Fix Bioimaging inference tool #1580
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
Merged
Merged
Changes from 15 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
0e73264
update model order
anuprulez 3f85240
update main
anuprulez 0630717
add support for png
anuprulez 04bd671
update tests
anuprulez 9e88305
update tests
anuprulez 2188630
update methods
anuprulez e293179
add tests
anuprulez 6dd9551
fix formatting
anuprulez 2395b4b
Add missing required_files to run remotely (#1577)
nsoranzo 873d3fc
Merge branch 'bgruening:master' into fix_imaging_tool
anuprulez 303f5da
remove bioimaging.core
anuprulez ac3631f
update tool version
anuprulez 1fb8991
add input param information
anuprulez 7a6aabd
add end of file line
anuprulez 36a7819
update output files
anuprulez fdc5219
add image_diff for comparing tiff images in tests
anuprulez 8bea904
update tests
anuprulez ddc4d99
rerun tests
anuprulez 99b577e
Merge branch 'bgruening:master' into fix_imaging_tool
anuprulez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| <description>with PyTorch</description> | ||
| <macros> | ||
| <token name="@TOOL_VERSION@">2.4.1</token> | ||
| <token name="@VERSION_SUFFIX@">0</token> | ||
| <token name="@VERSION_SUFFIX@">1</token> | ||
| </macros> | ||
| <creator> | ||
| <organization name="European Galaxy Team" url="https://galaxyproject.org/eu/" /> | ||
|
|
@@ -30,12 +30,14 @@ | |
| --imaging_model '$input_imaging_model' | ||
| --image_file '$input_image_file' | ||
| --image_size '$input_image_input_size' | ||
| --image_axes '$input_image_input_axes' | ||
| ]]> | ||
| </command> | ||
| <inputs> | ||
| <param name="input_imaging_model" type="data" format="zip" label="BioImage.IO model" help="Please upload a BioImage.IO model."/> | ||
| <param name="input_image_file" type="data" format="tiff,png" label="Input image" help="Please provide an input image for the analysis."/> | ||
| <param name="input_image_input_size" type="text" label="Size of the input image" help="Provide the size of the input image. See the chosen model's RDF file to find the correct input size. For example: for the BioImage.IO model MitochondriaEMSegmentationBoundaryModel, the input size is 256 x 256 x 32 x 1. Enter the size as 256,256,32,1."/> | ||
| <param name="input_image_input_axes" type="text" label="Axes of the input image" help="Provide the input axes of the input image. See the chosen model's RDF file to find the correct axes. For example: for the BioImage.IO model MitochondriaEMSegmentationBoundaryModel, the input axes is 'bzyx'"/> | ||
| </inputs> | ||
| <outputs> | ||
| <data format="tif" name="output_predicted_image" from_work_dir="output_predicted_image.tif" label="Predicted image"></data> | ||
|
|
@@ -46,16 +48,50 @@ | |
| <param name="input_imaging_model" value="input_imaging_model.zip" location="https://zenodo.org/api/records/6647674/files/weights-torchscript.pt/content"/> | ||
| <param name="input_image_file" value="input_image_file.tif" location="https://zenodo.org/api/records/6647674/files/sample_input_0.tif/content"/> | ||
| <param name="input_image_input_size" value="256,256,1,1"/> | ||
| <param name="input_image_input_axes" value="bcyx"/> | ||
| <output name="output_predicted_image" file="output_nucleisegboundarymodel.tif" compare="sim_size" delta="100" /> | ||
| <output name="output_predicted_image_matrix" file="output_nucleisegboundarymodel_matrix.npy" compare="sim_size" delta="100" /> | ||
| </test> | ||
| <test> | ||
| <param name="input_imaging_model" value="input_imaging_model.zip" location="https://zenodo.org/api/records/6647674/files/weights-torchscript.pt/content"/> | ||
| <param name="input_image_file" value="input_nucleisegboundarymodel.png"/> | ||
| <param name="input_image_input_size" value="256,256,1,1"/> | ||
| <param name="input_image_input_axes" value="bcyx"/> | ||
| <output name="output_predicted_image" file="output_nucleisegboundarymodel.tif" compare="sim_size" delta="100" /> | ||
| <output name="output_predicted_image_matrix" file="output_nucleisegboundarymodel_matrix.npy" compare="sim_size" delta="100" /> | ||
| </test> | ||
| <test> | ||
| <param name="input_imaging_model" value="input_imaging_model.zip" location="https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/emotional-cricket/1.1/files/torchscript_tracing.pt"/> | ||
| <param name="input_image_file" value="input_image_file.tif" location="https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/emotional-cricket/1.1/files/sample_input_0.tif"/> | ||
| <param name="input_image_input_size" value="128,128,100,1"/> | ||
| <param name="input_image_input_axes" value="bczyx"/> | ||
| <output name="output_predicted_image" file="output_3d-unet-arabidopsis-apical-stem-cells.tif" compare="sim_size" delta="100" /> | ||
| <output name="output_predicted_image_matrix" file="output_3d-unet-arabidopsis-apical-stem-cells.npy" compare="sim_size" delta="100" /> | ||
| </test> | ||
| <test> | ||
| <param name="input_imaging_model" value="input_imaging_model.zip" location="https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/emotional-cricket/1.1/files/torchscript_tracing.pt"/> | ||
| <param name="input_image_file" value="input_3d-unet-arabidopsis-apical-stem-cells.png" location="https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/emotional-cricket/1.1/files/raw.png"/> | ||
| <param name="input_image_input_size" value="128,128,100,1"/> | ||
| <param name="input_image_input_axes" value="bczyx"/> | ||
| <output name="output_predicted_image" file="output_3d-unet-arabidopsis-apical-stem-cells.tif" compare="sim_size" delta="100" /> | ||
| <output name="output_predicted_image_matrix" file="output_3d-unet-arabidopsis-apical-stem-cells.npy" compare="sim_size" delta="100" /> | ||
| </test> | ||
| <test> | ||
| <param name="input_imaging_model" value="input_imaging_model.zip" location="https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/organized-badger/1/files/weights-torchscript.pt"/> | ||
| <param name="input_image_file" value="input_platynereisemnucleisegmentationboundarymodel.tif" location="https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/organized-badger/1/files/sample_input_0.tif"/> | ||
| <param name="input_image_input_size" value="256,256,32,1"/> | ||
| <param name="input_image_input_axes" value="bczyx"/> | ||
| <output name="output_predicted_image" file="output_platynereisemnucleisegmentationboundarymodel.tif" compare="sim_size" delta="100" /> | ||
|
||
| <output name="output_predicted_image_matrix" file="output_platynereisemnucleisegmentationboundarymodel.npy" compare="sim_size" delta="100" /> | ||
| </test> | ||
| <test> | ||
| <param name="input_imaging_model" value="input_imaging_model.zip" location="https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/thoughtful-turtle/1/files/torchscript_tracing.pt"/> | ||
| <param name="input_image_file" value="input_3d-unet-lateral-root-primordia-cells.tif" location="https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/thoughtful-turtle/1/files/sample_input_0.tif"/> | ||
| <param name="input_image_input_size" value="128,128,100,1"/> | ||
| <param name="input_image_input_axes" value="bczyx"/> | ||
| <output name="output_predicted_image" file="output_3d-unet-lateral-root-primordia-cells.tif" compare="sim_size" delta="100" /> | ||
| <output name="output_predicted_image_matrix" file="output_3d-unet-lateral-root-primordia-cells.npy" compare="sim_size" delta="100" /> | ||
| </test> | ||
| </tests> | ||
| <help> | ||
| <![CDATA[ | ||
|
|
@@ -67,6 +103,7 @@ | |
| - BioImage.IO model: Add one of the model from Galaxy file uploader by choosing a "remote" file at "ML Models/bioimaging-models" | ||
| - Image to be analyzed: Provide an image as TIF/PNG file | ||
| - Provide the necessary input size for the model. This information can be found in the RDF file of each model (RDF file > config > test_information > inputs > size) | ||
| - Provide axes of input image. This information can also be found in the RDF file of each model (RDF file > inputs > axes). An example value of axes is 'bczyx' for 3D U-Net Arabidopsis Lateral Root Primordia model | ||
|
|
||
| **Output files** | ||
| - Predicted image: Predicted image using the BioImage.IO model | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+147 KB
tools/bioimaging/test-data/input_3d-unet-arabidopsis-apical-stem-cells.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.25 MB
tools/bioimaging/test-data/output_3d-unet-arabidopsis-apical-stem-cells.npy
Binary file not shown.
Binary file added
BIN
+6.27 MB
tools/bioimaging/test-data/output_3d-unet-arabidopsis-apical-stem-cells.tif
Binary file not shown.
Binary file added
BIN
+6.25 MB
tools/bioimaging/test-data/output_3d-unet-lateral-root-primordia-cells.npy
Binary file not shown.
Binary file added
BIN
+6.27 MB
tools/bioimaging/test-data/output_3d-unet-lateral-root-primordia-cells.tif
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
tools/bioimaging/test-data/output_nucleisegboundarymodel.tif
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
tools/bioimaging/test-data/output_nucleisegboundarymodel_matrix.npy
Binary file not shown.
Binary file added
BIN
+16 MB
tools/bioimaging/test-data/output_platynereisemnucleisegmentationboundarymodel.npy
Binary file not shown.
Binary file added
BIN
+16 MB
tools/bioimaging/test-data/output_platynereisemnucleisegmentationboundarymodel.tif
Binary file not shown.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
could this be a select?
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.
btw. a text param can also have select options ...
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.
can't it be extracted from the rdf so that the user doesn't need to know this?
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.
The parameter
axesprovides the real shape (number of dimensions) of the input image/matrix required by the model to make inferences. The parameterinput_sizeis necessary to slice pixels from different input image dimensions. So, both parameters I think are important to ascertain the target size of the image to be provided to the model. RDF file is not available inside the tool from where we could extract theaxesinformation. Also, In a few RDF files, the axes information is not straightforward and written like (from 3d-unet-arabidopsis-apical-stem-cells model):Users have to infer the correct axes information from above. From above, it is
bczyx. Other RDF files have this information directly given asbczyx. (bczyx == batch, channel, z, y, x)I can provide this as a select option.
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.
@FynnBe I understood that the info in the RDF file is standardised, right?