Skip to content

Commit

Permalink
[CI] minimal check on get_data()
Browse files Browse the repository at this point in the history
  • Loading branch information
KrisThielemans committed Sep 29, 2024
1 parent 0eb98be commit d054d64
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .github/workflows/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,21 @@ jobs:
shell: bash -el {0}
run: |
source /opt/SIRF-SuperBuild/INSTALL/bin/env_sirf.sh
mkdir curl -sfSL -o NeuroLF_Hoffman_Dataset.zip https://petric.tomography.stfc.ac.uk/data/NeuroLF_Hoffman_Dataset.zip
mkdir data; unzip -u NeuroLF_Hoffman_Dataset.zip; cd ..
curl -fsSL https://raw.githubusercontent.com/SyneRBI/PETRIC/main/petric.py > petric.py
test -f main.py || ln -s main_ISTA.py main.py
python <<EOF
import petric
from main import Submission, submission_callbacks
from cil.optimisation.algorithms import Algorithm
assert issubclass(Submission, Algorithm)
assert isinstance(submission_callbacks, list)
assert all(callable(callback) for callback in submission_callbacks)
data = petric.get_data('NeuroLF_Hoffman_Dataset')
assert data.OSEM_image.max() > 0
assert data.reference_image.max() > 0
assert data.FOV_mask.max() > 0
EOF
full:
if: startsWith(github.ref, 'refs/tags')
Expand Down
6 changes: 5 additions & 1 deletion SIRF_data_preparation/plot_BSREM_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
# scanID = 'Siemens_Vision600_thorax'
# scanID = 'NeuroLF_Hoffman_Dataset'
# scanID = 'Siemens_mMR_NEMA_IQ'
scanID = 'Mediso_NEMA_IQ'
# scanID = 'Mediso_NEMA_IQ'
# scanID = 'GE_DMI3_Torso'
scanID = 'Siemens_mMR_NEMA_IQ_lowcounts'

srcdir = SRCDIR / scanID
outdir = OUTDIR / scanID
Expand Down Expand Up @@ -126,3 +128,5 @@
plt.figure()
data_QC.plot_image(image - reference_image, **slices, vmin=-cmax / 100, vmax=cmax / 100)
plt.savefig(outdir / f'{scanID}_ref_diff_image_at_0.01_0.005.png')

# %%

0 comments on commit d054d64

Please sign in to comment.