labsyspharm / mcmicro

Multiple-choice microscopy pipeline
https://mcmicro.org/
MIT License
98 stars 58 forks source link

Mesmer Segmentation with a membrane channel #508

Closed ArozHada closed 1 year ago

ArozHada commented 1 year ago

Hello,

I am trying to segment TMA cores using Mesmer with a specific membrane channel. So far I have tried to do it by setting the following param.yml config and its variations.

workflow:
start-at: background
stop-at: quantification
segmentation: mesmer
tma: true
background: true
options:
mesmer: --image-mpp 0.23 --membrane-image --membrane-channel 13
#1 mesmer: --image-mpp 0.23 --membrane-image <image_in_registration_folder>--membrane-channel 13
#2 mesmer: --image-mpp 0.23 --membrane-channel 13

coreograph: --downsampleFactor 5

Since the segmentation works on each core isolated with coreograph, using the above params file gives me a usage error that the argument membrane image is missing. If I provide the image in the registration folder, it is unable to find the image.

The complete command executed by mcmicro is:

python /usr/src/app/run_app.py mesmer --squeeze --output-directory . --output-name cell.tif --nuclear-image 4.ome.tif  --image-mpp 0.23 --membrane-image <image_name/empty/no_arg> --membrane-channel 13

Is there any way to specify the membrane image to be the same as the nuclear image (that has been isolated by coreograph)?

ArtemSokolov commented 1 year ago

Hi Aroj,

I added a way for MCMICRO to pass the input image as --membrane-image to Mesmer in #509. Can you please try the latest version of the pipeline (nextflow pull labsyspharm/mcmicro) with the following params.yml:

workflow:
  start-at: background
  stop-at: quantification
  segmentation: mesmer
  tma: true
  background: true
options:
  mesmer: --image-mpp 0.23 --membrane-channel 13
  coreograph: --downsampleFactor 5
ArozHada commented 1 year ago

Hello Artem,

Yes, the issue is solved and the correct command is executed for mesmer within mcmicro now. Thank you so much for the help. :)