-
Notifications
You must be signed in to change notification settings - Fork 105
/
Copy pathgifti.test.io
executable file
·72 lines (62 loc) · 1.79 KB
/
gifti.test.io
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/tcsh
# either include the names of the gifti files on the command line,
# or be sitting in the directory with them
set skip_ts = 0
set prog = gifti_tool # was gifti_test
# if the user specifies -nots, skip the time series dataset
set narg = $#argv
set base = 1
set gt_comp = 0
if ( $narg >= 1 ) then
if ( "$argv[1]" == "-help" ) then
echo "usage: gifti.test.io [-nots] [-gt_compare] [files...]"
echo ""
echo "option:"
echo " -nots : do not process *time_series*.gii"
echo ""
echo "examples:"
echo " gifti.test.io"
echo " gifti.test.io *.gii"
echo " gifti.test.io -nots"
echo " gifti.test.io -nots *.gii"
exit
else if ( "$argv[1]" == "-gt_compare" ) then
@ narg --
@ base
set gt_comp = 1
else if ( "$argv[1]" == "-nots" ) then
@ narg --
@ base
set skip_ts = 1
endif
endif
echo using `which $prog` ...
if ( $narg >= 1 ) then
set files = ( $argv[$base-] )
else
echo applying default gifti files...
set files = ( gifti.*.gii )
endif
echo ""
foreach file ( $files )
echo -n "$file : "
if ( $skip_ts && "$file" =~ *time_series*.gii ) then
echo "skipping ..."
continue
endif
$prog -infile $file -no_updates -write_gifti new.gii
if( $status ) then
echo "** FAILURE : $prog -infile $file -no_updates -write_gifti new.gii"
else
if ( $gt_comp ) then
gifti_tool -compare_gifti -compare_data -infiles $file new.gii \
>& /dev/null
set result = $status
if ( $result ) echo '** differs **'
else
cmp $file new.gii
set result = $status
endif
if( ! $result ) echo okay
endif
end