brainplotlib
A lightweight package to plot brain surfaces with Python.
Science Score: 41.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
○codemeta.json file
-
○.zenodo.json file
-
✓DOI references
Found 9 DOI reference(s) in README -
✓Academic publication links
Links to: zenodo.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.8%) to scientific vocabulary
Keywords
Repository
A lightweight package to plot brain surfaces with Python.
Basic Info
- Host: GitHub
- Owner: feilong
- License: bsd-3-clause
- Language: Python
- Default Branch: main
- Homepage: https://feilong.github.io/brainplotlib/
- Size: 86.4 MB
Statistics
- Stars: 41
- Watchers: 1
- Forks: 1
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
brainplotlib is a Python package that plots data on cortical surface.
It's designed to have minimal requirements --- only NumPy and matplotlib.

Installation
The package can be installed with pip:
bash
pip install brainplotlib
Example usage
See the examples gallery for all code examples with detailed explanations.
```Python import numpy as np from brainplotlib import brainplot, exampledata
The example_data is icoorder5 resolution (10242 vertices per hemisphere),
and the non-cortical vertices have been masked out (9372 and 9370 remaining
vertices for the left and right hemisphere, respectively).
img, scale = brainplot( exampledata, vmax=10, vmin=-10, cmap='seismic', return_scale=True) ```
The rendered image is a NumPy array.
It can be rendered using matplotlib:
Python
import matplotlib.pyplot as plt
fig = plt.figure(figsize=(img.shape[1] / 200, img.shape[0] / 200), dpi=200)
plt.imshow(img)
plt.axis('off')
cbar = plt.colorbar(scale, shrink=0.8, aspect=30)
plt.savefig('example_data_with_colorbar.png', bbox_inches='tight')
plt.show()
Alternatively, the high-resolution image can be saved directly using OpenCV.
Python
import cv2
cv2.imwrite(
'example_data.png',
np.round(img[:, :, [2, 1, 0]] * 255).astype(np.uint8))
Citation
If you use this software in your publications, please cite it
bibtex
@software{brainplotlib,
author = {Ma Feilong and Guo Jiahui and M. Ida Gobbini and James V. Haxby},
title = {brainplotlib: plotting brain data on cortical surface},
month = feb,
year = 2022,
publisher = {Zenodo},
doi = {10.5281/zenodo.5979819},
url = {https://doi.org/10.5281/zenodo.5979819}
}
Owner
- Name: Feilong Ma
- Login: feilong
- Kind: user
- Repositories: 48
- Profile: https://github.com/feilong
Citation (CITATION.bib)
@software{brainplotlib,
author = {Ma Feilong and Guo Jiahui and M. Ida Gobbini and James V. Haxby},
title = {brainplotlib: plotting brain data on cortical surface},
month = feb,
year = 2022,
publisher = {Zenodo},
doi = {10.5281/zenodo.5979819},
url = {https://doi.org/10.5281/zenodo.5979819}
}
GitHub Events
Total
- Watch event: 7
- Fork event: 1
Last Year
- Watch event: 7
- Fork event: 1
Committers
Last synced: almost 3 years ago
All Time
- Total Commits: 28
- Total Committers: 1
- Avg Commits per committer: 28.0
- Development Distribution Score (DDS): 0.0
Top Committers
| Name | Commits | |
|---|---|---|
| Feilong Ma | m****g@g****m | 28 |
Issues and Pull Requests
Last synced: 8 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 44 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 7
- Total maintainers: 1
pypi.org: brainplotlib
A lightweight package to plot brain surfaces with Python.
- Homepage: https://feilong.github.io/brainplotlib/
- Documentation: https://brainplotlib.readthedocs.io/
- License: bsd-3-clause
-
Latest release: 1.0.0
published about 3 years ago