BodenmillerGroup / steinbock

A toolkit for processing multiplexed tissue images
https://bodenmillergroup.github.io/steinbock
MIT License
49 stars 14 forks source link

Maximum amount of segmented cells bounded from segmentation output file format (16-bit unsigned integer TIFF images) #207

Open asom opened 1 year ago

asom commented 1 year ago

Hi, I am running the following command: steinbock segment deepcell --minmax

On a big image, it works fine and segments the image quite well. However, after the segmentation reaches the 65536 cells, it assigns to all the remaining cells the same number(id). Is there any way to circumvent that? For example get as output a 32-but TIFF file?

nilseling commented 1 year ago

Hi @asom

Have a look at #132 for how to change the mask bit encoding. @Milad4849 could you please document this somewhere visible? Let's leave this issue open until it's in the docs.

asom commented 1 year ago

Thanks @nilseling for your quick response!

Trying to replicate it, running 0.16.1 version, I encounter continiously the same error:

[0m could not open ****my_folder***/STEINBOCK_MASK_DTYPE=uint32: failed to retrieve path for ****my_folder***/STEINBOCK_MASK_DTYPE=uint32: lstat ****my_folder***/STEINBOCK_MASK_DTYPE=uint32: no such file or directory

Somehow recognizes the "STEINBOCK_MASK_DTYPE" as folder extension.

The command I am running is the following:

singularity run -e STEINBOCK_MASK_DTYPE=uint32 -B /sc:/sc docker://ghcr.io/bodenmillergroup/steinbock:0.16.1 segment deepcell --img img --minmax --panel panel.csv -o masks

I would be more than grateful, if you could give me some further insights.

jwindhager commented 1 year ago

Since you're using Singularity, you'll need to specify the STEINBOCK_MASK_DTYPE environment variable with --env:

singularity run --env STEINBOCK_MASK_DTYPE=uint32 -B /sc:/sc docker://ghcr.io/bodenmillergroup/steinbock:0.16.1 segment deepcell --img img --minmax --panel panel.csv -o masks

Note that this will only work with Singularity 3.6 or newer.