** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: if1.cpp,v 1.1 2000/12/18 00:24:28 kevin Exp $
+** $Id: if1.cpp,v 1.2 2000/12/23 18:12:35 kevin Exp $
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
{0, 0, 0, 0}
};
-static const char* g_szIdStr = "$Id: if1.cpp,v 1.1 2000/12/18 00:24:28 kevin Exp $";
+static const char* g_szIdStr = "$Id: if1.cpp,v 1.2 2000/12/23 18:12:35 kevin Exp $";
void
if1_usage (const char *program)
}
if (opt_log) {
for (ix = 0; ix < nx; ix++)
- for (iy = 0; iy < ny; iy++)
- vOut[ix][iy] = log (vIn[ix][iy]);
- histString = "Log transformation";
+ for (iy = 0; iy < ny; iy++)\r
+ if (vIn[ix][iy] < 0)\r
+ vOut[ix][iy] = 0;
+ else\r
+ vOut[ix][iy] = log (vIn[ix][iy]);
+ histString = "Logrithmic transformation";
}
if (opt_exp) {
for (ix = 0; ix < nx; ix++)
for (iy = 0; iy < ny; iy++)
vOut[ix][iy] = exp (vIn[ix][iy]);
- histString = "Exp transformation";
+ histString = "Exponential transformation";
}
if (opt_sqr) {
for (ix = 0; ix < nx; ix++)
for (iy = 0; iy < ny; iy++)
vOut[ix][iy] = vIn[ix][iy] * vIn[ix][iy];
- histString = "Sqr transformation";
+ histString = "Square transformation";
}
if (opt_sqrt) {
for (ix = 0; ix < nx; ix++)
- for (iy = 0; iy < ny; iy++)
- vOut[ix][iy] = sqrt (vIn[ix][iy]);
- histString = "Sqrt transformation";
+ for (iy = 0; iy < ny; iy++)\r
+ if (vIn[ix][iy] < 0)
+ vOut[ix][iy] = sqrt (-vIn[ix][iy]);\r
+ else\r
+ vOut[ix][iy] = sqrt (vIn[ix][iy]);\r
+ histString = "Square root transformation";
}
im_out->labelsCopy (*im_in);