Metadata-Version: 2.4
Name: brainchop
Version: 0.1.15
Summary: Portable and lightweight brain segmentation using tinygrad
Home-page: https://github.com/neuroneural/brainchop-cli
Author: Mike Doan
Author-email: spikedoanz@gmail.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: tinygrad
Requires-Dist: niimath
Requires-Dist: requests
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# BrainChop

BrainChop is a lightweight tool for brain segmentation that runs on pretty much everything.

---

## Installation

You can install BrainChop using pip (Python > 3.10)


```
pip install brainchop
```

## Usage

To use BrainChop, run the following command:

```
brainchop input.nii.gz -o output.nii.gz
```

## Docker

You can also install BrainChop using docker
```
git clone git@github.com:neuroneural/brainchop-cli.git
cd brainchop-cli
docker build -t brainchop .
```

Then to run, use
```
docker run --rm -it --device=nvidia.com/gpu=all -v [[output directory]]:/app brainchop [[input nifti file]] -o [[output nifti file]]
```

On some systems (like recent 25.05 nixos), the docker run command will need to be prepended with
```
docker run --rm -it --device=nvidia.com/gpu=all
```

Where:
- `input.nii.gz` is your input NIfTI file
- `output.nii.gz` is the desired output file name


## Requirements

- Python 3.10+
- tinygrad : our tiny and portable (but powerful) ML inference engine
- numpy : basic tensor operations
- nibabel : to read nifti files
- requests : to download models

## License

This project is licensed under the MIT License.
