Thanks Rick,
I reorganized things, and now it runs smoothly using this code:
hemi=(lh rh)
runs=`ls $data_dir/*run*preproc.nii* | wc -l`
for r in `seq 1 $runs`
do
r=0$r
for h in ${hemi[*]}
do
if [ ! -f $data_dir/sub-${s}_run-${r}_${h}_v2s.niml.dset ]; then
3dVol2Surf \
-spec $freesurfer_dir/std.60.${s}_${h}.spec \
-surf_A smoothwm \
-surf_B pial \
-sv $data_dir/sub-${s}*space*preproc* \
-grid_parent $data_dir/*run-${r}*preproc.nii* \
-map_func ave \
-f_steps 10 \
-f_index nodes \
-oob_index -1 \
-oob_value 0.0 \
-outcols_NSD_format \
-out_1D $data_dir/sub-${s}_run-${r}_${h}_v2s.1D \
-out_niml $data_dir/sub-${s}_run-${r}_${h}_v2s.niml.dset
fi
done
done
I had two follow-up questions that I wanted to clarify.
1). The anatomical file from the -sv option and the functional runs in the -grid_parent option are both normalized in template (MNI) space. I've seen some other examples of 3dVol2Surf where the anatomical and functional runs appear to still be in native space; is it fine to perform 3dVol2Surf where the data has already been moved to template space?
2). The functional data I'm using has not been spatially smoothed nor intensity normalized at this point. Am I correct in assuming that these steps should occur following 3dVol2Surf?
Thanks again.
Dan