#! /bin/csh -f # Script file to take a reconstructed dataset and make analyze BRIKs # Should be placed in and run from FIDAP directory, output goes to analyze directory # Must be started from iris:/usr/people/mbeaucha # (Can't run in /data1/EC directory on iris because of "pwd" confusion, # can't run on hippo because no padstring command) # experiment code set ec = AN # Change to correct directory cd /data2/mike/AN # number of total tasks set max_tasks = 6 # number of reps of each task set repnumlist = ( 2 2 2 2 2 1 ) # number of slices set max_slices = 23 # number of timepoints set max_time = 88 # Make directory to hold results mkdir analyze chdir analyze # Loop over all tasks set tasknum = 1 while ( $tasknum <= $max_tasks ) cd ../{$ec}t{$tasknum} # analyze utilities append, so must remove any already existing files rm {$ec}*hdr {$ec}*img set repnum = 1 while ( $repnum <= $repnumlist[$tasknum] ) set time_pt = 1 while ( $time_pt <= $max_time ) set padtm = `pad_string $time_pt +0 2` set slice_no = 1 while ($slice_no <= $max_slices) set padsl = `pad_string $slice_no +0 2` # echo excise {$ec}t{$tasknum}r{$repnum}_{$padsl}.{$padtm} {$ec}t{$tasknum}r{$repnum}_{$padtm}.img 0 8192 excise {$ec}t{$tasknum}r{$repnum}_{$padsl}.{$padtm} {$ec}t{$tasknum}r{$repnum}_{$padtm}.img 0 8192 @ slice_no++ end @ time_pt ++ set max = `max16bit {$ec}t{$tasknum}r{$repnum}_{$padtm}` makeheader4 {$ec}t{$tasknum}r{$repnum}_{$padtm}.hdr 64 64 $max_slices 3.75 3.75 5 1 16 $max 0 $max 0 4 end @ repnum ++ # move results to analyze directory mv {$ec}*hdr {$ec}*img ../analyze/ end @ tasknum ++ end # Don't want to analyze first three images cd ../analyze mkdir EPanat mv {$ec}t?r?_0[0-3].img EPanat/ mv {$ec}t?r?_0[0-3].hdr EPanat/ # create a universal header for generating a mask (and other operations) cp {$ec}t1r1_04.hdr anyhdr.hdr