perform the Giotto Wrapper of cellpose segmentation. This is for a model inference to generate segmentation mask file from input image. main parameters needed
doCellposeSegmentation(
python_env = "giotto_cellpose",
image_dir,
mask_output,
channel_1 = 0,
channel_2 = 0,
model_name = "cyto3",
batch_size = 8,
resample = TRUE,
channel_axis = NULL,
z_axis = NULL,
normalize = TRUE,
invert = FALSE,
rescale = NULL,
diameter = NULL,
flow_threshold = 0.4,
cellprob_threshold = 0,
do_3D = FALSE,
anisotropy = NULL,
stitch_threshold = 0,
min_size = 15,
niter = NULL,
augment = FALSE,
tile = TRUE,
tile_overlap = 0.1,
bsize = 224,
interp = TRUE,
compute_masks = TRUE,
progress = NULL,
verbose = TRUE,
...
)
character, required. Provide a path to a gray scale or a three channel image.
required. Provide a path to the output mask file.
channel number for cytoplasm, default to 0(gray scale)
channel number for Nuclei, default to 0(gray scale)
Name of the model to run inference. Default to 'cyto3', if you want to run cutomized trained model, place your model file in ~/.cellpose/models and specify your model name.
Cellpose Parameter, Number of 224x224 patches to run simultaneously on the GPU. Can make smaller or bigger depending on GPU memory usage. Defaults to 8.
Cellpose Parameter
Cellpose Parameter
Cellpose Parameter
Cellpose Parameter
Cellpose Parameter
Cellpose Parameter
Cellpose Parameter
Cellpose Parameter
Cellpose Parameter
Cellpose Parameter
Cellpose Parameter
Cellpose Parameter
Cellpose Parameter
Cellpose Parameter
Cellpose Parameter
Cellpose Parameter
Cellpose Parameter
Cellpose Parameter
Cellpose Parameter
Cellpose Parameter
Cellpose Parameter
python environment with cellpose installed. default = "giotto_cellpose".
No return variable, as this will write directly to output path provided.
# example code
doCellposeSegmentation(
image_dir = input_image,
mask_output = output, channel_1 = 2,
channel_2 = 1, model_name = "cyto3", batch_size = 4
)
#> python already initialized in this session
#> active environment : '/usr/bin/python3'
#> python version : 3.10
#> specified py env from `envname` = 'giotto_cellpose' not found
#> Error: package 'cellpose' is not yet installed
#>
#> To install:
#> ## active python env: '/usr/bin/python3'
#> ## python version: 3.10
#> ## restart session then use GiottoClass::set_giotto_python_path() if this is incorrect
#> reticulate::conda_install(envname = '/usr/bin/python3', packages = c('cellpose'), pip = TRUE)