https://github.com/codingfisch/brain-stl
Turn your brain MRI into a printable 3D model in seconds 🧠➡️🖨️
Science Score: 13.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
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.9%) to scientific vocabulary
Repository
Turn your brain MRI into a printable 3D model in seconds 🧠➡️🖨️
Basic Info
Statistics
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
brain-stl 🧠
The easiest and fastest way to turn brain MRI scans into 3D printable models 🖨️ powered by deepmriprep ✨
Use the Colab demo or install it locally via pip install brain_stl 💨
By default, the model is saved as brain.stl, but you can customize the filename along with other options like
- Threshold: Pick a value between 0 and 3 for different tissue types (see GIF left, 2.5: white matter only) 🧠
- Hollowness: Adjust how hollow the brain is (enables faster printing) 💨
- Text: Add personalized text that works as a support structure 🔤
- Smoothing: Achieve a polished surface via iterative Laplacian smoothing ✨
- Mesh Reduction: Simplify the mesh to reduce the size of brain.stl ✂️
Usage 💻
To get your first brain.stl just run
```python
from brainstl import runbrain_stl
runbrainstl() # per default output_folder='.' (current folder) ``` and a publicly available brain MRI scan (from OpenNeuro) will be used 🌐
Scan files can be inputted in NifTi (.nii or .nii.gz) or DICOM (.dcm or folder) format
```python
from brainstl import runbrain_stl
runbrainstl('/path/to/scan.nii.gz') # or '/path/to/dicomfolder'
``
The main arguments ofrunbrainstlare
- **scanfilepath**: Path to the input scan (ifNone, use scan fromurl). Default:None
- **outputfolder**: Folder to save the.stlfile and other outputs. Default:'.'
- **stlname**: Name of the example.stlfile (without extension). Default:'brain'`
Click here, to see all remaining arguments 📑
- **`nifti_name`**: If DICOM produces multiple NifTis, this NifTi filename is used to proceed. Default: `None` - **`url`**: URL to download a brain scan if no `scan_filepath` is provided. Default: `OPENNEURO_URL` - **`use_cache`**: If `True`, reuses intermediate outputs (e.g., tissue data). Default: `False` - **`threshold`**: Threshold tissue value (`0.5`: fluid, `1.5`: gray matter, `2.5`: white matter). Default: `1.5` - **`hollow`**: How hollow the brain is (0 to 1). Default: `0` - **`in_template_space`**: If `True`, the 3D model is in standardized (template) orientation. Default: `False` - **`mesh_reduction`**: Fraction of mesh reduction (0 to 1) for smaller `.stl` file size. Default: `0` (no reduction) - **`smooth_iter`**: Number of iterations for Laplacian smoothing. Default: `0` (none) - **`smooth_lamb`**: Strength of each Laplacian smoothing step. Default: `0.2` - **`text`**: Custom text used as structural support. Default: `None` - **`text2`**: Second line of text. Default: `None` - **`textsize`**: Size (height) of the text. Default: `120` - **`textback`**: Coronal (depth) position of the back of the text. Default: `300` - **`textfront`**: Coronal (depth) position of the front of the text. Default: `330` - **`textlinelength`**: Length of line below the text. Default: `10`Command-Line Interface 🖥️
Process your first brain scan from the terminal by just running
bash
brain-stl
Without providing any arguments, it downloads a publicly available scan and creates a brain.stl of it 🧠
Run brain-stl --help (+copy&paste into ChatGPT) to understand the usage of custom settings 💡
Share Your Brains 🧠🌐
Use create_gif.py to get a GIF of your model and share it on social media with the hashtag #brain-stl 🤗
Owner
- Login: codingfisch
- Kind: user
- Repositories: 1
- Profile: https://github.com/codingfisch
GitHub Events
Total
- Issues event: 1
- Watch event: 12
- Issue comment event: 1
- Push event: 2
- Create event: 2
Last Year
- Issues event: 1
- Watch event: 12
- Issue comment event: 1
- Push event: 2
- Create event: 2
Issues and Pull Requests
Last synced: over 1 year 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
- soupandpsy (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- PyMCubes *
- dcm2niix *
- deepmriprep *
- fast_simplification 0.1.7
- niftiview *
- python ^3.9
- trimesh *