Skip to content

Commit e894222

Browse files
committed
TST: Do not remove fMRI notebook from list of discovered notebooks
Do not remove fMRI notebook from list of discovered notebooks: this will allow running the notebook at the time scheduled by the `notebooks.yml` GHA workflow file. Download `SynthStrip` model for skull stripping. Used by the fMRI BOLD realignment notebook. Fixes: ``` FileNotFoundError Traceback (most recent call last) Cell In[4], line 19 14 if not bmask_path.exists(): 15 bmsk_results = SynthStrip( 16 in_file=str(avg_path), 17 use_gpu=True, 18 ).run(cwd=str(WORKDIR)) ---> 19 copy(bmsk_results.outputs.out_mask,bmask_path) (...) FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/tmp/nifreezedev/ismrm25/sub-01_task-mixedgamblestask_run-03_boldref_desc-brain_mask.nii.gz' ``` raised for example at: https://github.com/jhlegarreta/nifreeze/actions/runs/14897027210/job/41841440531#step:11:102 Modify the call to the `SynthStrip` workflow in the notebook so that the model is loaded from a file that is provided as an argument.
1 parent 2ca25ff commit e894222

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

.github/workflows/notebooks.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ jobs:
4747
pip install osfclient
4848
osf -p 39k4x fetch hcpdata.npz "${TEST_DATA_HOME}/hcpdata.npz"
4949
50+
- name: Download SynthStrip model
51+
run: |
52+
wget https://github.com/freesurfer/freesurfer/blob/dev/mri_synthstrip/synthstrip.1.pt -P "${TEST_DATA_HOME}/synthstrip.1.pt"
53+
5054
- name: Install TeX Live
5155
run: |
5256
sudo apt-get update

docs/notebooks/bold_realignment.ipynb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
" bmsk_results = SynthStrip(\n",
7979
" in_file=str(avg_path),\n",
8080
" use_gpu=True,\n",
81+
" model=DATA_PATH / \"synthstrip.1.pt\",\n",
8182
" ).run(cwd=str(WORKDIR))\n",
8283
" copy(bmsk_results.outputs.out_mask, bmask_path)\n",
8384
"\n",

tools/run_notebooks.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,5 @@
2727

2828
# Find and run the notebooks
2929
notebooks = glob.glob("docs/notebooks/*.ipynb")
30-
# Make bold_realignment.ipynb Jupyter notebook an exception as it involves running a realignment
31-
# process for several DataLad datasets, which requires long running times.
32-
notebooks.remove("docs/notebooks/bold_realignment.ipynb")
3330

3431
sys.exit(subprocess.call(["pytest", "--nbmake"] + notebooks))

0 commit comments

Comments
 (0)