Skip to content

slideExtractTiles

timpeters03 edited this page Feb 9, 2024 · 4 revisions

Usage Overview:
This script, named slideExtractTiles, is designed to extract tiles from an input image and its corresponding mask. These tiles are typically used for further analysis or processing. Below is an overview of how to use the script:

Usage:

python slideExtractTiles.py --file <path_to_input_image> --mask <path_to_image_mask> [--out <path_to_output_directory>] [--layer <layer_number>] [--tile_size <tile_size>] [--suffix <output_folder_suffix>] [--save_mask <True/False>] [--keep_empty <True/False>] [--save_thumbnail <True/False>] [--color <masking_color>]

Example Usage:

python slideExtractTiles.py --file example_image.ndpi --mask example_mask.jpg --out output_directory/ --layer 1 --tile_size 2000 --suffix _tiles --save_mask True --keep_empty False --save_thumbnail True --color w

This command will extract tiles from the input image (example_image.ndpi) using the mask image (example_mask.jpg) with the specified options and save the results in the output_directory/ directory.

Arguments:

  • --file
    • Description: Path to the input image (WSI).
    • Required: Yes
  • --mask
    • Description: Path to the mask image corresponding to the input image.
    • Required: Yes
  • --out
    • Description: Path to the directory where the output tiles will be saved.
    • Required: No
    • Default: Current directory
  • --layer
    • Description: Determines at which layer to extract tiles.
    • Required: No
    • Default: 0
  • --tile_size
    • Description: Size of the tiles to be extracted.
    • Required: No
    • Default: 2000
  • --suffix
    • Description: Additional suffix for the output folder.
    • Required: No
    • Default: None
  • --save_mask
    • Description: Whether to save the resized mask.
    • Required: No
    • Default: False
  • --keep_empty
    • Description: Whether to keep empty tiles after masking.
    • Required: No
    • Default: False
  • --save_thumbnail
    • Description: Whether to keep a thumbnail image after masking.
    • Required: No
    • Default: True
  • --color
    • Description: Masking color ('w' for white, 'b' for black).
    • Required: No
    • Default: 'w'
Clone this wiki locally