Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
10cc909
Replace placeholder name with package name
MarcelRosier Aug 7, 2025
5382c26
Rename package dir
MarcelRosier Aug 9, 2025
2b7766a
Add rich,monai,sitk, nibabel
MarcelRosier Aug 9, 2025
59a80f3
Add model handler and inferer
MarcelRosier Aug 9, 2025
a62faf3
Make typing backwards compatible
MarcelRosier Aug 9, 2025
0835d36
Add intro, minimal example and part of citation info
MarcelRosier Aug 9, 2025
d292fff
Add zenodo downloader and tests
MarcelRosier Aug 21, 2025
08c15af
Integrate zenodo downloader and fix type issues
MarcelRosier Aug 21, 2025
c42c30e
Add weights
MarcelRosier Aug 21, 2025
2611b26
Add loguru, limit python to <4.0
MarcelRosier Aug 21, 2025
6eb47d3
Add citation info
MarcelRosier Aug 21, 2025
eb4ba8b
Disable logger by default
MarcelRosier Aug 21, 2025
1ac260b
Add CPU support
MarcelRosier Aug 21, 2025
20eb65f
Add basic RTD page
MarcelRosier Aug 21, 2025
713f487
Support py3.9
MarcelRosier Aug 21, 2025
902e82b
Add extremely basic tests
MarcelRosier Aug 21, 2025
ca6129c
Add py 3.9, 3.13 to tests
MarcelRosier Aug 21, 2025
3cd51bd
Rm lock file
MarcelRosier Aug 21, 2025
f6b5df7
Rm unused imports and prints
MarcelRosier Aug 21, 2025
1a02726
Readd lockfile for caching in actions
MarcelRosier Aug 21, 2025
d6d14d9
Add requests lib
MarcelRosier Aug 21, 2025
7e32464
Update stroke_segmentor/zenodo.py
neuronflow Aug 23, 2025
7597113
Add .vscode
MarcelRosier Aug 23, 2025
dab7c01
Add docstring, fix differing type casts
MarcelRosier Aug 23, 2025
167ae1e
Merge branch '1-feature-initial-setup' of github.com:BrainLesion/stro…
MarcelRosier Aug 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ please specify your docker version, You can find it by running:
docker --version
```

### Version of !PACKAGE_NAME! ?
please specify your version of !PACKAGE_NAME! (please make sure you run the latest version):
### Version of !stroke_segmentor! ?
please specify your version of !stroke_segmentor! (please make sure you run the latest version):
```sh
pip freeze | grep !PACKAGE_NAME!
pip freeze | grep !stroke_segmentor!
```

**Additional context**
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest] #, windows-latest, macos-latest] # Extend to your needs
python-version: ["3.10", "3.11", "3.12"] # Extend to your needs
python-version: ["3.9","3.10", "3.11", "3.12", "3.13"] # Extend to your needs

steps:
- uses: actions/checkout@v4
Expand All @@ -39,7 +39,7 @@ jobs:
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
poetry run pytest --cov=package_name --cov-report=xml --cov-report=term
poetry run pytest --cov=stroke_segmentor --cov-report=xml --cov-report=term
# Add the following block to upload coverage to Codecov, requires a CODECOV_TOKEN secret to be set in the repository
# - name: Upload results to Codecov
# # Only upload to Codecov after a merge to the main branch
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,11 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

testdata
NVAUTO
*.nii.gz
*.ipynb
.vscode

stroke_segmentor/weights
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
43 changes: 24 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
# PACKAGE_NAME
# Stroke Segmentor

[![Python Versions](https://img.shields.io/pypi/pyversions/PACKAGE_NAME)](https://pypi.org/project/PACKAGE_NAME/)
[![Stable Version](https://img.shields.io/pypi/v/PACKAGE_NAME?label=stable)](https://pypi.python.org/pypi/PACKAGE_NAME/)
[![Documentation Status](https://readthedocs.org/projects/PACKAGE_NAME/badge/?version=latest)](http://PACKAGE_NAME.readthedocs.io/?badge=latest)
[![tests](https://github.com/BrainLesion/PACKAGE_NAME/actions/workflows/tests.yml/badge.svg)](https://github.com/BrainLesion/PACKAGE_NAME/actions/workflows/tests.yml)
[![codecov](https://codecov.io/gh/BrainLesion/PACKAGE_NAME/graph/badge.svg?token=A7FWUKO9Y4)](https://codecov.io/gh/BrainLesion/PACKAGE_NAME)
[![Python Versions](https://img.shields.io/pypi/pyversions/stroke_segmentor)](https://pypi.org/project/stroke_segmentor/)
[![Stable Version](https://img.shields.io/pypi/v/stroke_segmentor?label=stable)](https://pypi.python.org/pypi/stroke_segmentor/)
[![Documentation Status](https://readthedocs.org/projects/stroke_segmentor/badge/?version=latest)](http://stroke_segmentor.readthedocs.io/?badge=latest)
[![tests](https://github.com/BrainLesion/stroke_segmentor/actions/workflows/tests.yml/badge.svg)](https://github.com/BrainLesion/stroke_segmentor/actions/workflows/tests.yml)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
<!-- [![codecov](https://codecov.io/gh/BrainLesion/stroke_segmentor/graph/badge.svg?token=A7FWUKO9Y4)](https://codecov.io/gh/BrainLesion/stroke_segmentor) -->

Description
## Features
State-of-the-art ischemic stroke lesion segmentation in MRI


## Installation

With a Python 3.8+ environment, you can install `PACKAGE_NAME` directly from [PyPI](https://pypi.org/project/PACKAGE_NAME/):
With a Python 3.8+ environment, you can install `stroke_segmentor` directly from [PyPI](https://pypi.org/project/stroke_segmentor/):

```bash
pip install PACKAGE_NAME
pip install stroke_segmentor
```


Expand All @@ -25,27 +24,33 @@ pip install PACKAGE_NAME
A minimal example to create a segmentation could look like this:

```python
# example
from stroke_segmentor.inferer import Inferer

inferer = Inferer()
pred = inferer.infer(
dwi_path="path/to/dwi.nii.gz",
adc_path="path/to/adc.nii.gz",
segmentation_path="seg.nii.gz", # optional. the numpy array is always returned for direct usage
)
```

<!-- For more examples and details please refer to our extensive Notebook tutorials here [NBViewer](https://nbviewer.org/github/BrainLesion/tutorials/blob/main/PACKAGE_NAME/tutorial.ipynb) ([GitHub](https://github.com/BrainLesion/tutorials/blob/main/PACKAGE_NAME/tutorial.ipynb)). For the best experience open the notebook in Colab. -->


## Citation

If you use PACKAGE_NAME in your research, please cite it to support the development!
> [!IMPORTANT]
> `stroke_segmentor` is part of the [BrainLesion](https://github.com/BrainLesion) suite.
> Please cite it support the development!
> https://github.com/BrainLesion#-citing-brainlesion-suite

```
TODO: citation will be added asap
```
This project is based on [DeepISLES](https://github.com/ezequieldlrosa/DeepIsles) and offers its NVAUTO algorithm.
Please cite the [original manuscript](https://github.com/ezequieldlrosa/DeepIsles?tab=readme-ov-file#citations).

## Contributing

We welcome all kinds of contributions from the community!

### Reporting Bugs, Feature Requests and Questions

Please open a new issue [here](https://github.com/BrainLesion/PACKAGE_NAME/issues).
Please open a new issue [here](https://github.com/BrainLesion/stroke_segmentor/issues).

### Code contributions

Expand Down
57 changes: 57 additions & 0 deletions docs/README_preprocessed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Stroke Segmentor

[![Python Versions](https://img.shields.io/pypi/pyversions/stroke_segmentor)](https://pypi.org/project/stroke_segmentor/)
[![Stable Version](https://img.shields.io/pypi/v/stroke_segmentor?label=stable)](https://pypi.python.org/pypi/stroke_segmentor/)
[![Documentation Status](https://readthedocs.org/projects/stroke_segmentor/badge/?version=latest)](http://stroke_segmentor.readthedocs.io/?badge=latest)
[![tests](https://github.com/BrainLesion/stroke_segmentor/actions/workflows/tests.yml/badge.svg)](https://github.com/BrainLesion/stroke_segmentor/actions/workflows/tests.yml)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
<!-- [![codecov](https://codecov.io/gh/BrainLesion/stroke_segmentor/graph/badge.svg?token=A7FWUKO9Y4)](https://codecov.io/gh/BrainLesion/stroke_segmentor) -->

State-of-the-art ischemic stroke lesion segmentation in MRI


## Installation

With a Python 3.8+ environment, you can install `stroke_segmentor` directly from [PyPI](https://pypi.org/project/stroke_segmentor/):

```bash
pip install stroke_segmentor
```


## Use Cases and Tutorials

A minimal example to create a segmentation could look like this:

```python
from stroke_segmentor.inferer import Inferer

inferer = Inferer()
pred = inferer.infer(
dwi_path="path/to/dwi.nii.gz",
adc_path="path/to/adc.nii.gz",
segmentation_path="seg.nii.gz", # optional. the numpy array is always returned for direct usage
)
```

## Citation

```{IMPORTANT}
`stroke_segmentor` is part of the [BrainLesion](https://github.com/BrainLesion) suite.
Please cite it support the development!
https://github.com/BrainLesion#-citing-brainlesion-suite
```
This project is based on [DeepISLES](https://github.com/ezequieldlrosa/DeepIsles) and offers its NVAUTO algorithm.
Please cite the [original manuscript](https://github.com/ezequieldlrosa/DeepIsles?tab=readme-ov-file#citations).

## Contributing

We welcome all kinds of contributions from the community!

### Reporting Bugs, Feature Requests and Questions

Please open a new issue [here](https://github.com/BrainLesion/stroke_segmentor/issues).

### Code contributions

Nice to have you on board! Please have a look at our [CONTRIBUTING.md](CONTRIBUTING.md) file.
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = "PACKAGE_NAME"
copyright = "2024, Marcel Rosier et al."
project = "stroke_segmentor"
copyright = "2025, Marcel Rosier et al."
author = "Marcel Rosier, Florian Kofler"

# -- General configuration ---------------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PACKAGE_NAME documentation
stroke_segmentor documentation
===================

.. include:: ../README_preprocessed.md
Expand All @@ -20,3 +20,6 @@ Sections
:maxdepth: 2
:caption: API Reference:

inferer
model_handler

5 changes: 5 additions & 0 deletions docs/source/inferer.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Inferer
===================

.. automodule:: stroke_segmentor.inferer
:members:
5 changes: 5 additions & 0 deletions docs/source/model_handler.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Model Handler
===================

.. automodule:: stroke_segmentor.model_handler
:members:
35 changes: 35 additions & 0 deletions make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
Empty file removed package_name/__init__.py
Empty file.
Loading