#!/bin/tcsh # ---------------------------------------------------------------------- # Convert a drawn surface ROI to the volume (and back?). # # In suma, draw an ROI and save it as (prefix) tuna.lh , # then run this script. # # This script runs ROI2dataset to convert the tuna ROI into a # surface dataset (NIML), and then runs 3dSurf2Vol to project # that into the volume domain, filling the volxels between the # smooth WM and pial surfaces. # # Afterwards, one could view the volume ROI in afni, 'talk' to # suma, and see how the volume ROI maps back to the surface. # ---------------------------------------------------------------------- if ( $#argv > 0 ) then set prefix = $1 else set prefix = tuna endif if ( ! -f $prefix.lh.niml.roi ) then echo "" echo "** missing $prefix.lh.niml.roi : please 'draw' in suma to create it" echo " (save -> $prefix.lh)" echo "" exit 1 endif ROI2dataset -prefix $prefix.lh.niml.dset -input $prefix.lh.niml.roi 3dSurf2Vol \ -spec ../SurfData/SUMA/std.DemoSubj_lh.spec \ -surf_A lh.smoothwm.asc \ -surf_B lh.pial.asc \ -sv DemoSubj_SurfVol_Alnd_Exp+orig \ -grid_parent DemoSubj_SurfVol_Alnd_Exp+orig \ -map_func mode \ -f_steps 12 \ -sdata $prefix.lh.niml.dset \ -prefix $prefix