file.pgx_handler

Author: André Filipe da Silva Fernandes Affiliation: Embedded Computing Lab (ECL), Federal University of Santa Catarina (UFSC) Contributors:

Description:

This module is used to read and write PGX files.

class PGXHeader(width: int, height: int, depth: int, byteorder: int)[source]

Bases: object

Parameters:
  • width (int)

  • height (int)

  • depth (int)

  • byteorder (int)

width: int
height: int
depth: int
byteorder: int
class PGXHandler[source]

Bases: object

Handler for reading and writing PGX image files.

read(path)[source]

Reads a PGX file and returns the image data as a numpy array.

Parameters:

path (Union[str, Path]) – Path to the PGX file

Returns:

Image data as 2D numpy array

Return type:

np.ndarray

write(path, data)[source]

Writes image data to a PGX file.

Parameters:
  • path (Union[str, Path]) – Path to the output PGX file

  • data (np.ndarray) – Image data as 2D numpy array

Returns:

None

Return type:

None