pandora2d.multiscale.check_configuration

This module contains functions allowing to check the configuration given to MVP pipeline.

Attributes

multiscale_configuration_schema

pandora2d_configuration_schema

default_configuration_multiscale

Functions

tiff_area(→ int)

Return tiff area for a given tif file_path

get_tif_files_list(→ List[pathlib.Path])

Return list of tif files in pyramid repository

get_tif_shape_list(→ List[Tuple])

Return list of tif files shape (height, width)

is_repository_with_tif_file(→ bool)

Check if the given path leads to a repository containing at least one readable tif file.

is_json_file(→ bool)

Check if the given path refers to a JSON file.

check_pyramid_repositories(first_pyramid_path, ...)

Check if first and second pyramid repositories contain the same number of tif files.

check_mask_pyramid_repositories(→ None)

Check if mask pyramid repository contains the same number of tif files as image pyramid repository.

get_multiscale_config(→ Dict[str, dict])

Get the multiscale configuration

check_multiscale_section(→ Dict[str, dict])

Check multiscale section of configuration

get_pandora2d_config(→ Dict[str, dict])

Get the pandora2d configuration

check_pandora2d_section(→ None)

Check pandora2d section of configuration

update_pyramid_configuration(→ None)

Update pyramid configurations with list of tif files sorted by ascending size

check_conf(→ Dict[str, dict])

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

pandora2d.multiscale.check_configuration.check_conf(user_cfg: Dict) Dict[str, dict][source]

Check multiscale configuration

Parameters:

user_cfg – user configuration

Returns:

cfg: checked multiscale configuration

pandora2d.multiscale.check_configuration.multiscale_configuration_schema[source]
pandora2d.multiscale.check_configuration.pandora2d_configuration_schema[source]
pandora2d.multiscale.check_configuration.default_configuration_multiscale[source]