neurostrip


Nameneurostrip JSON
Version 1.0.0 PyPI version JSON
download
home_pageNone
SummaryCNN based skull stripping (brain masking) from MRI
upload_time2025-07-29 20:06:16
maintainerNone
docs_urlNone
authorBryn Lloyd
requires_python>=3.10
licenseMIT
keywords mri skull stripping brain masking cnn medical imaging
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # NeuroStrip
[![PyPI](https://img.shields.io/pypi/v/neurostrip.svg)](https://pypi.org/project/neurostrip/)
[![CI](https://github.com/dyollb/neurostrip/actions/workflows/ci.yml/badge.svg)](https://github.com/dyollb/neurostrip/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![Downloads](https://img.shields.io/pypi/dm/neurostrip.svg)](https://pypi.org/project/neurostrip/)
CNN based skull stripping (brain masking) from MRI

## Installation

For CPU support:
```bash
pip install neurostrip[cpu]
```

For GPU support:
```bash
pip install neurostrip[gpu]
```

## Usage

```bash
neurostrip --image-path input.nii.gz --output-path output.nii.gz
```

## Development

### Setup Development Environment

1. Clone the repository
2. Set up the development environment:
   ```bash
   make setup-dev
   ```

This will:
- Install the package in editable mode with development dependencies
- Install pre-commit hooks for automatic code quality checks

### Development Tools

The project uses modern Python development tools optimized for Python ≥3.10:

- **Ruff**: Ultra-fast Python linter and formatter (replaces Black, isort, flake8, and more)
- **MyPy**: Static type checking
- **Bandit**: Security vulnerability scanning
- **pytest**: Testing framework
- **pre-commit**: Git hooks for automated code quality

### Available Commands

```bash
make help              # Show all available commands
make format            # Format code with ruff
make lint              # Run ruff linter
make fix               # Run ruff linter with auto-fix
make type-check        # Run mypy type checker
make security          # Run bandit security scanner
make test              # Run tests with pytest
make test-cov          # Run tests with coverage report
make check             # Run all checks (format, lint, type-check, test)
make pre-commit-run    # Run pre-commit on all files
make clean             # Clean build artifacts
```

### Pre-commit Hooks

Pre-commit hooks run automatically on every commit to ensure code quality:

- **General checks**: trailing whitespace, end-of-file fixing, YAML/TOML validation
- **Ruff linting and formatting**: comprehensive Python code analysis and formatting
- **MyPy type checking**: static type analysis
- **Bandit security scanning**: security vulnerability detection
- **Safety dependency checking**: known security vulnerabilities in dependencies
- **Typos spell checking**: documentation and comment spell checking

### Code Quality Standards

The project enforces strict code quality standards:

#### Ruff Configuration
- **Target**: Python 3.10+
- **Rules**: Comprehensive set including pycodestyle, pyflakes, isort, pyupgrade, simplify, type-checking, and pylint

#### Type Checking
- **MyPy**: Strict type checking enabled
- **Required**: Type annotations for all public functions
- **Configuration**: Comprehensive warnings and strict equality checks

### Running Tests

```bash
# Run all tests
make test

# Run with coverage report
make test-cov

# Run specific test file
python -m pytest tests/test_main.py -v

# Run specific test function
python -m pytest tests/test_main.py::test_predict_basic -v
```

### Development Workflow

1. **Make changes**: Edit code in `src/` directory
2. **Format and check**: Run `make check` to ensure code quality
3. **Test**: Run `make test` to verify functionality
4. **Commit**: Pre-commit hooks will run automatically
5. **Push**: Create pull request

### Adding Dependencies

- **Runtime dependencies**: Add to `dependencies` in `pyproject.toml`
- **Development dependencies**: Add to `dev` optional dependencies
- **GPU support**: Already configured with `gpu` optional dependencies

### Project Structure

```
neurostrip/
├── src/neurostrip/          # Main package source
├── tests/                   # Test files
├── pyproject.toml          # Project configuration
├── .pre-commit-config.yaml # Pre-commit hook configuration
├── Makefile               # Development commands
└── README.md              # This file
```

## Contributing

1. Fork the repository
2. Create a feature branch: `git checkout -b feature-name`
3. Set up development environment: `make setup-dev`
4. Make your changes
5. Run quality checks: `make check`
6. Commit changes (pre-commit hooks will run automatically)
7. Push and create a pull request

All contributions must:
- Pass pre-commit hooks
- Maintain or improve test coverage
- Include type annotations
- Follow Google docstring conventions
- Pass all CI checks

## License

MIT License - see LICENSE file for details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "neurostrip",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "MRI, skull stripping, brain masking, CNN, medical imaging",
    "author": "Bryn Lloyd",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/c4/2c/2dc9fd3c5ac300f51b571649e9ed394bcf916d855cf71ea79baff7c090bd/neurostrip-1.0.0.tar.gz",
    "platform": null,
    "description": "# NeuroStrip\n[![PyPI](https://img.shields.io/pypi/v/neurostrip.svg)](https://pypi.org/project/neurostrip/)\n[![CI](https://github.com/dyollb/neurostrip/actions/workflows/ci.yml/badge.svg)](https://github.com/dyollb/neurostrip/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n[![Downloads](https://img.shields.io/pypi/dm/neurostrip.svg)](https://pypi.org/project/neurostrip/)\nCNN based skull stripping (brain masking) from MRI\n\n## Installation\n\nFor CPU support:\n```bash\npip install neurostrip[cpu]\n```\n\nFor GPU support:\n```bash\npip install neurostrip[gpu]\n```\n\n## Usage\n\n```bash\nneurostrip --image-path input.nii.gz --output-path output.nii.gz\n```\n\n## Development\n\n### Setup Development Environment\n\n1. Clone the repository\n2. Set up the development environment:\n   ```bash\n   make setup-dev\n   ```\n\nThis will:\n- Install the package in editable mode with development dependencies\n- Install pre-commit hooks for automatic code quality checks\n\n### Development Tools\n\nThe project uses modern Python development tools optimized for Python \u22653.10:\n\n- **Ruff**: Ultra-fast Python linter and formatter (replaces Black, isort, flake8, and more)\n- **MyPy**: Static type checking\n- **Bandit**: Security vulnerability scanning\n- **pytest**: Testing framework\n- **pre-commit**: Git hooks for automated code quality\n\n### Available Commands\n\n```bash\nmake help              # Show all available commands\nmake format            # Format code with ruff\nmake lint              # Run ruff linter\nmake fix               # Run ruff linter with auto-fix\nmake type-check        # Run mypy type checker\nmake security          # Run bandit security scanner\nmake test              # Run tests with pytest\nmake test-cov          # Run tests with coverage report\nmake check             # Run all checks (format, lint, type-check, test)\nmake pre-commit-run    # Run pre-commit on all files\nmake clean             # Clean build artifacts\n```\n\n### Pre-commit Hooks\n\nPre-commit hooks run automatically on every commit to ensure code quality:\n\n- **General checks**: trailing whitespace, end-of-file fixing, YAML/TOML validation\n- **Ruff linting and formatting**: comprehensive Python code analysis and formatting\n- **MyPy type checking**: static type analysis\n- **Bandit security scanning**: security vulnerability detection\n- **Safety dependency checking**: known security vulnerabilities in dependencies\n- **Typos spell checking**: documentation and comment spell checking\n\n### Code Quality Standards\n\nThe project enforces strict code quality standards:\n\n#### Ruff Configuration\n- **Target**: Python 3.10+\n- **Rules**: Comprehensive set including pycodestyle, pyflakes, isort, pyupgrade, simplify, type-checking, and pylint\n\n#### Type Checking\n- **MyPy**: Strict type checking enabled\n- **Required**: Type annotations for all public functions\n- **Configuration**: Comprehensive warnings and strict equality checks\n\n### Running Tests\n\n```bash\n# Run all tests\nmake test\n\n# Run with coverage report\nmake test-cov\n\n# Run specific test file\npython -m pytest tests/test_main.py -v\n\n# Run specific test function\npython -m pytest tests/test_main.py::test_predict_basic -v\n```\n\n### Development Workflow\n\n1. **Make changes**: Edit code in `src/` directory\n2. **Format and check**: Run `make check` to ensure code quality\n3. **Test**: Run `make test` to verify functionality\n4. **Commit**: Pre-commit hooks will run automatically\n5. **Push**: Create pull request\n\n### Adding Dependencies\n\n- **Runtime dependencies**: Add to `dependencies` in `pyproject.toml`\n- **Development dependencies**: Add to `dev` optional dependencies\n- **GPU support**: Already configured with `gpu` optional dependencies\n\n### Project Structure\n\n```\nneurostrip/\n\u251c\u2500\u2500 src/neurostrip/          # Main package source\n\u251c\u2500\u2500 tests/                   # Test files\n\u251c\u2500\u2500 pyproject.toml          # Project configuration\n\u251c\u2500\u2500 .pre-commit-config.yaml # Pre-commit hook configuration\n\u251c\u2500\u2500 Makefile               # Development commands\n\u2514\u2500\u2500 README.md              # This file\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch: `git checkout -b feature-name`\n3. Set up development environment: `make setup-dev`\n4. Make your changes\n5. Run quality checks: `make check`\n6. Commit changes (pre-commit hooks will run automatically)\n7. Push and create a pull request\n\nAll contributions must:\n- Pass pre-commit hooks\n- Maintain or improve test coverage\n- Include type annotations\n- Follow Google docstring conventions\n- Pass all CI checks\n\n## License\n\nMIT License - see LICENSE file for details.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "CNN based skull stripping (brain masking) from MRI",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/dyollb/neurostrip",
        "Issues": "https://github.com/dyollb/neurostrip/issues",
        "Repository": "https://github.com/dyollb/neurostrip"
    },
    "split_keywords": [
        "mri",
        " skull stripping",
        " brain masking",
        " cnn",
        " medical imaging"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "75b3422f162dbb7033ce5f640ad0fa2910bd0349f0026eee995693cd5b5b6dc5",
                "md5": "4dad6bba58add7e1a5e2bd2077f33122",
                "sha256": "0e17d7a85908f4d06ecb8b01c8ef83ddecaba4ac304922f7d065de56223163ad"
            },
            "downloads": -1,
            "filename": "neurostrip-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4dad6bba58add7e1a5e2bd2077f33122",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 7933,
            "upload_time": "2025-07-29T20:06:15",
            "upload_time_iso_8601": "2025-07-29T20:06:15.601409Z",
            "url": "https://files.pythonhosted.org/packages/75/b3/422f162dbb7033ce5f640ad0fa2910bd0349f0026eee995693cd5b5b6dc5/neurostrip-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c42c2dc9fd3c5ac300f51b571649e9ed394bcf916d855cf71ea79baff7c090bd",
                "md5": "a259717c7055f3d4781a0a15c34849b7",
                "sha256": "e300aa600d1607d1afde601de88c329a4a5409220ad92de2e7b67b3826914c39"
            },
            "downloads": -1,
            "filename": "neurostrip-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a259717c7055f3d4781a0a15c34849b7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 12879,
            "upload_time": "2025-07-29T20:06:16",
            "upload_time_iso_8601": "2025-07-29T20:06:16.498822Z",
            "url": "https://files.pythonhosted.org/packages/c4/2c/2dc9fd3c5ac300f51b571649e9ed394bcf916d855cf71ea79baff7c090bd/neurostrip-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-29 20:06:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dyollb",
    "github_project": "neurostrip",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "neurostrip"
}
        
Elapsed time: 1.07742s