#!/bin/tcsh -f if ("$1" == '' || "$1" == "-help" || "$1" == "-h") then echo "Usage 1: A script to parse an AFNI name" echo "" echo " `basename $0` " echo "" echo "Outputs the path, prefix, view and sub-brick selection string." echo "" echo "If view is missing (nifti file), and sub-brick selection" echo "is used, view is set to '----'" echo "" goto END endif set anat_in = `echo "$1" | cut -d \[ -f1` set bling = `echo "$1" | cut -d \[ -f2 | cut -d \] -f1` if ("$bling" == "$1") set bling = "" set anat_path = $anat_in:h if ( "$anat_path" == "${anat_in}" ) set anat_path = "." set ana_pref = `@GetAfniPrefix ${anat_in}` set ana_view = `@GetAfniView ${anat_in}` if ("$ana_view" == '' && "$bling" != '') set ana_view = "----" echo "$anat_path $ana_pref $ana_view $bling" END: