Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 0 additions & 31 deletions .azure-pipelines/steps.yml

This file was deleted.

12 changes: 6 additions & 6 deletions .github/workflows/publish-on-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.12'
# This second step is unnecessary but highly recommended because
# It will cache database and saves time re-downloading it if database isn't stale.
- name: Cache pip
Expand All @@ -39,13 +39,13 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install scikit-build
pip install -e .
pip install build
pip install uv
uv pip install scikit-build build --system
uv pip install -e . --system
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
58 changes: 58 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Build & Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install uv
uv pip install scikit-build build --system
uv pip install -e . --system
- name: Run through staple
run: |
python fusion_run -inputs ./data/unet.nii.gz,./data/resunet.nii.gz -output ./data/test_staple.nii.gz -classes 0,1,2,4 -method staple
python -c "from LabelFusion.itkUtils import *; sys.exit('fail') if(not (imageComparision('./data/baseline_staple.nii.gz', './data/test_staple.nii.gz'))) else print('pass')"
- name: Run through itkvoting
run: |
python fusion_run -inputs ./data/unet.nii.gz,./data/resunet.nii.gz -output ./data/test_itkvoting.nii.gz -classes 0,1,2,4 -method itkvoting
python -c "from LabelFusion.itkUtils import *; sys.exit('fail') if(not (imageComparision('./data/baseline_itkvoting.nii.gz', './data/test_itkvoting.nii.gz'))) else print('pass')"
- name: Run through majorityvoting
run: |
python fusion_run -inputs ./data/unet.nii.gz,./data/resunet.nii.gz -output ./data/test_majorityvoting.nii.gz -classes 0,1,2,4 -method majorityvoting
python -c "from LabelFusion.itkUtils import *; sys.exit('fail') if(not (imageComparision('./data/baseline_majorityvoting.nii.gz', './data/test_majorityvoting.nii.gz'))) else print('pass')"
- name: Run through simple
run: |
python fusion_run -inputs ./data/unet.nii.gz,./data/resunet.nii.gz -output ./data/test_simple.nii.gz -classes 0,1,2,4 -method simple
python -c "from LabelFusion.itkUtils import *; sys.exit('fail') if(not (imageComparision('./data/baseline_simple.nii.gz', './data/test_simple.nii.gz'))) else print('pass')"

- name: Build distributions
run: python setup.py sdist

- name: Publish package to PyPI
if: github.repository == 'CBICA/FigureGenerator' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
2 changes: 1 addition & 1 deletion fusion_run
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ from LabelFusion.utils import *
from LabelFusion.wrapper import *

def main():
copyrightMessage = 'Contact: software@cbica.upenn.edu\n\n' + 'This program is NOT FDA/CE approved and NOT intended for clinical use.\nCopyright (c) ' + str(date.today().year) + ' University of Pennsylvania. All rights reserved.'
copyrightMessage = 'Contact: admin@fets.ai\n\n' + 'This program is NOT FDA/CE approved and NOT intended for clinical use.\nCopyright (c) ' + str(date.today().year) + ' University of Pennsylvania. All rights reserved.'
parser = argparse.ArgumentParser(prog='LabelFusion', formatter_class=argparse.RawTextHelpFormatter, description = "Fusion of different labels together.\n\n" + copyrightMessage)
parser.add_argument('-inputs', type=str, help = 'The absolute, comma-separated paths of labels that need to be fused', required=True)
parser.add_argument('-classes', type=str, help = 'The expected labels; for example, for BraTS, this should be \'0,1,2,4\'; this is not needed for STAPLE|ITKVoting', default='0,1')
Expand Down
11 changes: 7 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,24 @@
readme = readme_file.read()

requirements = [
"numpy",
"numpy>=1.19.2",
"SimpleITK!=2.0.*",
"SimpleITK!=2.2.1", # https://github.com/mlcommons/GaNDLF/issues/536
"setuptools",
"wheel",
"twine",
"keyring",
"black",
"psutil",
"requests",
]

setup(
name="LabelFusion",
version="1.0.14", # dev: development release; this should be changed when tagging
version="1.0.15", # dev: development release; this should be changed when tagging
author="Megh Bhalerao, Sarthak Pati",
author_email="admin@fets.ai",
python_requires=">=3.8",
python_requires=">=3.9",
packages=find_packages(),
scripts=["fusion_run"],
classifiers=[
Expand All @@ -32,9 +34,10 @@
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
],
description=("Label fusion strategies for multi-class labels."),
url="https://github.com/FETS-AI/LabelFusion",
Expand Down
Loading