processing.transform.mrtransform_wrapper

exception pywi.processing.transform.mrtransform_wrapper.MrTransformError[source]

Common mrtransform_wrapper module’s error.

exception pywi.processing.transform.mrtransform_wrapper.WrongDimensionError(msg=None)[source]

Raised when data having a wrong number of dimensions is given.

msg

str – Explanation of the error.

pywi.processing.transform.mrtransform_wrapper.wavelet_transform(input_image, number_of_scales=4, tmp_files_directory='.', noise_distribution=None, debug=False)[source]

Compute the starlet transform of input_image.

Parameters:
  • input_image (array_like) – The input image to transform.
  • number_of_scales (int, optional) – The number of scales used to transform input_image or in other words the number of wavelet planes returned.
  • tmp_files_directory (str, optional) – The path of the directory used to store mr_transform temporary data. The default is the current directory, but it may be more appropriate to specify here the path of a directory mounted in a ramdisk to speedup I/Os (“/Volumes/ramdisk” on MacOSX or “/dev/shm” on Linux).
  • noise_distribution (EmpiricalDistribution, optional) – The noise distribution used to fill ‘empty’ NaN pixels with the appropriate random noise distribution. If none, NaN pixels are fill with zeros (which may add unwanted harmonics in wavelet planes).
Returns:

Return a list containing the wavelet planes.

Return type:

list

Raises:

WrongDimensionError – If input_image is not a 2D array.

pywi.processing.transform.mrtransform_wrapper.inverse_wavelet_transform(wavelet_planes, last_plane='mask')[source]

Compute the inverse wavelet transform of wavelet_planes.

Parameters:
  • wavelet_planes (list of array_like) – The wavelet planes to (inverse) transform.
  • last_plane (str, optional) – Define what to do with the last plane: ‘keep’ to keep it in the inverse transform, ‘drop’ to remove it in the inverse transform, ‘mask’ to keep only pixels that are significant in the others planes.
Returns:

Return the cleaned image.

Return type:

array_like