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

Design a mechanism to pass image pixel size to Mesmer and other tools #30

Open
jmuhlich opened this issue Apr 24, 2024 · 5 comments
Open
Labels
bug Something isn't working

Comments

@jmuhlich
Copy link
Member

jmuhlich commented Apr 24, 2024

Description of the bug

The modules.config entry for Mesmer includes --image-mpp=0.215 in ext.args which is not appropriate. We do need a smart way to pass the pixel size to Mesmer (and other tools that need it), but hard coding it here is definitely wrong. Should this be perhaps extracted from the Ashlar output image and included in the metadata map or in its own separate channel? While we're at it we could extract other useful image metadata too. We could also extract metadata from the raw image data -- this would be particularly useful to cross-check against the samplesheet and markersheet content in the input validation step.

@jmuhlich jmuhlich added the bug Something isn't working label Apr 24, 2024
@josenimo
Copy link

I think that extracting the metadata from ashlar output is a good idea, however I am not sure how complex that is to do.
I think that asking users for that value in the parameter file is also ok.

Looking at your recent code in the tests, what about creating a dictionary as an output from ashlar (or even before ashlar), that contains the relevant image metadata to be accessed by any other step. The question whether it is better to pass this inside the ASHLAR.out.tif or as another ASHLAR.out is up to you.

@jmuhlich
Copy link
Member Author

I think it makes sense to write a module that extracts common useful ome-tiff metadata and into a format that is easily parsed from Nextflow code. This information can then be emitted from the module and collected into a channel.

@jmuhlich
Copy link
Member Author

Some of us discussed this face to face and decided that a separate image metadata extraction module would be best, rather than trying to get the Ashlar module to output the metadata itself. Doing this once in the Ashlar module might be feasible, but it's likely that we'll want image metadata from other tools. Installing the necessary extra tools and scripts for metadata extraction into other "third-party" containers like Mesmer and Cellpose will be difficult.

@josenimo
Copy link

I agree with a module itself, it would also be much easier to expand if needed.

@kbestak
Copy link
Contributor

kbestak commented May 31, 2024

Just a question here, why don't we implement a general pixel_size parameter that would then get passed to all modules that require it instead of extracting it from the metadata. Especially with how widely different inputs we would be expecting (that we would see in different staging modules), this would by far be the most straightforward approach. Let me know what you think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants