stereo.tools.tissue_extraction.tissue_extraction_to_bgef#

stereo.tools.tissue_extraction.tissue_extraction_to_bgef(src_gef_path, dst_bgef_path, dst_mask_dir_path, staining_type=None, model_path='', src_img_path='', rna_tissue_cut_bin_size=1, gpu='-1', num_threads=-1)[source]#
Parameters:
  • src_gef_path (Optional[str]) – the gef will be extracted by mask.tif from tissue cut.

  • dst_bgef_path (Optional[str]) – result bgef path, contains file name.

  • dst_mask_dir_path (Optional[str]) – save tissue cut result mask.tif to this directory.

  • staining_type (Optional[str]) – the staining type of regist.tif, available values include ‘ssDNA’, ‘dapi’, ‘HE’, ‘mIF’ and ‘RNA’, except ‘RNA’ staining type, src_img_path is required, while setting to ‘RNA’, the mask.tif will be generated from src gef.

  • model_path (Optional[str]) – the path if model used to generated mask.tif, it has to be matched with staining type.

  • src_img_path (Optional[str]) – the path of regist.tif which is used to generated mask.tif.

  • rna_tissue_cut_bin_size (Optional[int]) – fixed value 1.

  • gpu (Union[int, str]) – the gpu on which the model will work, -1 means working on cpu.

  • num_threads (int) – the number of threads when model work on cpu, -1 means using all the cores.

Returns:

the dst_bgef_path