#!/bin/tcsh -f if ( $#argv > 0 ) then if ( $argv[1] == '-help' || $argv[1] == '-h' ) then echo "" echo "@DriveAfni - a demo program for driving 'afni' from a script" echo "" echo "The purpose is for one to review this script while executing it." echo "" echo "This program requres the AFNI_data6 class data directory and must" echo "be run just above it (i.e. typing 'ls' should include AFNI_data6" echo "in the output)." echo "" echo " one output file is created: ./SavedAxiale.jpg" echo "" echo "See README.driver for details on driver commands." echo "See also 'plugout_drive -help'." echo "See also 'DriveSuma -help'." echo "" exit endif endif # NEEDS afni's class data archive AFNI_data?.tgz set adir = AFNI_data6 if ( ! -d $adir/afni/ ) then echo "" echo "** Directory $adir/afni not found." echo "" echo "You could be in the wrong directory," echo "or you may not have $adir on disk." echo "" echo "This directory is in archive:" echo " http://afni.nimh.nih.gov/pub/dist/edu/data/$adir.tgz" echo "" goto END endif afni -niml -yesplugouts $adir/afni & plugout_drive -com 'SWITCH_SESSION A.afni' \ -com 'OPEN_WINDOW A.axialimage geom=600x600+416+44 \ ifrac=0.8 opacity=9' \ -com 'OPEN_WINDOW A.sagittalimage geom=+45+430 \ ifrac=0.8 opacity=9' \ -com 'SWITCH_UNDERLAY anat' \ -com 'SWITCH_OVERLAY strip' \ -com 'SEE_OVERLAY +' \ -com 'OPEN_WINDOW A.axialimage keypress=v' \ -quit echo "Hit Enter to pause movie and move on" set l = $< plugout_drive -com 'OPEN_WINDOW A.axialimage keypress=space \ geom=+56+44 mont=6x3:8' \ -com 'SET_DICOM_XYZ A 0 20 40' \ -com 'SAVE_JPEG axialimage SavedAxiale.jpg' \ -quit echo "Hit Enter to view the saved image" set l = $< aiv SavedAxiale.jpg & echo "Hit Enter to examine time series." set l = $< #Now let us examine the time series plugout_drive -com 'OPEN_WINDOW B.sagittalimage \ geom=300x300+416+344 ifrac=0.8 opacity=9' \ -com 'SWITCH_UNDERLAY B.epi_r1' \ -com 'OPEN_WINDOW B.sagittalgraph \ geom=400x300+0+344 \ keypress=A keypress=v' \ -quit #Show how sub-brick selection can be done. #and how the threshold bar can be set echo "Hit Enter to pause movie and show sub-brick manipulation" set l = $< plugout_drive -com 'OPEN_WINDOW B.sagittalgraph keypress=space' \ -com 'SET_SUBBRICKS B 13 5 6' \ -com 'OPEN_WINDOW B.sagittalimage' \ -com 'SET_THRESHNEW B 0.0001 *p' \ -com 'SET_FUNC_RANGE B.5.0' \ -com 'SEE_OVERLAY B.+' \ -com 'SET_DICOM_XYZ B 30 80.7 15' \ -quit echo "Hit Enter to quit" set l = $< plugout_drive -com 'QUIT' -quit END: