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'

Overview

Welcome to slideToolKit

Manual

Introduction
General instructions

slideToolKit scripts

slide2Tiles
slideAppend.sh
slideAppendGCT.sh
slideConvert
slideDirectory
slideDupIdentify.py
slideEMask
slideEntropySegmentation.py
slideExtract.py
slideExtractTiles.py
slideInfo
slideInfo.py
slideJobChecker
slideLookup
slideMacro
slideMacro.py
slideMask
slideNormalize
slideRename
slideRename.py
slideThumb
slideThumb.py

slideQuantify v1

slideQuantify_v1
slideQuantify_v1_1_expresshist_mask.sh
slideQuantify_v1_2_expresshist_tile.sh
slideQuantify_v1_3_tile_normalizing.sh
slideQuantify_v1_4_cellprofiler.sh
slideQuantify_v1_5_wrapup.sh

slideQuantify v2

slideQuantify_v2
slideQuantify_v2_1_entropy_segmentation.sh
slideQuantify_v2_2_extract_tiles.sh
slideQuantify_v2_3_tile_normalizing.sh
slideQuantify_v2_4_cellprofiler.sh
slideQuantify_v2_5_wrapup.sh

slideQuantifyOSX

slideQuantifyOSX
slideQuantify_cellprofiler.sh
slideQuantify_mask.sh
slideQuantify_normalizing.sh
slideQuantify_tiling.sh
slideQuantify_wrapup.sh

Other scripts

slideToolKitTest.py

Installation

macOSX

Conda version (default/preferred)
Homebrew version

Linux

Rocky 8 Conda version (default/preferred)

Legacy

Ubuntu 16.04 LTS
Ubuntu 12.04 CentOS7 Conda version with modules
Administrator version

Conda vs brew

Clone this wiki locally