create_montage

This script can create a high-resolution montage of all images in a folder or datasets.

Create an overview image with thumbnails of all slides in a dataset.

usage: python create_montage.py --dataset <dataset_folder> --image_glob_pattern '**/*.tiff' --width 1000

Named Arguments

--cluster

The name of the GPU or CPU cluster inside the AzureML workspacethat should execute the job. To run on your local machine, omit this argument.

Default: “”

--datastore

The name of the AzureML datastore where the dataset is defined.

Default: “”

--dataset

The name of the AzureML dataset to use for creating the montage. The dataset will be mounted automatically. Use an absolute path to a folder on the local machine to bypass mounting.

Default: “”

--conda_env

The Conda environment file that should be used when submitting the present run to AzureML. If not specified, the hi-ml-cpath environment file will be used.

Default: hi-ml/hi-ml-cpath/environment.yml

--wait_for_completion

If True, wait for AML Run to complete before proceeding. If False, submit the run to AML and exit

Default: False

--docker_shm_size

The shared memory in the Docker image for the AzureML VMs.

Default: “100g”

--workspace_config_path

The path to the AzureML workspace configuration file. If not specified, the configuration file in the current folder or one of its parents will be used.

--display_name

The display name of the AzureML run. If not specified, a default name will be used.

Default: “”

--level

Resolution downsample level, e.g. if lowest resolution is 40x and the available downsample levels are [1.0, 4.0, 16.0] then level = 1 corresponds to 10x magnification

Default: 1

--exclude_by_slide_id

Provide a file that contains slide IDs that should be excluded. File format is CSV, the first column is used as the slide ID. If the file is empty, no slides will be excluded.

--include_by_slide_id

Provide a file that contains slide IDs that should be included. File format is CSV, the first column is used as the slide ID. If the file is empty, no montage will be produced.

--image_glob_pattern

When provided, use this pattern in rglob to find the files that should be included in the montage. Example: ‘**/*.tiff’ to find all TIFF files recursive. You may have to escape the pattern in your shell.

Default: “”

--width

The width of the montage in pixels

Default: 60000

--output_path

The folder where the montage will be saved

Default: outputs

--parallel

The number of parallel processes to use when creating the montage.

Default: 8

--backend

The backend to use for reading the slides. Can be ‘openslide’ or ‘cucim’

Default: “openslide”