https://github.com/agahkarakuzu/sunrise
NumPy, SciPy, MRI and Music | Presented at ISMRM 2021 Sunrise Educational Session
Science Score: 23.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
✓Academic publication links
Links to: ieee.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.2%) to scientific vocabulary
Keywords
Repository
NumPy, SciPy, MRI and Music | Presented at ISMRM 2021 Sunrise Educational Session
Basic Info
Statistics
- Stars: 24
- Watchers: 1
- Forks: 8
- Open Issues: 0
- Releases: 1
Topics
Metadata Files
README.md
Scientific computing with Python
Course material presented at ISMRM 2021 Sunrise Educational Session for Python Programming & Scientific Computing.
### 📚 3 Notebooks for 3 dimensions of MRI
* [1D-MUSIC.ipynb](/1D-MUSIC.ipynb) for basic NumPy operations and SciPy functions to create harmonious MRI melodies.

* [2D-BIDS.ipynb](/2D-BIDS.ipynb) for querying reconstructed images using BIDS layout, loading them using `nibabel`, `parsing them` using `NumPy` and creating interactive plots using `Plotly`.

* [3D-ISMRMRD.ipynb](/3D-ISMRMRD.ipynb) for reading ISMRM-RD k-space data (16 channels) using `ismrmrd-python`, reconstructing them using `SciPy` and creating interactive plots using `Plotly`.

### 🕸 You can execute the notebooks online
[](https://mybinder.org/v2/gh/agahkarakuzu/sunrise/HEAD)
### 📥 Instructions for running notebooks on your computer
#### 1. Clone this repository
```
git clone https://github.com/agahkarakuzu/sunrise.git
```
#### 2. Choose one of the following options
💻 Local Python environment
### Python
If you don't have Python installed on your computer, I highly recommend [Anaconda](https://www.anaconda.com/). Simply follow the instructions on the website to install Anaconda, which comes with Jupyter out of the box.
Then all you have to do is simply installing Python dependencies using `pip`. In a terminal window:
```python
cd /directory/to/sunrise/on/your/computer
pip install -r requirements.txt
```
That's all! After installing dependencies, run `jupyter notebook` or `jupyter lab` command in the terminal (while you are still at the `/sunrise` directory. Select a notebook, and start making some music using MRI sounds!
### Potentially missing dependencies
* If you cannot run Librosa on a Ubuntu OS, you may be missing `libsndfile1` package:
```terminal
sudo apt install libsndfile1
```
* Lolviz package (visualizing arrays using a graphical representation) is optional. You can follow the [official docs](https://github.com/parrt/lolviz) to install its dependencies on different OS.
* I did not test this on a Windows machine, please open an issue if you run into problems.
🐳 Use with Docker
If you have Docker installed on your computer and running, you can run the code
in the same environment described in this repository.
### Option-1: Use `repo2docker`
1. Simply install `repo2docker` from pyPI:
```
pip install jupyter-repo2docker
```
2. Run the following command in your terminal:
```
jupyter-repo2docker https://github.com/agahkarakuzu/sunrise
```
After building (it might take a while!), it should output in your terminal
something like:
```
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://0.0.0.0:36511/?token=f94f8fabb92e22f5bfab116c382b4707fc2cade56ad1ace0
```
This should start a Jupyter session on your browser and make all the resources
you see when you [launch a Binder](https://mybinder.org/v2/gh/agahkarakuzu/sunrise/main) for this repository.
To re-use your container built by repo2docker, do the following:
1. Run `docker images` command and copy the `IMAGE ID` to your clipboard
2. Run the following command to start the container:
```
docker run -it --rm -p 8888:8888 `PASTE IMAGE ID HERE` jupyter notebook --ip 0.0.0.0
```
### Option 2: Use Docker image built by this repo's GitHub Actions
This repository builds and pushes its own Docker images on every release!
You can see the available versions [here](https://hub.docker.com/r/agahkarakuzu/sunrise). I will give the instructions for the
latest version:
1. Pull the docker image
```
docker pull agahkarakuzu/sunrise:latest
```
2. Start the container
```
docker run -it --rm -p 8888:8888 agahkarakuzu/sunrise:latest
```
It is always good to know what you eat.
To that end, I equipped this repository with some tools to foster transparency & reproducibility.
Last, but not the least
Almost 1.5 years into the pandemic, I feel more and more like an analog guy in a digital world. I wanted to encourage creativity to take your mind off the stress of seeking an academic degree in a digital world, and to make MRI art while learning some Python.
If we are lucky to see digital-to-analog conversion happening next year, I would like to hear Python-generated MRI musics in the next MRM Highlights Party.
Please feel free to send a pull request to this repository by adding your MRI music in the REMIX folder. It does not matter if you used Python, C++, GarageBand, Logic Pro or even a synthesizer. All contributions are welcome!
Bonus
@mathieuboudreau created a fascinating Spotify playlist: unintentionally ISMRM. I hope that it serves as a source of inspiration for you to create magnetic melodies that are "intentionally ISMRM".
References and useful resources
AllenDowney/ThinkDSP was a great source of inspiration, I highly recommend his SciPy 2015 talk.
The amazing Pianoputer project
Visual NumPy, Pictorial Numpy tutorial, the Visual Guide to NumPy
EarSketch: Make beats & Learn code
I found out about EarSketch while creating this repository. It allows you to:
- Learn coding through music
- Use our sounds or your own (means that you can use files in the
WavMRIfolder!) - Learn Python or JavaScript code
- Produce studio-quality music
All in a web browser. It is a great opportunity to improve your algorithmic thinking skills. You need to create an account and login to be able to upload your sound samples. You can export them to SoundCloud with one click. I gave it a try, it works!
Python projects for MRI scientists by NeuroPoly
Vector illustrations in this project are under Freepik Premium license ag_e843bcd6** (Unlimited use without attribution).
Owner
- Name: Agah
- Login: agahkarakuzu
- Kind: user
- Location: Montreal
- Company: @neuropoly @qMRLab @neurolibre
- Website: https://agahkarakuzu.github.io
- Twitter: agahkarakuzu
- Repositories: 114
- Profile: https://github.com/agahkarakuzu
GitHub Events
Total
- Watch event: 1
- Fork event: 1
Last Year
- Watch event: 1
- Fork event: 1
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Agah | a****u@g****m | 59 |
| Tom Wilkinson | t****m@t****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 7 months ago
All Time
- Total issues: 0
- Total pull requests: 1
- Average time to close issues: N/A
- Average time to close pull requests: about 4 hours
- Total issue authors: 0
- Total pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 2.0
- Merged pull requests: 1
- 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
- tawilkinson (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- audioread ==2.1.9
- h5py ==3.1.0
- ismrmrd ==1.7.2
- librosa ==0.8.0
- lolviz ==1.4.4
- nibabel ==3.2.0
- numba ==0.53.1
- numpy ==1.18.4
- pandas ==0.25.3
- plotly ==4.14.0
- pydot *
- resampy ==0.2.2
- scipy ==1.5.4
- actions/checkout v2 composite
- jupyter/base-notebook 016833b15ceb build
- audioread ==2.1.9
- h5py ==3.1.0
- ipywidgets >=7.6
- ismrmrd ==1.7.2
- jupyter-book ==0.12.1
- jupyter-dash *
- jupyterlab >=3
- librosa ==0.8.0
- lolviz ==1.4.4
- nibabel ==3.2.0
- numba ==0.53.1
- numpy ==1.18.4
- pandas ==0.25.3
- plotly *
- repo2data *
- resampy ==0.2.2
- scipy ==1.5.4
