Write
Functions relating to writing image files of different formats.
WriteFunc
Bases: Protocol
Protocol for type hinting write functions.
__call__(file_path, img, *args, **kwargs)
Type hinted callables must match this function signature (not including self).
Parameters:
-
file_path(Path) –Path to file.
-
img(ndarray) –Image data to save.
-
*args–Other positional arguments.
-
**kwargs–Other keyword arguments.
get_write_func(data_type)
write_tiff(file_path, img, *args, **kwargs)
Write tiff files.
Parameters:
-
file_path(Path) –Path to file.
-
img(ndarray) –Image data to save.
-
*args–Positional arguments passed to
tifffile.imwrite. -
**kwargs–Keyword arguments passed to
tifffile.imwrite.
Raises:
-
ValueError–When the file extension of
file_pathdoes not match the Unix shell-style pattern '.tif'.