pysap.base.loaders.mat#

class MAT[source]#

Bases: pysap.base.loaders.loader_base.LoaderBase

Define the ‘.mat’ file loader.

allowed_extensions = ['.mat']#
load(path, image_field='image', meta_field='metadata')[source]#

A method that load the data and associated metadata.

Parameters
  • path (str) – the path to the data to be loaded.

  • image_field (str, default 'image') – the name of the data field that contains the image array.

  • meta_field (str, default 'metadata') – the name of the data field that contains the image metadata.

Returns

image – the loaded image.

Return type

Image

save(image, outpath, image_field='image', meta_field='metadata')[source]#

A method that save the image and associated metadata.

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

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

  • image_field (str, default 'image') – the name of the data field that contains the image array.

  • meta_field (str, default 'metadata') – the name of the data field that contains the image metadata.