Skip to content

Commit 9a6e6be

Browse files
authored
Merge branch 'main' into lighter_recon
2 parents 06c2b13 + 1d290c0 commit 9a6e6be

File tree

99 files changed

+22526
-4329
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+22526
-4329
lines changed

.blackignore

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Virtual environments
2+
.venv/
3+
venv/
4+
env/
5+
ENV/
6+
env.bak/
7+
venv.bak/
8+
9+
# Python cache
10+
__pycache__/
11+
*.py[cod]
12+
*$py.class
13+
*.so
14+
.Python
15+
.pytest_cache/
16+
17+
# Distribution / packaging
18+
.Python
19+
build/
20+
develop-eggs/
21+
dist/
22+
downloads/
23+
eggs/
24+
.eggs/
25+
lib/
26+
lib64/
27+
parts/
28+
sdist/
29+
var/
30+
wheels/
31+
*.egg-info/
32+
.installed.cfg
33+
*.egg
34+
35+
# PyInstaller
36+
*.manifest
37+
*.spec
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.coverage
43+
.coverage.*
44+
.cache
45+
nosetests.xml
46+
coverage.xml
47+
*.cover
48+
.hypothesis/
49+
.pytest_cache/
50+
51+
# Jupyter Notebook
52+
.ipynb_checkpoints
53+
54+
# pyenv
55+
.python-version
56+
57+
# celery beat schedule file
58+
celerybeat-schedule
59+
60+
# SageMath parsed files
61+
*.sage.py
62+
63+
# Environments
64+
.env
65+
.venv
66+
env/
67+
venv/
68+
ENV/
69+
env.bak/
70+
venv.bak/
71+
72+
# Spyder project settings
73+
.spyderproject
74+
.spyproject
75+
76+
# Rope project settings
77+
.ropeproject
78+
79+
# mkdocs documentation
80+
/site
81+
82+
# mypy
83+
.mypy_cache/
84+
.dmypy.json
85+
dmypy.json
86+
87+
# IDE
88+
.vscode/
89+
.idea/
90+
*.swp
91+
*.swo
92+
*~
93+
94+
# OS
95+
.DS_Store
96+
.DS_Store?
97+
._*
98+
.Spotlight-V100
99+
.Trashes
100+
ehthumbs.db
101+
Thumbs.db
102+
103+
# Project specific
104+
__MACOSX/
105+
*.zip
106+
*.mat
107+
*.v
108+
*.v.gz
109+
*.avi
110+
*.jpg
111+
*.bytes

.codespellrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[codespell]
2+
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
3+
skip = .git*,*.pdf,*.lock,.codespellrc
4+
check-hidden = true
5+
# Some domain specific variables, names, and some specific variable choices
6+
ignore-regex = \b(TE|PROMIS|Claus|nam|bais)\b
7+
# ignore-words-list =

.github/workflows/codespell.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Codespell configuration is within .codespellrc
2+
---
3+
name: Codespell
4+
5+
on:
6+
push:
7+
branches: [main]
8+
pull_request:
9+
branches: [main]
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
codespell:
16+
name: Check for spelling errors
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
- name: Annotate locations with typos
23+
uses: codespell-project/codespell-problem-matcher@v1
24+
- name: Codespell
25+
uses: codespell-project/actions-codespell@v2

.github/workflows/phantoms.yaml

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ jobs:
2727

2828
strategy:
2929
matrix:
30-
os: [ubuntu-20.04]
31-
python: ["3.10"]
30+
os: [ubuntu-latest]
31+
python: ["3.12"]
3232
fail-fast: false
3333

3434
steps:
@@ -37,15 +37,15 @@ jobs:
3737

3838
- name: Cache Node Posix
3939
if: runner.os != 'Windows' && !env.ACT
40-
uses: actions/cache@v3
40+
uses: actions/cache@v4
4141
with:
4242
path: ~/.npm
4343
key: npm-${{ runner.os }}-${{ env.cache-name }}
4444

4545
- name: Cache Phantoms
4646
if: ${{ !env.ACT }}
4747
id: phantom-cache
48-
uses: actions/cache@v3
48+
uses: actions/cache@v4
4949
env:
5050
cache-name: cache-phantoms
5151
with:
@@ -67,6 +67,12 @@ jobs:
6767
brew install dcm2niix
6868
fi
6969
70+
71+
- name: Check dcm2niix is installed and on path
72+
if: runner.os != 'Windows'
73+
run:
74+
dcm2niix -h
75+
7076
- name: Install dcm2niix windows
7177
if: runner.os == 'Windows'
7278
run: |
@@ -81,23 +87,26 @@ jobs:
8187
cache-dependency-path: |
8288
pypet2bids/pyproject.toml
8389
90+
- name: Install UV
91+
run: curl -LsSf https://astral.sh/uv/install.sh | sh && echo "$HOME/.cargo/bin" >> $GITHUB_PATH
92+
8493
- name: Install Python Dependencies
8594
run: |
8695
cd pypet2bids
87-
pip install .
96+
pip install -e .[dev]
8897
89-
- name: Install Poetry Build Package
98+
- name: Install UV Build Package
9099
run: |
91-
make installpoetry
100+
make installuv
92101
make buildpackage
93-
make installpackage
102+
cd pypet2bids && uv pip install dist/pypet2bids-*.whl --system
94103
dcm2niix4pet -h
95104
96105
- name: Set Up Node
97-
uses: actions/setup-node@v3
106+
uses: actions/setup-node@v4
98107

99108
- name: Install BIDS Validator
100-
run: npm install -g bids-validator
109+
run: npm install -g bids-validator@1.14.6
101110

102111
- name: Collect Phantoms
103112
if: ${{ steps.cache-phantoms.outputs.cache-hit != 'true' }} && ${{ !env.ACT }}
@@ -130,11 +139,15 @@ jobs:
130139
bash python_conversions.sh
131140
132141
- name: SetupMatlab
133-
if: ${{ matrix.os == 'ubuntu-20.04' }}
142+
if: ${{ matrix.os == 'ubuntu-latest' }}
134143
uses: matlab-actions/setup-matlab@v1
144+
# note matlab-actions/setup-matlab@v2 breaks this script, don't update unless you're forced to
145+
#with:
146+
#release: 'R2023a'
147+
#cache: true
135148

136149
- name: Run Matlab Conversion Script on Phantoms
137-
if: ${{ matrix.os == 'ubuntu-20.04' }}
150+
if: ${{ matrix.os == 'ubuntu-latest' }}
138151
uses: matlab-actions/run-command@v1
139152
with:
140153
command: |
@@ -154,6 +167,13 @@ jobs:
154167
run: |
155168
bids-validator OpenNeuroPET-Phantoms/python
156169
170+
- name: Debug
171+
uses: mxschmitt/action-tmate@v3
172+
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
173+
timeout-minutes: 15
174+
with:
175+
limit-access-to-actor: true
176+
157177
- name: Validate Matlab Conversion
158178
run: |
159179
bids-validator OpenNeuroPET-Phantoms/matlab

.github/workflows/python.yaml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ jobs:
3030
strategy:
3131
matrix:
3232
os: [macOS-latest, ubuntu-latest]
33-
python: ['3.8', '3.9', '3.10']
33+
python: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
3434

3535
steps:
3636
- name: Checkout Repo
3737
uses: actions/checkout@v2
3838

3939
- name: Cache Phantoms
4040
id: cache-phantoms
41-
uses: actions/cache@v2
41+
uses: actions/cache@v4
4242
with:
4343
path: US-sourced-OpenNeuroPET-Phantoms.zip
4444
key: ${{ runner.os }}-phantoms
@@ -47,14 +47,16 @@ jobs:
4747
uses: actions/setup-python@v4
4848
with:
4949
python-version: ${{ matrix.python }}
50+
cache: 'pip'
51+
cache-dependency-path: 'pypet2bids/pyproject.toml'
52+
53+
- name: Install UV
54+
run: curl -LsSf https://astral.sh/uv/install.sh | sh && echo "$HOME/.cargo/bin" >> $GITHUB_PATH
5055

5156
- name: Install dependencies
52-
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
5357
run: |
5458
cd pypet2bids
55-
python -m pip install --upgrade pip
56-
pip install poetry
57-
poetry install --with dev
59+
pip install -e .[dev]
5860
5961
- name: Collect ECAT and other phantoms
6062
if: steps.cache-phantoms.outputs.cache-hit != 'true'
@@ -73,12 +75,12 @@ jobs:
7375
- name: Test CLI --help
7476
run: |
7577
cd pypet2bids/
76-
poetry run python3 -m pypet2bids.ecat_cli --help
78+
python3 -m pypet2bids.ecat_cli --help
7779
7880
- name: Test CLI Ecat Dump
7981
run: |
8082
cd pypet2bids/
81-
poetry run python3 -m pypet2bids.ecat_cli ${{ env.REAL_ECAT_TEST_PATH }} --dump
83+
python3 -m pypet2bids.ecat_cli ${{ env.REAL_ECAT_TEST_PATH }} --dump
8284
8385
# the larger real data file uses too much ram for the github runner, we use the small file for
8486
# heavy io operations instead
@@ -87,9 +89,9 @@ jobs:
8789
gzip -d ${{ env.SMALLER_ECAT_PATH }}
8890
8991
- name: Test ecatread
90-
run: "cd pypet2bids/ && poetry run python3 -m tests.test_ecatread"
92+
run: "cd pypet2bids/ && python3 -m tests.test_ecatread"
9193

9294
- name: Run All Other Python Tests w/ Pytest
9395
run: |
9496
cd pypet2bids
95-
poetry run pytest -k 'not write_pixel_data' -k 'not test_convert_pmod_to_blood' tests/
97+
python -m pytest -k 'not write_pixel_data' -k 'not test_convert_pmod_to_blood' tests/

.github/workflows/windows.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
matrix:
1515
os: [windows-latest]
16-
python: ['3.8', '3.9', '3.10']
16+
python: ['3.9', '3.10']
1717

1818
steps:
1919
- name: Checkout Repo

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,12 @@ D:\\BIDS*
5858
*OpenNeuroPET-Phantoms*
5959
**PHANTOMS.zip
6060
ecat_validation/ECAT7_multiframe.v
61+
variables.env
62+
ecat_testing/matlab/
63+
ecat_testing/steps/
64+
ecat_testing/**/*.nii*
65+
*osem*
66+
*fbp*
67+
68+
matlab/SiemensHRRTparameters.txt
69+

.readthedocs.yaml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,20 @@ submodules:
1111
- golden_ecat.py
1212
- tests
1313

14-
1514
# Set the version of Python and other tools you might need
1615
build:
1716
os: ubuntu-22.04
1817
tools:
1918
python: "3.11"
20-
jobs:
21-
post_create_environment:
22-
- cp -r metadata pypet2bids/pypet2bids/
23-
# install poetry
24-
- pip install poetry
25-
- poetry config virtualenvs.create false
26-
# just use poetry to export a requirements.txt as that worked much better than the previous attempts
27-
- cd pypet2bids && poetry lock && poetry export --without-hashes --with dev --format=requirements.txt > requirements.txt
19+
20+
# Install Python dependencies
21+
python:
22+
install:
23+
- method: pip
24+
path: pypet2bids
25+
extra_requirements:
26+
- dev
2827

2928
# Build documentation in the docs/ directory with Sphinx
3029
sphinx:
3130
configuration: docs/conf.py
32-
33-
# Optionally declare the Python requirements required to build your docs
34-
python:
35-
install:
36-
- requirements: pypet2bids/requirements.txt

CITATION.cff

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,17 @@ authors:
3131
- family-names: "Ganz-Benjaminsen"
3232
given-names: "Melanie"
3333
orcid: "https://orcid.org/0000-0002-9120-8098"
34+
- family-names: "Bilgel"
35+
given-names: "Murat"
36+
orcid: "https://orcid.org/0000-0001-5042-7422"
37+
- family-names: "Eierud"
38+
given-names: "Cyrus"
39+
orcid: "https://orcid.org/0000-0002-9942-676X"
3440
- family-names: "Pernet"
3541
given-names: "Cyril"
3642
orcid: "https://orcid.org/0000-0003-4010-4632"
3743
title: "PET2BIDS"
38-
version: 1.0.0
44+
version: 1.3.20240502
3945
url: "https://github.com/openneuropet/PET2BIDS"
4046
date-released: 2022-10-01
4147
license: MIT

0 commit comments

Comments
 (0)