Skip to main content

Open source implementation of the uniform discrete curvelet transform in Python.

Project description

Curvelets

Curvelets is an open-source implementation of the Uniform Discrete Curvelet Transform (UDCT) in the Python programming language for N-dimensional signals.

Getting Started | Features | FAQs | Examples

Actions Status Documentation Status codecov

PyPI version Conda-Forge PyPI platforms PyPI downloads OS-support License

GitHub Discussion

Getting Started

Installation

Curvelets can be installed directly from the PyPI index:

pip install curvelets

Curvelets supports Python 3.9 and above, NumPy 1.20 and above.

First Steps

Curvelets provides a very simple interface to use the UDCT, UDCT. Its only required argument is the shape of the inputs, but you can also supply the number of "scale" or "resolutions" (num_scales) as well as the number of wedges per direction (wedges_per_direction). The more scales there are, the more granular the distinction between a slowly-varying and a highly-varying feature. The more wedges there are, the more granular the distinction between the directions of the features.

import numpy as np
from curvelets.numpy import UDCT

x = np.ones((128, 128))
C = UDCT(shape=x.shape)
y = C.forward(x)
np.testing.assert_allclose(x, C.backward(y))

Features

Feature Status
N-D
Arbitrary input shapes
Real inputs ✅ [^real-ftn]
Complex inputs
Asymmetric directional resolution ✅ [^asymmetric-ftn]
Wavelet at highest scale ✅ [^wavelet-ftn]
Monogenic coefficients ✅ [^monogenic-ftn]
PyTorch bindings ✅ [^torch-ftn]

[^real-ftn]: Supports real inputs with reduced storage requirements which exploit the symmetry of the real-valued Fourier transform. [^asymmetric-ftn]: The directional resolution is asymmetric in the sense that the number of wedges per direction is different for each direction. [^wavelet-ftn]: Isotropic wavelets are supported. [^monogenic-ftn]: The monogenic curvelet transform was originally defined for 2D signals by Storath 2010, but this implementation extends it to arbitrary N-D signals by using all Riesz transform components (one per dimension). [^torch-ftn]: PyTorch bindings are supported. UDCTModule does not support the monogenic mode yet.

FAQs

What are curvelets?

Curvelets have a long history and rich history in signal processing. They have been used for a multitude of tasks related in areas such as biomedical imaging (ultrasound, MRI), seismic imaging, synthetic aperture radar, among others. They allow us to extract useful features which can be used to attack problems such as segmentation, inpaining, classification, adaptive subtraction, etc.

You can find a good overview (plug: I wrote it!) of curvelets in the Medium article Demystifying Curvelets.

Curvelets are like wavelets, but in 2D (3D, 4D, etc.). So are steerable wavelets, Gabor wavelets, wedgelets, beamlets, bandlets, contourlets, shearlets, wave atoms, platelets, surfacelets… you get the idea. Like wavelets, these "X-lets" allow us to separate a signal into different "scales" (analog to frequency in 1D, that is, how fast the signal is varying), "location" (equivalent to time in 1D) and the direction in which the signal is varying (which does not have 1D analog).

What separates curvelets from the other X-lets are their interesting properties, including:

  • The curvelet transform has an exact inverse,
  • Forward and inverse discrete curvelet transforms are efficient [1, 2],
  • The curvelet transform is N-dimensional,
  • Curvelets are optimally sparse for wave phenomena (seismic, ultrasound, electromagnetic, etc.) [3],
  • Curvelets have little redundancy, forming a tight frame [4].

Why do we need another curvelet transform library?

There are three flavors of the discrete curvelet transform with publicly available implementations [^f1]. The first two are based on the Fast Discrete Curvelet Transform (FDCT) pioneered by Candès, Demanet, Donoho and Ying. They are the "wrapping" and "USFFT" (unequally-spaced Fast Fourier Transform) versions of the FDCT. Both are implemented (2D and 3D for the wrapping version and 2D for the USFFT version) in the proprietary CurveLab Toolbox in Matlab and C++.

As of 2026, any non-academic use of the CurveLab Toolbox requires a commercial license. Any library which ports or converts Curvelab code to another language is also subject to Curvelab's license. While this does not include libraries which wrap the CurveLab toolbox and therefore do not contain any source code of Curvelab, their usage still requires Curvelab and therefore its license. Such wrappers include curvelops, PyCurvelab which are both MIT licensed.

A third flavor is the Uniform Discrete Curvelet Transform (UDCT) which does not have the same restrictive license as the FDCT. The UDCT was first implemented in Matlab (see ucurvmd [dead link]) by one of its authors, Truong Nguyen. The 2D version was ported to Julia as the Curvelet.jl package, whose development has since been abandoned.

This library provides the first open-source, pure-Python implementation of the UDCT, borrowing heavily from Nguyen's original implementation. The goal of this library is to allow industry professionals to use the UDCT more easily. It also goes beyond the original implementation by providing support for complex signals, monogenic [7] extension for real signals and a wavelet transform at the highest scale.

[^f1]: The Candès FDCTs and UDCTs are not the only curvelet transforms. To my knowledge, there is another implementation of the 3D Discrete Curvelet Transform named the LR-FCT (Low-Redudancy Fast Curvelet Transform) by Woiselle, Stack and Fadili [5], but the code seems to be unavailable online. The monogenic curvelet transform [7] does not have a publicly available implementation. The S2LET package implements curvelets on the sphere [8].

Can I use curvelets for deep-learning?

This is another facet of the "data-centric" vs. "model-centric" debate in machine learning. Exploiting curvelets is a type of model engineering when used as part of the model architecture, or feature engineering when used as a preprocessing step.

It has been shown that fixed filter banks can be useful in speeding up training and improving performance of deep neural networks [9], 10] in some cases. My suggestion is to use curvelets or similar transforms for small to mid-sized datasets, especially in niche areas without a wide variety of high-quality training data.

Another aspect to consider is the availability of high-performance, GPU-accelerated, autodiff-friendly libraries. As far as I know, no curvelet library (including this one) satisfies those constraints. Alternative transforms can be found in Kymatio and Pytorch Wavelets which implement the wavelet scattering transform [11] and dual-tree complex wavelet transform [12], respectively. The former provides PyTorch, TensorFlow and JAX bindings, while the latter provides PyTorch bindings.

Related Projects

Project Description License N-D? Invertible?
Curvelets UDCT in Python MIT N-D Exact
Curvelab FDCT in C++ and Matlab Proprietary (free for academic use only) 2D, 3D Exact
curvelops Curvelab Python wrapper MIT, depedends on Curvelab 2D, 3D Exact
Kymatio Wavelet scattering transform BSD 3-clause 1D, 2D, 3D Approximate
dtcwt Dual-Tree Complex Wavelet Transform Custom BSD 2-clause 1D, 2D, 3D Exact
Pytorch Wavelets Discrete WT and Dual-Tree CWT MIT 2D Exact

Credits

The original Matlab implementation was developed by one of the authors of the UDCT, Truong T. Nguyen. The Python implementation was developed by Carlos Alberto da Costa Filho and Duy Nguyen.

References

[1] Candès, E., L. Demanet, D. Donoho, and L. Ying, 2006, Fast Discrete Curvelet Transforms: Multiscale Modeling & Simulation, 5, 861–899.
[2] Nguyen, T. T., and H. Chauris, 2010, Uniform Discrete Curvelet Transform: IEEE Transactions on Signal Processing, 58, 3618–3634.
[3] Candès, E. J., and L. Demanet, 2005, The curvelet representation of wave propagators is optimally sparse: Communications on Pure and Applied Mathematics, 58, 1472–1528.
[4] Candès, E. J., and D. L. Donoho, 2003, New tight frames of curvelets and optimal representations of objects with piecewise C2 singularities: Communications on Pure and Applied Mathematics, 57, 219–266.
[5] Woiselle, A., J.-L. Starck, and J. Fadili, 2010, 3D curvelet transforms and astronomical data restoration: Applied and Computational Harmonic Analysis, 28, 171–188.
[6] Starck, Jean-Luc. F-CUR3D – CosmoStat: CosmoStat, 26 June 2017, www.cosmostat.org/software/f-cur3d. Accessed 25 Feb. 2024.
[7] Storath, M., 2010, The monogenic curvelet transform: 2010 IEEE International Conference on Image Processing.
[8] Chan, J. Y. H., B. Leistedt, T. D. Kitching, and J. D. McEwen, 2017, Second-Generation Curvelets on the Sphere: IEEE Transactions on Signal Processing, 65, 5–14.
[9] Luan, S., C. Chen, B. Zhang, J. Han, and J. Liu, 2018, Gabor Convolutional Networks: IEEE Transactions on Image Processing, 27, 4357–4366.
[10] Bruna, J., and S. Mallat, 2013, Invariant Scattering Convolution Networks: IEEE Transactions on Pattern Analysis and Machine Intelligence, 35, 1872–1886.
[11] Andreux, M., T. Angles, G. Exarchakis, R. Leonarduzzi, G. Rochette, L. Thiry, J. Zarka, S. Mallat, J. Andén, E. Belilovsky, J. Bruna, V. Lostanlen, M. Chaudhary, M. J. Hirn, E. Oyallon, S. Zhang, C. Cella, and M. Eickenberg, 2020, Kymatio: Scattering Transforms in Python: Journal of Machine Learning Research, 21(60), 1−6.
[12] Kingsbury, N., 2001, Complex Wavelets for Shift Invariant Analysis and Filtering of Signals: Applied and Computational Harmonic Analysis, 10, 234–253.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

curvelets-1.0.0.tar.gz (211.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

curvelets-1.0.0-py3-none-any.whl (95.0 kB view details)

Uploaded Python 3

File details

Details for the file curvelets-1.0.0.tar.gz.

File metadata

  • Download URL: curvelets-1.0.0.tar.gz
  • Upload date:
  • Size: 211.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for curvelets-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6a9661e5152f0f6bb17618eec1b43e58f3c003762d702ef382f15e4d1393120c
MD5 f86a27bb185145779597ae953e59be83
BLAKE2b-256 039ef51903e361f9199e942def6a9a9cda3cffa576da56e12d6265789d27b5fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for curvelets-1.0.0.tar.gz:

Publisher: cd.yml on cako/curvelets

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file curvelets-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: curvelets-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 95.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for curvelets-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 15cfbdd72d5c7c1b0fd120446874be341d9017d60cf6fd6efc9325e570988da8
MD5 0e172abf3dfeafee52f8ca07ed7c67fb
BLAKE2b-256 2485457f3d932aa9befc601f2710f8ed6f214aad8b34311ec3259a447dd616a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for curvelets-1.0.0-py3-none-any.whl:

Publisher: cd.yml on cako/curvelets

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page