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

Unify channel indexing at the pipeline level #317

Closed
ArtemSokolov opened this issue Aug 24, 2021 · 0 comments · Fixed by #393
Closed

Unify channel indexing at the pipeline level #317

ArtemSokolov opened this issue Aug 24, 2021 · 0 comments · Fixed by #393
Labels
segmentation Issues related to segmentation (including probability map generation)

Comments

@ArtemSokolov
Copy link
Collaborator

ArtemSokolov commented Aug 24, 2021

Currently, channel indexing is provided separately for probability map computation and watershed segmentation. This results in the following issues:

  1. Some probability map modules will follow 0-based indexing, while others will use 1-based indexing. This is a potential source of confusion and "off by one" errors.
  2. There is no synchronization mechanism between probability maps and watershed segmentation. A user can supply channel indexing to one, but forget to do it for the other, which may result in erroneous segmentation masks.

The proposed solution is to unify channel indexing at the level of the pipeline by:

  1. Introducing two new configuration settings for all probability map modules:
    a. channel, which defines how channel specification is provided to the module. This would be --channel for UnMicst, --channelIDs for ilastik, and --nuclear-channel for Mesmer.
    b. and idxBase, which specifies whether channel indexing is assumed to be 0-based or 1-based.
  2. Introducing a new --channel parameter for MCMICRO, which will accept a list of channels to use for probability map computation and segmentation and forward these values to the appropriate flags in each module, while accounting for whether the modules use 0-based or 1-based indexing.

Example 1:
nextflow run labsyspharm/mcmicro --in exemplar-001 --probability-maps unmicst,mesmer --channel 25
will pass --channel 25 to UnMicst, --nuclear-channel 24 to Mesmer (which uses 0-based indexing), and --probMapChan 25 to watershed segmentation.

Example 2:
Modules like UnMicst and ilastik may accept multiple channels. The new --channel argument can accommodate this, but requires introducing a new assumption that the first value is the one to be used for watershed segmentation. So,
nextflow run labsyspharm/mcmicro --in exemplar-001 --probability-maps unmicst,ilastik --channel 25 26
will pass --channel 25 26 to UnMicst, --channelIDs 25 26 to ilastik, and --probMapChan 25 to watershed segmentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
segmentation Issues related to segmentation (including probability map generation)
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant