Howdy AFNI experts,
I am running a functional localizer GLM in each subject's T1w space using 3dDeconvolve. My design has three conditions (Animals, Foods, Tools) with a BLOCK(10,1) HRF across 3 concatenated runs, and I am using -tout to get t-statistics alongside my betas. Here is a simplified version of my call:
3dDeconvolve \
-input sub-${subj}_task-localizer_allrun_space-T1w_SI.nii.gz \
-mask sub-${subj}_space-T1w_GM_probseg_resampled.nii.gz \
-concat '1D: 0 134 268' \
-polort A \
-num_stimts 3 \
-stim_times 1 times_Animals.1D 'BLOCK(10,1)' -stim_label 1 Animals \
-stim_times 2 times_Foods.1D 'BLOCK(10,1)' -stim_label 2 Foods \
-stim_times 3 times_Tools.1D 'BLOCK(10,1)' -stim_label 3 Tools \
-num_glt 7 \
-gltsym 'SYM: Foods -0.5*Animals -0.5*Tools' -glt_label 3 Foods_vs_Others \
-tout \
-bucket sub-${subj}_T1w_SI_func_localizer.nii.gz
What I am trying to do:
For each subject, I want to take a specific contrast from the output bucket — for example Foods > Others (Foods_vs_Others) — threshold it at p < 0.001 (uncorrected), binarize the surviving voxels into a binary mask, and then intersect that binary mask with a subject-specific anatomical VTC ROI (also in T1w space). The goal is to get a subject-specific functional VTC mask showing only voxels that are both (a) within the anatomical VTC boundary and (b) significantly activated for that contrast.
I know this can be done interactively in the AFNI GUI — overlaying the stat map, setting the p-value threshold in the slider, and using the Write/Save function to extract the thresholded map. But I need to automate this across ~100 participants, so I am looking for the command-line equivalent.
My specific questions:
- What is the correct way to extract and threshold a specific GLT t-stat sub-brick from the bucket at p < 0.001? I was thinking
3dcalcor3dmaskdumpbut I am not sure of the right approach. - Once thresholded, what is the recommended way to binarize the surviving voxels into a 0/1 mask? Is
fslmaths -binappropriate here, or is there a preferred AFNI-native approach? - Is there a way to have AFNI automatically determine the correct t-threshold for a given p-value, rather than hardcoding a t-value?
Any guidance would be much appreciated. Thank you!
Thanks,
Sahithyan