sparkocr.utils.svs.tile_extraction#

Module Contents#

Functions#

chunk(lst, n)

Yield successive n-sized chunks from lst.

extract_tile(args)

find_thumbnail_page(tif)

Finds the thumbnail page using Aperio SVS conventions.

get_mid_level_tiles(flat_tiles_folder[, output_folder])

get_optimal_workers_and_batch([mem_per_worker_gb, ...])

Calculate optimal number of workers and batch size based on system memory and CPU.

process_svs(svs_file, output_root, num_workers[, ...])

svs_to_tiles(input_path, output_root[, level, thumbnail])

chunk(lst, n)#

Yield successive n-sized chunks from lst.

extract_tile(args)#
find_thumbnail_page(tif)#

Finds the thumbnail page using Aperio SVS conventions.

get_mid_level_tiles(flat_tiles_folder, output_folder=None)#
get_optimal_workers_and_batch(mem_per_worker_gb=1.5, ram_fraction=0.75, min_batch=1, max_batch=8)#

Calculate optimal number of workers and batch size based on system memory and CPU. Leaves headroom (e.g., 35%) to avoid saturation.

process_svs(svs_file, output_root, num_workers, level='auto', thumbnail=False)#
svs_to_tiles(input_path, output_root, level='auto', thumbnail=False)#