Skip to content

Commit c02a76c

Browse files
authored
[maint] docs cleanup (#18)
* Rename example_gallery to examples * Clean up some docs * Add docs links * Add README to docs --------- Co-authored-by: Charles Guan <3221512+charlesincharge@users.noreply.github.com>
1 parent 261d1fc commit c02a76c

File tree

8 files changed

+101
-54
lines changed

8 files changed

+101
-54
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ Build prerequisites:
5151

5252
## Examples
5353

54-
Try our examples:
54+
Try our [examples](https://forest-neurotech.github.io/mach/examples/):
5555

5656
* [📊 Plane Wave Imaging with PICMUS Dataset](examples/plane_wave_compound.py)
5757
* [🩸 Doppler Imaging](examples/doppler.py)
5858

59-
If you don't have a CUDA-enabled GPU, you can download the notebook from the docs and open in Google Colab (select a GPU instance).
59+
If you don't have a CUDA-enabled GPU, you can download the notebook from the [docs](https://forest-neurotech.github.io/mach/examples/) and open in Google Colab (select a GPU instance).
6060

6161
## Contributing
6262

docs/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
example_gallery/
1+
examples/
22
gen_modules/
33
generated/
44
_build/

docs/conf.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,14 @@
4141
"sphinx_gallery.gen_gallery",
4242
"sphinx.ext.napoleon",
4343
"sphinx.ext.intersphinx",
44+
"myst_parser",
4445
]
4546

4647
autosummary_generate = True
4748

49+
# Source file suffixes
50+
source_suffix = [".rst", ".md"]
51+
4852
# Add any paths that contain templates here, relative to this directory.
4953
# templates_path = ["_templates"]
5054

@@ -71,7 +75,7 @@
7175
# path to your example scripts
7276
"examples_dirs": ["../examples"],
7377
# path to where to save gallery generated output
74-
"gallery_dirs": ["example_gallery"],
78+
"gallery_dirs": ["examples"],
7579
# execute ALL examples/*.py files
7680
"filename_pattern": "/*",
7781
# specify that examples should be ordered according to filename

docs/index.rst

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
mach
22
==============================================================
33

4-
This documentation is under construction. For now, it mostly just includes the gallery of examples.
4+
.. note::
5+
6+
🚧 This documentation is under construction.
7+
8+
**mach** is an ultrafast CUDA-accelerated ultrasound beamformer for Python users, developed at Forest Neurotech.
59

610
.. toctree::
711
:maxdepth: 2
8-
:caption: Gallery:
12+
:caption: README:
913

10-
example_gallery/index
14+
readme
1115

12-
Indices and tables
13-
==================
16+
.. toctree::
17+
:maxdepth: 1
18+
:caption: Examples:
19+
n
1420

15-
* :ref:`genindex`
16-
* :ref:`modindex`
17-
* :ref:`search`
21+
examples/index

examples/README.rst

Lines changed: 8 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
Examples Gallery
1+
Gallery
22
================
33

44
This directory contains tutorial examples demonstrating mach capabilities.
5-
Each example is designed to work with sphinx-gallery for automatic documentation generation
6-
and can also be converted to Jupyter notebooks.
5+
Each example is designed to work with sphinx-gallery for automatic documentation generation.
76

87
Available Examples
98
------------------
@@ -14,47 +13,15 @@ Available Examples
1413
- **plane_wave_compound.py**: Plane wave compounding with PICMUS challenge data.
1514
Demonstrates coherent compounding of multiple plane wave angles for improved image quality.
1615

17-
Sphinx-Gallery Integration
18-
--------------------------
19-
20-
These examples follow sphinx-gallery conventions:
21-
22-
- Docstring with reStructuredText formatting for the main description
23-
- ``# %%`` comments to separate code cells
24-
- Proper attribution to external datasets and references
25-
- Educational narrative with clear learning objectives
26-
27-
To build the documentation with sphinx-gallery::
28-
29-
make docs
30-
31-
Jupyter Notebook Conversion
32-
---------------------------
33-
34-
To convert any example to a Jupyter notebook::
35-
36-
pip install jupytext
37-
jupytext --to notebook examples/*.py
38-
3916
Dependencies
4017
------------
4118

42-
**Common dependencies:**
43-
- **matplotlib**: Required for all visualizations
44-
- **numpy**: Basic array operations
45-
- **einops**: Required for array reshaping operations
46-
47-
**Example-specific dependencies:**
48-
49-
For **doppler.py**:
50-
- **pymust**: Required for PyMUST data loading and RF-to-IQ conversion
19+
**Additional common dependencies:**
5120

52-
For **plane_wave_compound.py**:
53-
- **pyuff-ustb**: Required for UFF data loading (``pip install pyuff-ustb``)
21+
- ``matplotlib``: Required for visualizations
22+
- ``numpy``: Basic array operations
5423

55-
Attribution
56-
-----------
24+
**Example-specific dependencies:**
5725

58-
- **PyMUST/MUST**: Garcia, D. MUST: An Open Platform for Ultrasound Research. https://www.biomecardio.com/MUST/index.html
59-
- **PICMUS** Liebgott, H. et al. Plane-Wave Imaging Challenge in Medical Ultrasound. https://www.creatis.insa-lyon.fr/Challenge/IEEE_IUS_2016/
60-
- **Inspired by**: ultraspy tutorials (https://ultraspy.readthedocs.io/) and vbeam examples (https://github.com/magnusdk/vbeam/)
26+
- **doppler.py** requires ``pymust`` to load example data and demodulate RF to IQ (``pip install pymust``)
27+
- **plane_wave_compound.py** requires ``pyuff-ustb`` to load example data (``pip install pyuff-ustb``)

examples/plane_wave_compound.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
- Beamform data from multiple plane-wave transmits
1313
- Coherently compound the results
1414
- Visualize the results
15+
16+
Attribution:
17+
18+
- Example inspired by vbeam examples (https://github.com/magnusdk/vbeam/)
19+
- Dataset from PICMUS challenge (https://www.creatis.insa-lyon.fr/Challenge/IEEE_IUS_2016/)
1520
"""
1621

1722
# %%

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,10 @@ compare = [
100100
"cupy-cuda12x>=12.0.0",
101101
]
102102
docs = [
103-
# includes example-dependencies
104103
"ipykernel>=6.10",
104+
"matplotlib>=3.9.4",
105+
"myst-parser>=3.0.1",
106+
"numpy>=2.0.2",
105107
"sphinx>=7.2.6",
106108
"sphinx-book-theme>=1.1.3",
107109
"sphinx-gallery>=0.18.0",

uv.lock

Lines changed: 65 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)