perform the Giotto Wrapper of Stardist 2D segmentation. This is for a model inference to generate segmentation mask file from input image. main parameters needed
doStardistSegmentation(
Image_dir,
python_env = "giotto_segmentation",
mask_output,
model_name = "2D_versatile_fluo",
nuclei_channel = NULL,
prob_thresh = NULL,
nms_thresh = NULL,
verbose = F,
...
)
character, required. Provide a path to an image.
python environment with Stardist installed. default = "giotto_segmentation". See Stardist official website for more details.
required. Provide a path to the output mask file.
Name of the model to run inference. Default to '2D_versatile_fluo'. If using HE model, input image must be RGB, else the nuclei_channel must be given
Required using IF based nuclei segmentation, channel number of the nuclei staining.
prob_thresh for model (if not given use model default)
nms_thresh for model (if not given use model default)
No return variable, as this will write directly to output path provided.
# example code
doStardistSegmentation(
Image_dir = input_image,
mask_output = output,
model_name = '2D_versatile_fluo',
nuclei_channel = 3
)
#> python already initialized in this session
#> active environment : '/usr/bin/python3'
#> python version : 3.10
#> specified py env from `envname` = 'giotto_segmentation' not found
#> Error: package 'stardist' 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('stardist'), pip = TRUE)