Skip to content

Latest commit

 

History

History

preprocessing

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Code for data preprocessing

Environment

pip install numpy
pip install opencv-python

Usage

cut_tumor_regions.py: extract annotated tumor regions of all WSIs.

  • get the usage information of scripts
python cut_tumor_regions.py --help
  • fill the irrelevant areas with white color
python cut_tumor_regions.py --wsi_dir_path ./WSIs --output_dir_path ./tumour-regions
  • not fill the irrelevant areas
python cut_tumor_regions.py --wsi_dir_path ./WSIs --output_dir_path ./tumour-regions --not_filled_other_regions

cut_patches.py: cut patches with fixed size from all extracted annotated tumor regions.

  • get the usage information of scripts
python cut_patches.py --help
  • cut patches with size of and the patches with blank ratio greater than 0.3 will be discarded, you can modify the parameters for your research
python cut_patches.py --tumour_region_dir_path ./tumour-regions --size 256 --max_blank_ratio 0.3 --output_dir_path ./patches