pandora2d.multiscale.check_configuration
This module contains functions allowing to check the configuration given to MVP pipeline.
Attributes
Functions
|
Return tiff area for a given tif file_path |
|
Return list of tif files in pyramid repository |
|
Return list of tif files shape (height, width) |
|
Check if the given path leads to a repository containing at least one readable tif file. |
|
Check if the given path refers to a JSON file. |
|
Check if first and second pyramid repositories contain the same number of tif files. |
|
Check if mask pyramid repository contains the same number of tif files as image pyramid repository. |
|
Get the multiscale configuration |
|
Check multiscale section of configuration |
|
Get the pandora2d configuration |
|
Check pandora2d section of configuration |
|
Update pyramid configurations with list of tif files sorted by ascending size |
|
Check multiscale configuration |
Module Contents
- pandora2d.multiscale.check_configuration.tiff_area(file_path: pathlib.Path | str) int[source]
Return tiff area for a given tif file_path
- Parameters:
file_path – path to tif file
- Returns:
tif area width*height
- pandora2d.multiscale.check_configuration.get_tif_files_list(path: pathlib.Path) List[pathlib.Path][source]
Return list of tif files in pyramid repository sorted by file area
- Parameters:
path – path to pyramid repository
- Returns:
list of tif files sorted by size (width*height)
- pandora2d.multiscale.check_configuration.get_tif_shape_list(tif_files_list: List[pathlib.Path]) List[Tuple][source]
Return list of tif files shape (height, width)
- Parameters:
tif_files_list – list of path to tif files
- Returns:
list of shape (height, width) for each tif file in tif_files_list
- pandora2d.multiscale.check_configuration.is_repository_with_tif_file(path: os.PathLike | str) bool[source]
Check if the given path leads to a repository containing at least one readable tif file.
- Parameters:
path – path to a repository
- Returns:
whether the path refers to a valid repository or not
- pandora2d.multiscale.check_configuration.is_json_file(path: str | pathlib.Path) bool[source]
Check if the given path refers to a JSON file.
- Parameters:
path – path to a JSON file
- Returns:
whether the path refers to a JSON file or not
- pandora2d.multiscale.check_configuration.check_pyramid_repositories(first_pyramid_path: str | pathlib.Path, second_pyramid_path: str | pathlib.Path)[source]
Check if first and second pyramid repositories contain the same number of tif files. Check if tif files have correct suffix.
This method is used to check that the left and right image pyramids contain the same number of images, and that, if masks are specified, there are as many masks as there are images in the pyramids.
- Parameters:
first_pyramid_path – path to first pyramid repository
second_pyramid_path – path to second pyramid repository
- pandora2d.multiscale.check_configuration.check_mask_pyramid_repositories(user_cfg: Dict) None[source]
Check if mask pyramid repository contains the same number of tif files as image pyramid repository. Check if tif files have correct suffix.
- Parameters:
user_cfg – user configuration
- pandora2d.multiscale.check_configuration.get_multiscale_config(user_cfg: Dict[str, dict]) Dict[str, dict][source]
Get the multiscale configuration
- Parameters:
user_cfg – user configuration
- Return cfg:
partial configuration
- pandora2d.multiscale.check_configuration.check_multiscale_section(user_cfg) Dict[str, dict][source]
Check multiscale section of configuration
- Parameters:
user_cfg – user configuration
- Returns:
cfg: checked multiscale configuration
- pandora2d.multiscale.check_configuration.get_pandora2d_config(user_cfg: Dict[str, dict]) Dict[str, dict][source]
Get the pandora2d configuration
- Parameters:
user_cfg – user configuration
- Return cfg:
partial configuration
- pandora2d.multiscale.check_configuration.check_pandora2d_section(user_cfg) None[source]
Check pandora2d section of configuration
- Parameters:
user_cfg – user configuration
- Returns:
cfg: checked pandora2d configuration
- pandora2d.multiscale.check_configuration.update_pyramid_configuration(cfg_multiscale: Dict) None[source]
Update pyramid configurations with list of tif files sorted by ascending size instead of path to pyramid repository.
- Parameters:
cfg_multiscale – multiscale configuration