Skip to content

Commit 398d7ab

Browse files
authored
Merge pull request #124 from jhlegarreta/DoNotRemovefMRINotebookFromList2
TST: Do not remove fMRI BOLD notebook from list of discovered notebooks
2 parents a27812f + 6a48ae9 commit 398d7ab

File tree

3 files changed

+34
-4
lines changed

3 files changed

+34
-4
lines changed

.github/workflows/notebooks.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,33 @@ jobs:
4141
with:
4242
python-version: ${{ matrix.python-version }}
4343

44+
- name: Check for nvcc and set CUDA flag
45+
id: detect-cuda
46+
run: |
47+
if command -v nvcc &> /dev/null; then
48+
echo "nvcc found: CUDA is available"
49+
echo "HAS_CUDA=true" >> $GITHUB_ENV
50+
else
51+
echo "nvcc not found: CUDA is not available"
52+
echo "HAS_CUDA=false" >> $GITHUB_ENV
53+
fi
54+
55+
- name: Install AFNI
56+
run: |
57+
# Detect Ubuntu version
58+
UBUNTU_VERSION=$(lsb_release -rs | cut -d. -f1)
59+
AFNI_PACKAGE="linux_ubuntu_${UBUNTU_VERSION}_64"
60+
echo "Detected Ubuntu version: $UBUNTU_VERSION"
61+
echo "Using AFNI package: $AFNI_PACKAGE"
62+
# Install dependencies
63+
sudo apt-get update
64+
sudo apt-get install -y tcsh curl libglu1-mesa libxmu6 libxm4 libgsl-dev libglw1-mesa
65+
# Download and install AFNI
66+
curl -O https://afni.nimh.nih.gov/pub/dist/bin/${AFNI_PACKAGE}/@update.afni.binaries
67+
tcsh @update.afni.binaries -package $AFNI_PACKAGE -do_extras
68+
# Add AFNI to PATH
69+
echo "$HOME/abin" >> $GITHUB_PATH
70+
4471
- name: Install TeX Live
4572
run: |
4673
sudo apt-get update
@@ -69,6 +96,10 @@ jobs:
6996
pip install osfclient
7097
osf -p 39k4x fetch hcpdata.npz "${TEST_DATA_HOME}/hcpdata.npz"
7198
99+
- name: Download SynthStrip model
100+
run: |
101+
wget https://ftp.nmr.mgh.harvard.edu/pub/dist/freesurfer/synthstrip/models/synthstrip.1.pt -P "${TEST_DATA_HOME}"
102+
72103
- name: Install tox
73104
run: |
74105
python -m pip install --upgrade pip

docs/notebooks/bold_realignment.ipynb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,12 @@
7474
" bmask_path = (\n",
7575
" OUTPUT_DIR / bold_run.parent / f\"{bold_run.name.rsplit('_', 1)[0]}_label-brain_mask.nii.gz\"\n",
7676
" )\n",
77+
" use_gpu = getenv(\"HAS_CUDA\", \"false\").lower() == \"true\"\n",
7778
" if not bmask_path.exists():\n",
7879
" bmsk_results = SynthStrip(\n",
7980
" in_file=str(avg_path),\n",
80-
" use_gpu=True,\n",
81+
" model=DATA_PATH / \"synthstrip.1.pt\",\n",
82+
" use_gpu=use_gpu,\n",
8183
" ).run(cwd=str(WORKDIR))\n",
8284
" copy(bmsk_results.outputs.out_mask, bmask_path)\n",
8385
"\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)