pysap.utils#

A module with common functions to list and load transformations.

wavelist(family=None)[source]#

List/sort all available transforms.

Parameters

family (str or list of str, default None) – the family wave family name.

Returns

transforms – the requested transforms.

Return type

dict

load_image(image_path)[source]#

Load an image.

Parameters

image_path (str) – the image path.

Returns

image – the loaded image.

Return type

Image

save_image(image, image_path)[source]#

Save an image.

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

  • image_path (str) – the image path.

load_transform(name)[source]#

Load a transformation using his name.

All the available transfroms are stored in the ‘pysap.AVAILABLE_TRANSFORMS’ parameter.

Parameters

name (str) – the name of the desired transformation.

Returns

transform – the transformation.

Return type

WaveletTransformBase

class TempDir(isap=False)[source]#

Bases: object

Create a tempdir with the with synthax.

_mkdtemp_isap()[source]#

Method to generate a temporary folder compatible with the ISAP implementation.

If ‘jpg’ or ‘pgm’ (with any case for each letter) are in the pathname, it will corrupt the format detection in ISAP.

Returns

tmpdir – the generated ISAP compliant temporary folder.

Return type

str

pySAP logo is ascii art using fender font.

Returns

logo – the pysap logo.

Return type

str

Return a nice ascii logo for the FISTA optimization using the dansing font.

Returns

logo – the desired ascii logo.

Return type

str

Return a nice ascii logo for the CONDAT-VU optimization using the dansing font.

Returns

logo – the desired ascii logo.

Return type

str