# Copy+pasteable commands from the AFNI Bootcamp's "afni11_roi.pdf" # presentation # Run these in this directory of AFNI Bootcamp data cd ~/AFNI_data6/afni # modally smooth a dataset and have AFNI show that with discrete colors 3dLocalstat -stat mode -nbhd 'SPHERE(-1.8)' -prefix myrois_mode1.8 myrois+orig. 3drefit -cmap INT_CMAP -copytables myrois+orig myrois_mode1.8+orig # Change grid/resolution of data set from (high res) anat to # (low res) EPI 3dresample \ -master rall_vr+orig \ -prefix anat_roi_resam \ -inset anat_roi+orig \ -rmode NN # use ROI to mask to a dataset 3dcalc -a rall_vr+orig. -b anat_roi_resam+orig \ -expr 'a*step(b)' -prefix rall_masked # Calculate average value per time point, dump to text file... 3dmaskave \ -mask anat_roi_resam+orig \ -quiet \ rall_vr+orig > epi_avg.1D # ... and view dumped text file results, using either of these more epi_avg.1D # Dump *values* of a dset that are within a mask region into a # text file; no coordinate locations saved in this case, but could # save the coordinates of each voxel, too. 3dmaskdump \ -noijk \ -mask anat_roi_resam+orig \ func_slim+orig'[2]' > Vrel-tstats.txt # ... and view dumped text file results more Vrel-tstats.txt # Compute separate statistics for each ROI in a volume 3dROIstats \ -mask 3rois+orig \ func_slim+orig'[0]' # *** 3dClusterize example here with updated notation *** # put the stats in a standard space for later use with whereami adwarp \ -apar anat+tlrc \ -dpar func_slim+orig \ -dxyz 3 # Generate map of clusters 3dClusterize -clust_nvox 200 -bisided -8.0 8.0 -ithr 2 -idat 1 -NN 1 \ -inset func_slim+tlrc. -pref_map myclusters # Find suprathreshold voxels, and make into clusters (kinda like GUI's # Clusterize functionality and/or 3dclust) 3dmerge \ -prefix func_roi \ -dxyz=1 \ -1clip 99.0 \ -1clust_order 1 200 \ func_slim+orig.'[0]' # ============ "Getting around with spheres" example ========== # Try this: adwarp \ -apar anat+tlrc \ -dpar func_slim+orig \ -dxyz 3 # 1) In afni GUI, select: # Underlay -> anat, # Overlay -> func_slim # 2) Switch 'view' to Talairach # 3) Overlay index -> vrel_coef, # Threshold index -> vrel_tstat # 4) Clusterize (default opts OK), and Save Tabl 1dcat Clust_table.1D'[4..6]' > Clust_PeakXYZ.1D 3dUndump -srad 7.5 -master func_slim+tlrc -orient RAI \ -prefix clust_spheres -xyz Clust_PeakXYZ.1D