curvelets 0.0.2a0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. curvelets-0.0.2a0/.git_archival.txt +4 -0
  2. curvelets-0.0.2a0/.gitattributes +1 -0
  3. curvelets-0.0.2a0/.gitignore +162 -0
  4. curvelets-0.0.2a0/.pre-commit-config.yaml +83 -0
  5. curvelets-0.0.2a0/.readthedocs.yaml +18 -0
  6. curvelets-0.0.2a0/LICENSE +19 -0
  7. curvelets-0.0.2a0/Makefile +57 -0
  8. curvelets-0.0.2a0/PKG-INFO +205 -0
  9. curvelets-0.0.2a0/README.md +139 -0
  10. curvelets-0.0.2a0/docs/conf.py +51 -0
  11. curvelets-0.0.2a0/docs/index.md +19 -0
  12. curvelets-0.0.2a0/examples/README.rst +4 -0
  13. curvelets-0.0.2a0/examples/plot_zone_plate.py +165 -0
  14. curvelets-0.0.2a0/noxfile.py +118 -0
  15. curvelets-0.0.2a0/pyproject.toml +160 -0
  16. curvelets-0.0.2a0/src/curvelets/__init__.py +13 -0
  17. curvelets-0.0.2a0/src/curvelets/_version.py +16 -0
  18. curvelets-0.0.2a0/src/curvelets/_version.pyi +4 -0
  19. curvelets-0.0.2a0/src/curvelets/numpy/__init__.py +7 -0
  20. curvelets-0.0.2a0/src/curvelets/numpy/typing.py +21 -0
  21. curvelets-0.0.2a0/src/curvelets/numpy/udct.py +167 -0
  22. curvelets-0.0.2a0/src/curvelets/numpy/udctmdwin.py +315 -0
  23. curvelets-0.0.2a0/src/curvelets/numpy/utils.py +170 -0
  24. curvelets-0.0.2a0/src/curvelets/plot/__init__.py +4 -0
  25. curvelets-0.0.2a0/src/curvelets/plot/_matplotlib.py +70 -0
  26. curvelets-0.0.2a0/src/curvelets/py.typed +0 -0
  27. curvelets-0.0.2a0/src/curvelets/reference/__init__.py +5 -0
  28. curvelets-0.0.2a0/src/curvelets/reference/_adapt_grid.py +39 -0
  29. curvelets-0.0.2a0/src/curvelets/reference/_angle_fun.py +30 -0
  30. curvelets-0.0.2a0/src/curvelets/reference/_angle_kron.py +23 -0
  31. curvelets-0.0.2a0/src/curvelets/reference/_circshift.py +8 -0
  32. curvelets-0.0.2a0/src/curvelets/reference/_downsamp.py +54 -0
  33. curvelets-0.0.2a0/src/curvelets/reference/_fftflip.py +16 -0
  34. curvelets-0.0.2a0/src/curvelets/reference/_fun_meyer.py +58 -0
  35. curvelets-0.0.2a0/src/curvelets/reference/_travel.py +5 -0
  36. curvelets-0.0.2a0/src/curvelets/reference/_upsamp.py +11 -0
  37. curvelets-0.0.2a0/src/curvelets/reference/udct.py +94 -0
  38. curvelets-0.0.2a0/src/curvelets/reference/udctmdwin.py +283 -0
  39. curvelets-0.0.2a0/tests/test_numpy.py +249 -0
  40. curvelets-0.0.2a0/tests/test_package.py +9 -0
@@ -0,0 +1,4 @@
1
+ node: $Format:%H$
2
+ node-date: $Format:%cI$
3
+ describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
4
+ ref-names: $Format:%D$
@@ -0,0 +1 @@
1
+ .git_archival.txt export-subst
@@ -0,0 +1,162 @@
1
+ .vscode/
2
+ docs/auto_examples
3
+ sg_execution_times.rst
4
+
5
+ # Byte-compiled / optimized / DLL files
6
+ __pycache__/
7
+ *.py[cod]
8
+ *$py.class
9
+
10
+ # C extensions
11
+ *.so
12
+
13
+ # Distribution / packaging
14
+ .Python
15
+ build/
16
+ develop-eggs/
17
+ dist/
18
+ downloads/
19
+ eggs/
20
+ .eggs/
21
+ lib/
22
+ lib64/
23
+ parts/
24
+ sdist/
25
+ var/
26
+ wheels/
27
+ share/python-wheels/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+ MANIFEST
32
+
33
+ # PyInstaller
34
+ # Usually these files are written by a python script from a template
35
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
36
+ *.manifest
37
+ *.spec
38
+
39
+ # Installer logs
40
+ pip-log.txt
41
+ pip-delete-this-directory.txt
42
+
43
+ # Unit test / coverage reports
44
+ htmlcov/
45
+ .tox/
46
+ .nox/
47
+ .coverage
48
+ .coverage.*
49
+ .cache
50
+ nosetests.xml
51
+ coverage.xml
52
+ *.cover
53
+ *.py,cover
54
+ .hypothesis/
55
+ .pytest_cache/
56
+ cover/
57
+
58
+ # Translations
59
+ *.mo
60
+ *.pot
61
+
62
+ # Django stuff:
63
+ *.log
64
+ local_settings.py
65
+ db.sqlite3
66
+ db.sqlite3-journal
67
+
68
+ # Flask stuff:
69
+ instance/
70
+ .webassets-cache
71
+
72
+ # Scrapy stuff:
73
+ .scrapy
74
+
75
+ # Sphinx documentation
76
+ docs/_build/
77
+
78
+ # PyBuilder
79
+ .pybuilder/
80
+ target/
81
+
82
+ # Jupyter Notebook
83
+ .ipynb_checkpoints
84
+
85
+ # IPython
86
+ profile_default/
87
+ ipython_config.py
88
+
89
+ # pyenv
90
+ # For a library or package, you might want to ignore these files since the code is
91
+ # intended to run in multiple environments; otherwise, check them in:
92
+ # .python-version
93
+
94
+ # pipenv
95
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
96
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
97
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
98
+ # install all needed dependencies.
99
+ #Pipfile.lock
100
+
101
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
102
+ __pypackages__/
103
+
104
+ # Celery stuff
105
+ celerybeat-schedule
106
+ celerybeat.pid
107
+
108
+ # SageMath parsed files
109
+ *.sage.py
110
+
111
+ # Environments
112
+ .env
113
+ .venv*
114
+ env/
115
+ venv*/
116
+ ENV/
117
+ env.bak/
118
+ venv.bak/
119
+
120
+ # Spyder project settings
121
+ .spyderproject
122
+ .spyproject
123
+
124
+ # Rope project settings
125
+ .ropeproject
126
+
127
+ # mkdocs documentation
128
+ /site
129
+
130
+ # mypy
131
+ .mypy_cache/
132
+ .dmypy.json
133
+ dmypy.json
134
+
135
+ # Pyre type checker
136
+ .pyre/
137
+
138
+ # pytype static type analyzer
139
+ .pytype/
140
+
141
+ # Cython debug symbols
142
+ cython_debug/
143
+
144
+ # setuptools_scm
145
+ src/*/_version.py
146
+
147
+
148
+ # ruff
149
+ .ruff_cache/
150
+
151
+ # OS specific stuff
152
+ .DS_Store
153
+ .DS_Store?
154
+ ._*
155
+ .Spotlight-V100
156
+ .Trashes
157
+ ehthumbs.db
158
+ Thumbs.db
159
+
160
+ # Common editor files
161
+ *~
162
+ *.swp
@@ -0,0 +1,83 @@
1
+ ci:
2
+ autoupdate_commit_msg: "chore: update pre-commit hooks"
3
+ autofix_commit_msg: "style: pre-commit fixes"
4
+
5
+ repos:
6
+ - repo: https://github.com/adamchainz/blacken-docs
7
+ rev: "1.19.1"
8
+ hooks:
9
+ - id: blacken-docs
10
+ additional_dependencies: [black==23.*]
11
+
12
+ - repo: https://github.com/pre-commit/pre-commit-hooks
13
+ rev: "v5.0.0"
14
+ hooks:
15
+ - id: check-added-large-files
16
+ - id: check-case-conflict
17
+ - id: check-merge-conflict
18
+ - id: check-symlinks
19
+ - id: check-yaml
20
+ - id: debug-statements
21
+ - id: end-of-file-fixer
22
+ - id: mixed-line-ending
23
+ - id: name-tests-test
24
+ args: ["--pytest-test-first"]
25
+ - id: requirements-txt-fixer
26
+ - id: trailing-whitespace
27
+
28
+ - repo: https://github.com/pre-commit/pygrep-hooks
29
+ rev: "v1.10.0"
30
+ hooks:
31
+ - id: rst-backticks
32
+ - id: rst-directive-colons
33
+ - id: rst-inline-touching-normal
34
+
35
+ - repo: https://github.com/astral-sh/ruff-pre-commit
36
+ rev: "v0.7.4"
37
+ hooks:
38
+ - id: ruff
39
+ args: ["--fix", "--show-fixes"]
40
+ exclude: reference
41
+ - id: ruff-format
42
+ exclude: reference
43
+
44
+ - repo: https://github.com/pre-commit/mirrors-mypy
45
+ rev: "v1.13.0"
46
+ hooks:
47
+ - id: mypy
48
+ args: ["--follow-imports=skip"]
49
+ exclude: src/curvelets/reference|noxfile.py
50
+ additional_dependencies:
51
+ - pytest
52
+
53
+ - repo: https://github.com/codespell-project/codespell
54
+ rev: "v2.3.0"
55
+ hooks:
56
+ - id: codespell
57
+ exclude: '\.ipynb$'
58
+
59
+ - repo: https://github.com/shellcheck-py/shellcheck-py
60
+ rev: "v0.10.0.1"
61
+ hooks:
62
+ - id: shellcheck
63
+
64
+ - repo: local
65
+ hooks:
66
+ - id: disallow-caps
67
+ name: Disallow improper capitalization
68
+ language: pygrep
69
+ entry: PyBind|Numpy|Cmake|CCache|Github|PyTest
70
+ exclude: .pre-commit-config.yaml
71
+
72
+ - repo: https://github.com/abravalheri/validate-pyproject
73
+ rev: "v0.23"
74
+ hooks:
75
+ - id: validate-pyproject
76
+ additional_dependencies: ["validate-pyproject-schema-store[all]"]
77
+
78
+ - repo: https://github.com/python-jsonschema/check-jsonschema
79
+ rev: "0.29.4"
80
+ hooks:
81
+ - id: check-dependabot
82
+ - id: check-github-workflows
83
+ - id: check-readthedocs
@@ -0,0 +1,18 @@
1
+ # Read the Docs configuration file
2
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3
+
4
+ version: 2
5
+
6
+ build:
7
+ os: ubuntu-22.04
8
+ tools:
9
+ python: "3.11"
10
+ sphinx:
11
+ configuration: docs/conf.py
12
+
13
+ python:
14
+ install:
15
+ - method: pip
16
+ path: .
17
+ extra_requirements:
18
+ - docs
@@ -0,0 +1,19 @@
1
+ Copyright 2024 Carlos Alberto da Costa Filho
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ this software and associated documentation files (the "Software"), to deal in
5
+ the Software without restriction, including without limitation the rights to
6
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7
+ of the Software, and to permit persons to whom the Software is furnished to do
8
+ so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
@@ -0,0 +1,57 @@
1
+ UV := $(shell command -v uv 2> /dev/null || command which uv 2> /dev/null)
2
+
3
+ .PHONY: test
4
+
5
+ uvcheck:
6
+ ifndef UV
7
+ $(error "Ensure uv is in your PATH")
8
+ endif
9
+ @echo Using uv: $(UV)
10
+
11
+
12
+ test39:
13
+ make uvcheck
14
+ $(UV) tool run nox -s tests-3.9
15
+
16
+ test310:
17
+ make uvcheck
18
+ $(UV) tool run nox -s tests-3.10
19
+
20
+ test311:
21
+ make uvcheck
22
+ $(UV) tool run nox -s tests-3.11
23
+
24
+ test312:
25
+ make uvcheck
26
+ $(UV) tool run nox -s tests-3.12
27
+
28
+ test313:
29
+ make uvcheck
30
+ $(UV) tool run nox -s tests-3.13
31
+
32
+ test:
33
+ make test39
34
+ make test310
35
+ make test311
36
+ make test312
37
+ make test313
38
+
39
+ lint:
40
+ make uvcheck
41
+ $(UV) tool run nox -s lint
42
+
43
+ pylint:
44
+ make uvcheck
45
+ $(UV) tool run nox -s pylint
46
+
47
+ docs:
48
+ make uvcheck
49
+ $(UV) tool run nox -s docs
50
+
51
+ servedocs:
52
+ make uvcheck
53
+ $(UV) tool run nox -s docs -- --serve --port 1234
54
+
55
+ precommitupdate:
56
+ make uvcheck
57
+ $(UV) tool run pre-commit autoupdate
@@ -0,0 +1,205 @@
1
+ Metadata-Version: 2.3
2
+ Name: curvelets
3
+ Version: 0.0.2a0
4
+ Summary: Open source implementation of the uniform discrete curvelet transform in Python.
5
+ Project-URL: Homepage, https://github.com/cako/curvelets
6
+ Project-URL: Bug Tracker, https://github.com/cako/curvelets/issues
7
+ Project-URL: Discussions, https://github.com/cako/curvelets/discussions
8
+ Project-URL: Changelog, https://github.com/cako/curvelets/releases
9
+ Author-email: Carlos Alberto da Costa Filho <c.dacostaf@gmail.com>
10
+ License: Copyright 2024 Carlos Alberto da Costa Filho
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
13
+ this software and associated documentation files (the "Software"), to deal in
14
+ the Software without restriction, including without limitation the rights to
15
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
16
+ of the Software, and to permit persons to whom the Software is furnished to do
17
+ so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+ Classifier: Development Status :: 2 - Pre-Alpha
30
+ Classifier: Intended Audience :: Developers
31
+ Classifier: Intended Audience :: Science/Research
32
+ Classifier: License :: OSI Approved :: MIT License
33
+ Classifier: Natural Language :: English
34
+ Classifier: Operating System :: OS Independent
35
+ Classifier: Programming Language :: Python
36
+ Classifier: Programming Language :: Python :: 3
37
+ Classifier: Programming Language :: Python :: 3 :: Only
38
+ Classifier: Programming Language :: Python :: 3.9
39
+ Classifier: Programming Language :: Python :: 3.10
40
+ Classifier: Programming Language :: Python :: 3.11
41
+ Classifier: Programming Language :: Python :: 3.12
42
+ Classifier: Topic :: Scientific/Engineering
43
+ Classifier: Topic :: Scientific/Engineering :: Image Processing
44
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
45
+ Classifier: Typing :: Typed
46
+ Requires-Python: >=3.9
47
+ Requires-Dist: numpy>=1.20
48
+ Requires-Dist: typing-extensions; python_version <= '3.10'
49
+ Provides-Extra: dev
50
+ Requires-Dist: pytest-cov>=3; extra == 'dev'
51
+ Requires-Dist: pytest>=6; extra == 'dev'
52
+ Provides-Extra: docs
53
+ Requires-Dist: furo>=2023.08.17; extra == 'docs'
54
+ Requires-Dist: matplotlib; extra == 'docs'
55
+ Requires-Dist: myst-parser>=0.13; extra == 'docs'
56
+ Requires-Dist: sphinx-autodoc-typehints; extra == 'docs'
57
+ Requires-Dist: sphinx-copybutton; extra == 'docs'
58
+ Requires-Dist: sphinx-gallery; extra == 'docs'
59
+ Requires-Dist: sphinx>=7.0; extra == 'docs'
60
+ Provides-Extra: matplotlib
61
+ Requires-Dist: matplotlib; extra == 'matplotlib'
62
+ Provides-Extra: test
63
+ Requires-Dist: pytest-cov>=3; extra == 'test'
64
+ Requires-Dist: pytest>=6; extra == 'test'
65
+ Description-Content-Type: text/markdown
66
+
67
+ # Curvelets
68
+
69
+ > [!WARNING]
70
+ > **This project is in *very* early development! Expect bugs!**
71
+
72
+
73
+ <h3>
74
+ <a href="#getting-started">Getting Started</a>
75
+ <span> | </span>
76
+ <a href="#FAQs">FAQs</a>
77
+ <span> | </span>
78
+ <a href="https://curvelets.readthedocs.io/en/latest/auto_examples/index.html">Examples</a>
79
+ </h3>
80
+
81
+ [![Actions Status][actions-badge]][actions-link]
82
+ [![Documentation Status](https://readthedocs.org/projects/curvelets/badge/?version=latest)](https://curvelets.readthedocs.io/en/latest/?badge=latest)
83
+ [![codecov](https://codecov.io/github/cako/curvelets/graph/badge.svg?token=T16E0ANTLR)](https://codecov.io/github/cako/curvelets)
84
+
85
+ [![PyPI version][pypi-version]][pypi-link]
86
+ [![Conda-Forge][conda-badge]][conda-link]
87
+ [![PyPI platforms][pypi-platforms]][pypi-link]
88
+ ![PyPI downloads](https://img.shields.io/pypi/dm/curvelets.svg?label=Pypi%20downloads)
89
+ ![OS-support](https://img.shields.io/badge/OS-linux,win,osx-850A8B.svg)
90
+ ![License](https://img.shields.io/github/license/cako/curvelets)
91
+
92
+ [![GitHub Discussion][github-discussions-badge]][github-discussions-link]
93
+
94
+ <!-- SPHINX-START -->
95
+
96
+ <!-- prettier-ignore-start -->
97
+ [actions-badge]: https://github.com/cako/curvelets/workflows/CI/badge.svg
98
+ [actions-link]: https://github.com/cako/curvelets/actions
99
+ [conda-badge]: https://img.shields.io/conda/vn/conda-forge/Curvelets
100
+ [conda-link]: https://github.com/conda-forge/Curvelets-feedstock
101
+ [github-discussions-badge]: https://img.shields.io/static/v1?label=Discussions&message=Ask&color=blue&logo=github
102
+ [github-discussions-link]: https://github.com/cako/curvelets/discussions
103
+ [pypi-link]: https://pypi.org/project/Curvelets/
104
+ [pypi-platforms]: https://img.shields.io/pypi/pyversions/Curvelets
105
+ [pypi-version]: https://img.shields.io/pypi/v/Curvelets
106
+ [rtd-badge]: https://readthedocs.org/projects/Curvelets/badge/?version=latest
107
+ [rtd-link]: https://Curvelets.readthedocs.io/en/latest/?badge=latest
108
+
109
+ <!-- prettier-ignore-end -->
110
+ ## Getting stated
111
+
112
+ ```python
113
+ import numpy as np
114
+ from curvelets.numpy import SimpleUDCT
115
+
116
+ x = np.ones((128, 128))
117
+ C = SimpleUDCT(shape=x.shape)
118
+ y = C.forward(x)
119
+ np.testing.assert_allclose(x, C.backward(y))
120
+ ```
121
+
122
+ You can use `SimpleUDCT` very similarly to `FDCT` from [curvelops](https://github.com/PyLops/curvelops), with a limitation that SimpleUDCT only operates arrays whose sizes are powers of 2.
123
+
124
+
125
+
126
+ ## FAQs
127
+
128
+ ### 0. Should I use this library?
129
+
130
+ Probably not! This library is a work in progress, pre-alpha library for a very specific version of the curvelet transform known as the Uniform Discrete Curvelet Transform (UDCT).
131
+
132
+ Consider using other, more mature projects.
133
+
134
+ | | Description | License | N-D? | Shape | Invertible? |
135
+ | ----------------------------------------------------------- | ----------------------------------- | ---------------------------------------- | ---------- | ----------- | ----------- |
136
+ | curvelets | UDCT in Python | MIT | N-D | Powers of 2 | Exact |
137
+ | [Curvelab](https://curvelet.org/software.php) | FDCT in C++ and Matlab | Proprietary (free for academic use only) | 2D, 3D | Any | Exact |
138
+ | [curvelops](https://github.com/PyLops/curvelops) | Curvelab Python wrapper | MIT, depedends on Curvelab | 2D, 3D | Any | Exact |
139
+ | [Kymatio](https://www.kymat.io/) | Wavelet scattering transform | BSD 3-clause | 1D, 2D, 3D | Any | Approximate |
140
+ | [dtcwt](https://dtcwt.readthedocs.io) | Dual-Tree Complex Wavelet Transform | Custom BSD 2-clause | 1D, 2D, 3D | Any | Exact |
141
+ | [Pytorch Wavelets](https://pytorch-wavelets.readthedocs.io) | Discrete WT and Dual-Tree CWT | MIT | 2D | Any | Exact |
142
+
143
+
144
+
145
+ ### 1. What even *are* curvelets?
146
+
147
+ Curvelets are like wavelets, but in 2D (3D, 4D, etc.). But 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).
148
+
149
+ What separates curvelets from the other X-lets are their interesting properties, including:
150
+ * The curvelet transform has an exact inverse
151
+ * The discrete curvelet transform has efficient decomposition ("analysis") and reconstruction ("synthesis") implementations [[1](#1-candès-e-l-demanet-d-donoho-and-l-ying-2006-fast-discrete-curvelet-transforms-multiscale-modeling--simulation-5-861899), [2](#2-nguyen-t-t-and-h-chauris-2010-uniform-discrete-curvelet-transform-ieee-transactions-on-signal-processing-58-36183634)]
152
+ * The curvelet transform is naturally N-dimensional
153
+ * Curvelet basis functions yield an optimally sparse representation of wave phenomena (seismic data, ultrasound data, etc.) [[3](#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-14721528)]
154
+ * Curvelets have little redundancy, forming a _tight frame_ [[4](#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-219266)]
155
+
156
+ You can find a good overview (plug: I wrote it!) of curvelets in the Medium article [Demystifying Curvelets](https://towardsdatascience.com/desmystifying-curvelets-c6d88faba0bf).
157
+
158
+ ### 2. Why should I care about curvelets?
159
+ 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.
160
+
161
+ ### 3. Why do we need another curvelet transform library?
162
+
163
+ There are three flavors of the discrete curvelet transform with available implementations. 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 only for the USFFT version) in the proprietary [CurveLab Toolbox](http://www.curvelet.org/software.html) in Matlab and C++.
164
+
165
+ As of 2024, any non-academic use of the CurveLab Toolbox requires a commercial license. This includes libraries which wrap the CurveLab toolbox such as pybind11-based wrapper [curvelops](https://github.com/PyLops/curvelops), Python SWIG-based wrapper [PyCurvelab](https://github.com/slimgroup/PyCurvelab). Neither curvelops nor PyCurvelab package include any source code of Curvelab. It should be noted, however, that any library which ports or converts Curvelab code to another language is subject to Curvelab's license. Again, neither curvelops or PyCurvelab do so, and can therefore be freely distributed as per their licenses (both have MIT licenses).
166
+
167
+ 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](https://github.com/nttruong7/ucurvmd) \[dead link\]) by one of its authors, Truong Nguyen. The 2D version was ported to Julia as the [Curvelet.jl](https://github.com/fundamental/Curvelet.jl) package, whose development has since been abandoned.
168
+
169
+ This library provides the first pure-Python implementation of the UDCT, borrowing heavily from Nguyen's original implementation. The goal of this library is to allow industry processionals to use the UDCT more easily.
170
+
171
+ Note: The Candès FDCTs and Nguyen UDCT 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](#5-woiselle-a-j-l-starck-and-j-fadili-2010-3d-curvelet-transforms-and-astronomical-data-restoration-applied-and-computational-harmonic-analysis-28-171188)], but the code seems to have disappeared off the internet [[6](#6-starck-jean-luc-f-cur3d--cosmostat-cosmostat-26-june-2017-wwwcosmostatorgsoftwaref-cur3d-accessed-25-feb-2024)]. Moreover, there is also another type of continuous curvelet transform, the monogenic curvelet transform [[7](#7-storath-m-2010-the-monogenic-curvelet-transform-2010-ieee-international-conference-on-image-processing)], but I have found no implementation available.
172
+ Lastly, the [S2LET](https://astro-informatics.github.io/s2let/) package the equivalent of curvelets but on the sphere [[8](#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-514)].
173
+
174
+ ### 4. Can I use curvelets for deep-learning?
175
+ This is another facet of the "data-centric" vs "model-centric" debate in machine learning. Exploiting curvelets is a type of model engineering, as opposed to using conventional model architectures and letting the data guide the learning process. Alternatively, if the transform is used as a preprocessing step, it can be seen from as feature engineering.
176
+
177
+ My suggestion is to use curvelets and other transforms for small to mid-sized datasets, especially in niche areas without a wide variety of high-quality tranining data. It has been shown that fixed filter banks can be useful in speeding up training and improving performance of deep neural networks [[9](#9-luan-s-c-chen-b-zhang-j-han-and-j-liu-2018-gabor-convolutional-networks-ieee-transactions-on-image-processing-27-43574366), [10](#10-bruna-j-and-s-mallat-2013-invariant-scattering-convolution-networks-ieee-transactions-on-pattern-analysis-and-machine-intelligence-35-18721886)] in some cases.
178
+
179
+ Another expected to consider is the availability of high-performance, GPU-accelerated and autodiff-friendly libraries. As far as I know, no curvelet library (including this one) satisfies those constraints. Alternative transforms can be found in [Kymatio](https://www.kymat.io/) and [Pytorch Wavelets](https://pytorch-wavelets.readthedocs.io/en/latest/readme.html) which implement the wavelet scattering transform [[11](#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-2160-16)] and dual-tree complex wavelet transform, respectively [[12](#12-kingsbury-n-2001-complex-wavelets-for-shift-invariant-analysis-and-filtering-of-signals-applied-and-computational-harmonic-analysis-10-234253)].
180
+
181
+ ## References
182
+ ##### [1] Candès, E., L. Demanet, D. Donoho, and L. Ying, 2006, *Fast Discrete Curvelet Transforms*: Multiscale Modeling & Simulation, 5, 861–899.
183
+
184
+ ##### [2] Nguyen, T. T., and H. Chauris, 2010, *Uniform Discrete Curvelet Transform*: IEEE Transactions on Signal Processing, 58, 3618–3634.
185
+
186
+ ##### [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.
187
+
188
+ ##### [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.
189
+
190
+ ##### [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.
191
+
192
+ ##### [6] Starck, Jean-Luc. *F-CUR3D – CosmoStat*: CosmoStat, 26 June 2017, www.cosmostat.org/software/f-cur3d. Accessed 25 Feb. 2024.
193
+
194
+ ##### [7] Storath, M., 2010, *The monogenic curvelet transform*: 2010 IEEE International Conference on Image Processing.
195
+
196
+ ##### [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.
197
+
198
+
199
+ ##### [9] Luan, S., C. Chen, B. Zhang, J. Han, and J. Liu, 2018, *Gabor Convolutional Networks*: IEEE Transactions on Image Processing, 27, 4357–4366.
200
+
201
+ ##### [10] Bruna, J., and S. Mallat, 2013, *Invariant Scattering Convolution Networks*: IEEE Transactions on Pattern Analysis and Machine Intelligence, 35, 1872–1886.
202
+
203
+ ##### [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.
204
+
205
+ ##### [12] Kingsbury, N., 2001, *Complex Wavelets for Shift Invariant Analysis and Filtering of Signals*: Applied and Computational Harmonic Analysis, 10, 234–253.