Hi all,
I’m preprocessing a task fMRI dataset on the Puma HPC cluster using Neurodesk containers for AFNI and FreeSurfer. I’m trying to include ventricle-based nuisance regressors in afni_proc.py via:
-regress_ROI_PC FSvent 5
-regress_ROI_PC_per_run FSvent
As far as I understand, the standard AFNI workflow is:
- Run FreeSurfer
recon-all. - Run
@SUMA_Make_Spec_FSon the FreeSurfer subject directory. - Use the resulting FSvent mask for the regressors above.
FreeSurfer part works. The SUMA part does not.
Environment
FreeSurfer container
${SIF}/freesurfer_v8.1.sif
AFNI container
${SIF}/afni_v24.1.02.sif
SUBJECTS_DIR
/groups/*******/metvis_fmri/derivatives/freesurfer
FreeSurfer completed fine
recon-all -s sub-METVIS001 finished without error
Log is present and clean.
Attempt to generate FSvent with AFNI container
Inside the AFNI container, with FreeSurfer’s SUBJECTS_DIR bound:
SUB=sub-METVIS001
SUBJECTS_DIR=/groups/*****/metvis_fmri/derivatives/freesurfer
apptainer exec --cleanenv \
--env SUBJECTS_DIR="$SUBJECTS_DIR" \
--bind /groups/******/metvis_fmri:/groups/******/metvis_fmri \
${SIF}/afni_v24.1.02.sif \
tcsh -c "@SUMA_Make_Spec_FS -sid $SUB -NIFTI"
This fails with:
++ Running @SUMA_Make_Spec_FS version: 2.2.4
program not found in path: mris_convert
1 program(s) not found
program failure: exiting...
So:
@SUMA_Make_Spec_FSexists in AFNI’s container,- but it cannot find
mris_convert, - because the FreeSurfer binaries only exist inside the other container (
freesurfer_v8.1.sif).
Binding the FreeSurfer directory makes the data visible, but it does not expose the FS commands.
My questions
What is the recommended way in Neurodesk to generate FSvent when AFNI and FreeSurfer are split across separate containers?
Specifically:
- Is there an existing AFNI+FreeSurfer combined container?
- Is there a documented workflow where
@SUMA_Make_Spec_FSis run inside the FreeSurfer container instead of the AFNI one? - Is there a wrapper or module on Neurodesk/Puma that puts AFNI and FS binaries on the same PATH?
- If none of the above are standard, is there a different recommended method for generating the FSvent mask used by AFNI for nuisance regression?
Right now, recon-all is complete and correct, but I’m blocked because AFNI’s SUMA tools cannot access FreeSurfer’s executables.
Any guidance on the expected / canonical way to do this in Neurodesk would be greatly appreciated.
P.S. For now, I am working around the issue by:
- Running
recon-allin the FreeSurfer container (done). - Still inside the FreeSurfer container, using
mri_binarizeandmri_convertto create NIFTI ventricle and WM masks. - Then, in AFNI, warping these masks to EPI space and extracting PCs manually.
This appears functionally equivalent to the FSvent approach, but I would still like to know the intended / supported method within the Neurodesk ecosystem.