File: mincaverage-test.sh

package info (click to toggle)
minc-tools 2.3.00%2Bdfsg-16
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,720 kB
  • sloc: ansic: 65,674; perl: 7,423; yacc: 1,177; sh: 633; lex: 319; makefile: 224
file content (25 lines) | stat: -rwxr-xr-x 796 bytes parent folder | download | duplicates (6)
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
#! /bin/bash
if [[ ! -x $MINCAVERAGE_BIN ]]; then
    MINCAVERAGE_BIN=`which mincaverage`;
fi;

if [[ ! -x $MINCSTATS_BIN ]]; then
    MINCSTATS_BIN=`which mincstats`;
fi;
# Test the standard (no-normalize) case. This has always worked.
$MINCAVERAGE_BIN -clobber mincaverage-in0.mnc mincaverage-in1.mnc mincaverage-out.mnc
r1=`$MINCSTATS_BIN -quiet -sum mincaverage-out.mnc`
if [[ $r1 != "-88.5" ]]; then
  echo "Problem with non-normalized average:" $r1
  exit 1;
fi;
# Now test the normalize case. This failed until fixed in Oct 2014.
$MINCAVERAGE_BIN -normalize -clobber mincaverage-in0.mnc mincaverage-in1.mnc mincaverage-out.mnc
r2=`$MINCSTATS_BIN -quiet -sum mincaverage-out.mnc`
if [[ $r2 != "-22.25" ]]; then
  echo "Problem with normalized average:" $r2
  exit 1;
fi;
echo "OK."
exit 0