-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathfix_diff
More file actions
executable file
·44 lines (33 loc) · 1.05 KB
/
fix_diff
File metadata and controls
executable file
·44 lines (33 loc) · 1.05 KB
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
#!/bin/sh
# fix_diff - compare the noise component list from two classification output files
#
# Gholamreza Salimi-Khorshidi and Stephen Smith, FMRIB Analysis Group
#
# Copyright (C) 2012-2013 University of Oxford
#
# SHCOPYRIGHT
#############################################################
Usage() {
cat <<EOF
fix_diff <true_classification.txt> <fix_auto_classification.txt>
e.g.: fix_diff hand_labels_noise.txt fix4melview_HCP2000_thr5.txt
EOF
exit 1
}
#############################################################
[ "$2" = "" ] && Usage
in1=$1
in2=$2
i=1
while [ $i -lt `wc -l $in1 $in2 | tail -n 1 | awk '{print $1}'` ] ; do
in1y=`tail -n 1 $in1 | sed 's/\[/,/g' | sed 's/\]/,/g' | sed 's/ //g' | grep ,${i}, | wc -l`
in2y=`tail -n 1 $in2 | sed 's/\[/,/g' | sed 's/\]/,/g' | sed 's/ //g' | grep ,${i}, | wc -l`
if [ $in1y != $in2y ] ; then
if [ $in1y == 1 ] ; then
echo component $i only classed as noise in input 1
else
echo component $i only classed as noise in input 2
fi
fi
i=`echo "$i 1 + p" | dc -`
done