Metadata-Version: 2.1
Name: NeuroRuler
Version: 0.0.2
Summary: A program that calculates head circumference from MRI data (.nii, .nii.gz, .nrrd).
Home-page: https://github.com/COMP523TeamD/NeuroRuler
Download-URL: https://github.com/COMP523TeamD/NeuroRuler/releases
Author: COMP523 Team D
Author-email: Peifeng He <hankhe@ad.unc.edu>, Madison Lester <madiali@email.unc.edu>, Eric Schneider <eric@cs.unc.edu>, Jesse Wei <jesse@cs.unc.edu>
Project-URL: Homepage, https://github.com/COMP523TeamD/HeadCircumferenceTool
Project-URL: Bug Tracker, https://github.com/COMP523TeamD/HeadCircumferenceTool/issues
Keywords: MRI,NIfTI,NRRD,brain,circumference,PyQt6
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: setuptools
Requires-Dist: SimpleITK
Requires-Dist: numpy
Requires-Dist: argparse
Requires-Dist: opencv-python
Requires-Dist: pytest
Requires-Dist: PyQt6
Requires-Dist: qimage2ndarray
Requires-Dist: screeninfo

# NeuroRuler

![Tests](https://github.com/COMP523TeamD/NeuroRuler/actions/workflows/tests.yml/badge.svg)
![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)
![Python](https://img.shields.io/badge/python-3670A0?style=plastic&logo=python&logoColor=ffdd54)

> A program that calculates head circumference from MRI data (`.nii`, `.nii.gz`, `.nrrd`).

<p align="center">
  <img src="https://i.imgur.com/nqwqHq8.gif" alt="GUI demo"/>
</p>

## Cite this tool

If you want 😉 format is bibtex.

```bibtex
@misc{neuroruler,
  title={NeuroRuler},
  author={Wei, Jesse and Lester, Madison and He, Peifeng and Schneider, Eric and Styner, Martin},
  howpublished={\url{https://github.com/COMP523TeamD/NeuroRuler}},
  year={2023}
}
```

## Install

Your Python version needs to be 3.8+. Check with `python --version`. Install via pip.

```sh
python -m pip install NeuroRuler
```

If `python` doesn't work, try `python3`. Also, do not run `pip install NeuroRuler` without `python -m`, which may cause import issues.

If contributing to this repo, please also run `python -m pip install -r requirements.txt` to install additional development dependencies (for code formatting, documentation, etc.). After installing additional dependencies, run `pre-commit install` to enable pre-commit actions.

## Run GUI

Run these commands in a Python terminal:

```py
from NeuroRuler.GUI import gui
gui()
```

Note: If you make changes to the repo, then use the [`gui.py`](gui.py) script to run the GUI. Changes you make will not be reflected in the package from pip until uploaded to PyPI.

See [release](#release) for how to upload to PyPI or Test PyPI.

## Configure settings

Edit [`config.json`](config.json).

You can also supply CLI arguments, which override settings in `config.json`.

```text
usage: gui.py [-h] [-d] [-e] [-t THEME] [-c COLOR]

options:
  -h, --help            show this help message and exit
  -d, --debug           print debug info
  -e, --export-index    exported file names use the index displayed in the GUI instead of the original file name
  -t THEME, --theme THEME
                        configure theme, options are dark, dark-green, dark-hct, dark-purple, light, light-green, light-hct, or
                        light-purple
  -c COLOR, --color COLOR
                        contour color as name (e.g. red) or hex color code rrggbb
```

## Run tests

`pytest`

## Documentation

[https://NeuroRuler.readthedocs.io](https://NeuroRuler.readthedocs.io)

See [`.readthedocs.yaml`](.readthedocs.yaml) and [`docs/`](docs/).

## Pre-commit actions

Run `pre-commit install` to enable pre-commit actions.

Before each commit, the actions in [`.pre-commit-config.yaml`](.pre-commit-config.yaml) will be run. Specifically, code will be reformatted with `black`. Note that some file names are excluded, so don't name any source code files those names.

## Release

* [PyPI page](https://pypi.org/project/NeuroRuler/)
* [TestPyPI page](https://test.pypi.org/project/NeuroRuler/)

To publish to [PyPI](https://pypi.org/project/NeuroRuler/), edit the version number in [`setup.py`](setup.py). If a branch named `release-pypi` doesn't exist, create it. Push a **tagged (use the version number) commit** to the `release-pypi` branch to publish to PyPI (these actions cause the [`pypi.yml`](.github/workflows/pypi.yml) action to run).

The version number on PyPI will be the one in `setup.py`, so make sure it's correct!

Follow a similar process to publish to TestPyPI, except the commit doesn't have to be tagged.
