
if test $# != 3
then
   echo "Create a 2D Synthetic Images"
   echo "  Euclidean distance between each pixel and selected spectra."
   echo "  Produces synthetic image series dist%03d.dat"
   echo "  Produces sythetic summary image summary.dat"
   echo "Usage:"
   echo "  imClassify.ksh imageTemplate 1dTemplate 1dCount"
   echo "Example:"
   echo "  imClassify.ksh lsoap1_abs/ir%03d.dat class%03d.dat 4"
   exit 0
fi

nameND=$1
name1D=$2 
count=$3
nameList=""

typeset -i i

i=0

while [ $i -lt $count ]
do
   let i=i+1

   inName=$(printf $name1D      $i)
   outName=$(printf dist%03d.dat $i)
   nameList="$nameList $outName"

   echo $i $inName $outName $nameList
   imDistance.ksh $nameND $inName $outName

   echo "Created synthetic image $outName"
done

imClassify $nameList summary.dat

echo "Created synthetic image summary.dat"

sleep 10
