You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(19) |
Nov
(45) |
Dec
(80) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(58) |
Feb
(127) |
Mar
(74) |
Apr
(34) |
May
(117) |
Jun
(14) |
Jul
(26) |
Aug
(13) |
Sep
(1) |
Oct
(38) |
Nov
(13) |
Dec
(5) |
| 2005 |
Jan
(108) |
Feb
(134) |
Mar
(54) |
Apr
(133) |
May
(16) |
Jun
(54) |
Jul
(128) |
Aug
(99) |
Sep
(157) |
Oct
(182) |
Nov
(236) |
Dec
(212) |
| 2006 |
Jan
(86) |
Feb
(76) |
Mar
(121) |
Apr
(27) |
May
(7) |
Jun
(1) |
Jul
(6) |
Aug
(28) |
Sep
(1) |
Oct
(27) |
Nov
(5) |
Dec
|
| 2007 |
Jan
(32) |
Feb
(22) |
Mar
(22) |
Apr
(11) |
May
(3) |
Jun
(12) |
Jul
(11) |
Aug
(9) |
Sep
(37) |
Oct
(4) |
Nov
(9) |
Dec
(51) |
| 2008 |
Jan
(7) |
Feb
(31) |
Mar
(46) |
Apr
(31) |
May
(5) |
Jun
(27) |
Jul
(12) |
Aug
(5) |
Sep
(13) |
Oct
(24) |
Nov
(112) |
Dec
(15) |
| 2009 |
Jan
(6) |
Feb
(103) |
Mar
(66) |
Apr
(9) |
May
(8) |
Jun
(1) |
Jul
(20) |
Aug
(9) |
Sep
(2) |
Oct
(81) |
Nov
(88) |
Dec
(30) |
| 2010 |
Jan
(65) |
Feb
(57) |
Mar
(22) |
Apr
(12) |
May
(4) |
Jun
(12) |
Jul
(43) |
Aug
(6) |
Sep
(6) |
Oct
(4) |
Nov
(6) |
Dec
(3) |
| 2011 |
Jan
(10) |
Feb
(27) |
Mar
(11) |
Apr
(9) |
May
(69) |
Jun
(73) |
Jul
(67) |
Aug
(116) |
Sep
(40) |
Oct
(11) |
Nov
(34) |
Dec
(19) |
| 2012 |
Jan
|
Feb
(4) |
Mar
(28) |
Apr
(18) |
May
(9) |
Jun
(7) |
Jul
(4) |
Aug
(155) |
Sep
(264) |
Oct
(172) |
Nov
(15) |
Dec
(40) |
| 2013 |
Jan
(1) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
(20) |
Jul
(76) |
Aug
(67) |
Sep
(49) |
Oct
(27) |
Nov
(3) |
Dec
(3) |
| 2014 |
Jan
(7) |
Feb
(7) |
Mar
(16) |
Apr
|
May
(4) |
Jun
(1) |
Jul
(18) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2015 |
Jan
(6) |
Feb
(5) |
Mar
(3) |
Apr
(23) |
May
(5) |
Jun
|
Jul
(2) |
Aug
(4) |
Sep
|
Oct
|
Nov
(2) |
Dec
(4) |
| 2016 |
Jan
(2) |
Feb
(7) |
Mar
(2) |
Apr
(1) |
May
(14) |
Jun
(3) |
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
(1) |
Dec
(3) |
| 2017 |
Jan
(6) |
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(12) |
Sep
(6) |
Oct
|
Nov
(3) |
Dec
|
| 2018 |
Jan
(4) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(8) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2019 |
Jan
|
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
(8) |
Oct
|
Nov
(2) |
Dec
(25) |
| 2020 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
(53) |
Nov
(33) |
Dec
|
| 2021 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(4) |
Dec
(5) |
| 2022 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(5) |
Jul
(93) |
Aug
(206) |
Sep
(39) |
Oct
(19) |
Nov
(11) |
Dec
|
| 2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
(150) |
Jul
(124) |
Aug
(14) |
Sep
(5) |
Oct
|
Nov
(1) |
Dec
|
| 2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(62) |
Aug
|
Sep
(7) |
Oct
|
Nov
(7) |
Dec
|
| 2025 |
Jan
|
Feb
|
Mar
|
Apr
(14) |
May
(3) |
Jun
|
Jul
|
Aug
(76) |
Sep
(214) |
Oct
(6) |
Nov
|
Dec
|
|
From: Gordon K. <kin...@us...> - 2004-05-12 11:07:36
|
Update of /cvsroot/teem/teem/src/echo/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31157/test Modified Files: test.c trend.c Log Message: multi-threading may be working Index: test.c =================================================================== RCS file: /cvsroot/teem/teem/src/echo/test/test.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** test.c 7 Jan 2004 15:34:29 -0000 1.16 --- test.c 12 May 2004 11:07:24 -0000 1.17 *************** *** 40,46 **** for (I=0; I<30; I++) { sph = echoObjectNew(scene, echoTypeSphere); ! R = airRand(); ! G = airRand(); ! B = airRand(); echoSphereSet(sph, AIR_AFFINE(0, R, 1, -1, 1), --- 40,46 ---- for (I=0; I<30; I++) { sph = echoObjectNew(scene, echoTypeSphere); ! R = airDrand48(); ! G = airDrand48(); ! B = airDrand48(); echoSphereSet(sph, AIR_AFFINE(0, R, 1, -1, 1), Index: trend.c =================================================================== RCS file: /cvsroot/teem/teem/src/echo/test/trend.c,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** trend.c 12 May 2004 04:03:31 -0000 1.59 --- trend.c 12 May 2004 11:07:24 -0000 1.60 *************** *** 126,130 **** N = 1000000; - /* airSrand(); */ airArraySetLen(LIST(scene)->objArr, N); for (i=0; i<N; i++) { --- 126,129 ---- *************** *** 708,719 **** parm->jitterType = echoJitterJitter; ! parm->numSamples = 4; ! parm->imgResU = 200; ! parm->imgResV = 200; parm->aperture = 0.0; parm->textureNN = AIR_FALSE; parm->renderLights = AIR_TRUE; parm->renderBoxes = AIR_FALSE; ! parm->seedRand = AIR_FALSE; parm->maxRecDepth = 10; ELL_3V_SET(parm->maxRecCol, 0, 0, 0); --- 707,718 ---- parm->jitterType = echoJitterJitter; ! parm->numSamples = 25; ! parm->imgResU = 300; ! parm->imgResV = 300; parm->aperture = 0.0; parm->textureNN = AIR_FALSE; parm->renderLights = AIR_TRUE; parm->renderBoxes = AIR_FALSE; ! parm->seedRand = AIR_TRUE; parm->maxRecDepth = 10; ELL_3V_SET(parm->maxRecCol, 0, 0, 0); *************** *** 727,732 **** echoColorSet(rect, 1, 1, 1, 1.0); echoMatterPhongSet(scene, rect, 0.1, 0.5, 0.6, 50); ! nrrdLoad(ntext=nrrdNew(), "pot.png", NULL); ! echoMatterTextureSet(scene, rect, ntext); echoObjectAdd(scene, rect); --- 726,736 ---- echoColorSet(rect, 1, 1, 1, 1.0); echoMatterPhongSet(scene, rect, 0.1, 0.5, 0.6, 50); ! if (nrrdLoad(ntext=nrrdNew(), "pot.png", NULL)) { ! /* oops, no pot */ ! airFree(biffGetDone(NRRD)); ! nrrdNuke(ntext); ! } else { ! echoMatterTextureSet(scene, rect, ntext); ! } echoObjectAdd(scene, rect); *************** *** 836,841 **** echoScene *scene; airArray *mop; ! char *me, *err; ! int E; me = argv[0]; --- 840,845 ---- echoScene *scene; airArray *mop; ! char *me, *err, *env; ! int E, tmp; me = argv[0]; *************** *** 877,881 **** /* makeSceneDOF(cam, parm, scene); */ ! parm->numThreads = 1; E = 0; if (!E) E |= echoRTRender(nraw, cam, scene, parm, state); --- 881,892 ---- /* makeSceneDOF(cam, parm, scene); */ ! if ((env = getenv("NT"))) { ! if (1 == sscanf(env, "%d", &tmp)) { ! parm->numThreads = tmp; ! } ! } else { ! parm->numThreads = 1; ! } ! E = 0; if (!E) E |= echoRTRender(nraw, cam, scene, parm, state); |
|
From: Gordon K. <kin...@us...> - 2004-05-12 10:37:24
|
Update of /cvsroot/teem/teem/src/ell/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25403 Added Files: rot2aa.c Log Message: matrix to angle-axis, on the command line --- NEW FILE: rot2aa.c --- /* teem: Gordon Kindlmann's research software Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998 University of Utah This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "../ell.h" char *rot2aaInfo = ("converts a list of rotation matrices to a list of " "angle axis specifications"); int main(int argc, char *argv[]) { char *me, *outS, *err; hestOpt *hopt; hestParm *hparm; airArray *mop; Nrrd *_nmat, *nmat, *naa; me = argv[0]; mop = airMopNew(); hparm = hestParmNew(); hparm->elideMultipleNonExistFloatDefault = AIR_TRUE; hopt = NULL; airMopAdd(mop, hparm, (airMopper)hestParmFree, airMopAlways); hestOptAdd(&hopt, NULL, "input matrices", airTypeOther, 1, 1, &_nmat, NULL, "list of rotation matrices, 2-D array with one matrix " "(in ROW-major order) per scanline", NULL, NULL, nrrdHestNrrd); hestOptAdd(&hopt, NULL, "output filename", airTypeString, 1, 1, &outS, "-", "file to write EPS output to"); hestParseOrDie(hopt, argc-1, argv+1, hparm, me, rot2aaInfo, AIR_TRUE, AIR_TRUE, AIR_TRUE); airMopAdd(mop, hopt, (airMopper)hestOptFree, airMopAlways); airMopAdd(mop, hopt, (airMopper)hestParseFree, airMopAlways); if (!( 2 == _nmat->dim && 9 == _nmat->axis[0].size )) { fprintf(stderr, "%s: need a 2-D 9-by-N nrrd\n", me); airMopError(mop); return 1; } nmat = nrrdNew(); airMopAdd(mop, nmat, (airMopper)nrrdNuke, airMopAlways); if (nrrdConvert(nmat, _nmat, nrrdTypeDouble)) { airMopAdd(mop, err = biffGetDone(NRRD), airFree, airMopAlways); fprintf(stderr, "%s: couldn't convert to double:\n%s", me, err); airMopError(mop); return 1; } airMopOkay(mop); exit(0); } |
|
From: Gordon K. <kin...@us...> - 2004-05-12 10:07:24
|
Update of /cvsroot/teem/teem/src/air In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19318 Added Files: privateAir.h Log Message: new private header --- NEW FILE: privateAir.h --- /* teem: Gordon Kindlmann's research software Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998 University of Utah This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <teemEndian.h> #include <teemQnanhibit.h> #include <teemBigbitfield.h> /* ** _airFloat, _airDouble ** ** these unions facilitate converting amonst ** i: unsigned integral type ** c: (sign,exp,frac) triples of unsigned integral components ** v: the floating point numbers these bit-patterns represent */ typedef union { unsigned int i; struct { #if TEEM_ENDIAN == 1234 unsigned int frac : 23; unsigned int exp : 8; unsigned int sign : 1; #else unsigned int sign : 1; unsigned int exp : 8; unsigned int frac : 23; #endif } c; float v; } _airFloat; typedef union { airULLong i; #if TEEM_BIGBITFIELD == 1 /* #ifndef __sparc */ struct { # if TEEM_ENDIAN == 1234 airULLong frac : 52; unsigned int exp : 11; unsigned int sign : 1; # else unsigned int sign : 1; unsigned int exp : 11; airULLong frac : 52; # endif } c; #endif /* these next two members are used for printing in airFPFprintf_d */ struct { /* access to whole double as two unsigned ints */ #if TEEM_ENDIAN == 1234 unsigned int half0 : 32; unsigned int half1 : 32; #else unsigned int half1 : 32; unsigned int half0 : 32; #endif } h; struct { /* access to fraction with two unsigned ints */ #if TEEM_ENDIAN == 1234 unsigned int frac0 : 32; unsigned int frac1 : 20; unsigned int exp : 11; unsigned int sign : 1; #else unsigned int sign : 1; unsigned int exp : 11; unsigned int frac1 : 20; unsigned int frac0 : 32; #endif } c2; double v; } _airDouble; |
|
From: Gordon K. <kin...@us...> - 2004-05-12 10:06:12
|
Update of /cvsroot/teem/teem/src/nrrd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19009 Modified Files: arith.c formatVTK.c Log Message: new random numbers in air Index: formatVTK.c =================================================================== RCS file: /cvsroot/teem/teem/src/nrrd/formatVTK.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** formatVTK.c 11 Jan 2004 00:38:54 -0000 1.7 --- formatVTK.c 12 May 2004 10:05:56 -0000 1.8 *************** *** 346,350 **** fprintf(file, "SPACING %g %g %g\n", xs, ys, zs); fprintf(file, "POINT_DATA %d\n", sx*sy*sz); ! airSrand(); sprintf(name, "nrrd%05d", airRandInt(100000)); if (3 == nrrd->dim) { --- 346,350 ---- fprintf(file, "SPACING %g %g %g\n", xs, ys, zs); fprintf(file, "POINT_DATA %d\n", sx*sy*sz); ! airSrand48(airTime()); sprintf(name, "nrrd%05d", airRandInt(100000)); if (3 == nrrd->dim) { Index: arith.c =================================================================== RCS file: /cvsroot/teem/teem/src/nrrd/arith.c,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** arith.c 9 Apr 2004 19:47:26 -0000 1.35 --- arith.c 12 May 2004 10:05:56 -0000 1.36 *************** *** 147,151 **** return (a < 0.0 ? -1 : (a > 0.0 ? 1 : 0));} double _nrrdUnaryOpExists(double a) {return AIR_EXISTS(a);} ! double _nrrdUnaryOpRand(double a) {return airRand();} /* wacky! */ double (*_nrrdUnaryOp[NRRD_UNARY_OP_MAX+1])(double) = { --- 147,151 ---- return (a < 0.0 ? -1 : (a > 0.0 ? 1 : 0));} double _nrrdUnaryOpExists(double a) {return AIR_EXISTS(a);} ! double _nrrdUnaryOpRand(double a) {return airDrand48();} /* wacky! */ double (*_nrrdUnaryOp[NRRD_UNARY_OP_MAX+1])(double) = { |
|
From: Gordon K. <kin...@us...> - 2004-05-12 10:03:40
|
Update of /cvsroot/teem/teem/src/air In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18464 Modified Files: 754.c GNUmakefile air.h miscAir.c Added Files: rand48.c Log Message: adapted/simplified the drand48() implementation from glibc-2.3, in new functions airDrand48(), including a re-entrant version airDrand48_r(). This became an issue as soon as echo become genuinely multi-threaded Index: 754.c =================================================================== RCS file: /cvsroot/teem/teem/src/air/754.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** 754.c 7 Jan 2004 15:34:27 -0000 1.15 --- 754.c 12 May 2004 10:03:26 -0000 1.16 *************** *** 20,23 **** --- 20,24 ---- #include "air.h" + #include "privateAir.h" #include <teemEndian.h> #include <teemQnanhibit.h> *************** *** 38,107 **** #endif - /* - ** _airFloat, _airDouble - ** - ** these unions facilitate converting amonst - ** i: unsigned integral type - ** c: (sign,exp,frac) triples of unsigned integral components - ** v: the floating point numbers these bit-patterns represent - */ - typedef union { - unsigned int i; - struct { - #if TEEM_ENDIAN == 1234 - unsigned int frac : 23; - unsigned int exp : 8; - unsigned int sign : 1; - #else - unsigned int sign : 1; - unsigned int exp : 8; - unsigned int frac : 23; - #endif - } c; - float v; - } _airFloat; - - typedef union { - airULLong i; - #if TEEM_BIGBITFIELD == 1 - /* #ifndef __sparc */ - struct { - # if TEEM_ENDIAN == 1234 - airULLong frac : 52; - unsigned int exp : 11; - unsigned int sign : 1; - # else - unsigned int sign : 1; - unsigned int exp : 11; - airULLong frac : 52; - # endif - } c; - #endif - /* these next two members are used for printing in airFPFprintf_d */ - struct { /* access to whole double as two unsigned ints */ - #if TEEM_ENDIAN == 1234 - unsigned int half0 : 32; - unsigned int half1 : 32; - #else - unsigned int half1 : 32; - unsigned int half0 : 32; - #endif - } h; - struct { /* access to fraction with two unsigned ints */ - #if TEEM_ENDIAN == 1234 - unsigned int frac0 : 32; - unsigned int frac1 : 20; - unsigned int exp : 11; - unsigned int sign : 1; - #else - unsigned int sign : 1; - unsigned int exp : 11; - unsigned int frac1 : 20; - unsigned int frac0 : 32; - #endif - } c2; - double v; - } _airDouble; - /* ** The hex numbers in braces are examples of C's "initial member of a union" --- 39,42 ---- Index: miscAir.c =================================================================== RCS file: /cvsroot/teem/teem/src/air/miscAir.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** miscAir.c 22 Apr 2004 10:12:45 -0000 1.24 --- miscAir.c 12 May 2004 10:03:27 -0000 1.25 *************** *** 259,292 **** /* - ******** airSrand() - ** - ** uses clock to seed srand() - */ - void - airSrand(void) { - - srand((unsigned int)airTime()); - } - - /* - ******** airRand() - ** - ** returns double in range [0.0,1.0) - */ - double - airRand(void) { - double val, sc = 1.0/(RAND_MAX+1.0); - - val = sc*rand(); - - /* repeat as needed */ - val = sc*(val + rand()); - val = sc*(val + rand()); - val = sc*(val + rand()); - - return val; - } - - /* ******** airRandInt ** --- 259,262 ---- *************** *** 297,301 **** int i; ! AIR_INDEX(0.0, airRand(), 1.0, N, i); i = AIR_CLAMP(0, i, N-1); return i; --- 267,271 ---- int i; ! AIR_INDEX(0.0, airDrand48(), 1.0, N, i); i = AIR_CLAMP(0, i, N-1); return i; Index: air.h =================================================================== RCS file: /cvsroot/teem/teem/src/air/air.h,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** air.h 13 Mar 2004 20:03:08 -0000 1.40 --- air.h 12 May 2004 10:03:27 -0000 1.41 *************** *** 300,303 **** --- 300,315 ---- TEEM_API int airExists_d(double d); + typedef struct { + airULLong a; /* Factor in congruential formula. */ + unsigned short c, /* Additive const. in congruential formula. */ + x0, x1, x2; /* Current state. */ + } airDrand48State; + /* rand48.c */ + TEEM_API airDrand48State *airDrand48StateGlobal; + TEEM_API void airSrand48_r(airDrand48State *state, int seed); + TEEM_API double airDrand48_r(airDrand48State *state); + TEEM_API void airSrand48(int seed); + TEEM_API double airDrand48(); + /* ******** airType *************** *** 395,400 **** /* ---- BEGIN non-NrrdIO */ TEEM_API const char airMyFmt_size_t[]; - TEEM_API void airSrand(void); - TEEM_API double airRand(void); TEEM_API int airRandInt(int N); TEEM_API void airShuffle(int *buff, int N, int perm); --- 407,410 ---- --- NEW FILE: rand48.c --- /* teem: Gordon Kindlmann's research software Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998 University of Utah This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ** The contents of this file were derived from the *rand48*.c files ** from glibc-2.3/stdlib, which is distributed under the LGPL that ** governs the distribution of Teem. */ #include "air.h" #include "privateAir.h" airDrand48State _airDrand48StateGlobal = { AIR_ULLONG(0x5deece66d), /* a */ 0xb, /* c */ 0x330e, 0, 0 /* x0, x1, x2 */ }; airDrand48State * airDrand48StateGlobal = &_airDrand48StateGlobal; void _airDrand48Iterate(airDrand48State *state) { airULLong X, result; X = ((airULLong)state->x2 << 32 | (unsigned)state->x1 << 16 | state->x0); result = X*state->a + state->c; state->x0 = result & 0xffff; state->x1 = (result >> 16) & 0xffff; state->x2 = (result >> 32) & 0xffff; return; } void airSrand48_r(airDrand48State *state, int seed) { state->x0 = 0x330e; state->x1 = seed & 0xffff; state->x2 = seed >> 16; state->c = 0xb; state->a = AIR_ULLONG(0x5deece66d); return; } void airSrand48(int seed) { airSrand48_r(airDrand48StateGlobal, seed); return; } double airDrand48_r(airDrand48State *state) { _airDouble temp; _airDrand48Iterate(state); temp.v = 1.0; temp.c2.frac1 = (state->x2 << 4) | (state->x1 >> 12); temp.c2.frac0 = ((state->x1 & 0xfff) << 20) | (state->x0 << 4); return temp.v - 1.0; } double airDrand48() { return airDrand48_r(airDrand48StateGlobal); } Index: GNUmakefile =================================================================== RCS file: /cvsroot/teem/teem/src/air/GNUmakefile,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** GNUmakefile 7 Jan 2004 15:34:27 -0000 1.12 --- GNUmakefile 12 May 2004 10:03:27 -0000 1.13 *************** *** 46,53 **** $(L).NEED = $(L).PUBLIC_HEADERS = air.h ! $(L).OBJS = 754.o array.o miscAir.o parseAir.o endianAir.o \ dio.o mop.o enum.o sane.o string.o threadAir.o $(L).TESTS = test/floatprint test/doubleprint test/tok \ ! test/tmop test/tline test/fp $(L).NEED_ENDIAN = true --- 46,54 ---- $(L).NEED = $(L).PUBLIC_HEADERS = air.h ! $(L).PRIVATE_HEADERS = privateAir.h ! $(L).OBJS = 754.o rand48.o array.o miscAir.o parseAir.o endianAir.o \ dio.o mop.o enum.o sane.o string.o threadAir.o $(L).TESTS = test/floatprint test/doubleprint test/tok \ ! test/tmop test/tline test/fp test/trand $(L).NEED_ENDIAN = true |
|
From: Gordon K. <kin...@us...> - 2004-05-12 10:03:38
|
Update of /cvsroot/teem/teem/src/air/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18464/test Added Files: trand.c Log Message: adapted/simplified the drand48() implementation from glibc-2.3, in new functions airDrand48(), including a re-entrant version airDrand48_r(). This became an issue as soon as echo become genuinely multi-threaded --- NEW FILE: trand.c --- /* teem: Gordon Kindlmann's research software Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998 University of Utah This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "../air.h" int main(int argc, char *argv[]) { char *me, *NS; int ii, N; me = argv[0]; if (2 != argc) { /* 0 1 (2) */ fprintf(stderr, "usage: %s <N>\n", me); exit(1); } NS = argv[1]; if (1 != sscanf(NS, "%d", &N)) { fprintf(stderr, "%s: couldn't parse %s as int N\n", me, NS); exit(1); } for (ii=0; ii<N; ii++) { printf("%g\n", airDrand48()); } exit(0); } |
|
From: Gordon K. <kin...@us...> - 2004-05-12 04:05:09
|
Update of /cvsroot/teem/teem/src/air In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22088 Modified Files: threadAir.c Log Message: unused variables Index: threadAir.c =================================================================== RCS file: /cvsroot/teem/teem/src/air/threadAir.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** threadAir.c 11 May 2004 20:32:11 -0000 1.15 --- threadAir.c 12 May 2004 04:05:00 -0000 1.16 *************** *** 451,455 **** airThreadMutex * airThreadMutexNew(void) { - char me[]="airThreadMutexInit"; airThreadMutex *mutex; --- 451,454 ---- *************** *** 486,490 **** airThreadCond * airThreadCondNew(void) { - char me[]="airThreadCondInit"; airThreadCond *cond; --- 485,488 ---- |
|
From: Gordon K. <kin...@us...> - 2004-05-12 04:03:43
|
Update of /cvsroot/teem/teem/src/echo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21805 Modified Files: GNUmakefile echo.h list.c methodsEcho.c objmethods.c renderEcho.c Log Message: debuggin Index: renderEcho.c =================================================================== RCS file: /cvsroot/teem/teem/src/echo/renderEcho.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** renderEcho.c 13 Mar 2004 20:03:09 -0000 1.25 --- renderEcho.c 12 May 2004 04:03:31 -0000 1.26 *************** *** 22,26 **** int ! echoThreadStateInit(echoThreadState *tstate, echoRTParm *parm, echoGlobalState *gstate) { char me[]="echoThreadStateInit", err[AIR_STRLEN_MED]; --- 22,26 ---- int ! echoThreadStateInit(int threadIdx, echoThreadState *tstate, echoRTParm *parm, echoGlobalState *gstate) { char me[]="echoThreadStateInit", err[AIR_STRLEN_MED]; *************** *** 30,37 **** biffAdd(ECHO, err); return 1; } ! /* this will probably be over-written */ tstate->verbose = gstate->verbose; ! if (nrrdMaybeAlloc(tstate->nperm, nrrdTypeInt, 2, ECHO_JITTABLE_NUM, parm->numSamples)) { --- 30,38 ---- biffAdd(ECHO, err); return 1; } ! /* tstate->thread set by echoThreadStateNew() */ ! tstate->gstate = gstate; /* this will probably be over-written */ tstate->verbose = gstate->verbose; ! tstate->threadIdx = threadIdx; if (nrrdMaybeAlloc(tstate->nperm, nrrdTypeInt, 2, ECHO_JITTABLE_NUM, parm->numSamples)) { *************** *** 55,59 **** biffAdd(ECHO, err); return 1; } - tstate->chanBuff = airFree(tstate->chanBuff); if (!( tstate->chanBuff = --- 56,59 ---- *************** *** 63,66 **** --- 63,68 ---- biffAdd(ECHO, err); return 1; } + + tstate->returnPtr = NULL; return 0; *************** *** 264,324 **** } ! /* ! ******** echoRTRender ! ** ! ** top-level call to accomplish all (ray-tracing) rendering. As much ! ** error checking as possible should be done here and not in the ! ** lower-level functions. ! */ ! int ! echoRTRender(Nrrd *nraw, limnCamera *cam, echoScene *scene, ! echoRTParm *parm, echoGlobalState *gstate) { ! char me[]="echoRTRender", err[AIR_STRLEN_MED], done[20]; int imgUi, imgVi, /* integral pixel indices */ samp; /* which sample are we doing */ echoPos_t tmp0, tmp1, ! eye[3], /* eye center before jittering */ ! at[3], /* ray destination (pixel center post-jittering) */ ! U[4], V[4], N[4], /* view space basis (only first 3 elements used) */ pixUsz, pixVsz, /* U and V dimensions of a pixel */ imgU, imgV, /* floating point pixel center locations */ imgOrig[3]; /* image origin */ - echoThreadState *tstate; /* only one thread for now */ - echoCol_t *img, *chan; /* current scanline of channel buffer array */ - echoRay ray; /* (not a pointer) */ double time0; ! if (echoRTRenderCheck(nraw, cam, scene, parm, gstate)) { ! sprintf(err, "%s: problem with input", me); ! biffAdd(ECHO, err); return 1; ! } ! if (nrrdMaybeAlloc(nraw, echoCol_nt, 3, ! ECHO_IMG_CHANNELS, parm->imgResU, parm->imgResV)) { ! sprintf(err, "%s: couldn't allocate output image", me); ! biffMove(ECHO, err, NRRD); return 1; ! } ! nrrdAxisInfoSet(nraw, nrrdAxisInfoLabel, ! "r,g,b,a,t", "x", "y"); ! nrrdAxisInfoSet(nraw, nrrdAxisInfoMin, ! AIR_NAN, cam->uRange[0], cam->vRange[0]); ! nrrdAxisInfoSet(nraw, nrrdAxisInfoMax, ! AIR_NAN, cam->uRange[1], cam->vRange[1]); ! tstate = echoThreadStateNew(); ! if (echoThreadStateInit(tstate, parm, gstate)) { ! sprintf(err, "%s:", me); ! biffAdd(ECHO, err); return 1; ! } ! ! gstate->time = airTime(); ! if (parm->seedRand) { ! airSrand(); ! } ! echoJitterCompute(parm, tstate); ! if (gstate->verbose > 2) { ! nrrdSave("jitt.nrrd", tstate->njitt, NULL); } /* set eye, U, V, N, imgOrig */ ! ELL_3V_COPY(eye, cam->from); ELL_4MV_ROW0_GET(U, cam->W2V); ELL_4MV_ROW1_GET(V, cam->W2V); --- 266,304 ---- } ! void * ! _echoRTRenderThreadBody(void *_arg) { ! char done[20]; int imgUi, imgVi, /* integral pixel indices */ samp; /* which sample are we doing */ echoPos_t tmp0, tmp1, ! *jitt, pixUsz, pixVsz, /* U and V dimensions of a pixel */ + U[4], V[4], N[4], /* view space basis (only first 3 elements used) */ imgU, imgV, /* floating point pixel center locations */ + eye[3], /* eye center before jittering */ + at[3], /* ray destination (pixel center post-jittering) */ imgOrig[3]; /* image origin */ double time0; + echoRay ray; /* (not a pointer) */ + echoThreadState *arg; + echoCol_t *img, *chan; /* current scanline of channel buffer array */ + Nrrd *nraw; /* copies of arguments to echoRTRender ... */ + limnCamera *cam; + echoScene *scene; + echoRTParm *parm; ! arg = (echoThreadState *)_arg; ! nraw = arg->gstate->nraw; ! cam = arg->gstate->cam; ! scene = arg->gstate->scene; ! parm = arg->gstate->parm; ! ! echoJitterCompute(arg->gstate->parm, arg); ! if (arg->gstate->verbose > 2) { ! nrrdSave("jitt.nrrd", arg->njitt, NULL); } /* set eye, U, V, N, imgOrig */ ! ELL_3V_COPY(eye, arg->gstate->cam->from); ELL_4MV_ROW0_GET(U, cam->W2V); ELL_4MV_ROW1_GET(V, cam->W2V); *************** *** 330,356 **** pixVsz = (cam->vRange[1] - cam->vRange[0])/(parm->imgResV); ! tstate->depth = 0; ray.shadow = AIR_FALSE; ! img = (echoCol_t *)nraw->data; ! fprintf(stderr, "%s: ", me); /* prep for printing airDoneStr */ ! tstate->verbose = AIR_FALSE; ! for (imgVi=0; imgVi<parm->imgResV; imgVi++) { ! imgV = NRRD_POS(nrrdCenterCell, cam->vRange[0], cam->vRange[1], ! parm->imgResV, imgVi); if (!(imgVi % 5)) { fprintf(stderr, "%s", airDoneStr(0, imgVi, parm->imgResV-1, done)); fflush(stderr); } for (imgUi=0; imgUi<parm->imgResU; imgUi++) { imgU = NRRD_POS(nrrdCenterCell, cam->uRange[0], cam->uRange[1], parm->imgResU, imgUi); ! /* initialize things on first "scanline" */ ! tstate->jitt = (echoPos_t *)tstate->njitt->data; ! chan = tstate->chanBuff; ! /* tstate->verbose = ( (160 == imgUi && 160 == imgVi) ); */ ! if (tstate->verbose) { fprintf(stderr, "\n"); fprintf(stderr, "-----------------------------------------------\n"); --- 310,354 ---- pixVsz = (cam->vRange[1] - cam->vRange[0])/(parm->imgResV); ! arg->depth = 0; ray.shadow = AIR_FALSE; ! arg->verbose = AIR_FALSE; ! while (1) { ! if (arg->gstate->workMutex) { ! airThreadMutexLock(arg->gstate->workMutex); ! } ! imgVi = arg->gstate->workIdx; ! if (arg->gstate->workIdx < parm->imgResV) { ! arg->gstate->workIdx += 1; ! } ! /* if (!(imgVi % 5)) { fprintf(stderr, "%s", airDoneStr(0, imgVi, parm->imgResV-1, done)); fflush(stderr); } + */ + fprintf(stderr, "%d : %d\n", arg->threadIdx, imgVi); + if (arg->gstate->workMutex) { + airThreadMutexUnlock(arg->gstate->workMutex); + } + if (imgVi == parm->imgResV) { + /* we're done! */ + break; + } + + imgV = NRRD_POS(nrrdCenterCell, cam->vRange[0], cam->vRange[1], + parm->imgResV, imgVi); for (imgUi=0; imgUi<parm->imgResU; imgUi++) { imgU = NRRD_POS(nrrdCenterCell, cam->uRange[0], cam->uRange[1], parm->imgResU, imgUi); ! img = ((echoCol_t *)nraw->data ! + ECHO_IMG_CHANNELS*(imgUi + parm->imgResU*imgVi)); ! /* initialize things on first "scanline" */ ! jitt = (echoPos_t *)arg->njitt->data; ! chan = arg->chanBuff; ! /* arg->verbose = ( (160 == imgUi && 160 == imgVi) ); */ ! if (arg->verbose) { fprintf(stderr, "\n"); fprintf(stderr, "-----------------------------------------------\n"); *************** *** 365,376 **** ELL_3V_COPY(ray.from, eye); if (parm->aperture) { ! tmp0 = parm->aperture*(tstate->jitt[0 + 2*echoJittableLens]); ! tmp1 = parm->aperture*(tstate->jitt[1 + 2*echoJittableLens]); ELL_3V_SCALE_ADD3(ray.from, 1, ray.from, tmp0, U, tmp1, V); } /* set at[] */ ! tmp0 = imgU + pixUsz*(tstate->jitt[0 + 2*echoJittablePixel]); ! tmp1 = imgV + pixVsz*(tstate->jitt[1 + 2*echoJittablePixel]); ELL_3V_SCALE_ADD3(at, 1, imgOrig, tmp0, U, tmp1, V); --- 363,374 ---- ELL_3V_COPY(ray.from, eye); if (parm->aperture) { ! tmp0 = parm->aperture*(jitt[0 + 2*echoJittableLens]); ! tmp1 = parm->aperture*(jitt[1 + 2*echoJittableLens]); ELL_3V_SCALE_ADD3(ray.from, 1, ray.from, tmp0, U, tmp1, V); } /* set at[] */ ! tmp0 = imgU + pixUsz*(jitt[0 + 2*echoJittablePixel]); ! tmp1 = imgV + pixVsz*(jitt[1 + 2*echoJittablePixel]); ELL_3V_SCALE_ADD3(at, 1, imgOrig, tmp0, U, tmp1, V); *************** *** 384,407 **** memset(chan, 0, ECHO_IMG_CHANNELS*sizeof(echoCol_t)); } else { ! echoRayColor(chan, &ray, scene, parm, tstate); } chan[4] = airTime() - time0; ! /* move to next "scanlines" */ ! tstate->jitt += 2*ECHO_JITTABLE_NUM; chan += ECHO_IMG_CHANNELS; } ! echoChannelAverage(img, parm, tstate); img += ECHO_IMG_CHANNELS; if (!parm->reuseJitter) { ! echoJitterCompute(parm, tstate); } } } gstate->time = airTime() - gstate->time; fprintf(stderr, "\n%s: time = %g\n", me, gstate->time); ! tstate = echoThreadStateNix(tstate); ! return 0; } --- 382,486 ---- memset(chan, 0, ECHO_IMG_CHANNELS*sizeof(echoCol_t)); } else { ! echoRayColor(chan, &ray, scene, parm, arg); } chan[4] = airTime() - time0; ! /* move to next "scanline" */ ! jitt += 2*ECHO_JITTABLE_NUM; chan += ECHO_IMG_CHANNELS; } ! echoChannelAverage(img, parm, arg); ! img[0] = arg->threadIdx; img += ECHO_IMG_CHANNELS; if (!parm->reuseJitter) { ! echoJitterCompute(parm, arg); } } } + + return _arg; + } + + + /* + ******** echoRTRender + ** + ** top-level call to accomplish all (ray-tracing) rendering. As much + ** error checking as possible should be done here and not in the + ** lower-level functions. + */ + int + echoRTRender(Nrrd *nraw, limnCamera *cam, echoScene *scene, + echoRTParm *parm, echoGlobalState *gstate) { + char me[]="echoRTRender", err[AIR_STRLEN_MED]; + int tid, ret; + airArray *mop; + echoThreadState *tstate[ECHO_THREAD_MAX]; + + if (echoRTRenderCheck(nraw, cam, scene, parm, gstate)) { + sprintf(err, "%s: problem with input", me); + biffAdd(ECHO, err); return 1; + } + gstate->nraw = nraw; + gstate->cam = cam; + gstate->scene = scene; + gstate->parm = parm; + mop = airMopNew(); + if (nrrdMaybeAlloc(nraw, echoCol_nt, 3, + ECHO_IMG_CHANNELS, parm->imgResU, parm->imgResV)) { + sprintf(err, "%s: couldn't allocate output image", me); + biffMove(ECHO, err, NRRD); airMopError(mop); return 1; + } + airMopAdd(mop, nraw, (airMopper)nrrdNix, airMopOnError); + nrrdAxisInfoSet(nraw, nrrdAxisInfoLabel, + "r,g,b,a,t", "x", "y"); + nrrdAxisInfoSet(nraw, nrrdAxisInfoMin, + AIR_NAN, cam->uRange[0], cam->vRange[0]); + nrrdAxisInfoSet(nraw, nrrdAxisInfoMax, + AIR_NAN, cam->uRange[1], cam->vRange[1]); + gstate->time = airTime(); + if (parm->seedRand) { + airSrand(); + } + + if (parm->numThreads > 1) { + gstate->workMutex = airThreadMutexNew(); + airMopAdd(mop, gstate->workMutex, + (airMopper)airThreadMutexNix, airMopAlways); + } else { + gstate->workMutex = NULL; + } + for (tid=0; tid<parm->numThreads; tid++) { + if (!( tstate[tid] = echoThreadStateNew() )) { + sprintf(err, "%s: failed to create thread state %d", me, tid); + biffAdd(ECHO, err); airMopError(mop); return 1; + } + if (echoThreadStateInit(tid, tstate[tid], parm, gstate)) { + sprintf(err, "%s: failed to initialized thread state %d", me, tid); + biffAdd(ECHO, err); airMopError(mop); return 1; + } + airMopAdd(mop, tstate[tid], (airMopper)echoThreadStateNix, airMopAlways); + } + fprintf(stderr, "%s: ", me); /* prep for printing airDoneStr */ + gstate->workIdx = 0; + for (tid=0; tid<parm->numThreads; tid++) { + if (( ret = airThreadStart(tstate[tid]->thread, _echoRTRenderThreadBody, + (void *)(tstate[tid])) )) { + sprintf(err, "%s: thread[%d] failed to start: %d", me, tid, ret); + biffAdd(ECHO, err); airMopError(mop); return 1; + } + } + for (tid=0; tid<parm->numThreads; tid++) { + if (( ret = airThreadJoin(tstate[tid]->thread, + (void **)(&(tstate[tid]->returnPtr))) )) { + sprintf(err, "%s: thread[%d] failed to join: %d", me, tid, ret); + biffAdd(ECHO, err); airMopError(mop); return 1; + } + } + gstate->time = airTime() - gstate->time; fprintf(stderr, "\n%s: time = %g\n", me, gstate->time); ! airMopOkay(mop); return 0; } Index: echo.h =================================================================== RCS file: /cvsroot/teem/teem/src/echo/echo.h,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** echo.h 19 Feb 2004 03:44:07 -0000 1.61 --- echo.h 12 May 2004 04:03:31 -0000 1.62 *************** *** 67,70 **** --- 67,72 ---- #define ECHO_LEN_SMALL_ENOUGH 5 /* to control splitting for split objects */ + #define ECHO_THREAD_MAX 512 /* max number of threads */ + typedef struct { int jitterType, /* from echoJitter* enum below */ *************** *** 80,85 **** renderBoxes, /* faintly render bounding boxes */ seedRand, /* call airSrand() (don't if repeatability wanted) */ ! sqNRI; /* how many iterations of newton-raphson we allow for finding superquadric root (within tolorance sqTol) */ echoPos_t sqTol; /* how close newtwon-raphson must get to zero */ --- 82,88 ---- renderBoxes, /* faintly render bounding boxes */ seedRand, /* call airSrand() (don't if repeatability wanted) */ ! sqNRI, /* how many iterations of newton-raphson we allow for finding superquadric root (within tolorance sqTol) */ + numThreads; /* number of threads to spawn per rendering */ echoPos_t sqTol; /* how close newtwon-raphson must get to zero */ *************** *** 94,104 **** } echoRTParm; typedef struct { int verbose; double time; /* time it took to render image */ } echoGlobalState; typedef struct { ! int verbose, depth; /* how many recursion levels are we at */ Nrrd *nperm, /* ECHO_JITTABLE_NUM x parm->numSamples array --- 97,118 ---- } echoRTParm; + struct echoScene_t; + typedef struct { int verbose; double time; /* time it took to render image */ + Nrrd *nraw; /* copies of arguments to echoRTRender */ + limnCamera *cam; + struct echoScene_t *scene; + echoRTParm *parm; + int workIdx; /* next work assignment (such as a scanline) */ + airThreadMutex *workMutex; /* mutex around work assignment */ } echoGlobalState; typedef struct { ! airThread *thread; /* my thread */ ! echoGlobalState *gstate; ! int verbose, /* blah blah blah */ ! threadIdx, /* my thread index */ depth; /* how many recursion levels are we at */ Nrrd *nperm, /* ECHO_JITTABLE_NUM x parm->numSamples array *************** *** 115,118 **** --- 129,133 ---- echoCol_t *chanBuff; /* for storing ray color and other parameters for each of the parm->numSamples rays in current pixel */ + void *returnPtr; /* for airThreadJoin */ } echoThreadState; *************** *** 338,342 **** ** and nrrds to be nixed and nuked, respectively. */ ! typedef struct { echoObject **cat; /* array of ALL objects and all lights */ airArray *catArr; --- 353,357 ---- ** and nrrds to be nixed and nuked, respectively. */ ! typedef struct echoScene_t { echoObject **cat; /* array of ALL objects and all lights */ airArray *catArr; *************** *** 489,493 **** /* renderEcho.c ---------------------------------------- */ ! TEEM_API int echoThreadStateInit(echoThreadState *tstate, echoRTParm *parm, echoGlobalState *gstate); TEEM_API void echoJitterCompute(echoRTParm *parm, echoThreadState *state); --- 504,508 ---- /* renderEcho.c ---------------------------------------- */ ! TEEM_API int echoThreadStateInit(int threadIdx, echoThreadState *tstate, echoRTParm *parm, echoGlobalState *gstate); TEEM_API void echoJitterCompute(echoRTParm *parm, echoThreadState *state); Index: methodsEcho.c =================================================================== RCS file: /cvsroot/teem/teem/src/echo/methodsEcho.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** methodsEcho.c 13 Mar 2004 20:03:09 -0000 1.14 --- methodsEcho.c 12 May 2004 04:03:31 -0000 1.15 *************** *** 41,44 **** --- 41,45 ---- parm->seedRand = AIR_TRUE; parm->sqNRI = 15; + parm->numThreads = 1; parm->sqTol = 0.0001; parm->aperture = 0.0; /* pinhole camera by default */ *************** *** 67,70 **** --- 68,77 ---- state->verbose = 0; state->time = 0; + state->nraw = NULL; + state->cam = NULL; + state->scene = NULL; + state->parm = NULL; + state->workIdx = 0; + state->workMutex = NULL; } return state; *************** *** 75,78 **** --- 82,86 ---- state = airFree(state); + /* mutex freed at end of echoRTRender() */ return NULL; } *************** *** 84,88 **** --- 92,99 ---- state = (echoThreadState *)calloc(1, sizeof(echoThreadState)); if (state) { + state->thread = airThreadNew(); state->verbose = 0; + state->threadIdx = -1; + state->depth = -1; state->njitt = nrrdNew(); state->nperm = nrrdNew(); *************** *** 90,93 **** --- 101,105 ---- state->jitt = NULL; state->chanBuff = NULL; + state->returnPtr = NULL; } return state; *************** *** 98,101 **** --- 110,114 ---- if (state) { + state->thread = airThreadNix(state->thread); nrrdNuke(state->njitt); nrrdNuke(state->nperm); Index: list.c =================================================================== RCS file: /cvsroot/teem/teem/src/echo/list.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** list.c 7 Jan 2004 15:34:28 -0000 1.3 --- list.c 12 May 2004 04:03:31 -0000 1.4 *************** *** 136,140 **** that there's nothing substantial left of it */ airArraySetLen(LIST(list)->objArr, 0); ! free(mids); return split; } --- 136,140 ---- that there's nothing substantial left of it */ airArraySetLen(LIST(list)->objArr, 0); ! mids = airFree(mids); return split; } Index: objmethods.c =================================================================== RCS file: /cvsroot/teem/teem/src/echo/objmethods.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** objmethods.c 13 Mar 2004 20:03:09 -0000 1.9 --- objmethods.c 12 May 2004 04:03:31 -0000 1.10 *************** *** 39,43 **** if (obj) { \ do { BODY dummy=dummy;} while (0); \ ! free(obj); \ } \ return NULL; \ --- 39,43 ---- if (obj) { \ do { BODY dummy=dummy;} while (0); \ ! airFree(obj); \ } \ return NULL; \ Index: GNUmakefile =================================================================== RCS file: /cvsroot/teem/teem/src/echo/GNUmakefile,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** GNUmakefile 7 Jan 2004 15:34:28 -0000 1.18 --- GNUmakefile 12 May 2004 04:03:30 -0000 1.19 *************** *** 48,52 **** $(L).PRIVATE_HEADERS = privateEcho.h $(L).OBJS = enumsEcho.o methodsEcho.o objmethods.o bounds.o set.o model.o \ ! matter.o renderEcho.o intx.o sqd.o list.o color.o lightEcho.o $(L).TESTS = test/test test/trend #### --- 48,52 ---- $(L).PRIVATE_HEADERS = privateEcho.h $(L).OBJS = enumsEcho.o methodsEcho.o objmethods.o bounds.o set.o model.o \ ! matter.o intx.o sqd.o list.o color.o lightEcho.o renderEcho.o $(L).TESTS = test/test test/trend #### |
|
From: Gordon K. <kin...@us...> - 2004-05-12 04:03:43
|
Update of /cvsroot/teem/teem/src/echo/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21805/test Modified Files: trend.c Log Message: debuggin Index: trend.c =================================================================== RCS file: /cvsroot/teem/teem/src/echo/test/trend.c,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** trend.c 19 Feb 2004 06:45:11 -0000 1.58 --- trend.c 12 May 2004 04:03:31 -0000 1.59 *************** *** 708,714 **** parm->jitterType = echoJitterJitter; ! parm->numSamples = 25; ! parm->imgResU = 300; ! parm->imgResV = 300; parm->aperture = 0.0; parm->textureNN = AIR_FALSE; --- 708,714 ---- parm->jitterType = echoJitterJitter; ! parm->numSamples = 4; ! parm->imgResU = 200; ! parm->imgResV = 200; parm->aperture = 0.0; parm->textureNN = AIR_FALSE; *************** *** 877,880 **** --- 877,881 ---- /* makeSceneDOF(cam, parm, scene); */ + parm->numThreads = 1; E = 0; if (!E) E |= echoRTRender(nraw, cam, scene, parm, state); |
|
From: Gordon K. <kin...@us...> - 2004-05-11 20:32:20
|
Update of /cvsroot/teem/teem/src/air In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32641 Modified Files: threadAir.c Log Message: now, even with airThreadNoopWarning, there is no printed warning for doing new or nix on thread constructs Index: threadAir.c =================================================================== RCS file: /cvsroot/teem/teem/src/air/threadAir.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** threadAir.c 7 Jan 2004 15:34:27 -0000 1.14 --- threadAir.c 11 May 2004 20:32:11 -0000 1.15 *************** *** 455,461 **** mutex = (airThreadMutex *)calloc(1, sizeof(airThreadMutex)); - if (airThreadNoopWarning) { - fprintf(stderr, "%s: WARNING: all mutex usage is a no-op!\n", me); - } return mutex; } --- 455,458 ---- *************** *** 493,499 **** cond = (airThreadCond *)calloc(1, sizeof(airThreadCond)); - if (airThreadNoopWarning) { - fprintf(stderr, "%s: WARNING: all cond usage is a no-op!\n", me); - } return cond; } --- 490,493 ---- |
|
From: Gordon K. <kin...@us...> - 2004-05-11 06:02:15
|
Update of /cvsroot/teem/teem/src/limn In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5064 Modified Files: cam.c Log Message: nixed debugging variable Index: cam.c =================================================================== RCS file: /cvsroot/teem/teem/src/limn/cam.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** cam.c 10 May 2004 23:20:21 -0000 1.23 --- cam.c 11 May 2004 06:02:04 -0000 1.24 *************** *** 199,203 **** Nrrd *nquat, *nfrom, *natpt, *nupvc, *ndist, *nfova, *ntime, *nsample; double fratVec[3], *quat, *from, *atpt, *upvc, *dist, *fova, ! W2V[9], N[3], fratDist, testquat[4]; limnSpline *timeSpline, *quatSpline, *fromSpline, *atptSpline, *upvcSpline, *distSpline, *fovaSpline; --- 199,203 ---- Nrrd *nquat, *nfrom, *natpt, *nupvc, *ndist, *nfova, *ntime, *nsample; double fratVec[3], *quat, *from, *atpt, *upvc, *dist, *fova, ! W2V[9], N[3], fratDist; limnSpline *timeSpline, *quatSpline, *fromSpline, *atptSpline, *upvcSpline, *distSpline, *fovaSpline; |
|
From: Gordon K. <kin...@us...> - 2004-05-11 06:00:28
|
Update of /cvsroot/teem/teem/src/hoover In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4697 Modified Files: hoover.h methodsHoover.c rays.c Log Message: improved load balancing of hooverRender- now scanlines are doled out as fast as they are finished, rather than assigning each thread to every Nth scanline Index: hoover.h =================================================================== RCS file: /cvsroot/teem/teem/src/hoover/hoover.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** hoover.h 19 Feb 2004 03:44:57 -0000 1.23 --- hoover.h 11 May 2004 06:00:17 -0000 1.24 *************** *** 84,88 **** ** 4) image information ** 5) opaque "user information" pointer ! ** 6) the number of threads to spawn ** 7) the callbacks */ --- 84,88 ---- ** 4) image information ** 5) opaque "user information" pointer ! ** 6) stuff about multi-threading ** 7) the callbacks */ *************** *** 90,109 **** /******** 1) camera information */ ! limnCamera *cam; /* camera info */ /******** 2) volume information: size and spacing, centering */ ! int volSize[3]; /* X,Y,Z resolution of volume */ ! double volSpacing[3]; /* distance between samples in X,Y,Z direction */ ! int volCentering; /* either nrrdCenterNode or nrrdCenterCell */ /******** 3) image information: dimensions + centering */ ! int imgSize[2], /* # samples of image along U and V axes */ ! imgCentering; /* either nrrdCenterNode or nrrdCenterCell */ /******** 4) opaque "user information" pointer */ ! void *user; /* passed to all callbacks */ ! /******** 5) the number of threads to spawn */ ! int numThreads; /* number of threads to spawn per rendering */ /* --- 90,111 ---- /******** 1) camera information */ ! limnCamera *cam; /* camera info */ /******** 2) volume information: size and spacing, centering */ ! int volSize[3]; /* X,Y,Z resolution of volume */ ! double volSpacing[3]; /* distance between samples in X,Y,Z direction */ ! int volCentering; /* either nrrdCenterNode or nrrdCenterCell */ /******** 3) image information: dimensions + centering */ ! int imgSize[2], /* # samples of image along U and V axes */ ! imgCentering; /* either nrrdCenterNode or nrrdCenterCell */ /******** 4) opaque "user information" pointer */ ! void *user; /* passed to all callbacks */ ! /******** 5) stuff about multi-threading */ ! int numThreads, /* number of threads to spawn per rendering */ ! workIdx; /* next work assignment (such as a scanline) */ ! airThreadMutex *workMutex; /* mutex around work assignment */ /* *************** *** 172,182 **** ** ** This is not a terribly flexible scheme (don't forget, this is ! ** hoover) in that it enforces rather rigid constraints on how ! ** multi-threading works: one thread can not render multiple rays ** simulatenously. If there were more args to sample() (like a ** ray, or an integral rayIndex), then this would be possible, ** but it would mean that _hooverThreadBody() would have to ! ** implement all the smarts about which samples belong on which rays ! ** belong with which threads. ** ** At some point now or in the future, an effort will be made to --- 174,184 ---- ** ** This is not a terribly flexible scheme (don't forget, this is ! ** hoover) in that it imposes some constraints on how multi-threading ! ** can work: one thread can not render multiple rays ** simulatenously. If there were more args to sample() (like a ** ray, or an integral rayIndex), then this would be possible, ** but it would mean that _hooverThreadBody() would have to ! ** implement all the smarts about which samples belong on which rays, ! ** and which rays belong with which threads. ** ** At some point now or in the future, an effort will be made to Index: rays.c =================================================================== RCS file: /cvsroot/teem/teem/src/hoover/rays.c,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** rays.c 10 May 2004 19:29:22 -0000 1.30 --- rays.c 11 May 2004 06:00:17 -0000 1.31 *************** *** 199,207 **** } ! /* for now, the load-balancing among P processors is simplistic: the ! Nth thread (0-based numbering) gets scanlines N, N+P, N+2P, N+3P, ! etc., until it goes beyond the last scanline */ ! vI = arg->whichThread; ! while (vI < arg->ctx->imgSize[1]) { if (nrrdCenterCell == arg->ctx->imgCentering) { v = uvScale*AIR_AFFINE(-0.5, vI, arg->ctx->imgSize[1]-0.5, --- 199,220 ---- } ! while (1) { ! /* the work assignment is simply the next scanline to be rendered: ! the result of all this is setting vI */ ! if (arg->ctx->workMutex) { ! airThreadMutexLock(arg->ctx->workMutex); ! } ! vI = arg->ctx->workIdx; ! if (arg->ctx->workIdx < arg->ctx->imgSize[1]) { ! arg->ctx->workIdx += 1; ! } ! if (arg->ctx->workMutex) { ! airThreadMutexUnlock(arg->ctx->workMutex); ! } ! if (vI == arg->ctx->imgSize[1]) { ! /* we're done! */ ! break; ! } ! if (nrrdCenterCell == arg->ctx->imgCentering) { v = uvScale*AIR_AFFINE(-0.5, vI, arg->ctx->imgSize[1]-0.5, *************** *** 290,295 **** } } /* end this scanline */ ! vI += arg->ctx->numThreads; ! } /* end skipping through scanlines */ if ( (ret = (arg->ctx->threadEnd)(thread, --- 303,307 ---- } } /* end this scanline */ ! } /* end while(1) assignment of scanlines */ if ( (ret = (arg->ctx->threadEnd)(thread, *************** *** 353,356 **** --- 365,374 ---- thread[threadIdx] = airThreadNew(); } + ctx->workIdx = 0; + if (1 < ctx->numThreads) { + ctx->workMutex = airThreadMutexNew(); + } else { + ctx->workMutex = NULL; + } /* (done): call airThreadStart() once per thread, passing the *************** *** 366,370 **** from this copy errArg->errCode into *errCodeP, and return errArg->whichErr */ ! if (1 < ctx->numThreads && !airThreadCapable) { fprintf(stderr, "%s: WARNING: not multi-threaded; will do %d " --- 384,388 ---- from this copy errArg->errCode into *errCodeP, and return errArg->whichErr */ ! if (1 < ctx->numThreads && !airThreadCapable) { fprintf(stderr, "%s: WARNING: not multi-threaded; will do %d " *************** *** 397,400 **** --- 415,422 ---- } + if (1 < ctx->numThreads) { + ctx->workMutex = airThreadMutexNix(ctx->workMutex); + } + if ( (ret = (ctx->renderEnd)(render, ctx->user)) ) { *errCodeP = ret; Index: methodsHoover.c =================================================================== RCS file: /cvsroot/teem/teem/src/hoover/methodsHoover.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** methodsHoover.c 10 May 2004 19:31:52 -0000 1.10 --- methodsHoover.c 11 May 2004 06:00:17 -0000 1.11 *************** *** 34,37 **** --- 34,39 ---- ctx->user = NULL; ctx->numThreads = 1; + ctx->workIdx = 0; + ctx->workMutex = NULL; ctx->renderBegin = hooverStubRenderBegin; ctx->threadBegin = hooverStubThreadBegin; *************** *** 154,157 **** --- 156,160 ---- if (ctx) { limnCameraNix(ctx->cam); + /* workMutex is cleaned up at end of render */ free(ctx); } |
|
From: Gordon K. <kin...@us...> - 2004-05-11 02:40:07
|
Update of /cvsroot/teem/teem/src/ten In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5113 Modified Files: aniso.c chan.c epireg.c glyph.c miscTen.c mod.c ten.h tenGage.c tendEval.c tendEvec.c tendNorm.c tendPoint.c tensor.c Log Message: API RENAME: some function renamings, to make way for future move to doubles, or at least way from float-specificity: tenEigensolve --> tenEigensolve_f tenMakeOne --> tenMakeOne_f tenSimulateOne --> tenSimulateOne_f tenAnisoCalc --> tenAnisoCalc_f tenEvqOne --> tenEvqOne_f tenEstimateLinearSingle --> tenEstimateLinearSingle_f API NEW: tenEigensolve_d API CHANGE: Functions xxx which haven't been renamed to xxx_f, and which took float arguments (not a pointer to float), now take a double instead. This is not a change that anyone will notice. Affected functions are: tenEstimateLinear3D() tenEstimateLinear4D() tenExpand() tenSimulate() tenAnisoVolume() tenSizeScale() tenAnisoScale() tenEigenvaluePower() tenEigenvalueClamp() tenEigenvalueAdd() API CHANGE: More of a big deal: this guy took a float array ("weight"), and now its a double array: tenSizeNormalize(Nrrd *nout, Nrrd *nin, double weight[3], double amount, double target); Index: aniso.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/aniso.c,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** aniso.c 7 May 2004 19:09:58 -0000 1.32 --- aniso.c 11 May 2004 02:39:54 -0000 1.33 *************** *** 21,26 **** #include "privateTen.h" - float tenAnisoSigma = 0.000001; - /* ** learned: don't take sqrt(FLT_EPSILON) and expect it to still be --- 21,24 ---- *************** *** 29,33 **** /* ! ******** tenAnisoCalc ** ** given an array of three SORTED (descending) eigenvalues "e", --- 27,31 ---- /* ! ******** tenAnisoCalc_f ** ** given an array of three SORTED (descending) eigenvalues "e", *************** *** 38,42 **** */ void ! tenAnisoCalc(float c[TEN_ANISO_MAX+1], float e[3]) { float e0, e1, e2, stdv, mean, sum, cl, cp, ca, ra, fa, vf, denom; --- 36,40 ---- */ void ! tenAnisoCalc_f(float c[TEN_ANISO_MAX+1], float e[3]) { float e0, e1, e2, stdv, mean, sum, cl, cp, ca, ra, fa, vf, denom; *************** *** 44,53 **** if (!( e[0] >= e[1] && e[1] >= e[2] )) { ! fprintf(stderr, "tenAnisoCalc: eigen values not sorted: " "%g %g %g (%d %d)\n", e[0], e[1], e[2], e[0] >= e[1], e[1] >= e[2]); } if (tenVerbose && !( e[0] >= 0 && e[1] >= 0 && e[2] >= 0 )) { ! fprintf(stderr, "tenAnisoCalc: eigen values not all >= 0: %g %g %g\n", e[0], e[1], e[2]); } --- 42,51 ---- if (!( e[0] >= e[1] && e[1] >= e[2] )) { ! fprintf(stderr, "tenAnisoCalc_f: eigen values not sorted: " "%g %g %g (%d %d)\n", e[0], e[1], e[2], e[0] >= e[1], e[1] >= e[2]); } if (tenVerbose && !( e[0] >= 0 && e[1] >= 0 && e[2] >= 0 )) { ! fprintf(stderr, "tenAnisoCalc_f: eigen values not all >= 0: %g %g %g\n", e[0], e[1], e[2]); } *************** *** 156,160 **** e[2] = c0*m0[2] + c1*m1[2] + c2*m2[2]; ELL_SORT3(e[0], e[1], e[2], tmp); /* got some warnings w/out this */ ! tenAnisoCalc(c, e); out[x + res*y] = c[aniso]; } --- 154,158 ---- e[2] = c0*m0[2] + c1*m1[2] + c2*m2[2]; ELL_SORT3(e[0], e[1], e[2], tmp); /* got some warnings w/out this */ ! tenAnisoCalc_f(c, e); out[x + res*y] = c[aniso]; } *************** *** 170,174 **** int ! tenAnisoVolume(Nrrd *nout, Nrrd *nin, int aniso, float thresh) { char me[]="tenAnisoVolume", err[AIR_STRLEN_MED]; size_t N, I, copyI; --- 168,172 ---- int ! tenAnisoVolume(Nrrd *nout, Nrrd *nin, int aniso, double thresh) { char me[]="tenAnisoVolume", err[AIR_STRLEN_MED]; size_t N, I, copyI; *************** *** 203,207 **** continue; } ! tenEigensolve(eval, evec, tensor); if (!(AIR_EXISTS(eval[0]) && AIR_EXISTS(eval[1]) && AIR_EXISTS(eval[2]))) { copyI = I; --- 201,205 ---- continue; } ! tenEigensolve_f(eval, evec, tensor); if (!(AIR_EXISTS(eval[0]) && AIR_EXISTS(eval[1]) && AIR_EXISTS(eval[2]))) { copyI = I; *************** *** 213,217 **** biffAdd(TEN, err); return 1; } ! tenAnisoCalc(c, eval); out[I] = c[aniso]; } --- 211,215 ---- biffAdd(TEN, err); return 1; } ! tenAnisoCalc_f(c, eval); out[I] = c[aniso]; } *************** *** 262,267 **** N = nrrdElementNumber(nin)/7; for (I=0; I<=N-1; I++) { ! tenEigensolve(eval, evec, tdata); ! tenAnisoCalc(c, eval); cl = c[clIdx]; cp = c[cpIdx]; --- 260,265 ---- N = nrrdElementNumber(nin)/7; for (I=0; I<=N-1; I++) { ! tenEigensolve_f(eval, evec, tdata); ! tenAnisoCalc_f(c, eval); cl = c[clIdx]; cp = c[cpIdx]; Index: glyph.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/glyph.c,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** glyph.c 1 Mar 2004 21:59:03 -0000 1.36 --- glyph.c 11 May 2004 02:39:54 -0000 1.37 *************** *** 264,270 **** } } ! tenEigensolve(eval, evec, tdata); ELL_3M_TRANSPOSE(rotEvec, evec); ! tenAnisoCalc(aniso, eval); if (parm->doSlice && pI[parm->sliceAxis] == parm->slicePos) { --- 264,270 ---- } } ! tenEigensolve_f(eval, evec, tdata); ELL_3M_TRANSPOSE(rotEvec, evec); ! tenAnisoCalc_f(aniso, eval); if (parm->doSlice && pI[parm->sliceAxis] == parm->slicePos) { Index: tendEvec.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/tendEvec.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tendEvec.c 13 Mar 2004 20:03:11 -0000 1.16 --- tendEvec.c 11 May 2004 02:39:54 -0000 1.17 *************** *** 88,92 **** if (1 == compLen) { for (I=0; I<N; I++) { ! tenEigensolve(eval, evec, tdata); scl = tdata[0] >= thresh; ELL_3V_SCALE(edata, scl, evec+3*comp[0]); --- 88,92 ---- if (1 == compLen) { for (I=0; I<N; I++) { ! tenEigensolve_f(eval, evec, tdata); scl = tdata[0] >= thresh; ELL_3V_SCALE(edata, scl, evec+3*comp[0]); *************** *** 96,100 **** } else { for (I=0; I<N; I++) { ! tenEigensolve(eval, evec, tdata); scl = tdata[0] >= thresh; for (cc=0; cc<compLen; cc++) { --- 96,100 ---- } else { for (I=0; I<N; I++) { ! tenEigensolve_f(eval, evec, tdata); scl = tdata[0] >= thresh; for (cc=0; cc<compLen; cc++) { Index: mod.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/mod.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** mod.c 7 Jan 2004 15:34:31 -0000 1.10 --- mod.c 11 May 2004 02:39:54 -0000 1.11 *************** *** 23,28 **** int ! tenSizeNormalize(Nrrd *nout, Nrrd *nin, float _weight[3], ! float amount, float target) { char me[]="tenSizeNormalize", err[AIR_STRLEN_MED]; float *tin, *tout, eval[3], evec[9], size, weight[3]; --- 23,28 ---- int ! tenSizeNormalize(Nrrd *nout, Nrrd *nin, double _weight[3], ! double amount, double target) { char me[]="tenSizeNormalize", err[AIR_STRLEN_MED]; float *tin, *tout, eval[3], evec[9], size, weight[3]; *************** *** 59,63 **** N = nrrdElementNumber(nin)/7; for (I=0; I<=N-1; I++) { ! tenEigensolve(eval, evec, tin); size = (weight[0]*AIR_ABS(eval[0]) + weight[1]*AIR_ABS(eval[1]) --- 59,63 ---- N = nrrdElementNumber(nin)/7; for (I=0; I<=N-1; I++) { ! tenEigensolve_f(eval, evec, tin); size = (weight[0]*AIR_ABS(eval[0]) + weight[1]*AIR_ABS(eval[1]) *************** *** 73,77 **** fprintf(stderr, "%g %g %g\n", eval[0], eval[1], eval[2]); */ ! tenMakeOne(tout, tin[0], eval, evec); tin += 7; tout += 7; --- 73,77 ---- fprintf(stderr, "%g %g %g\n", eval[0], eval[1], eval[2]); */ ! tenMakeOne_f(tout, tin[0], eval, evec); tin += 7; tout += 7; *************** *** 82,86 **** int ! tenSizeScale(Nrrd *nout, Nrrd *nin, float amount) { char me[]="tenSizeScale", err[AIR_STRLEN_MED]; size_t I, N; --- 82,86 ---- int ! tenSizeScale(Nrrd *nout, Nrrd *nin, double amount) { char me[]="tenSizeScale", err[AIR_STRLEN_MED]; size_t I, N; *************** *** 125,129 **** */ int ! tenAnisoScale(Nrrd *nout, Nrrd *nin, float scale, int fixDet, int makePositive) { char me[]="tenAnisoScale", err[AIR_STRLEN_MED]; --- 125,129 ---- */ int ! tenAnisoScale(Nrrd *nout, Nrrd *nin, double scale, int fixDet, int makePositive) { char me[]="tenAnisoScale", err[AIR_STRLEN_MED]; *************** *** 149,153 **** N = nrrdElementNumber(nin)/7; for (I=0; I<N; I++) { ! tenEigensolve(eval, evec, tin); if (fixDet) { eval[0] = AIR_MAX(eval[0], 0.00001); --- 149,153 ---- N = nrrdElementNumber(nin)/7; for (I=0; I<N; I++) { ! tenEigensolve_f(eval, evec, tin); if (fixDet) { eval[0] = AIR_MAX(eval[0], 0.00001); *************** *** 172,176 **** eval[2] = AIR_MAX(eval[2], 0.0); } ! tenMakeOne(tout, tin[0], eval, evec); tin += 7; tout += 7; --- 172,176 ---- eval[2] = AIR_MAX(eval[2], 0.0); } ! tenMakeOne_f(tout, tin[0], eval, evec); tin += 7; tout += 7; *************** *** 185,189 **** */ int ! tenEigenvalueClamp(Nrrd *nout, Nrrd *nin, float min, float max) { char me[]="tenEigenvalueClamp", err[AIR_STRLEN_MED]; size_t I, N; --- 185,189 ---- */ int ! tenEigenvalueClamp(Nrrd *nout, Nrrd *nin, double min, double max) { char me[]="tenEigenvalueClamp", err[AIR_STRLEN_MED]; size_t I, N; *************** *** 208,212 **** N = nrrdElementNumber(nin)/7; for (I=0; I<N; I++) { ! tenEigensolve(eval, evec, tin); if (AIR_EXISTS(min)) { eval[0] = AIR_MAX(eval[0], min); --- 208,212 ---- N = nrrdElementNumber(nin)/7; for (I=0; I<N; I++) { ! tenEigensolve_f(eval, evec, tin); if (AIR_EXISTS(min)) { eval[0] = AIR_MAX(eval[0], min); *************** *** 219,223 **** eval[2] = AIR_MIN(eval[2], max); } ! tenMakeOne(tout, tin[0], eval, evec); tin += 7; tout += 7; --- 219,223 ---- eval[2] = AIR_MIN(eval[2], max); } ! tenMakeOne_f(tout, tin[0], eval, evec); tin += 7; tout += 7; *************** *** 232,236 **** */ int ! tenEigenvaluePower(Nrrd *nout, Nrrd *nin, float expo) { char me[]="tenEigenvaluePower", err[AIR_STRLEN_MED]; size_t I, N; --- 232,236 ---- */ int ! tenEigenvaluePower(Nrrd *nout, Nrrd *nin, double expo) { char me[]="tenEigenvaluePower", err[AIR_STRLEN_MED]; size_t I, N; *************** *** 255,263 **** N = nrrdElementNumber(nin)/7; for (I=0; I<N; I++) { ! tenEigensolve(eval, evec, tin); eval[0] = pow(eval[0], expo); eval[1] = pow(eval[1], expo); eval[2] = pow(eval[2], expo); ! tenMakeOne(tout, tin[0], eval, evec); tin += 7; tout += 7; --- 255,263 ---- N = nrrdElementNumber(nin)/7; for (I=0; I<N; I++) { ! tenEigensolve_f(eval, evec, tin); eval[0] = pow(eval[0], expo); eval[1] = pow(eval[1], expo); eval[2] = pow(eval[2], expo); ! tenMakeOne_f(tout, tin[0], eval, evec); tin += 7; tout += 7; *************** *** 272,276 **** */ int ! tenEigenvalueAdd(Nrrd *nout, Nrrd *nin, float val) { char me[]="tenEigenvalueAdd", err[AIR_STRLEN_MED]; size_t I, N; --- 272,276 ---- */ int ! tenEigenvalueAdd(Nrrd *nout, Nrrd *nin, double val) { char me[]="tenEigenvalueAdd", err[AIR_STRLEN_MED]; size_t I, N; *************** *** 295,303 **** N = nrrdElementNumber(nin)/7; for (I=0; I<N; I++) { ! tenEigensolve(eval, evec, tin); eval[0] += val; eval[1] += val; eval[2] += val; ! tenMakeOne(tout, tin[0], eval, evec); tin += 7; tout += 7; --- 295,303 ---- N = nrrdElementNumber(nin)/7; for (I=0; I<N; I++) { ! tenEigensolve_f(eval, evec, tin); eval[0] += val; eval[1] += val; eval[2] += val; ! tenMakeOne_f(tout, tin[0], eval, evec); tin += 7; tout += 7; Index: chan.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/chan.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** chan.c 7 Mar 2004 00:52:57 -0000 1.31 --- chan.c 11 May 2004 02:39:54 -0000 1.32 *************** *** 129,133 **** /* ! ******** tenEstimateSingle ** ** estimate one single tensor --- 129,133 ---- /* ! ******** tenEstimateSingle_f ** ** estimate one single tensor *************** *** 153,159 **** */ void ! tenEstimateLinearSingle(float *ten, float *B0P, float *dwi, double *emat, ! int DD, int knownB0, ! float thresh, float soft, float b) { double logB0, v[_TEN_MAX_DWI_NUM], tmp, mean; int i, j; --- 153,159 ---- */ void ! tenEstimateLinearSingle_f(float *ten, float *B0P, float *dwi, double *emat, ! int DD, int knownB0, ! float thresh, float soft, float b) { double logB0, v[_TEN_MAX_DWI_NUM], tmp, mean; int i, j; *************** *** 223,227 **** Nrrd **_ndwi, int dwiLen, Nrrd *_nbmat, int knownB0, ! float thresh, float soft, float b) { char me[]="tenEstimateLinear3D", err[AIR_STRLEN_MED]; Nrrd *ndwi; --- 223,227 ---- Nrrd **_ndwi, int dwiLen, Nrrd *_nbmat, int knownB0, ! double thresh, double soft, double b) { char me[]="tenEstimateLinear3D", err[AIR_STRLEN_MED]; Nrrd *ndwi; *************** *** 269,273 **** tenEstimateLinear4D(Nrrd *nten, Nrrd **nterrP, Nrrd **nB0P, Nrrd *ndwi, Nrrd *_nbmat, int knownB0, ! float thresh, float soft, float b) { char me[]="tenEstimateLinear4D", err[AIR_STRLEN_MED]; Nrrd *nemat, *nbmat, *ncrop, *nhist; --- 269,273 ---- tenEstimateLinear4D(Nrrd *nten, Nrrd **nterrP, Nrrd **nB0P, Nrrd *ndwi, Nrrd *_nbmat, int knownB0, ! double thresh, double soft, double b) { char me[]="tenEstimateLinear4D", err[AIR_STRLEN_MED]; Nrrd *nemat, *nbmat, *ncrop, *nhist; *************** *** 388,393 **** fprintf(stderr, "%s: input dwi1[%d] = %g\n", me, d, dwi1[d]); } ! tenEstimateLinearSingle(ten, &_B0, ! dwi1, emat, DD, knownB0, thresh, soft, b); if (nB0P) { *B0 = _B0; --- 388,393 ---- fprintf(stderr, "%s: input dwi1[%d] = %g\n", me, d, dwi1[d]); } ! tenEstimateLinearSingle_f(ten, &_B0, ! dwi1, emat, DD, knownB0, thresh, soft, b); if (nB0P) { *B0 = _B0; *************** *** 400,404 **** te = 0; if (knownB0) { ! tenSimulateOne(dwi2, _B0, ten, bmat, DD, b); for (d=1; d<DD; d++) { d1 = AIR_MAX(dwi1[d], 1); --- 400,404 ---- te = 0; if (knownB0) { ! tenSimulateOne_f(dwi2, _B0, ten, bmat, DD, b); for (d=1; d<DD; d++) { d1 = AIR_MAX(dwi1[d], 1); *************** *** 408,415 **** te /= (DD-1); } else { ! tenSimulateOne(dwi2, _B0, ten, bmat, DD+1, b); for (d=0; d<DD; d++) { d1 = AIR_MAX(dwi1[d], 1); ! /* tenSimulateOne always puts the B0 in the beginning of the dwi vector, but in this case we didn't have it in the input dwi vecctor */ --- 408,415 ---- te /= (DD-1); } else { ! tenSimulateOne_f(dwi2, _B0, ten, bmat, DD+1, b); for (d=0; d<DD; d++) { d1 = AIR_MAX(dwi1[d], 1); ! /* tenSimulateOne_f always puts the B0 in the beginning of the dwi vector, but in this case we didn't have it in the input dwi vecctor */ *************** *** 437,441 **** /* ! ******** tenSimulateOne ** ** given a tensor, simulate the set of diffusion weighted measurements --- 437,441 ---- /* ! ******** tenSimulateOne_f ** ** given a tensor, simulate the set of diffusion weighted measurements *************** *** 448,453 **** */ void ! tenSimulateOne(float *dwi, ! float B0, float *ten, double *bmat, int DD, float b) { double vv; /* this is how we multiply the off-diagonal entries by 2 */ --- 448,453 ---- */ void ! tenSimulateOne_f(float *dwi, ! float B0, float *ten, double *bmat, int DD, float b) { double vv; /* this is how we multiply the off-diagonal entries by 2 */ *************** *** 475,479 **** int ! tenSimulate(Nrrd *ndwi, Nrrd *nT2, Nrrd *nten, Nrrd *_nbmat, float b) { char me[]="tenSimulate", err[AIR_STRLEN_MED]; size_t II; --- 475,479 ---- int ! tenSimulate(Nrrd *ndwi, Nrrd *nT2, Nrrd *nten, Nrrd *_nbmat, double b) { char me[]="tenSimulate", err[AIR_STRLEN_MED]; size_t II; *************** *** 520,524 **** for (II=0; II<sx*sy*sz; II++) { /* tenVerbose = (II == 42 + 190*(96 + 196*0)); */ ! tenSimulateOne(dwi, lup(nT2->data, II), ten, bmat, DD, b); dwi += DD; ten += 7; --- 520,524 ---- for (II=0; II<sx*sy*sz; II++) { /* tenVerbose = (II == 42 + 190*(96 + 196*0)); */ ! tenSimulateOne_f(dwi, lup(nT2->data, II), ten, bmat, DD, b); dwi += DD; ten += 7; Index: miscTen.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/miscTen.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** miscTen.c 30 Mar 2004 19:25:14 -0000 1.24 --- miscTen.c 11 May 2004 02:39:54 -0000 1.25 *************** *** 24,28 **** int tenEvecRGB(Nrrd *nout, Nrrd *nin, int which, int aniso, ! float gamma, float bgGray, float isoGray) { char me[]="tenEvecRGB", err[AIR_STRLEN_MED]; int size[NRRD_DIM_MAX]; --- 24,28 ---- int tenEvecRGB(Nrrd *nout, Nrrd *nin, int which, int aniso, ! double gamma, double bgGray, double isoGray) { char me[]="tenEvecRGB", err[AIR_STRLEN_MED]; int size[NRRD_DIM_MAX]; *************** *** 58,63 **** for (II=0; II<NN; II++) { /* tenVerbose = (II == (50 + 64*(32 + 64*0))); */ ! tenEigensolve(eval, evec, tdata); ! tenAnisoCalc(an, eval); R = AIR_ABS(evec[0 + 3*which]); G = AIR_ABS(evec[1 + 3*which]); --- 58,63 ---- for (II=0; II<NN; II++) { /* tenVerbose = (II == (50 + 64*(32 + 64*0))); */ ! tenEigensolve_f(eval, evec, tdata); ! tenAnisoCalc_f(an, eval); R = AIR_ABS(evec[0 + 3*which]); G = AIR_ABS(evec[1 + 3*which]); *************** *** 163,169 **** qdata = nout->data; for (I=0; I<N; I++) { ! tenEigensolve(eval, evec, tdata); if (scaleByAniso) { ! tenAnisoCalc(c, eval); an = c[aniso]; } else { --- 163,169 ---- qdata = nout->data; for (I=0; I<N; I++) { ! tenEigensolve_f(eval, evec, tdata); if (scaleByAniso) { ! tenAnisoCalc_f(c, eval); an = c[aniso]; } else { *************** *** 215,219 **** */ int ! _tenFindValley(float *valP, Nrrd *nhist, float tweak, int save) { char me[]="_tenFindValley", err[AIR_STRLEN_MED]; double gparm[NRRD_KERNEL_PARMS_NUM], dparm[NRRD_KERNEL_PARMS_NUM]; --- 215,219 ---- */ int ! _tenFindValley(double *valP, Nrrd *nhist, double tweak, int save) { char me[]="_tenFindValley", err[AIR_STRLEN_MED]; double gparm[NRRD_KERNEL_PARMS_NUM], dparm[NRRD_KERNEL_PARMS_NUM]; Index: tenGage.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/tenGage.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tenGage.c 9 May 2004 22:55:16 -0000 1.19 --- tenGage.c 11 May 2004 02:39:54 -0000 1.20 *************** *** 163,167 **** #if !GAGE_TYPE_FLOAT int ci; ! float tenAnsF[7], evalAnsF[3], evecAnsF[9], aniso[TEN_ANISO_MAX+1]; #endif --- 163,167 ---- #if !GAGE_TYPE_FLOAT int ci; ! float evalAnsF[3], aniso[TEN_ANISO_MAX+1]; #endif *************** *** 221,239 **** we always find the eigenvalues, whether or not they were asked for */ #if GAGE_TYPE_FLOAT ! tenEigensolve(evalAns, evecAns, tenAns); #else ! TEN_T_COPY(tenAnsF, tenAns); ! tenEigensolve(evalAnsF, evecAnsF, tenAnsF); ! ELL_3V_COPY(evalAns, evalAnsF); ! ELL_3M_COPY(evecAns, evecAnsF); #endif } else if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageEval)) { /* else eigenvectors are NOT needed, but eigenvalues ARE needed */ #if GAGE_TYPE_FLOAT ! tenEigensolve(evalAns, NULL, tenAns); #else ! TEN_T_COPY(tenAnsF, tenAns); ! tenEigensolve(evalAnsF, NULL, tenAnsF); ! ELL_3V_COPY(evalAns, evalAnsF); #endif } --- 221,234 ---- we always find the eigenvalues, whether or not they were asked for */ #if GAGE_TYPE_FLOAT ! tenEigensolve_f(evalAns, evecAns, tenAns); #else ! tenEigensolve_d(evalAns, evecAns, tenAns); #endif } else if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageEval)) { /* else eigenvectors are NOT needed, but eigenvalues ARE needed */ #if GAGE_TYPE_FLOAT ! tenEigensolve_f(evalAns, NULL, tenAns); #else ! tenEigensolve_d(evalAns, NULL, tenAns); #endif } *************** *** 445,451 **** if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageAniso)) { #if GAGE_TYPE_FLOAT ! tenAnisoCalc(pvl->directAnswer[tenGageAniso], evalAns); #else ! tenAnisoCalc(aniso, evalAnsF); for (ci=0; ci<=TEN_ANISO_MAX; ci++) { pvl->directAnswer[tenGageAniso][ci] = aniso[ci]; --- 440,446 ---- if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageAniso)) { #if GAGE_TYPE_FLOAT ! tenAnisoCalc_f(pvl->directAnswer[tenGageAniso], evalAns); #else ! tenAnisoCalc_f(aniso, evalAnsF); for (ci=0; ci<=TEN_ANISO_MAX; ci++) { pvl->directAnswer[tenGageAniso][ci] = aniso[ci]; Index: ten.h =================================================================== RCS file: /cvsroot/teem/teem/src/ten/ten.h,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** ten.h 22 Apr 2004 07:14:54 -0000 1.84 --- ten.h 11 May 2004 02:39:54 -0000 1.85 *************** *** 435,443 **** TEEM_API int tenVerbose; TEEM_API int tenTensorCheck(Nrrd *nin, int wantType, int want4D, int useBiff); ! TEEM_API int tenExpand(Nrrd *tnine, Nrrd *tseven, float scale, float thresh); TEEM_API int tenShrink(Nrrd *tseven, Nrrd *nconf, Nrrd *tnine); ! TEEM_API int tenEigensolve(float eval[3], float evec[9], float ten[7]); ! TEEM_API void tenMakeOne(float ten[7], ! float conf, float eval[3], float evec[9]); TEEM_API int tenMake(Nrrd *nout, Nrrd *nconf, Nrrd *neval, Nrrd *nevec); TEEM_API int tenSlice(Nrrd *nout, Nrrd *nten, int axis, int pos, int dim); --- 435,444 ---- TEEM_API int tenVerbose; TEEM_API int tenTensorCheck(Nrrd *nin, int wantType, int want4D, int useBiff); ! TEEM_API int tenExpand(Nrrd *tnine, Nrrd *tseven, double scale, double thresh); TEEM_API int tenShrink(Nrrd *tseven, Nrrd *nconf, Nrrd *tnine); ! TEEM_API int tenEigensolve_f(float eval[3], float evec[9], float ten[7]); ! TEEM_API int tenEigensolve_d(double eval[3], double evec[9], double ten[7]); ! TEEM_API void tenMakeOne_f(float ten[7], ! float conf, float eval[3], float evec[9]); TEEM_API int tenMake(Nrrd *nout, Nrrd *nconf, Nrrd *neval, Nrrd *nevec); TEEM_API int tenSlice(Nrrd *nout, Nrrd *nten, int axis, int pos, int dim); *************** *** 447,471 **** TEEM_API int tenBMatrixCalc(Nrrd *nbmat, Nrrd *ngrad); TEEM_API int tenEMatrixCalc(Nrrd *nemat, Nrrd *nbmat, int knownB0); ! TEEM_API void tenEstimateLinearSingle(float *ten, float *B0P, float *dwi, ! double *emat, int DD, int knownB0, ! float thresh, float soft, float b); TEEM_API int tenEstimateLinear3D(Nrrd *nten, Nrrd **nterrP, Nrrd **nB0P, Nrrd **ndwi, int dwiLen, Nrrd *nbmat, int knownB0, ! float thresh, float soft, float b); TEEM_API int tenEstimateLinear4D(Nrrd *nten, Nrrd **nterrP, Nrrd **nB0P, Nrrd *ndwi, Nrrd *_nbmat, int knownB0, ! float thresh, float soft, float b); ! TEEM_API void tenSimulateOne(float *dwi, float B0, float *ten, ! double *bmat, int DD, float b); TEEM_API int tenSimulate(Nrrd *ndwi, Nrrd *nT2, Nrrd *nten, ! Nrrd *nbmat, float b); /* aniso.c */ ! TEEM_API float tenAnisoSigma; /* added to denominator in Westin anisos */ ! TEEM_API void tenAnisoCalc(float c[TEN_ANISO_MAX+1], float eval[3]); TEEM_API int tenAnisoPlot(Nrrd *nout, int aniso, int res, int whole, int nanout); ! TEEM_API int tenAnisoVolume(Nrrd *nout, Nrrd *nin, int aniso, float thresh); TEEM_API int tenAnisoHistogram(Nrrd *nout, Nrrd *nin, int version, int resolution); --- 448,471 ---- TEEM_API int tenBMatrixCalc(Nrrd *nbmat, Nrrd *ngrad); TEEM_API int tenEMatrixCalc(Nrrd *nemat, Nrrd *nbmat, int knownB0); ! TEEM_API void tenEstimateLinearSingle_f(float *ten, float *B0P, float *dwi, ! double *emat, int DD, int knownB0, ! float thresh, float soft, float b); TEEM_API int tenEstimateLinear3D(Nrrd *nten, Nrrd **nterrP, Nrrd **nB0P, Nrrd **ndwi, int dwiLen, Nrrd *nbmat, int knownB0, ! double thresh, double soft, double b); TEEM_API int tenEstimateLinear4D(Nrrd *nten, Nrrd **nterrP, Nrrd **nB0P, Nrrd *ndwi, Nrrd *_nbmat, int knownB0, ! double thresh, double soft, double b); ! TEEM_API void tenSimulateOne_f(float *dwi, float B0, float *ten, ! double *bmat, int DD, float b); TEEM_API int tenSimulate(Nrrd *ndwi, Nrrd *nT2, Nrrd *nten, ! Nrrd *nbmat, double b); /* aniso.c */ ! TEEM_API void tenAnisoCalc_f(float c[TEN_ANISO_MAX+1], float eval[3]); TEEM_API int tenAnisoPlot(Nrrd *nout, int aniso, int res, int whole, int nanout); ! TEEM_API int tenAnisoVolume(Nrrd *nout, Nrrd *nin, int aniso, double thresh); TEEM_API int tenAnisoHistogram(Nrrd *nout, Nrrd *nin, int version, int resolution); *************** *** 473,483 **** /* miscTen.c */ TEEM_API int tenEvecRGB(Nrrd *nout, Nrrd *nin, int which, int aniso, ! float gamma, float bgGray, float isoGray); ! TEEM_API short tenEvqOne(float vec[3], float scl); TEEM_API int tenEvqVolume(Nrrd *nout, Nrrd *nin, int which, int aniso, int scaleByAniso); TEEM_API int tenBMatrixCheck(Nrrd *nbmat); ! TEEM_API int _tenFindValley(float *valP, Nrrd *nhist, ! float tweak, int save); /* fiberMethods.c */ --- 473,483 ---- /* miscTen.c */ TEEM_API int tenEvecRGB(Nrrd *nout, Nrrd *nin, int which, int aniso, ! double gamma, double bgGray, double isoGray); ! TEEM_API short tenEvqOne_f(float vec[3], float scl); TEEM_API int tenEvqVolume(Nrrd *nout, Nrrd *nin, int which, int aniso, int scaleByAniso); TEEM_API int tenBMatrixCheck(Nrrd *nbmat); ! TEEM_API int _tenFindValley(double *valP, Nrrd *nhist, ! double tweak, int save); /* fiberMethods.c */ *************** *** 502,506 **** int dwiLen, Nrrd *ngrad, int reference, ! float bwX, float bwY, float fitFrac, float DWthr, int doCC, const NrrdKernel *kern, double *kparm, --- 502,507 ---- int dwiLen, Nrrd *ngrad, int reference, ! double bwX, double bwY, ! double fitFrac, double DWthr, int doCC, const NrrdKernel *kern, double *kparm, *************** *** 508,525 **** TEEM_API int tenEpiRegister4D(Nrrd *nout, Nrrd *nin, Nrrd *ngrad, int reference, ! float bwX, float bwY, float fitFrac, ! float DWthr, int doCC, const NrrdKernel *kern, double *kparm, int progress, int verbose); /* mod.c */ ! TEEM_API int tenSizeNormalize(Nrrd *nout, Nrrd *nin, float weight[3], ! float amount, float target); ! TEEM_API int tenSizeScale(Nrrd *nout, Nrrd *nin, float amount); ! TEEM_API int tenAnisoScale(Nrrd *nout, Nrrd *nin, float amount, int fixDet, int makePositive); ! TEEM_API int tenEigenvaluePower(Nrrd *nout, Nrrd *nin, float expo); ! TEEM_API int tenEigenvalueClamp(Nrrd *nout, Nrrd *nin, float min, float max); ! TEEM_API int tenEigenvalueAdd(Nrrd *nout, Nrrd *nin, float val); /* tenGage.c */ --- 509,527 ---- TEEM_API int tenEpiRegister4D(Nrrd *nout, Nrrd *nin, Nrrd *ngrad, int reference, ! double bwX, double bwY, ! double fitFrac, double DWthr, ! int doCC, const NrrdKernel *kern, double *kparm, int progress, int verbose); /* mod.c */ ! TEEM_API int tenSizeNormalize(Nrrd *nout, Nrrd *nin, double weight[3], ! double amount, double target); ! TEEM_API int tenSizeScale(Nrrd *nout, Nrrd *nin, double amount); ! TEEM_API int tenAnisoScale(Nrrd *nout, Nrrd *nin, double scale, int fixDet, int makePositive); ! TEEM_API int tenEigenvaluePower(Nrrd *nout, Nrrd *nin, double expo); ! TEEM_API int tenEigenvalueClamp(Nrrd *nout, Nrrd *nin, double min, double max); ! TEEM_API int tenEigenvalueAdd(Nrrd *nout, Nrrd *nin, double val); /* tenGage.c */ Index: tendPoint.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/tendPoint.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tendPoint.c 22 Apr 2004 07:46:52 -0000 1.10 --- tendPoint.c 11 May 2004 02:39:54 -0000 1.11 *************** *** 77,81 **** fprintf(stderr, "% 15.7f % 15.7f % 15.7f\n", tdata[2], tdata[4], tdata[5]); fprintf(stderr, "% 15.7f % 15.7f % 15.7f\n", tdata[3], tdata[5], tdata[6]); ! tenEigensolve(eval, evec, tdata); fprintf(stderr, "eigensystem = (<eigenvalue> : <eigenvector>):\n"); fprintf(stderr, "% 15.7f : % 15.7f % 15.7f % 15.7f\n", --- 77,81 ---- fprintf(stderr, "% 15.7f % 15.7f % 15.7f\n", tdata[2], tdata[4], tdata[5]); fprintf(stderr, "% 15.7f % 15.7f % 15.7f\n", tdata[3], tdata[5], tdata[6]); ! tenEigensolve_f(eval, evec, tdata); fprintf(stderr, "eigensystem = (<eigenvalue> : <eigenvector>):\n"); fprintf(stderr, "% 15.7f : % 15.7f % 15.7f % 15.7f\n", *************** *** 95,99 **** fprintf(stderr, "% 15.7f % 15.7f % 15.7f\n", mat[6], mat[7], mat[8]); ! tenAnisoCalc(c, eval); fprintf(stderr, "anisotropies = \n"); for (i=1; i<=TEN_ANISO_MAX; i++) { --- 95,99 ---- fprintf(stderr, "% 15.7f % 15.7f % 15.7f\n", mat[6], mat[7], mat[8]); ! tenAnisoCalc_f(c, eval); fprintf(stderr, "anisotropies = \n"); for (i=1; i<=TEN_ANISO_MAX; i++) { Index: tendNorm.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/tendNorm.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tendNorm.c 7 Jan 2004 15:34:31 -0000 1.4 --- tendNorm.c 11 May 2004 02:39:54 -0000 1.5 *************** *** 37,43 **** Nrrd *nin, *nout; char *outS; ! float weight[3], amount, target; ! hestOptAdd(&hopt, "w", "w0 w1 w2", airTypeFloat, 3, 3, weight, NULL, "relative weights to put on major, medium, and minor " "eigenvalue when performing normalization (internally " --- 37,44 ---- Nrrd *nin, *nout; char *outS; ! float amount, target; ! double weight[3]; ! hestOptAdd(&hopt, "w", "w0 w1 w2", airTypeDouble, 3, 3, weight, NULL, "relative weights to put on major, medium, and minor " "eigenvalue when performing normalization (internally " Index: epireg.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/epireg.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** epireg.c 13 Mar 2004 20:03:11 -0000 1.28 --- epireg.c 11 May 2004 02:39:54 -0000 1.29 *************** *** 191,195 **** int ! _tenEpiRegFindThresh(float *DWthrP, Nrrd **nin, int ninLen, int save) { char me[]="_tenEpiRegFindThresh", err[AIR_STRLEN_MED]; Nrrd *nhist, *ntmp; --- 191,195 ---- int ! _tenEpiRegFindThresh(double *DWthrP, Nrrd **nin, int ninLen, int save) { char me[]="_tenEpiRegFindThresh", err[AIR_STRLEN_MED]; Nrrd *nhist, *ntmp; *************** *** 247,251 **** int _tenEpiRegThreshold(Nrrd **nthresh, Nrrd **nblur, int ninLen, ! float DWthr, int verb, int progress) { char me[]="_tenEpiRegThreshold", err[AIR_STRLEN_MED]; airArray *mop; --- 247,251 ---- int _tenEpiRegThreshold(Nrrd **nthresh, Nrrd **nblur, int ninLen, ! double DWthr, int verb, int progress) { char me[]="_tenEpiRegThreshold", err[AIR_STRLEN_MED]; airArray *mop; *************** *** 999,1004 **** tenEpiRegister3D(Nrrd **nout, Nrrd **nin, int ninLen, Nrrd *_ngrad, int reference, ! float bwX, float bwY, float fitFrac, ! float DWthr, int doCC, const NrrdKernel *kern, double *kparm, int progress, int verbose) { --- 999,1004 ---- tenEpiRegister3D(Nrrd **nout, Nrrd **nin, int ninLen, Nrrd *_ngrad, int reference, ! double bwX, double bwY, double fitFrac, ! double DWthr, int doCC, const NrrdKernel *kern, double *kparm, int progress, int verbose) { *************** *** 1135,1140 **** tenEpiRegister4D(Nrrd *_nout, Nrrd *_nin, Nrrd *ngrad, int reference, ! float bwX, float bwY, float fitFrac, ! float DWthr, int doCC, const NrrdKernel *kern, double *kparm, int progress, int verbose) { --- 1135,1140 ---- tenEpiRegister4D(Nrrd *_nout, Nrrd *_nin, Nrrd *ngrad, int reference, ! double bwX, double bwY, double fitFrac, ! double DWthr, int doCC, const NrrdKernel *kern, double *kparm, int progress, int verbose) { Index: tendEval.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/tendEval.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tendEval.c 13 Mar 2004 20:03:11 -0000 1.15 --- tendEval.c 11 May 2004 02:39:54 -0000 1.16 *************** *** 93,97 **** ELL_3V_SET(map, 1, 2, 3); for (I=0; I<N; I++) { ! tenEigensolve(eval, evec, tdata); edata[I] = (tdata[0] >= thresh)*eval[comp[0]]; tdata += 7; --- 93,97 ---- ELL_3V_SET(map, 1, 2, 3); for (I=0; I<N; I++) { ! tenEigensolve_f(eval, evec, tdata); edata[I] = (tdata[0] >= thresh)*eval[comp[0]]; tdata += 7; *************** *** 100,104 **** ELL_4V_SET(map, 0, 1, 2, 3); for (I=0; I<N; I++) { ! tenEigensolve(eval, evec, tdata); for (cc=0; cc<compLen; cc++) edata[cc] = (tdata[0] >= thresh)*eval[comp[cc]]; --- 100,104 ---- ELL_4V_SET(map, 0, 1, 2, 3); for (I=0; I<N; I++) { ! tenEigensolve_f(eval, evec, tdata); for (cc=0; cc<compLen; cc++) edata[cc] = (tdata[0] >= thresh)*eval[comp[cc]]; Index: tensor.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/tensor.c,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** tensor.c 7 May 2004 19:13:34 -0000 1.30 --- tensor.c 11 May 2004 02:39:54 -0000 1.31 *************** *** 73,77 **** int ! tenExpand(Nrrd *nout, Nrrd *nin, float scale, float thresh) { char me[]="tenExpand", err[AIR_STRLEN_MED]; size_t N, I; --- 73,77 ---- int ! tenExpand(Nrrd *nout, Nrrd *nin, double scale, double thresh) { char me[]="tenExpand", err[AIR_STRLEN_MED]; size_t N, I; *************** *** 179,183 **** /* ! ******** tenEigensolve ** ** uses ell_3m_eigensolve_d to get the eigensystem of a single tensor --- 179,183 ---- /* ! ******** tenEigensolve_f ** ** uses ell_3m_eigensolve_d to get the eigensystem of a single tensor *************** *** 194,198 **** */ int ! tenEigensolve(float _eval[3], float _evec[9], float t[7]) { double m[9], eval[3], evec[9], trc, iso[9]; int ret; --- 194,198 ---- */ int ! tenEigensolve_f(float _eval[3], float _evec[9], float t[7]) { double m[9], eval[3], evec[9], trc, iso[9]; int ret; *************** *** 201,206 **** trc = ELL_3M_TRACE(m)/3.0; ELL_3M_IDENTITY_SET(iso); ! ELL_3M_SCALE(iso, trc, iso); ! ELL_3M_SUB(m, m, iso); if (_evec) { ret = ell_3m_eigensolve_d(eval, evec, m, AIR_TRUE); --- 201,206 ---- trc = ELL_3M_TRACE(m)/3.0; ELL_3M_IDENTITY_SET(iso); ! ELL_3M_SCALE_SET(iso, -trc, -trc, -trc); ! ELL_3M_ADD2(m, m, iso); if (_evec) { ret = ell_3m_eigensolve_d(eval, evec, m, AIR_TRUE); *************** *** 249,252 **** --- 249,283 ---- } + int + tenEigensolve_d(double _eval[3], double evec[9], double t[7]) { + double m[9], eval[3], trc, iso[9]; + int ret; + + TEN_T2M(m, t); + trc = ELL_3M_TRACE(m)/3.0; + ELL_3M_SCALE_SET(iso, -trc, -trc, -trc); + ELL_3M_ADD2(m, m, iso); + if (evec) { + ret = ell_3m_eigensolve_d(eval, evec, m, AIR_TRUE); + ELL_3V_SET(_eval, eval[0] + trc, eval[1] + trc, eval[2] + trc); + if (ell_cubic_root_single_double == ret) { + /* this was added to fix a stupid problem with very nearly + isotropic glyphs, used for demonstration figures */ + if (eval[0] == eval[1]) { + ELL_3V_CROSS(evec+6, evec+0, evec+3); + } else { + ELL_3V_CROSS(evec+0, evec+3, evec+6); + } + } + } else { + /* caller only wants eigenvalues */ + ret = ell_3m_eigenvalues_d(eval, m, AIR_TRUE); + ELL_3V_SET(_eval, eval[0] + trc, eval[1] + trc, eval[2] + trc); + } + return ret; + } + + + /* lop A fprintf(stderr, "################################### I = %d\n", (int)I); *************** *** 289,293 **** void ! tenMakeOne(float ten[7], float conf, float eval[3], float evec[9]) { double tmpMat1[9], tmpMat2[9], diag[9], evecT[9]; --- 320,324 ---- void ! tenMakeOne_f(float ten[7], float conf, float eval[3], float evec[9]) { double tmpMat1[9], tmpMat2[9], diag[9], evecT[9]; *************** *** 378,382 **** out = (float *)nout->data; for (I=0; I<N; I++) { ! tenMakeOne(out, conf[I], eval, evec); /* lop A */ out += 7; --- 409,413 ---- out = (float *)nout->data; for (I=0; I<N; I++) { ! tenMakeOne_f(out, conf[I], eval, evec); /* lop A */ out += 7; |
|
From: Gordon K. <kin...@us...> - 2004-05-11 02:10:06
|
Update of /cvsroot/teem/teem/src/ell In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32548 Modified Files: ellMacros.h Log Message: another macro! Index: ellMacros.h =================================================================== RCS file: /cvsroot/teem/teem/src/ell/ellMacros.h,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** ellMacros.h 10 May 2004 19:32:21 -0000 1.43 --- ellMacros.h 11 May 2004 02:09:54 -0000 1.44 *************** *** 229,232 **** --- 229,237 ---- (v2)[2] = AIR_ABS((v1)[2])) + #define ELL_3M_SCALE_SET(m, x, y, z) \ + (ELL_3V_SET((m)+ 0, (x), 0 , 0 ), \ + ELL_3V_SET((m)+ 3, 0 , (y), 0 ), \ + ELL_3V_SET((m)+ 6, 0 , 0 , (z))) + #define ELL_3M_SCALE(m2, s, m1) \ (ELL_3V_SCALE((m2)+0, (s), (m1)+0), \ |
|
From: Gordon K. <kin...@us...> - 2004-05-10 23:22:47
|
Update of /cvsroot/teem/teem-vtk/camAnim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32720/camAnim Modified Files: anim.tcl camAnim.tcl Log Message: I now believe that limnCameraPathMake works correctly Index: anim.tcl =================================================================== RCS file: /cvsroot/teem/teem-vtk/camAnim/anim.tcl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** anim.tcl 10 May 2004 10:47:20 -0000 1.2 --- anim.tcl 10 May 2004 23:22:37 -0000 1.3 *************** *** 77,81 **** .an.whichKeyS config -to [expr $numberKeys-1] set whichKey 0 ! newWhichKey return --- 77,81 ---- .an.whichKeyS config -to [expr $numberKeys-1] set whichKey 0 ! newWhichKey blah return *************** *** 112,116 **** } proc setCamState {allState} { ! global camera cursor cursorX cursorY cursorZ global viewAngle --- 112,116 ---- } proc setCamState {allState} { ! global camera cursor cursorX cursorY cursorZ upVector global viewAngle *************** *** 127,130 **** --- 127,131 ---- eval $camera SetFocalPoint $at eval $camera SetViewUp $up + set upVector $up eval $camera SetPosition $fr $camera SetClippingRange $dn $df *************** *** 138,161 **** } proc getState {} { - global isoValue global relDwell # allHash simplifies construction of even-length list describing state array set allHash [getCamState] - array set allHash "isoValue $isoValue" array set allHash "relDwell $relDwell" return [array get allHash] } proc setState {allState} { - global isoValue global relDwell array set allHash $allState setCamState $allState - set isoValue [lindex [array get allHash "isoValue"] 1] - newIsoValue set relDwell [lindex [array get allHash "relDwell"] 1] } ! proc newWhichKey {} { global whichKey global masterKey --- 139,157 ---- } proc getState {} { global relDwell # allHash simplifies construction of even-length list describing state array set allHash [getCamState] array set allHash "relDwell $relDwell" return [array get allHash] } proc setState {allState} { global relDwell array set allHash $allState setCamState $allState set relDwell [lindex [array get allHash "relDwell"] 1] } ! proc newWhichKey {blah} { global whichKey global masterKey *************** *** 192,196 **** set numberKeys [llength $masterKey] .an.whichKeyS config -to [expr $numberKeys-1] ! newWhichKey } proc initKeys {} { --- 188,192 ---- set numberKeys [llength $masterKey] .an.whichKeyS config -to [expr $numberKeys-1] ! newWhichKey blah } proc initKeys {} { *************** *** 203,207 **** set numberKeys [llength $masterKey] set whichKey 0 ! newWhichKey } proc nukeKeys {} { --- 199,203 ---- set numberKeys [llength $masterKey] set whichKey 0 ! newWhichKey blah } proc nukeKeys {} { *************** *** 280,285 **** label .an.whichKeyL -text "Current Keyframe" scale .an.whichKeyS -len $scaleLen -from 0 -to [expr $numberKeys-1] \ ! -res 1 -ori h -var whichKey ! bind .an.whichKeyS <ButtonRelease> newWhichKey grid .an.whichKeyL -s e -row $row -column 0 grid .an.whichKeyS -s w -row $row -column 1 -columnspan 3 --- 276,280 ---- label .an.whichKeyL -text "Current Keyframe" scale .an.whichKeyS -len $scaleLen -from 0 -to [expr $numberKeys-1] \ ! -res 1 -ori h -var whichKey -command newWhichKey grid .an.whichKeyL -s e -row $row -column 0 grid .an.whichKeyS -s w -row $row -column 1 -columnspan 3 *************** *** 361,365 **** foreach key $masterKey { array set allHash $key - lappend isoValueList [lindex [array get allHash "isoValue"] 1] set dn [lindex [array get allHash "cam.dn"] 1] set di [lindex [array get allHash "cam.di"] 1] --- 356,359 ---- *************** *** 371,380 **** lappend fratupList [concat $fr $at $up] } - puts "isoValueList = $isoValueList" puts "dndidfList = $dndidfList" puts "fratupList = $fratupList" saveList "time.txt" $timeList - saveList "isovalue.txt" $isoValueList saveList "dndidf.txt" $dndidfList saveList "fratup.txt" $fratupList --- 365,372 ---- Index: camAnim.tcl =================================================================== RCS file: /cvsroot/teem/teem-vtk/camAnim/camAnim.tcl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** camAnim.tcl 10 May 2004 10:47:20 -0000 1.2 --- camAnim.tcl 10 May 2004 23:22:37 -0000 1.3 *************** *** 34,37 **** --- 34,39 ---- set frameShown 0 + set cursorShown 1 + set cubeWidth 0.04 set cursorX 0 *************** *** 445,448 **** --- 447,467 ---- .top.buttPng config -text "Save $fname" } + proc toggleCursor {} { + global cursorShown + + puts "toggleCursor $cursorShown" + if {$cursorShown} { + ren RemoveActor cubeActor + } else { + ren AddActor cubeActor + } + if {$cursorShown} { + .top.c.but config -text "Show Cursor" + } else { + .top.c.but config -text "Hide Cursor" + } + render + set cursorShown [expr 1 - $cursorShown] + } proc toggleFrame {} { global frameShown |
|
From: Gordon K. <kin...@us...> - 2004-05-10 23:20:31
|
Update of /cvsroot/teem/teem/src/limn/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32247/test Modified Files: tcamanim.c Log Message: I now believe that limnCameraPathMake works correctly Index: tcamanim.c =================================================================== RCS file: /cvsroot/teem/teem/src/limn/test/tcamanim.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcamanim.c 10 May 2004 21:20:33 -0000 1.7 --- tcamanim.c 10 May 2004 23:20:21 -0000 1.8 *************** *** 75,82 **** (*keycamP)[ki].fov = va; (*keycamP)[ki].aspect = (double)imgSize[0]/imgSize[1]; } - (*keycamP)[0].atRelative = AIR_FALSE; - (*keycamP)[0].orthographic = AIR_FALSE; - (*keycamP)[0].rightHanded = AIR_TRUE; tmp = (double*)calloc(*numKeysP, sizeof(double)); --- 75,82 ---- (*keycamP)[ki].fov = va; (*keycamP)[ki].aspect = (double)imgSize[0]/imgSize[1]; + (*keycamP)[ki].atRelative = AIR_FALSE; + (*keycamP)[ki].orthographic = AIR_FALSE; + (*keycamP)[ki].rightHanded = AIR_TRUE; } tmp = (double*)calloc(*numKeysP, sizeof(double)); *************** *** 177,180 **** --- 177,182 ---- airMopError(mop); return 1; } + airMopAdd(mop, keycam, airFree, airMopAlways); + airMopAdd(mop, time, airFree, airMopAlways); cam = (limnCamera *)calloc(N, sizeof(limnCamera)); airMopAdd(mop, cam, airFree, airMopAlways); |
|
From: Gordon K. <kin...@us...> - 2004-05-10 23:20:31
|
Update of /cvsroot/teem/teem/src/limn In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32247 Modified Files: cam.c Log Message: I now believe that limnCameraPathMake works correctly Index: cam.c =================================================================== RCS file: /cvsroot/teem/teem/src/limn/cam.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** cam.c 10 May 2004 21:40:36 -0000 1.22 --- cam.c 10 May 2004 23:20:21 -0000 1.23 *************** *** 162,173 **** ** PRE-ALLOCATED array of output cameras, "cam". ** ! ** input: an array of keyframe cameras "keycam", and times associated ! ** with the key frames "time", both arrays length "numKeys" ** trackWhat: takes values from the limnCameraPathTrack* enum ** quatType: spline to control camera orientations. This is needed for ! ** tracking at or from, but not needed for limnCameraPathTrackBoth ! ** This is the only limnSplineTypeSpec* argument that can be NULL ** posType: spline to control whichever of from, at, and up are needed for ! ** the given style of tracking ** distType: spline to control neer, faar, dist: positions of near clipping, ** far clipping, and image plane, as well as the --- 162,175 ---- ** PRE-ALLOCATED array of output cameras, "cam". ** ! ** input: ! ** keycam: array of keyframe cameras ! ** time: times associated with the key frames ! ** ---> both of these arrays are length "numKeys" <--- ** trackWhat: takes values from the limnCameraPathTrack* enum ** quatType: spline to control camera orientations. This is needed for ! ** tracking at or from, but not needed for limnCameraPathTrackBoth. ! ** This is the only limnSplineTypeSpec* argument that can be NULL. ** posType: spline to control whichever of from, at, and up are needed for ! ** the given style of tracking. ** distType: spline to control neer, faar, dist: positions of near clipping, ** far clipping, and image plane, as well as the *************** *** 177,184 **** ** ** NOTE: The "atRelative", "orthographic", and "rightHanded" fields ! ** are used from keycam[0], and those fields are ignored for all other ! ** keycam[i]. Also, for the sake of simplicity, this only works with ! ** fov and aspect, instead of {u,v}Range, and hence both "fov" and "aspect" ! ** need to set in *all* the keycams, even if neither of them ever changes! */ int --- 179,188 ---- ** ** NOTE: The "atRelative", "orthographic", and "rightHanded" fields ! ** are copied from keycam[0] into all output cam[i], but you still need ! ** to correctly set them for all keycam[i] for limnCameraUpdate to work ! ** as expected. Also, for the sake of simplicity, this function only works ! ** with fov and aspect, instead of {u,v}Range, and hence both "fov" and ! ** "aspect" need to set in *all* the keycams, even if neither of them ! ** ever changes! */ int *************** *** 195,199 **** Nrrd *nquat, *nfrom, *natpt, *nupvc, *ndist, *nfova, *ntime, *nsample; double fratVec[3], *quat, *from, *atpt, *upvc, *dist, *fova, ! W2V[9], N[3], fratDist; limnSpline *timeSpline, *quatSpline, *fromSpline, *atptSpline, *upvcSpline, *distSpline, *fovaSpline; --- 199,203 ---- Nrrd *nquat, *nfrom, *natpt, *nupvc, *ndist, *nfova, *ntime, *nsample; double fratVec[3], *quat, *from, *atpt, *upvc, *dist, *fova, ! W2V[9], N[3], fratDist, testquat[4]; limnSpline *timeSpline, *quatSpline, *fromSpline, *atptSpline, *upvcSpline, *distSpline, *fovaSpline; *************** *** 264,275 **** biffAdd(LIMN, err); airMopError(mop); return 1; } - fprintf(stderr, "!%s: keycam[%d].W2V:\n", me, ii); - ell_4m_print_d(stderr, keycam[ii].W2V); ell_4m_to_q_d(quat + 4*ii, keycam[ii].W2V); - fprintf(stderr, "!%s: --> q = %g %g %g %g --> \n", me, - (quat + 4*ii)[0], (quat + 4*ii)[1], - (quat + 4*ii)[2], (quat + 4*ii)[3]); - ell_q_to_3m_d(W2V, quat + 4*ii); - ell_3m_print_d(stderr, W2V); if (ii) { if (0 > ELL_4V_DOT(quat + 4*ii, quat + 4*(ii-1))) { --- 268,272 ---- *************** *** 282,286 **** ELL_3V_SUB(fratVec, keycam[ii].from, keycam[ii].at); fratDist = ELL_3V_LEN(fratVec); - fprintf(stderr, "!%s(%d): fratDist = %g\n", me, ii, fratDist); ELL_4V_SET(dist + 4*ii, fratDist, keycam[ii].neer, keycam[ii].dist, keycam[ii].faar); --- 279,282 ---- *************** *** 367,371 **** } else { fratDist = (dist + 4*ii)[0]; - fprintf(stderr, "!%s(%d): fratDist = %g\n", me, ii, fratDist); ell_q_to_3m_d(W2V, quat + 4*ii); ELL_3MV_ROW1_GET(cam[ii].up, W2V); --- 363,366 ---- |
|
From: Gordon K. <kin...@us...> - 2004-05-10 21:40:45
|
Update of /cvsroot/teem/teem/src/limn In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11913 Modified Files: cam.c Log Message: still debuggin Index: cam.c =================================================================== RCS file: /cvsroot/teem/teem/src/limn/cam.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** cam.c 10 May 2004 21:20:30 -0000 1.21 --- cam.c 10 May 2004 21:40:36 -0000 1.22 *************** *** 264,270 **** biffAdd(LIMN, err); airMopError(mop); return 1; } - ell_4m_to_q_d(quat + 4*ii, keycam[ii].W2V); fprintf(stderr, "!%s: keycam[%d].W2V:\n", me, ii); ell_4m_print_d(stderr, keycam[ii].W2V); fprintf(stderr, "!%s: --> q = %g %g %g %g --> \n", me, (quat + 4*ii)[0], (quat + 4*ii)[1], --- 264,270 ---- biffAdd(LIMN, err); airMopError(mop); return 1; } fprintf(stderr, "!%s: keycam[%d].W2V:\n", me, ii); ell_4m_print_d(stderr, keycam[ii].W2V); + ell_4m_to_q_d(quat + 4*ii, keycam[ii].W2V); fprintf(stderr, "!%s: --> q = %g %g %g %g --> \n", me, (quat + 4*ii)[0], (quat + 4*ii)[1], |
|
From: Gordon K. <kin...@us...> - 2004-05-10 21:20:46
|
Update of /cvsroot/teem/teem/src/limn/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7408/test Modified Files: tcamanim.c Log Message: still debuggin Index: tcamanim.c =================================================================== RCS file: /cvsroot/teem/teem/src/limn/test/tcamanim.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcamanim.c 10 May 2004 19:46:50 -0000 1.6 --- tcamanim.c 10 May 2004 21:20:33 -0000 1.7 *************** *** 58,62 **** ki = airArrayIncrLen(camA, 1); airArrayIncrLen(dwellA, 1); ! if (15 != sscanf(line, "cam.di %lg cam.at %lg %lg %lg " "cam.up %lg %lg %lg cam.dn %lg cam.df %lg cam.va %lg " "relDwell %lg cam.fr %lg %lg %lg", --- 58,62 ---- ki = airArrayIncrLen(camA, 1); airArrayIncrLen(dwellA, 1); ! if (14 != sscanf(line, "cam.di %lg cam.at %lg %lg %lg " "cam.up %lg %lg %lg cam.dn %lg cam.df %lg cam.va %lg " "relDwell %lg cam.fr %lg %lg %lg", |
|
From: Gordon K. <kin...@us...> - 2004-05-10 21:20:45
|
Update of /cvsroot/teem/teem/src/limn In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7408 Modified Files: cam.c Log Message: still debuggin Index: cam.c =================================================================== RCS file: /cvsroot/teem/teem/src/limn/cam.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** cam.c 10 May 2004 19:27:24 -0000 1.20 --- cam.c 10 May 2004 21:20:30 -0000 1.21 *************** *** 265,268 **** --- 265,275 ---- } ell_4m_to_q_d(quat + 4*ii, keycam[ii].W2V); + fprintf(stderr, "!%s: keycam[%d].W2V:\n", me, ii); + ell_4m_print_d(stderr, keycam[ii].W2V); + fprintf(stderr, "!%s: --> q = %g %g %g %g --> \n", me, + (quat + 4*ii)[0], (quat + 4*ii)[1], + (quat + 4*ii)[2], (quat + 4*ii)[3]); + ell_q_to_3m_d(W2V, quat + 4*ii); + ell_3m_print_d(stderr, W2V); if (ii) { if (0 > ELL_4V_DOT(quat + 4*ii, quat + 4*(ii-1))) { *************** *** 274,279 **** ELL_3V_COPY(upvc + 3*ii, keycam[ii].up); ELL_3V_SUB(fratVec, keycam[ii].from, keycam[ii].at); ! ELL_4V_SET(dist + 4*ii, ! ELL_3V_LEN(fratVec), keycam[ii].neer, keycam[ii].dist, keycam[ii].faar); ELL_2V_SET(fova + 2*ii, keycam[ii].fov, keycam[ii].aspect); --- 281,287 ---- ELL_3V_COPY(upvc + 3*ii, keycam[ii].up); ELL_3V_SUB(fratVec, keycam[ii].from, keycam[ii].at); ! fratDist = ELL_3V_LEN(fratVec); ! fprintf(stderr, "!%s(%d): fratDist = %g\n", me, ii, fratDist); ! ELL_4V_SET(dist + 4*ii, fratDist, keycam[ii].neer, keycam[ii].dist, keycam[ii].faar); ELL_2V_SET(fova + 2*ii, keycam[ii].fov, keycam[ii].aspect); *************** *** 333,337 **** if (!E) E |= limnSplineNrrdEvaluate(natpt, atptSpline, nsample); if (!E) atpt = (double*)(natpt->data); ! if (!E) E |= limnSplineNrrdEvaluate(nupvc, atptSpline, nsample); if (!E) upvc = (double*)(nupvc->data); break; --- 341,345 ---- if (!E) E |= limnSplineNrrdEvaluate(natpt, atptSpline, nsample); if (!E) atpt = (double*)(natpt->data); ! if (!E) E |= limnSplineNrrdEvaluate(nupvc, upvcSpline, nsample); if (!E) upvc = (double*)(nupvc->data); break; *************** *** 359,362 **** --- 367,371 ---- } else { fratDist = (dist + 4*ii)[0]; + fprintf(stderr, "!%s(%d): fratDist = %g\n", me, ii, fratDist); ell_q_to_3m_d(W2V, quat + 4*ii); ELL_3MV_ROW1_GET(cam[ii].up, W2V); |
|
From: Gordon K. <kin...@us...> - 2004-05-10 19:47:00
|
Update of /cvsroot/teem/teem/src/limn/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17368/test Modified Files: soid.c tbc.c tcamanim.c Log Message: fixed warning messages Index: tbc.c =================================================================== RCS file: /cvsroot/teem/teem/src/limn/test/tbc.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tbc.c 7 Jan 2004 15:34:30 -0000 1.3 --- tbc.c 10 May 2004 19:46:50 -0000 1.4 *************** *** 53,57 **** hestOpt *hopt=NULL; airArray *mop; ! int bi, ci, i, N, M, pause, loop; Nrrd *ncptA, *ncptB, *nout; double *out, minT, maxT, scale, tran[2], B, C; --- 53,57 ---- hestOpt *hopt=NULL; airArray *mop; ! int bi, ci, i, N, M, loop; Nrrd *ncptA, *ncptB, *nout; double *out, minT, maxT, scale, tran[2], B, C; *************** *** 108,113 **** } - pause = M/150; - printf("%%!\n"); printf("1 setlinewidth\n"); --- 108,111 ---- Index: tcamanim.c =================================================================== RCS file: /cvsroot/teem/teem/src/limn/test/tcamanim.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcamanim.c 10 May 2004 19:27:25 -0000 1.5 --- tcamanim.c 10 May 2004 19:46:50 -0000 1.6 *************** *** 30,38 **** char me[]="_limnReadCamanim", err[AIR_STRLEN_MED]; char line[AIR_STRLEN_HUGE]; ! int lret, ki; double *tmp, *dwell, di, dn, df, fr[3], at[3], up[3], va; airArray *mop, *camA, *dwellA; ! if (!( 0 < (lret = airOneLine(fin, line, AIR_STRLEN_HUGE)) && !strcmp(_LIMNMAGIC, line) )) { sprintf(err, "%s: couldn't read first line or it wasn't \"%s\"", --- 30,38 ---- char me[]="_limnReadCamanim", err[AIR_STRLEN_MED]; char line[AIR_STRLEN_HUGE]; ! int ki; double *tmp, *dwell, di, dn, df, fr[3], at[3], up[3], va; airArray *mop, *camA, *dwellA; ! if (!( 0 < airOneLine(fin, line, AIR_STRLEN_HUGE) && !strcmp(_LIMNMAGIC, line) )) { sprintf(err, "%s: couldn't read first line or it wasn't \"%s\"", *************** *** 40,44 **** biffAdd(LIMN, err); return 1; } ! if (!( 0 < (lret = airOneLine(fin, line, AIR_STRLEN_HUGE)) && 2 == (airStrtrans(airStrtrans(line, '{', ' '), '}', ' '), sscanf(line, "imgSize %d %d", imgSize+0, imgSize+1)) )) { --- 40,44 ---- biffAdd(LIMN, err); return 1; } ! if (!( 0 < airOneLine(fin, line, AIR_STRLEN_HUGE) && 2 == (airStrtrans(airStrtrans(line, '{', ' '), '}', ' '), sscanf(line, "imgSize %d %d", imgSize+0, imgSize+1)) )) { *************** *** 54,58 **** airMopAdd(mop, dwellA, (airMopper)airArrayNuke, airMopAlways); ! while ( 0 < (lret = airOneLine(fin, line, AIR_STRLEN_HUGE)) ) { airStrtrans(airStrtrans(line, '{', ' '), '}', ' '); ki = airArrayIncrLen(camA, 1); --- 54,58 ---- airMopAdd(mop, dwellA, (airMopper)airArrayNuke, airMopAlways); ! while ( 0 < airOneLine(fin, line, AIR_STRLEN_HUGE) ) { airStrtrans(airStrtrans(line, '{', ' '), '}', ' '); ki = airArrayIncrLen(camA, 1); Index: soid.c =================================================================== RCS file: /cvsroot/teem/teem/src/limn/test/soid.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** soid.c 1 Mar 2004 21:59:03 -0000 1.11 --- soid.c 10 May 2004 19:46:50 -0000 1.12 *************** *** 27,36 **** char *me, *err, *outS; float p[3], q[4], mR[9], eval[3], scale[3], len, sh, cl, cp, qA, qB; ! float matA[16], matB[16], os, rad, edgeWidth[5], AB[2]; hestOpt *hopt=NULL; airArray *mop; limnObject *obj; limnLook *look; int lookRod, lookSoid; ! limnPart *part; int partIdx=-1; /* sssh */ int res, axis, sphere; FILE *file; --- 27,36 ---- char *me, *err, *outS; float p[3], q[4], mR[9], eval[3], scale[3], len, sh, cl, cp, qA, qB; ! float matA[16], matB[16], os, rad, AB[2]; hestOpt *hopt=NULL; airArray *mop; limnObject *obj; limnLook *look; int lookRod, lookSoid; ! int partIdx=-1; /* sssh */ int res, axis, sphere; FILE *file; *************** *** 38,43 **** mop = airMopNew(); - edgeWidth[0] = 0; - edgeWidth[1] = 0; me = argv[0]; hestOptAdd(&hopt, "sc", "scalings", airTypeFloat, 3, 3, scale, "1 1 1", --- 38,41 ---- *************** *** 117,121 **** axis, qA, qB, 2*res, res); } - part = obj->part + partIdx; ELL_4M_IDENTITY_SET(matA); ELL_4M_SCALE_SET(matB, scale[0], scale[1], scale[2]); --- 115,118 ---- |
|
From: Gordon K. <kin...@us...> - 2004-05-10 19:33:01
|
Update of /cvsroot/teem/teem/src/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14501 Modified Files: miter.c mrender.c Log Message: added support for the field-of-view stuff Index: mrender.c =================================================================== RCS file: /cvsroot/teem/teem/src/bin/mrender.c,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** mrender.c 13 Mar 2004 20:03:08 -0000 1.33 --- mrender.c 10 May 2004 19:32:51 -0000 1.34 *************** *** 465,469 **** NULL, "0 0 0", "0 0 1", NULL, NULL, NULL, ! "-1 1", "-1 1"); hestOptAdd(&hopt, "is", "image size", airTypeInt, 2, 2, uu->hctx->imgSize, "256 256", "image dimensions"); --- 465,469 ---- NULL, "0 0 0", "0 0 1", NULL, NULL, NULL, ! "nan nan", "nan nan", "20"); hestOptAdd(&hopt, "is", "image size", airTypeInt, 2, 2, uu->hctx->imgSize, "256 256", "image dimensions"); *************** *** 536,539 **** --- 536,549 ---- airEnumStr(uu->kind->enm, uu->whatq), uu->kind->name); + if (limnCameraAspectSet(uu->hctx->cam, + uu->hctx->imgSize[0], uu->hctx->imgSize[1], + nrrdCenterCell) + || limnCameraUpdate(uu->hctx->cam)) { + airMopAdd(mop, errS = biffGetDone(LIMN), airFree, airMopAlways); + fprintf(stderr, "%s: trouble setting camera:\n%s\n", me, errS); + airMopError(mop); + return 1; + } + /* set remaining fields of hoover context */ base = uu->kind->baseDim; Index: miter.c =================================================================== RCS file: /cvsroot/teem/teem/src/bin/miter.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** miter.c 11 Apr 2004 15:06:05 -0000 1.27 --- miter.c 10 May 2004 19:32:51 -0000 1.28 *************** *** 62,66 **** NULL, "0 0 0", "0 0 1", NULL, NULL, NULL, ! "-1 1", "-1 1"); hestOptAdd(&hopt, "ffr", "fake from", airTypeDouble, 3, 3, &(muu->fakeFrom), "nan nan nan", --- 62,66 ---- NULL, "0 0 0", "0 0 1", NULL, NULL, NULL, ! "nan nan", "nan nan", "20"); hestOptAdd(&hopt, "ffr", "fake from", airTypeDouble, 3, 3, &(muu->fakeFrom), "nan nan nan", *************** *** 160,164 **** muu->lit->on[0] = AIR_TRUE; muu->lit->vsp[0] = AIR_TRUE; ! if (limnCameraUpdate(muu->hctx->cam) || limnLightUpdate(muu->lit, muu->hctx->cam)) { airMopAdd(mop, errS = biffGetDone(LIMN), airFree, airMopAlways); --- 160,177 ---- muu->lit->on[0] = AIR_TRUE; muu->lit->vsp[0] = AIR_TRUE; ! if (AIR_EXISTS(muu->hctx->cam->uRange[0]) ! && AIR_EXISTS(muu->hctx->cam->uRange[1]) ! && AIR_EXISTS(muu->hctx->cam->vRange[0]) ! && AIR_EXISTS(muu->hctx->cam->vRange[1])) { ! /* someone went to the trouble of setting the U,V minmax, which ! means they probably don't want the "fov"-based view window, ! whether or not the "fov" value came from the command-line or ! from the (unavoidable) default */ ! muu->hctx->cam->fov = AIR_NAN; ! } ! if (limnCameraAspectSet(muu->hctx->cam, ! muu->hctx->imgSize[0], muu->hctx->imgSize[1], ! nrrdCenterCell) ! || limnCameraUpdate(muu->hctx->cam) || limnLightUpdate(muu->lit, muu->hctx->cam)) { airMopAdd(mop, errS = biffGetDone(LIMN), airFree, airMopAlways); |
|
From: Gordon K. <kin...@us...> - 2004-05-10 19:32:31
|
Update of /cvsroot/teem/teem/src/ell In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14425 Modified Files: ellMacros.h Log Message: we can always use more macros Index: ellMacros.h =================================================================== RCS file: /cvsroot/teem/teem/src/ell/ellMacros.h,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** ellMacros.h 7 May 2004 19:07:44 -0000 1.42 --- ellMacros.h 10 May 2004 19:32:21 -0000 1.43 *************** *** 216,219 **** --- 216,222 ---- (v3)[2] = AIR_MAX((v1)[2], (v2)[2])) + #define ELL_3V_EXISTS(v) \ + (AIR_EXISTS((v)[0]) && AIR_EXISTS((v)[1]) && AIR_EXISTS((v)[2])) + #define ELL_3V_AFFINE(v,i,x,I,o,O) ( \ (v)[0] = AIR_AFFINE((i)[0],(x)[0],(I)[0],(o)[0],(O)[0]), \ *************** *** 469,472 **** --- 472,479 ---- (length = ELL_4V_LEN(v1), ELL_4V_SCALE(v2, 1.0/length, v1)) + #define ELL_4V_EXISTS(v) \ + (AIR_EXISTS((v)[0]) && AIR_EXISTS((v)[1]) \ + && AIR_EXISTS((v)[2]) && AIR_EXISTS((v)[3])) + #define ELL_4M_ADD2(m3, m1, m2) \ (ELL_4V_ADD2((m3)+ 0, (m1)+ 0, (m2)+ 0), \ |
|
From: Gordon K. <kin...@us...> - 2004-05-10 19:32:01
|
Update of /cvsroot/teem/teem/src/hoover In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14270 Modified Files: methodsHoover.c Log Message: added call to limnCameraAspectSet Index: methodsHoover.c =================================================================== RCS file: /cvsroot/teem/teem/src/hoover/methodsHoover.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** methodsHoover.c 7 Jan 2004 15:34:29 -0000 1.9 --- methodsHoover.c 10 May 2004 19:31:52 -0000 1.10 *************** *** 54,60 **** biffAdd(HOOVER, err); return 1; } ! if (limnCameraUpdate(ctx->cam)) { ! sprintf(err, "%s: trouble learning view transform matrix", me); ! biffMove(HOOVER, err, LIMN); return 1; } if (airEnumValCheck(nrrdCenter, ctx->volCentering)) { --- 54,60 ---- biffAdd(HOOVER, err); return 1; } ! if (airEnumValCheck(nrrdCenter, ctx->imgCentering)) { ! sprintf(err, "%s: pixel centering (%d) invalid", me, ctx->imgCentering); ! biffAdd(HOOVER, err); return 1; } if (airEnumValCheck(nrrdCenter, ctx->volCentering)) { *************** *** 62,68 **** biffAdd(HOOVER, err); return 1; } ! if (airEnumValCheck(nrrdCenter, ctx->imgCentering)) { ! sprintf(err, "%s: pixel centering (%d) invalid", me, ctx->imgCentering); ! biffAdd(HOOVER, err); return 1; } if (!(ctx->volSize[0] > 1 --- 62,70 ---- biffAdd(HOOVER, err); return 1; } ! if (limnCameraAspectSet(ctx->cam, ! ctx->imgSize[0], ctx->imgSize[1], ctx->imgCentering) ! || limnCameraUpdate(ctx->cam)) { ! sprintf(err, "%s: trouble setting up camera", me); ! biffMove(HOOVER, err, LIMN); return 1; } if (!(ctx->volSize[0] > 1 |
|
From: Gordon K. <kin...@us...> - 2004-05-10 19:29:31
|
Update of /cvsroot/teem/teem/src/hoover In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13677 Modified Files: rays.c Log Message: typo in comment Index: rays.c =================================================================== RCS file: /cvsroot/teem/teem/src/hoover/rays.c,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** rays.c 7 Jan 2004 15:34:29 -0000 1.29 --- rays.c 10 May 2004 19:29:22 -0000 1.30 *************** *** 324,328 **** int threadIdx; ! /* this calls limnCamUpdate() */ if (hooverContextCheck(ctx)) { sprintf(err, "%s: problem detected in given context", me); --- 324,328 ---- int threadIdx; ! /* this calls limnCameraUpdate() */ if (hooverContextCheck(ctx)) { sprintf(err, "%s: problem detected in given context", me); |