magmap.io.naming module#

magmap.io.naming.get_roi_path(path, offset, roi_size=None)[source]#

Get a string describing an ROI for an image at a given path.

Parameters:
  • path (str) – Path to include in string, without extension.

  • offset (List[int]) – Offset of ROI.

  • roi_size (List[int]) – Shape of ROI; defaults to None to ignore.

Returns:

String with path without extension followed immediately by offset and roi_size as tuples, with all spaces removed.

Return type:

str

magmap.io.naming.make_subimage_name(base, offset=None, shape=None, suffix=None)[source]#

Make name of subimage for a given offset and shape.

The order of offset and shape are assumed to be in z, y, x but will be reversed for the output name since the user-oriented ordering is x, y, z.

Parameters:
  • base (str) – Start of name, which can include full parent path.

  • offset (Optional[Tuple[int, int, int]], default: None) – Offset as a tuple; defaults to None to ignore sub-image.

  • shape (Optional[Tuple[int, int, int]], default: None) – Shape as a tuple; defaults to None to ignore sub-image.

  • suffix (Optional[str], default: None) – Suffix to append, replacing any existing extension in base; defaults to None.

Return type:

str

Returns:

Name (or path) to subimage.