Skip to content

Commit ab158ea

Browse files
committed
license + readme example
1 parent 8947b31 commit ab158ea

4 files changed

Lines changed: 85 additions & 24 deletions

File tree

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2026 Toomas Erik Anijärv
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do 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,
14+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
17+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
18+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
19+
OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
![logo](docs/assets/yabplot_logo.png)
44

5-
**yabplot** is a Python library for creating beautiful, publication-quality 3D brain visualizations. it supports plotting cortical regions, subcortical structures, and white matter bundles, built on top of [PyVista](https://docs.pyvista.org/).
5+
[![PyPI version](https://img.shields.io/pypi/v/yabplot.svg)](https://pypi.org/project/yabplot/)
6+
[![Docs](https://github.com/teanijarv/yabplot/actions/workflows/docs.yml/badge.svg)](https://teanijarv.github.io/yabplot/)
7+
[![Tests](https://github.com/teanijarv/yabplot/actions/workflows/tests.yml/badge.svg)](https://github.com/teanijarv/yabplot/actions/workflows/tests.yml)
8+
<!-- [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.XXXXXX.svg)](https://doi.org/10.5281/zenodo.XXXXXX) -->
9+
10+
**yabplot** is a Python library for creating beautiful, publication-quality 3D brain visualizations. it supports plotting cortical regions, subcortical structures, and white matter bundles.
611

712
the idea is simple. while there are already amazing visualization tools available, they often focus on specific domains—using one tool for white matter tracts and another for cortical surfaces inevitably leads to inconsistent styles. i wanted a unified, simple-to-use tool that enables me (and hopefully others) to perform most brain visualizations in a single place. recognizing that neuroscience evolves daily, i designed **yabplot** to be modular: it supports standard pre-packaged atlases out of the box, but easily accepts any custom parcellation or tractography dataset you might need.
813

@@ -27,27 +32,43 @@ dependencies: python 3.11 with ipywidgets, nibabel, pandas, pooch, pyvista, scik
2732

2833
## quick start
2934

30-
please refer to the documentation and examples for comprehensive guides.
35+
please refer to the [documentation](https://teanijarv.github.io/yabplot/) for more comprehensive guides.
3136

3237
```python
3338
import yabplot as yab
3439
import numpy as np
3540

36-
# plot random data on cortical regions
37-
regions = yab.get_atlas_regions('schaefer_400', 'cortical')
38-
data = np.random.rand(len(regions))
39-
yab.plot_cortical(data=data, atlas='schaefer_400', cmap='viridis')
41+
# see available cortical atlases
42+
atlases = yab.get_available_resources(category='cortical')
4043

41-
# plot values for specific subcortical regions
42-
data = {'Left_Amygdala': 0.8, 'Right_Thalamus': 0.5}
43-
yab.plot_subcortical(data=data, atlas='aseg', views=['left_lateral', 'superior'])
44+
# see the region names within the aseg atlas
45+
regions = yab.get_atlas_regions(atlas='aseg', category='subcortical')
46+
47+
# plot data on cortical regions
48+
data = np.arange(0, 1, 0.001)
49+
yab.plot_cortical(data=data, atlas='schaefer_1000', figsize=(600, 300),
50+
cmap='viridis', vminmax=[0, 1], style='default',
51+
views=['left_lateral', 'superior', 'right_lateral'])
4452

45-
# plot values for specific white matter bundles
46-
data = {'FMaj': 0.2, 'FMin': -0.3}
47-
yab.plot_tracts(data=data, atlas='xtract_tiny', style='matte')
53+
54+
# plot values for specific subcortical regions
55+
data = {'Left_Amygdala': 0.8, 'Right_Hippocampus': 0.5,
56+
'Right_Thalamus': -0.5, 'Left_Putamen': -1}
57+
yab.plot_subcortical(data=data, atlas='aseg', figsize=(600, 450), layout=(2, 2),
58+
views=['superior', 'anterior', 'left_lateral', 'right_lateral'],
59+
cmap='coolwarm', vminmax=[-1, 1], style='matte')
60+
61+
# plot data on white matter bundles
62+
regions = yab.get_atlas_regions(atlas='xtract_tiny', category='tracts')
63+
data = np.arange(0, len(regions))
64+
yab.plot_tracts(data=data, atlas='xtract_tiny', figsize=(600, 300),
65+
views=['superior', 'anterior', 'left_lateral'], nan_color='#cccccc',
66+
bmesh_type='fsaverage', style='default', cmap='plasma')
4867

4968
```
5069

70+
![examples](docs/assets/examples.png)
71+
5172
## acknowledgements
5273

5374
yabplot relies on the extensive work of the neuroimaging community. if you use these atlases in your work, please cite the original authors.

docs/assets/examples.png

730 KB
Loading

docs/index.md

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
![logo](assets/yabplot_logo.png)
44

5-
**yabplot** is a Python library for creating beautiful, publication-quality 3D brain visualizations. it supports plotting cortical regions, subcortical structures, and white matter bundles, built on top of [PyVista](https://docs.pyvista.org/).
5+
[![PyPI version](https://img.shields.io/pypi/v/yabplot.svg)](https://pypi.org/project/yabplot/)
6+
[![Docs](https://github.com/teanijarv/yabplot/actions/workflows/docs.yml/badge.svg)](https://teanijarv.github.io/yabplot/)
7+
[![Tests](https://github.com/teanijarv/yabplot/actions/workflows/tests.yml/badge.svg)](https://github.com/teanijarv/yabplot/actions/workflows/tests.yml)
8+
<!-- [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.XXXXXX.svg)](https://doi.org/10.5281/zenodo.XXXXXX) -->
9+
10+
**yabplot** is a Python library for creating beautiful, publication-quality 3D brain visualizations. it supports plotting cortical regions, subcortical structures, and white matter bundles.
611

712
the idea is simple. while there are already amazing visualization tools available, they often focus on specific domains—using one tool for white matter tracts and another for cortical surfaces inevitably leads to inconsistent styles. i wanted a unified, simple-to-use tool that enables me (and hopefully others) to perform most brain visualizations in a single place. recognizing that neuroscience evolves daily, i designed **yabplot** to be modular: it supports standard pre-packaged atlases out of the box, but easily accepts any custom parcellation or tractography dataset you might need.
813

@@ -27,27 +32,43 @@ dependencies: python 3.11 with ipywidgets, nibabel, pandas, pooch, pyvista, scik
2732

2833
## quick start
2934

30-
please refer to the documentation and examples for comprehensive guides.
35+
please refer to the [documentation](https://teanijarv.github.io/yabplot/) for more comprehensive guides.
3136

3237
```python
3338
import yabplot as yab
3439
import numpy as np
3540

36-
# plot random data on cortical regions
37-
regions = yab.get_atlas_regions('schaefer_400', 'cortical')
38-
data = np.random.rand(len(regions))
39-
yab.plot_cortical(data=data, atlas='schaefer_400', cmap='viridis')
41+
# see available cortical atlases
42+
atlases = yab.get_available_resources(category='cortical')
4043

41-
# plot values for specific subcortical regions
42-
data = {'Left_Amygdala': 0.8, 'Right_Thalamus': 0.5}
43-
yab.plot_subcortical(data=data, atlas='aseg', views=['left_lateral', 'superior'])
44+
# see the region names within the aseg atlas
45+
regions = yab.get_atlas_regions(atlas='aseg', category='subcortical')
46+
47+
# plot data on cortical regions
48+
data = np.arange(0, 1, 0.001)
49+
yab.plot_cortical(data=data, atlas='schaefer_1000', figsize=(600, 300),
50+
cmap='viridis', vminmax=[0, 1], style='default',
51+
views=['left_lateral', 'superior', 'right_lateral'])
4452

45-
# plot values for specific white matter bundles
46-
data = {'FMaj': 0.2, 'FMin': -0.3}
47-
yab.plot_tracts(data=data, atlas='xtract_tiny', style='matte')
53+
54+
# plot values for specific subcortical regions
55+
data = {'Left_Amygdala': 0.8, 'Right_Hippocampus': 0.5,
56+
'Right_Thalamus': -0.5, 'Left_Putamen': -1}
57+
yab.plot_subcortical(data=data, atlas='aseg', figsize=(600, 450), layout=(2, 2),
58+
views=['superior', 'anterior', 'left_lateral', 'right_lateral'],
59+
cmap='coolwarm', vminmax=[-1, 1], style='matte')
60+
61+
# plot data on white matter bundles
62+
regions = yab.get_atlas_regions(atlas='xtract_tiny', category='tracts')
63+
data = np.arange(0, len(regions))
64+
yab.plot_tracts(data=data, atlas='xtract_tiny', figsize=(600, 300),
65+
views=['superior', 'anterior', 'left_lateral'], nan_color='#cccccc',
66+
bmesh_type='fsaverage', style='default', cmap='plasma')
4867

4968
```
5069

70+
![examples](assets/examples.png)
71+
5172
## acknowledgements
5273

5374
yabplot relies on the extensive work of the neuroimaging community. if you use these atlases in your work, please cite the original authors.

0 commit comments

Comments
 (0)