UNCDEPENdLab / fmri.pipeline

R package for running full fMRI GLM analyses in FSL and other software.
GNU General Public License v3.0
4 stars 0 forks source link

Allow run_afni_command to use PATH for AFNI binaries #8

Closed wasciutto closed 1 year ago

wasciutto commented 1 year ago

Currently, this function searches for a path to AFNI's binaries via the environment variable AFNIDIR, and returns ~/afni otherwise.

While the DEPENd lab's AFNI module sets up the env var AFNIDIR, the Longleaf AFNI module does not. This makes the main Longleaf AFNI modules functionally incompatible with run_afni_command through a non-parallel function like combine_feat_l3_to_afni, unless the user manually sets the variable, which will not change alongside AFNI version switches via the module system. Using compute settings through the gpa object will not support this either in the case of a command like combine_feat_l3_to_afni, where it does not draw on parallel compute settings.

Proposed solution: Don't default to ~/afni if no AFNIPATH is found. Let PATH be searched as the main fallback by not appending a full path to the AFNI commands. If ~/afni is actually where the user's AFNI is, it should be on PATH anyways

michaelhallquist commented 1 year ago

Excellent points! Honestly, AFNIDIR isn't that common, and the function made some unconventional assumptions about AFNI's location. I have now modified run_afni_command and run_fsl_command to look in the system path for the locations of relevant binaries if they can't be found otherwise. Fixed by c6b3d53.