pysap.base.loaders.loader_base#

class LoaderBase[source]#

Bases: object

Base class for all loaders.

allowed_extensions = []#
can_load(path)[source]#

A method checking the file extension.

Parameters

path (str) – the path to the image to be loaded.

Returns

out – True if the file extension is valid, False otherwise.

Return type

bool

load(path)[source]#

A method that load the image data and associated metadata.

Parameters

path (str) – the path to the image to be loaded.

Returns

image – the loaded image.

Return type

Image

can_save(outpath)[source]#

A method checking the output file extension.

Parameters

outpath (str) – the path where the the image will be saved.

Returns

out – True if the output file extension is valid, False otherwise.

Return type

bool

save(image, outpath)[source]#

A method that save the image data and associated metadata.

Parameters
  • image (Image) – the image to be saved.

  • outpath (str) – the path where the the image will be saved.