Skip to content

wkcuber.tile_cubing

# &nbsp def check_input_pattern(input_pattern: str) -> str:
# &nbsp def path_from_coordinate_pattern( pattern: str, coord_ids_with_replacement_info: Dict[str, Tuple[int, int]] ) -> pathlib.Path:

Formulates a path from the given pattern and coordinate info.

The coord_ids_with_replacement_info is a Dict that maps a dimension to a tuple of the coordinate value and the desired length.

# &nbsp def parse_coordinate_pattern(pattern: str) -> Tuple[List[re.Pattern], pathlib.Path]:

Creates a list of all subdirectores in pattern as regexes

Only starts creating regexes from the first path component that contains a coordinate template string (eg. {x}), these are returned as a pathlib.Path as the second component of the return value.

Raises ValueError in case the pattern is incorrectly formatted.

# &nbsp def detect_interval_for_dimensions( file_path_pattern: str ) -> Tuple[Dict[str, int], Dict[str, int], Dict[str, int], Union[pathlib.Path, NoneType], int]:

Searches filesystem for all files that will match the given pattern.

Returns the needed information to find all matching files, in order:

  • The minimum amount of length of each coordinate, this represents the amount of leading zeros that should be added inside shorter filenames
  • The lowest value of indexes of each coordinate.
  • The highest value of indexes of each coordinate.
  • The first matching file found.
  • The total amount of matching files.

Raises RuntimeError in case padding is not used in a consistent way.

# &nbsp def tile_cubing_job( args: Tuple[webknossos.dataset.view.View, List[int], str, int, Tuple[int, int, int], Dict[str, int], Dict[str, int], Dict[str, int], str, int] ) -> int:
# &nbsp def tile_cubing( target_path: pathlib.Path, layer_name: str, batch_size: int, input_path_pattern: str, voxel_size: Tuple[int, int, int], args: argparse.Namespace, executor: Union[cluster_tools.schedulers.cluster_executor.ClusterExecutor, cluster_tools.executors.multiprocessing.MultiprocessingExecutor] ) -> None:
# &nbsp def create_parser() -> argparse.ArgumentParser: