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,
  ...
)

Arguments

Image_dir

character, required. Provide a path to an image.

python_env

python environment with Stardist installed. default = "giotto_segmentation". See Stardist official website for more details.

mask_output

required. Provide a path to the output mask file.

model_name

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

nuclei_channel

Required using IF based nuclei segmentation, channel number of the nuclei staining.

prob_thresh

prob_thresh for model (if not given use model default)

nms_thresh

nms_thresh for model (if not given use model default)

Value

No return variable, as this will write directly to output path provided.

Examples

# 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)