tiff

io

auxiliary.tiff.io.read_tiff(tiff_path: str) ndarray

Read a TIFF file and return its data as a NumPy array.

Parameters:

tiff_path (str) – Path to the TIFF file to be read.

Returns:

Data from the TIFF file as a NumPy array.

Return type:

np.ndarray

auxiliary.tiff.io.write_tiff(numpy_array: ndarray, output_tiff_path: str, create_parent_directory: bool = False, transpose: bool = False) None

Write a NumPy array to a TIFF file.

Parameters:
  • numpy_array (np.ndarray) – NumPy array containing the data to be written.

  • output_tiff_path (str) – Path to the output TIFF file.

  • create_parent_directory (bool) – Whether to create the parent directory if it doesn’t exist.

  • transpose (bool) – Whether to transpose the input array before writing.