bm_dataset.split_images_two_tissues module

Splitting image containing two samples


Using these scripts for 1+GB images take several tens of GB RAM

Sample usage:

python         -i "/datagrid/Medical/dataset_ANHIR/images/COAD_*/scale-100pc/*_*.png"         --nb_workers 3

Copyright (C) 2016-2019 Jiri Borovec <>


parse the input parameters :return dict: parameters

bm_dataset.split_images_two_tissues.main(path_images, dimension, overwrite, nb_workers)[source]

main entry point

  • path_images – path to images

  • dimension (int) – for 2D inages it is 0 or 1

  • overwrite (bool) – whether overwrite existing image on output

  • nb_workers (int) – nb jobs running in parallel

bm_dataset.split_images_two_tissues.split_image(img_path, overwrite=False, cut_dim=0)[source]

split two images in single dimension

the input images assume to contain two names in the image name separated by “_”

  • img_path (str) – path to the input / output image

  • overwrite (bool) – allow overwrite exiting output images

  • cut_dim (int) – define splitting dimension

bm_dataset.split_images_two_tissues.CUT_DIMENSION = 0[source]

cut image in one dimension/axis

bm_dataset.split_images_two_tissues.SCALE_SIZE = 512[source]

use following image size for estimating cutting line