exception pywi.processing.transform.starlet.StarletError[source]

Common starlet module’s error.

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

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


str – Explanation of the error.


Compute the starlet transform of input_image.

Pseudo code:

wavelet_transform(input_image, num_scales):

scales[0] $leftarrow$ input_image

for $i in [0, dots, ext{num_scales} - 2]$

$quad$ scales[$i + 1$] $leftarrow$ convolve(scales[$i$], $i$)

$quad$ scales[$i$] $leftarrow$ scales[$i$] - scales[$i + 1$]

Inspired by Sparce2D mr_transform (originally implemented in isap/cxx/sparse2d/src/libsparse2d/

```cpp static void mr_transform (Ifloat &Image,

MultiResol &MR_Transf, Bool EdgeLineTransform, type_border Border, Bool Details) {

// […] = Image; for (s = 0; s < Nbr_Plan -1; s++) {

smooth_bspline (,,Border,s); -=;

} // […]

  • 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.
  • 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).

Return a list containing the wavelet planes.

Return type:



WrongDimensionError – If input_image is not a 2D array.

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

Compute the inverse wavelet transform of wavelet_planes.

  • 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.

Return the cleaned image.

Return type: