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-07-26 21:01:03
|
Update of /cvsroot/teem/teem/src/alan In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30921 Modified Files: alan.h coreAlan.c methodsAlan.c Log Message: still hacking Index: coreAlan.c =================================================================== RCS file: /cvsroot/teem/teem/src/alan/coreAlan.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** coreAlan.c 26 Jul 2004 11:43:18 -0000 1.18 --- coreAlan.c 26 Jul 2004 21:00:54 -0000 1.19 *************** *** 213,219 **** void * _alanTuringWorker(void *_task) { ! alan_t *tendata, *ten, Dxx, Dxy, Dyy, react, _react, *lev0, *lev1, *parm, deltaT, alpha, beta, A, B, ! *v[27], lapA, lapB, deltaA, deltaB, diffA, diffB, change; int dim, iter, stop, startW, endW, idx, px, mx, py, my, pz, mz, --- 213,222 ---- void * _alanTuringWorker(void *_task) { ! alan_t *tendata, *ten, react, _react, ! Dxx, Dxy, Dyy, Dxz, Dyz, ! *tpx, *tmx, *tpy, *tmy, *tpz, *tmz, *lev0, *lev1, *parm, deltaT, alpha, beta, A, B, ! *v[27], lapA, lapB, corrA, corrB, ! deltaA, deltaB, diffA, diffB, change; int dim, iter, stop, startW, endW, idx, px, mx, py, my, pz, mz, *************** *** 301,305 **** v[7] = lev0 + 2*( x + sx*(py)); if (tendata) { - ten = tendata + 4*(x + sx*(y)); /* ** 0 1 2 Dxy/2 Dyy -Dxy/2 --- 304,307 ---- *************** *** 311,314 **** --- 313,317 ---- v[6] = lev0 + 2*(mx + sx*(py)); v[8] = lev0 + 2*(px + sx*(py)); + ten = tendata + 4*idx; Dxx = ten[1]; Dxy = ten[2]; *************** *** 321,327 **** --- 324,349 ---- - 2*(Dxx + Dyy)*B); react = ten[0]; + if (task->actx->homogAniso) { + corrA = 0; + corrB = 0; + } else { + tpx = tendata + 4*(px + sx*( y + sy*( z))); + tmx = tendata + 4*(mx + sx*( y + sy*( z))); + tpy = tendata + 4*( x + sx*(py + sy*( z))); + tmy = tendata + 4*( x + sx*(my + sy*( z))); + corrA = ((tpx[1] - tmx[1])*(v[5][0] - v[3][0])/4 + /* Dxx,x * A,x */ + (tpx[2] - tmx[2])*(v[7][0] - v[1][0])/4 + /* Dxy,x * A,y */ + (tpy[2] - tmy[2])*(v[5][0] - v[3][0])/4 + /* Dxy,y * A,x */ + (tpy[3] - tmy[3])*(v[7][0] - v[1][0])); /* Dyy,y * A,y */ + corrB = ((tpx[1] - tmx[1])*(v[5][1] - v[3][1])/4 + /* Dxx,x * B,x */ + (tpx[2] - tmx[2])*(v[7][1] - v[1][1])/4 + /* Dxy,x * B,y */ + (tpy[2] - tmy[2])*(v[5][1] - v[3][1])/4 + /* Dxy,y * B,x */ + (tpy[3] - tmy[3])*(v[7][1] - v[1][1])); /* Dyy,y * B,y */ + } } else { lapA = v[1][0] + v[3][0] + v[5][0] + v[7][0] - 4*A; lapB = v[1][1] + v[3][1] + v[5][1] + v[7][1] - 4*B; + corrA = 0; + corrB = 0; react = 1; } *************** *** 350,367 **** v[16] = lev0 + 2*( x + sx*(py + sy*( z))); v[22] = lev0 + 2*( x + sx*( y + sy*(pz))); ! lapA = (v[ 4][0] + v[10][0] + v[12][0] ! + v[14][0] + v[16][0] + v[22][0] - 6*A); ! lapB = (v[ 4][1] + v[10][1] + v[12][1] ! + v[14][1] + v[16][1] + v[22][1] - 6*B); ! react = 1; } react *= _react; ! deltaA = deltaT*(react*task->actx->K*(alpha - A*B) + diffA*lapA); if (AIR_ABS(deltaA) > task->actx->maxPixelChange) { stop = alanStopDiverged; } change += AIR_ABS(deltaA); ! deltaB = deltaT*(react*task->actx->K*(A*B - B - beta) + diffB*lapB); if (!( AIR_EXISTS(deltaA) && AIR_EXISTS(deltaB) )) { stop = alanStopNonExist; --- 372,403 ---- v[16] = lev0 + 2*( x + sx*(py + sy*( z))); v[22] = lev0 + 2*( x + sx*( y + sy*(pz))); ! if (tendata) { ! ! if (task->actx->homogAniso) { ! corrA = 0; ! corrB = 0; ! } else { ! ! } ! } else { ! lapA = (v[ 4][0] + v[10][0] + v[12][0] ! + v[14][0] + v[16][0] + v[22][0] - 6*A); ! lapB = (v[ 4][1] + v[10][1] + v[12][1] ! + v[14][1] + v[16][1] + v[22][1] - 6*B); ! corrA = 0; ! corrB = 0; ! react = 1; ! } } react *= _react; ! deltaA = deltaT*(react*task->actx->K*(alpha - A*B) ! + diffA*(lapA + corrA)); if (AIR_ABS(deltaA) > task->actx->maxPixelChange) { stop = alanStopDiverged; } change += AIR_ABS(deltaA); ! deltaB = deltaT*(react*task->actx->K*(A*B - B - beta) ! + diffB*(lapB + corrB)); if (!( AIR_EXISTS(deltaA) && AIR_EXISTS(deltaB) )) { stop = alanStopNonExist; Index: methodsAlan.c =================================================================== RCS file: /cvsroot/teem/teem/src/alan/methodsAlan.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** methodsAlan.c 26 Jul 2004 11:43:18 -0000 1.13 --- methodsAlan.c 26 Jul 2004 21:00:54 -0000 1.14 *************** *** 33,36 **** --- 33,37 ---- ELL_3V_SET(actx->size, 0, 0, 0); actx->oversample = 0; + actx->homogAniso = AIR_FALSE; actx->numThreads = 1; actx->frameInterval = 10; *************** *** 184,187 **** --- 185,189 ---- biffAdd(ALAN, err); return 1; } + actx->nten = nrrdNuke(actx->nten); actx->nten = nrrdNew(); *************** *** 194,197 **** --- 196,201 ---- if (3 == actx->dim) { actx->size[2] = oversample*nten->axis[3].size; + } else { + actx->size[2] = 1; } *************** *** 242,245 **** --- 246,253 ---- actx->numThreads = parmI; break; + case alanParmHomogAniso: + parmI = parm; + actx->homogAniso = parmI; + break; case alanParmSaveInterval: parmI = parm; Index: alan.h =================================================================== RCS file: /cvsroot/teem/teem/src/alan/alan.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** alan.h 26 Jul 2004 11:43:18 -0000 1.14 --- alan.h 26 Jul 2004 21:00:54 -0000 1.15 *************** *** 49,52 **** --- 49,53 ---- alanParmNumThreads, alanParmFrameInterval, + alanParmHomogAniso, alanParmSaveInterval, alanParmMaxIteration, *************** *** 101,104 **** --- 102,106 ---- size[3], /* number of texels in X, Y, (Z) */ oversample, /* oversampling of tensors to texels */ + homogAniso, /* homogenous anisotropy approximation */ numThreads, /* # of threads, if airThreadCapable */ frameInterval, /* # of iterations between which to an image */ |
|
From: Gordon K. <kin...@us...> - 2004-07-26 11:43:58
|
Update of /cvsroot/teem/teem/src/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20232 Modified Files: spots.c Log Message: still hacking Index: spots.c =================================================================== RCS file: /cvsroot/teem/teem/src/bin/spots.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** spots.c 26 Jul 2004 07:26:17 -0000 1.6 --- spots.c 26 Jul 2004 11:43:38 -0000 1.7 *************** *** 39,43 **** alanContext *actx; int *size, sizeLen, fi, si, wrap, nt, cfn; ! double deltaT, mch, xch, alphabeta[2], time0, time1, H; Nrrd *ninit=NULL, *nten=NULL, *nparm=NULL; --- 39,43 ---- alanContext *actx; int *size, sizeLen, fi, si, wrap, nt, cfn; ! double deltaT, mch, xch, alphabeta[2], time0, time1, deltaX, react, rrange; Nrrd *ninit=NULL, *nten=NULL, *nparm=NULL; *************** *** 59,73 **** "terms of the reaction-diffusion equations. The default " "values were the ones published by Turing."); hestOptAdd(&hopt, "dt", "time", airTypeDouble, 1, 1, &deltaT, "1.0", "time-step size in Euler integration. Can be larger, at " "risk of hitting divergent instability."); ! hestOptAdd(&hopt, "dx", "size", airTypeDouble, 1, 1, &H, "1.3", "nominal size of simulation grid element."); hestOptAdd(&hopt, "mch", "change", airTypeDouble, 1, 1, &mch, "0.00001", ! "the minimum significant change, averaged over the whole texture, in the " ! "first morphogen: to signify convergence"); hestOptAdd(&hopt, "xch", "change", airTypeDouble, 1, 1, &xch, "6", ! "the maximum allowable change, averaged over the whole texture, in the " ! "first morphogen: to signify divergence"); hestOptAdd(&hopt, "fi", "frame inter", airTypeInt, 1, 1, &fi, "0", "the number of iterations between which to save out an 8-bit " --- 59,77 ---- "terms of the reaction-diffusion equations. The default " "values were the ones published by Turing."); + hestOptAdd(&hopt, "sr", "react", airTypeDouble, 1, 1, &react, "1.0", + "scaling of reaction term"); + hestOptAdd(&hopt, "rr", "range range", airTypeDouble, 1, 1, &rrange, "4.0", + "amount of random noise to add to inital textures"); hestOptAdd(&hopt, "dt", "time", airTypeDouble, 1, 1, &deltaT, "1.0", "time-step size in Euler integration. Can be larger, at " "risk of hitting divergent instability."); ! hestOptAdd(&hopt, "dx", "size", airTypeDouble, 1, 1, &deltaX, "1.3", "nominal size of simulation grid element."); hestOptAdd(&hopt, "mch", "change", airTypeDouble, 1, 1, &mch, "0.00001", ! "the minimum significant change (averaged over the whole " ! "texture) in the first morphogen: to signify convergence"); hestOptAdd(&hopt, "xch", "change", airTypeDouble, 1, 1, &xch, "6", ! "the maximum allowable change (averaged over the whole " ! "texture) in the first morphogen: to signify divergence"); hestOptAdd(&hopt, "fi", "frame inter", airTypeInt, 1, 1, &fi, "0", "the number of iterations between which to save out an 8-bit " *************** *** 115,127 **** if (alanParmSet(actx, alanParmVerbose, 1) || alanParmSet(actx, alanParmTextureType, alanTextureTypeTuring) - || alanParmSet(actx, alanParmRandRange, 4.0) || alanParmSet(actx, alanParmK, 0.0125) - || alanParmSet(actx, alanParmH, 1.2) || alanParmSet(actx, alanParmAlpha, alphabeta[0]) || alanParmSet(actx, alanParmBeta, alphabeta[1]) || alanParmSet(actx, alanParmDeltaT, deltaT) ! || alanParmSet(actx, alanParmH, H) || alanParmSet(actx, alanParmMinAverageChange, mch) || alanParmSet(actx, alanParmMaxPixelChange, xch) || alanParmSet(actx, alanParmSaveInterval, si) || alanParmSet(actx, alanParmFrameInterval, fi) --- 119,131 ---- if (alanParmSet(actx, alanParmVerbose, 1) || alanParmSet(actx, alanParmTextureType, alanTextureTypeTuring) || alanParmSet(actx, alanParmK, 0.0125) || alanParmSet(actx, alanParmAlpha, alphabeta[0]) || alanParmSet(actx, alanParmBeta, alphabeta[1]) + || alanParmSet(actx, alanParmDeltaX, deltaX) || alanParmSet(actx, alanParmDeltaT, deltaT) ! || alanParmSet(actx, alanParmReact, react) || alanParmSet(actx, alanParmMinAverageChange, mch) || alanParmSet(actx, alanParmMaxPixelChange, xch) + || alanParmSet(actx, alanParmRandRange, rrange) || alanParmSet(actx, alanParmSaveInterval, si) || alanParmSet(actx, alanParmFrameInterval, fi) |
|
From: Gordon K. <kin...@us...> - 2004-07-26 11:43:27
|
Update of /cvsroot/teem/teem/src/alan In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20204 Modified Files: alan.h coreAlan.c methodsAlan.c Log Message: still hacking Index: coreAlan.c =================================================================== RCS file: /cvsroot/teem/teem/src/alan/coreAlan.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** coreAlan.c 26 Jul 2004 07:26:03 -0000 1.17 --- coreAlan.c 26 Jul 2004 11:43:18 -0000 1.18 *************** *** 213,217 **** void * _alanTuringWorker(void *_task) { ! alan_t *tendata, *ten, Dxx, Dxy, Dyy, react, *lev0, *lev1, *parm, deltaT, alpha, beta, A, B, *v[27], lapA, lapB, deltaA, deltaB, diffA, diffB, change; --- 213,217 ---- void * _alanTuringWorker(void *_task) { ! alan_t *tendata, *ten, Dxx, Dxy, Dyy, react, _react, *lev0, *lev1, *parm, deltaT, alpha, beta, A, B, *v[27], lapA, lapB, deltaA, deltaB, diffA, diffB, change; *************** *** 227,235 **** sz = (2 == dim ? 1 : task->actx->size[2]); parm = (alan_t*)(task->actx->nparm->data); ! diffA = task->actx->diffA/pow(task->actx->H, dim); ! diffB = task->actx->diffB/pow(task->actx->H, dim); startW = task->idx*sy/task->actx->numThreads; endW = (task->idx+1)*sy/task->actx->numThreads; tendata = task->actx->nten ? (alan_t *)task->actx->nten->data : NULL; if (2 == dim) { --- 227,236 ---- sz = (2 == dim ? 1 : task->actx->size[2]); parm = (alan_t*)(task->actx->nparm->data); ! diffA = task->actx->diffA/pow(task->actx->deltaX, dim); ! diffB = task->actx->diffB/pow(task->actx->deltaX, dim); startW = task->idx*sy/task->actx->numThreads; endW = (task->idx+1)*sy/task->actx->numThreads; tendata = task->actx->nten ? (alan_t *)task->actx->nten->data : NULL; + _react = task->actx->react; if (2 == dim) { *************** *** 356,359 **** --- 357,361 ---- } + react *= _react; deltaA = deltaT*(react*task->actx->K*(alpha - A*B) + diffA*lapA); if (AIR_ABS(deltaA) > task->actx->maxPixelChange) { Index: methodsAlan.c =================================================================== RCS file: /cvsroot/teem/teem/src/alan/methodsAlan.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** methodsAlan.c 26 Jul 2004 07:26:03 -0000 1.12 --- methodsAlan.c 26 Jul 2004 11:43:18 -0000 1.13 *************** *** 41,48 **** actx->K = AIR_NAN; actx->F = AIR_NAN; ! actx->H = 1.25; actx->alpha = 16; actx->beta = 12; actx->deltaT = 1.0; actx->initA = actx->initB = 0; actx->diffA = actx->diffB = 0; --- 41,49 ---- actx->K = AIR_NAN; actx->F = AIR_NAN; ! actx->deltaX = 1.25; actx->alpha = 16; actx->beta = 12; actx->deltaT = 1.0; + actx->react = 1.0; actx->initA = actx->initB = 0; actx->diffA = actx->diffB = 0; *************** *** 260,263 **** --- 261,270 ---- actx->deltaT = parm; break; + case alanParmDeltaX: + actx->deltaX = parm; + break; + case alanParmReact: + actx->react = parm; + break; case alanParmDiffA: actx->diffA = parm; *************** *** 275,281 **** actx->F = parm; break; - case alanParmH: - actx->H = parm; - break; case alanParmMinAverageChange: actx->minAverageChange = parm; --- 282,285 ---- Index: alan.h =================================================================== RCS file: /cvsroot/teem/teem/src/alan/alan.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** alan.h 26 Jul 2004 07:26:03 -0000 1.13 --- alan.h 26 Jul 2004 11:43:18 -0000 1.14 *************** *** 53,61 **** alanParmRandRange, alanParmDeltaT, alanParmDiffA, alanParmDiffB, alanParmK, alanParmF, - alanParmH, alanParmMinAverageChange, alanParmMaxPixelChange, --- 53,62 ---- alanParmRandRange, alanParmDeltaT, + alanParmDeltaX, alanParmDiffA, alanParmDiffB, + alanParmReact, alanParmK, alanParmF, alanParmMinAverageChange, alanParmMaxPixelChange, *************** *** 106,110 **** constFilename; /* always use the same filename when saving frames */ alan_t K, F, /* simulation variables */ ! H, /* size of spatial grid discretization */ minAverageChange, /* min worthwhile "avergageChange" value (see below), assume convergence if it falls below this */ --- 107,111 ---- constFilename; /* always use the same filename when saving frames */ alan_t K, F, /* simulation variables */ ! deltaX, /* size of spatial grid discretization */ minAverageChange, /* min worthwhile "avergageChange" value (see below), assume convergence if it falls below this */ *************** *** 113,116 **** --- 114,118 ---- this is exceeded */ alpha, beta, /* variables for turing */ + react, /* additional scaling of reaction term */ deltaT, /* euler integration step size */ initA, initB, /* initial (constant) values for each morphogen */ |
|
From: Gordon K. <kin...@us...> - 2004-07-26 07:31:03
|
Update of /cvsroot/teem/teem/src/ten In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16157 Modified Files: glyph.c Log Message: tweaking ray tracing shadows Index: glyph.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/glyph.c,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** glyph.c 23 Jun 2004 01:46:41 -0000 1.41 --- glyph.c 26 Jul 2004 07:30:42 -0000 1.42 *************** *** 335,339 **** ELL_3V_COPY(((echoRectangle*)esquare)->edge1, edge1); echoColorSet(esquare, sliceGray, sliceGray, sliceGray, 1); ! echoMatterPhongSet(glyphsEcho, esquare, 1, 0, 0, 40); echoListAdd(list, esquare); } --- 335,342 ---- ELL_3V_COPY(((echoRectangle*)esquare)->edge1, edge1); echoColorSet(esquare, sliceGray, sliceGray, sliceGray, 1); ! /* this is pretty arbitrary- but I want shadows to have some effect. ! Previously, the material was all ambient: (A,D,S) = (1,0,0), ! which avoided all shadow effects. */ ! echoMatterPhongSet(glyphsEcho, esquare, 0.4, 0.6, 0, 40); echoListAdd(list, esquare); } |
|
From: Gordon K. <kin...@us...> - 2004-07-26 07:30:19
|
Update of /cvsroot/teem/teem/src/echo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16100 Modified Files: color.c renderEcho.c sqd.c Log Message: alas, still debugging superquadric glyph ray intersection Index: sqd.c =================================================================== RCS file: /cvsroot/teem/teem/src/echo/sqd.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** sqd.c 7 Jan 2004 15:34:28 -0000 1.5 --- sqd.c 26 Jul 2004 07:30:10 -0000 1.6 *************** *** 92,96 **** echoPos_t x, echoPos_t y, echoPos_t z, echoPos_t A, echoPos_t B) { ! echoPos_t R, xxb, yya, zza; xxb = pow(x*x, 1/B); yya = pow(y*y, 1/A); zza = pow(z*z, 1/A); --- 92,98 ---- echoPos_t x, echoPos_t y, echoPos_t z, echoPos_t A, echoPos_t B) { ! echoPos_t R, xxb, yya, zza, larg; ! ! echoPos_t ret; xxb = pow(x*x, 1/B); yya = pow(y*y, 1/A); zza = pow(z*z, 1/A); *************** *** 100,104 **** 2*yya/(B*y*(yya + zza + R)), 2*zza/(B*z*(yya + zza + R))); ! return log(pow(yya + zza, A/B) + xxb); } --- 102,136 ---- 2*yya/(B*y*(yya + zza + R)), 2*zza/(B*z*(yya + zza + R))); ! larg = pow(yya + zza, A/B) + xxb; ! ret= larg > 0 ? log(larg) : ECHO_POS_MIN; ! /* ! if (!( AIR_EXISTS(grad[0]) && AIR_EXISTS(grad[1]) && AIR_EXISTS(grad[2]) )) { ! fprintf(stderr, "_echo_SuperquadX_lvg: PANIC\n"); ! fprintf(stderr, "x = %g, y = %g, z = %g, A = %g, B = %g\n", ! x, y, z, A, B); ! fprintf(stderr, "pow(%g * %g = %g, 1/%g = %g) = %g\n", ! x, x, x*x, B, 1/B, pow(x*x, 1/B)); ! fprintf(stderr, "xxb = %g, yya = %g, zza = %g\n", ! xxb, yya, zza); ! fprintf(stderr, "R: pow(%g + %g = %g, 1-(%g/%g = %g) = %g) = %g*%g = %g\n", ! yya, zza, yya + zza, ! A, B, A/B, 1-(A/B), ! pow(yya + zza, 1-(A/B)), xxb, ! pow(yya + zza, 1-(A/B))*xxb); ! fprintf(stderr, "grad[0]: 2/(%g * %g * (1 + pow(%g + %g = %g, %g/%g = %g)/%g = %g)) = %g\n", ! B, x, yya, zza, yya+zza, A, B, A/B, xxb, ! pow(yya + zza, A/B)/xxb, grad[0]); ! fprintf(stderr, "grad[1]: 2*%g/(%g*%g*(%g + %g + %g = %g) = %g) = %g\n", ! yya, B, y, yya, zza, R, yya + zza + R, ! B*y*(yya + zza + R), ! 2*yya/(B*y*(yya + zza + R))); ! ! fprintf(stderr, "log(pow(%g + %g = %g, %g) = %g + %g) = %g\n", ! yya, zza, yya+zza, A/B, pow(yya + zza, A/B), xxb, ret); ! fprintf(stderr, "grad = %g %g %g\n", grad[0], grad[1], grad[2]); ! fprintf(stderr, "\n----------\n\n"); ! } ! */ ! return ret; } *************** *** 107,111 **** echoPos_t x, echoPos_t y, echoPos_t z, echoPos_t A, echoPos_t B) { ! echoPos_t R, xxa, yyb, zza; xxa = pow(x*x, 1/A); yyb = pow(y*y, 1/B); zza = pow(z*z, 1/A); --- 139,143 ---- echoPos_t x, echoPos_t y, echoPos_t z, echoPos_t A, echoPos_t B) { ! echoPos_t R, xxa, yyb, zza, larg; xxa = pow(x*x, 1/A); yyb = pow(y*y, 1/B); zza = pow(z*z, 1/A); *************** *** 115,119 **** 2/(B*y*(1 + pow(xxa + zza, A/B)/yyb)), 2*zza/(B*z*(xxa + zza + R))); ! return log(pow(xxa + zza, A/B) + yyb); } --- 147,152 ---- 2/(B*y*(1 + pow(xxa + zza, A/B)/yyb)), 2*zza/(B*z*(xxa + zza + R))); ! larg = pow(xxa + zza, A/B) + yyb; ! return larg > 0 ? log(larg) : ECHO_POS_MIN; } *************** *** 122,126 **** echoPos_t x, echoPos_t y, echoPos_t z, echoPos_t A, echoPos_t B) { ! echoPos_t R, xxa, yya, zzb; xxa = pow(x*x, 1/A); yya = pow(y*y, 1/A); zzb = pow(z*z, 1/B); --- 155,161 ---- echoPos_t x, echoPos_t y, echoPos_t z, echoPos_t A, echoPos_t B) { ! echoPos_t R, xxa, yya, zzb, larg; ! ! echoPos_t ret; xxa = pow(x*x, 1/A); yya = pow(y*y, 1/A); zzb = pow(z*z, 1/B); *************** *** 130,134 **** 2*yya/(B*y*(xxa + yya + R)), 2/(B*z*(1 + pow(xxa + yya, A/B)/zzb))); ! return log(pow(xxa + yya, A/B) + zzb); } --- 165,186 ---- 2*yya/(B*y*(xxa + yya + R)), 2/(B*z*(1 + pow(xxa + yya, A/B)/zzb))); ! larg = pow(xxa + yya, A/B) + zzb; ! ! ret = larg > 0 ? log(larg) : ECHO_POS_MIN; ! /* ! if (!AIR_EXISTS(ret)) { ! fprintf(stderr, "_echo_SuperquadZ_lvg: PANIC\n"); ! fprintf(stderr, "x = %g, y = %g, z = %g, A = %g, B = %g\n", ! x, y, z, A, B); ! fprintf(stderr, "pow(%g*%g = %g, %g) = %g\n", ! x, x, x*x, 1/A, xxa); ! fprintf(stderr, "pow(%g*%g = %g, %g) = %g\n", ! y, y, y*y, 1/A, yya); ! fprintf(stderr, "log(pow(%g, %g) = %g + %g) = %g\n", ! xxa + yya, A/B, pow(xxa + yya, A/B), zzb, ret); ! exit(0); ! } ! */ ! return ret; } *************** *** 294,298 **** TT = (Tmin + Tmax)/2; LVALGRAD(VV, dV, TT); ! while (iter < parm->sqNRI && AIR_ABS(VV) > parm->sqTol) { if (tstate->verbose) { fprintf(stderr, "%s%s: iter = %d: TT = %g, VV = %g, dV = %g\n", --- 346,352 ---- TT = (Tmin + Tmax)/2; LVALGRAD(VV, dV, TT); ! ! while (iter < parm->sqNRI && AIR_ABS(VV) > parm->sqTol ! && AIR_EXISTS(VV) && AIR_EXISTS(dV)) { if (tstate->verbose) { fprintf(stderr, "%s%s: iter = %d: TT = %g, VV = %g, dV = %g\n", *************** *** 318,321 **** --- 372,384 ---- } + if (!( AIR_EXISTS(VV) && AIR_EXISTS(dV) )) { + /* we bailed out of the loop above because + we got screwed by numerical errors + --> pretend that there was no intersection, + and HEY this will have to be debugged later */ + return AIR_FALSE; + } + + /* else we succeedded in finding the intersection */ intx->t = TT + saveTmin; VALGRAD(VV, dV, TT); /* puts gradient into grad */ Index: renderEcho.c =================================================================== RCS file: /cvsroot/teem/teem/src/echo/renderEcho.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** renderEcho.c 12 May 2004 11:07:24 -0000 1.27 --- renderEcho.c 26 Jul 2004 07:30:10 -0000 1.28 *************** *** 347,351 **** chan = arg->chanBuff; ! /* arg->verbose = ( (160 == imgUi && 160 == imgVi) ); */ if (arg->verbose) { --- 347,351 ---- chan = arg->chanBuff; ! /* arg->verbose = ( (38 == imgUi && 121 == imgVi) ); */ if (arg->verbose) { Index: color.c =================================================================== RCS file: /cvsroot/teem/teem/src/echo/color.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** color.c 26 May 2004 02:11:00 -0000 1.26 --- color.c 26 Jul 2004 07:30:10 -0000 1.27 *************** *** 130,133 **** --- 130,138 ---- ELL_3V_NORM(Ldir, Ldir, Ldist); Ldot = ELL_3V_DOT(Ldir, intx->norm); + /* HEY: HACK: we have to general per-object-type flag that says, + this kind of object has no notion of in-versus-out facing ... */ + if (echoTypeRectangle == intx->obj->type) { + Ldot = AIR_ABS(Ldot); + } if (Ldot <= 0) { continue; *************** *** 157,160 **** --- 162,168 ---- if (spec) { Ldot = ELL_3V_DOT(Ldir, intx->refl); + if (echoTypeRectangle == intx->obj->type) { + Ldot = AIR_ABS(Ldot); + } if (Ldot > 0) { Ldot = pow(Ldot, sp); |
|
From: Gordon K. <kin...@us...> - 2004-07-26 07:26:26
|
Update of /cvsroot/teem/teem/src/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15481 Modified Files: spots.c Log Message: working on 3D reaction-diffusion textures Index: spots.c =================================================================== RCS file: /cvsroot/teem/teem/src/bin/spots.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** spots.c 7 Jan 2004 15:34:28 -0000 1.5 --- spots.c 26 Jul 2004 07:26:17 -0000 1.6 *************** *** 27,31 **** char *spotsInfo = ("Generate reaction-diffusion textures based on " ! "Turing's formulation. "); int --- 27,32 ---- char *spotsInfo = ("Generate reaction-diffusion textures based on " ! "Turing's second example formulation (page 65) of " ! "his 1954 paper \"The Chemical Basis of Morphogenesis.\" "); int *************** *** 38,42 **** alanContext *actx; int *size, sizeLen, fi, si, wrap, nt, cfn; ! double speed, mch, alphabeta[2], time0, time1, H; Nrrd *ninit=NULL, *nten=NULL, *nparm=NULL; --- 39,43 ---- alanContext *actx; int *size, sizeLen, fi, si, wrap, nt, cfn; ! double deltaT, mch, xch, alphabeta[2], time0, time1, H; Nrrd *ninit=NULL, *nten=NULL, *nparm=NULL; *************** *** 58,62 **** "terms of the reaction-diffusion equations. The default " "values were the ones published by Turing."); ! hestOptAdd(&hopt, "dt", "time", airTypeDouble, 1, 1, &speed, "1.0", "time-step size in Euler integration. Can be larger, at " "risk of hitting divergent instability."); --- 59,63 ---- "terms of the reaction-diffusion equations. The default " "values were the ones published by Turing."); ! hestOptAdd(&hopt, "dt", "time", airTypeDouble, 1, 1, &deltaT, "1.0", "time-step size in Euler integration. Can be larger, at " "risk of hitting divergent instability."); *************** *** 64,69 **** "nominal size of simulation grid element."); hestOptAdd(&hopt, "mch", "change", airTypeDouble, 1, 1, &mch, "0.00001", ! "the minimum change, averaged over the whole texture, in the " ! "first morphogen, that signifies convergence"); hestOptAdd(&hopt, "fi", "frame inter", airTypeInt, 1, 1, &fi, "0", "the number of iterations between which to save out an 8-bit " --- 65,73 ---- "nominal size of simulation grid element."); hestOptAdd(&hopt, "mch", "change", airTypeDouble, 1, 1, &mch, "0.00001", ! "the minimum significant change, averaged over the whole texture, in the " ! "first morphogen: to signify convergence"); ! hestOptAdd(&hopt, "xch", "change", airTypeDouble, 1, 1, &xch, "6", ! "the maximum allowable change, averaged over the whole texture, in the " ! "first morphogen: to signify divergence"); hestOptAdd(&hopt, "fi", "frame inter", airTypeInt, 1, 1, &fi, "0", "the number of iterations between which to save out an 8-bit " *************** *** 116,122 **** || alanParmSet(actx, alanParmAlpha, alphabeta[0]) || alanParmSet(actx, alanParmBeta, alphabeta[1]) ! || alanParmSet(actx, alanParmSpeed, speed) || alanParmSet(actx, alanParmH, H) || alanParmSet(actx, alanParmMinAverageChange, mch) || alanParmSet(actx, alanParmSaveInterval, si) || alanParmSet(actx, alanParmFrameInterval, fi) --- 120,127 ---- || alanParmSet(actx, alanParmAlpha, alphabeta[0]) || alanParmSet(actx, alanParmBeta, alphabeta[1]) ! || alanParmSet(actx, alanParmDeltaT, deltaT) || alanParmSet(actx, alanParmH, H) || alanParmSet(actx, alanParmMinAverageChange, mch) + || alanParmSet(actx, alanParmMaxPixelChange, xch) || alanParmSet(actx, alanParmSaveInterval, si) || alanParmSet(actx, alanParmFrameInterval, fi) |
|
From: Gordon K. <kin...@us...> - 2004-07-26 07:26:12
|
Update of /cvsroot/teem/teem/src/alan In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15443 Modified Files: alan.h coreAlan.c methodsAlan.c Log Message: working on 3D reaction-diffusion textures Index: coreAlan.c =================================================================== RCS file: /cvsroot/teem/teem/src/alan/coreAlan.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** coreAlan.c 12 May 2004 21:52:37 -0000 1.16 --- coreAlan.c 26 Jul 2004 07:26:03 -0000 1.17 *************** *** 47,52 **** biffAdd(ALAN, err); return 1; } ! if (0 == actx->speed) { ! sprintf(err, "%s: speed == 0", me); biffAdd(ALAN, err); return 1; } --- 47,52 ---- biffAdd(ALAN, err); return 1; } ! if (0 == actx->deltaT) { ! sprintf(err, "%s: deltaT == 0", me); biffAdd(ALAN, err); return 1; } *************** *** 158,162 **** parm[2 + 3*I] = parmInit[2 + 3*I]; } else { ! parm[0 + 3*I] = actx->speed; parm[1 + 3*I] = actx->alpha; parm[2 + 3*I] = actx->beta; --- 158,162 ---- parm[2 + 3*I] = parmInit[2 + 3*I]; } else { ! parm[0 + 3*I] = actx->deltaT; parm[1 + 3*I] = actx->alpha; parm[2 + 3*I] = actx->beta; *************** *** 170,174 **** char me[]="_alanPerIteration", fname[AIR_STRLEN_MED]; Nrrd *nslc, *nimg; ! if (!(actx->saveInterval || actx->frameInterval)) { if (actx->verbose && !(iter % 100)) { --- 170,174 ---- char me[]="_alanPerIteration", fname[AIR_STRLEN_MED]; Nrrd *nslc, *nimg; ! if (!(actx->saveInterval || actx->frameInterval)) { if (actx->verbose && !(iter % 100)) { *************** *** 186,190 **** nrrdSlice(nslc=nrrdNew(), actx->_nlev[(iter+1) % 2], 0, 0); nrrdQuantize(nimg=nrrdNew(), nslc, NULL, 8); ! sprintf(fname, "%06d.png", actx->constFilename ? 0 : iter); nrrdSave(fname, nimg, NULL); fprintf(stderr, "%s: iter = %d, averageChange = %g, saved %s\n", --- 186,191 ---- nrrdSlice(nslc=nrrdNew(), actx->_nlev[(iter+1) % 2], 0, 0); nrrdQuantize(nimg=nrrdNew(), nslc, NULL, 8); ! sprintf(fname, (2 == actx->dim ? "%06d.png" : "%06d.nrrd"), ! actx->constFilename ? 0 : iter); nrrdSave(fname, nimg, NULL); fprintf(stderr, "%s: iter = %d, averageChange = %g, saved %s\n", *************** *** 211,231 **** void * ! _alanTuring2DWorker(void *_task) { alan_t *tendata, *ten, Dxx, Dxy, Dyy, react, ! *lev0, *lev1, *parm, speed, alpha, beta, A, B, ! *v[9], lapA, lapB, deltaA, deltaB, diffA, diffB, change; ! int iter, stop, startY, endY, idx, px, mx, py, my, sx, sy, x, y; alanTask *task; task = (alanTask *)_task; sx = task->actx->size[0]; sy = task->actx->size[1]; parm = (alan_t*)(task->actx->nparm->data); ! diffA = task->actx->diffA/(task->actx->H*task->actx->H); ! diffB = task->actx->diffB/(task->actx->H*task->actx->H); ! startY = task->idx*sy/task->actx->numThreads; ! endY = (task->idx+1)*sy/task->actx->numThreads; tendata = task->actx->nten ? (alan_t *)task->actx->nten->data : NULL; for (iter = 0; alanStopNot == task->actx->stop && iter < task->actx->maxIteration; --- 212,248 ---- void * ! _alanTuringWorker(void *_task) { alan_t *tendata, *ten, Dxx, Dxy, Dyy, react, ! *lev0, *lev1, *parm, deltaT, alpha, beta, A, B, ! *v[27], lapA, lapB, deltaA, deltaB, diffA, diffB, change; ! int dim, iter, stop, startW, endW, idx, ! px, mx, py, my, pz, mz, ! startY, endY, startZ, endZ, sx, sy, sz, x, y, z; alanTask *task; task = (alanTask *)_task; + dim = task->actx->dim; sx = task->actx->size[0]; sy = task->actx->size[1]; + sz = (2 == dim ? 1 : task->actx->size[2]); parm = (alan_t*)(task->actx->nparm->data); ! diffA = task->actx->diffA/pow(task->actx->H, dim); ! diffB = task->actx->diffB/pow(task->actx->H, dim); ! startW = task->idx*sy/task->actx->numThreads; ! endW = (task->idx+1)*sy/task->actx->numThreads; tendata = task->actx->nten ? (alan_t *)task->actx->nten->data : NULL; + if (2 == dim) { + startZ = 0; + endZ = 1; + startY = startW; + endY = endW; + } else { + startZ = startW; + endZ = endW; + startY = 0; + endY = sy; + } + for (iter = 0; alanStopNot == task->actx->stop && iter < task->actx->maxIteration; *************** *** 240,316 **** stop = alanStopNot; change = 0; ! for (y = startY; y < endY; y++) { if (task->actx->wrap) { ! py = AIR_MOD(y+1, sy); ! my = AIR_MOD(y-1, sy); } else { ! py = AIR_MIN(y+1, sy-1); ! my = AIR_MAX(y-1, 0); } ! for (x = 0; x < sx; x++) { if (task->actx->wrap) { ! px = AIR_MOD(x+1, sx); ! mx = AIR_MOD(x-1, sx); ! } else { ! px = AIR_MIN(x+1, sx-1); ! mx = AIR_MAX(x-1, 0); ! } ! idx = x + sx*(y); ! ten = tendata + 4*(x + sx*(y)); ! A = lev0[0 + 2*idx]; ! B = lev0[1 + 2*idx]; ! speed = parm[0 + 3*idx]; ! alpha = parm[1 + 3*idx]; ! beta = parm[2 + 3*idx]; ! v[1] = lev0 + 2*( x + sx*(my)); ! v[3] = lev0 + 2*(mx + sx*( y)); ! v[5] = lev0 + 2*(px + sx*( y)); ! v[7] = lev0 + 2*( x + sx*(py)); ! if (tendata) { ! /* ! ** 0 1 2 Dxy/2 Dyy -Dxy/2 ! ** 3 4 5 Dxx -2*(Dxx + Dyy) Dxx ! ** 6 7 8 -Dxy/2 Dyy Dxy/2 ! */ ! v[0] = lev0 + 2*(mx + sx*(my)); ! v[2] = lev0 + 2*(px + sx*(my)); ! v[6] = lev0 + 2*(mx + sx*(py)); ! v[8] = lev0 + 2*(px + sx*(py)); ! Dxx = ten[1]; ! Dxy = ten[2]; ! Dyy = ten[3]; ! lapA = (Dxy*(v[0][0] + v[8][0] - v[2][0] - v[6][0])/2 ! + Dxx*(v[3][0] + v[5][0]) + Dyy*(v[1][0] + v[7][0]) ! - 2*(Dxx + Dyy)*A); ! lapB = (Dxy*(v[0][1] + v[8][1] - v[2][1] - v[6][1])/2 ! + Dxx*(v[3][1] + v[5][1]) + Dyy*(v[1][1] + v[7][1]) ! - 2*(Dxx + Dyy)*B); ! react = ten[0]; } else { ! lapA = v[1][0] + v[3][0] + v[5][0] + v[7][0] - 4*A; ! lapB = v[1][1] + v[3][1] + v[5][1] + v[7][1] - 4*B; ! react = 1; ! } ! ! deltaA = speed*(react*task->actx->K*(alpha - A*B) + diffA*lapA); ! if (AIR_ABS(deltaA) > task->actx->maxPixelChange) { ! stop = alanStopDiverged; } ! change += AIR_ABS(deltaA); ! deltaB = speed*(react*task->actx->K*(A*B - B - beta) + diffB*lapB); ! if (!( AIR_EXISTS(deltaA) && AIR_EXISTS(deltaB) )) { ! stop = alanStopNonExist; } - - A += deltaA; - B = AIR_MAX(0, B + deltaB); - lev1[0 + 2*idx] = A; - lev1[1 + 2*idx] = B; } } ! /* add change to global sum in a threadsafe way */ airThreadMutexLock(task->actx->changeMutex); ! task->actx->averageChange += change/(sx*sy); task->actx->changeCount += 1; if (task->actx->changeCount == task->actx->numThreads) { --- 257,380 ---- stop = alanStopNot; change = 0; ! for (z = startZ; z < endZ; z++) { if (task->actx->wrap) { ! pz = AIR_MOD(z+1, sz); ! mz = AIR_MOD(z-1, sz); } else { ! pz = AIR_MIN(z+1, sz-1); ! mz = AIR_MAX(z-1, 0); } ! for (y = startY; y < endY; y++) { if (task->actx->wrap) { ! py = AIR_MOD(y+1, sy); ! my = AIR_MOD(y-1, sy); } else { ! py = AIR_MIN(y+1, sy-1); ! my = AIR_MAX(y-1, 0); } ! for (x = 0; x < sx; x++) { ! if (task->actx->wrap) { ! px = AIR_MOD(x+1, sx); ! mx = AIR_MOD(x-1, sx); ! } else { ! px = AIR_MIN(x+1, sx-1); ! mx = AIR_MAX(x-1, 0); ! } ! idx = x + sx*(y + sy*z); ! A = lev0[0 + 2*idx]; ! B = lev0[1 + 2*idx]; ! deltaT = parm[0 + 3*idx]; ! alpha = parm[1 + 3*idx]; ! beta = parm[2 + 3*idx]; ! if (2 == dim) { ! /* ! ** 0 1 2 ----> X ! ** 3 4 5 ! ** 6 7 8 ! ** | ! ** v Y ! */ ! v[1] = lev0 + 2*( x + sx*(my)); ! v[3] = lev0 + 2*(mx + sx*( y)); ! v[5] = lev0 + 2*(px + sx*( y)); ! v[7] = lev0 + 2*( x + sx*(py)); ! if (tendata) { ! ten = tendata + 4*(x + sx*(y)); ! /* ! ** 0 1 2 Dxy/2 Dyy -Dxy/2 ! ** 3 4 5 Dxx -2*(Dxx + Dyy) Dxx ! ** 6 7 8 -Dxy/2 Dyy Dxy/2 ! */ ! v[0] = lev0 + 2*(mx + sx*(my)); ! v[2] = lev0 + 2*(px + sx*(my)); ! v[6] = lev0 + 2*(mx + sx*(py)); ! v[8] = lev0 + 2*(px + sx*(py)); ! Dxx = ten[1]; ! Dxy = ten[2]; ! Dyy = ten[3]; ! lapA = (Dxy*(v[0][0] + v[8][0] - v[2][0] - v[6][0])/2 ! + Dxx*(v[3][0] + v[5][0]) + Dyy*(v[1][0] + v[7][0]) ! - 2*(Dxx + Dyy)*A); ! lapB = (Dxy*(v[0][1] + v[8][1] - v[2][1] - v[6][1])/2 ! + Dxx*(v[3][1] + v[5][1]) + Dyy*(v[1][1] + v[7][1]) ! - 2*(Dxx + Dyy)*B); ! react = ten[0]; ! } else { ! lapA = v[1][0] + v[3][0] + v[5][0] + v[7][0] - 4*A; ! lapB = v[1][1] + v[3][1] + v[5][1] + v[7][1] - 4*B; ! react = 1; ! } ! } else { ! /* 3 == dim */ ! /* ! ** 0 1 2 ---- X ! ** 3 4 5 ! ** 6 7 8 ! ** / ! ** / 9 10 11 ! ** Y 12 13 14 ! ** 15 16 17 ! ** ! ** 18 19 20 ! ** 21 22 23 ! ** 24 25 26 ! ** | ! ** | ! ** Z ! */ ! v[ 4] = lev0 + 2*( x + sx*( y + sy*(mz))); ! v[10] = lev0 + 2*( x + sx*(my + sy*( z))); ! v[12] = lev0 + 2*(mx + sx*( y + sy*( z))); ! v[14] = lev0 + 2*(px + sx*( y + sy*( z))); ! v[16] = lev0 + 2*( x + sx*(py + sy*( z))); ! v[22] = lev0 + 2*( x + sx*( y + sy*(pz))); ! lapA = (v[ 4][0] + v[10][0] + v[12][0] ! + v[14][0] + v[16][0] + v[22][0] - 6*A); ! lapB = (v[ 4][1] + v[10][1] + v[12][1] ! + v[14][1] + v[16][1] + v[22][1] - 6*B); ! react = 1; ! } ! ! deltaA = deltaT*(react*task->actx->K*(alpha - A*B) + diffA*lapA); ! if (AIR_ABS(deltaA) > task->actx->maxPixelChange) { ! stop = alanStopDiverged; ! } ! change += AIR_ABS(deltaA); ! deltaB = deltaT*(react*task->actx->K*(A*B - B - beta) + diffB*lapB); ! if (!( AIR_EXISTS(deltaA) && AIR_EXISTS(deltaB) )) { ! stop = alanStopNonExist; ! } ! ! A += deltaA; ! B = AIR_MAX(0, B + deltaB); ! lev1[0 + 2*idx] = A; ! lev1[1 + 2*idx] = B; } } } ! /* add change to global sum in a threadsafe way */ airThreadMutexLock(task->actx->changeMutex); ! task->actx->averageChange += change/(sx*sy*sz); task->actx->changeCount += 1; if (task->actx->changeCount == task->actx->numThreads) { *************** *** 378,382 **** task[tid].idx = tid; task[tid].thread = airThreadNew(); ! airThreadStart(task[tid].thread, _alanTuring2DWorker, (void *)&(task[tid])); } --- 442,446 ---- task[tid].idx = tid; task[tid].thread = airThreadNew(); ! airThreadStart(task[tid].thread, _alanTuringWorker, (void *)&(task[tid])); } Index: methodsAlan.c =================================================================== RCS file: /cvsroot/teem/teem/src/alan/methodsAlan.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** methodsAlan.c 7 Jan 2004 15:34:27 -0000 1.11 --- methodsAlan.c 26 Jul 2004 07:26:03 -0000 1.12 *************** *** 44,48 **** actx->alpha = 16; actx->beta = 12; ! actx->speed = 1.0; actx->initA = actx->initB = 0; actx->diffA = actx->diffB = 0; --- 44,48 ---- actx->alpha = 16; actx->beta = 12; ! actx->deltaT = 1.0; actx->initA = actx->initB = 0; actx->diffA = actx->diffB = 0; *************** *** 257,262 **** actx->constFilename = parmI; break; ! case alanParmSpeed: ! actx->speed = parm; break; case alanParmDiffA: --- 257,262 ---- actx->constFilename = parmI; break; ! case alanParmDeltaT: ! actx->deltaT = parm; break; case alanParmDiffA: Index: alan.h =================================================================== RCS file: /cvsroot/teem/teem/src/alan/alan.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** alan.h 19 Feb 2004 03:44:08 -0000 1.12 --- alan.h 26 Jul 2004 07:26:03 -0000 1.13 *************** *** 52,56 **** alanParmMaxIteration, alanParmRandRange, ! alanParmSpeed, alanParmDiffA, alanParmDiffB, --- 52,56 ---- alanParmMaxIteration, alanParmRandRange, ! alanParmDeltaT, alanParmDiffA, alanParmDiffB, *************** *** 113,117 **** this is exceeded */ alpha, beta, /* variables for turing */ ! speed, /* euler integration step size */ initA, initB, /* initial (constant) values for each morphogen */ diffA, diffB, /* base diffusion rates for each morphogen */ --- 113,117 ---- this is exceeded */ alpha, beta, /* variables for turing */ ! deltaT, /* euler integration step size */ initA, initB, /* initial (constant) values for each morphogen */ diffA, diffB, /* base diffusion rates for each morphogen */ |
|
From: Gordon K. <kin...@us...> - 2004-07-26 01:22:14
|
Update of /cvsroot/teem/teem/src/unrrdu In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2425/unrrdu Modified Files: 1op.c Log Message: added usage note about log base 2, which has always been there Index: 1op.c =================================================================== RCS file: /cvsroot/teem/teem/src/unrrdu/1op.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** 1op.c 12 May 2004 21:30:04 -0000 1.19 --- 1op.c 26 Jul 2004 01:22:04 -0000 1.20 *************** *** 39,42 **** --- 39,43 ---- "same as in C\n " "\b\bo \"exp\", \"log\", \"log10\", \"log1p\": same as in C\n " + "\b\bo \"log2\": log base 2\n " "\b\bo \"sqrt\", \"cbrt\", \"ceil\", \"floor\": same as in C\n " "\b\bo \"erf\": error function (integral of Gaussian)\n " |
|
From: Gordon K. <kin...@us...> - 2004-07-26 01:21:28
|
Update of /cvsroot/teem/teem/src/nrrd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2342/nrrd Modified Files: nrrdEnums.h enumsNrrd.c arith.c Log Message: added signed exponentiation Index: arith.c =================================================================== RCS file: /cvsroot/teem/teem/src/nrrd/arith.c,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** arith.c 12 May 2004 10:05:56 -0000 1.36 --- arith.c 26 Jul 2004 01:21:19 -0000 1.37 *************** *** 229,232 **** --- 229,233 ---- double _nrrdBinaryOpDivide(double a, double b) {return a / b;} double _nrrdBinaryOpPow(double a, double b) {return pow(a,b);} + double _nrrdBinaryOpSgnPow(double a, double b) {return airSgnPow(a,b);} double _nrrdBinaryOpMod(double a, double b) { return AIR_MOD((int)a,(int)b);} *************** *** 253,256 **** --- 254,258 ---- _nrrdBinaryOpDivide, _nrrdBinaryOpPow, + _nrrdBinaryOpSgnPow, _nrrdBinaryOpMod, _nrrdBinaryOpFmod, Index: nrrdEnums.h =================================================================== RCS file: /cvsroot/teem/teem/src/nrrd/nrrdEnums.h,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** nrrdEnums.h 23 Jun 2004 01:43:46 -0000 1.47 --- nrrdEnums.h 26 Jul 2004 01:21:19 -0000 1.48 *************** *** 429,448 **** nrrdBinaryOpDivide, /* 4 */ nrrdBinaryOpPow, /* 5 */ ! nrrdBinaryOpMod, /* 6 */ ! nrrdBinaryOpFmod, /* 7 */ ! nrrdBinaryOpAtan2, /* 8 */ ! nrrdBinaryOpMin, /* 9 */ ! nrrdBinaryOpMax, /* 10 */ ! nrrdBinaryOpLT, /* 11 */ ! nrrdBinaryOpLTE, /* 12 */ ! nrrdBinaryOpGT, /* 13 */ ! nrrdBinaryOpGTE, /* 14 */ ! nrrdBinaryOpCompare, /* 15 */ ! nrrdBinaryOpEqual, /* 16 */ ! nrrdBinaryOpNotEqual, /* 17 */ ! nrrdBinaryOpExists, /* 18 */ nrrdBinaryOpLast }; ! #define NRRD_BINARY_OP_MAX 18 /* --- 429,449 ---- nrrdBinaryOpDivide, /* 4 */ nrrdBinaryOpPow, /* 5 */ ! nrrdBinaryOpSgnPow, /* 6 */ ! nrrdBinaryOpMod, /* 7 */ ! nrrdBinaryOpFmod, /* 8 */ ! nrrdBinaryOpAtan2, /* 9 */ ! nrrdBinaryOpMin, /* 10 */ ! nrrdBinaryOpMax, /* 11 */ ! nrrdBinaryOpLT, /* 12 */ ! nrrdBinaryOpLTE, /* 13 */ ! nrrdBinaryOpGT, /* 14 */ ! nrrdBinaryOpGTE, /* 15 */ ! nrrdBinaryOpCompare, /* 16 */ ! nrrdBinaryOpEqual, /* 17 */ ! nrrdBinaryOpNotEqual, /* 18 */ ! nrrdBinaryOpExists, /* 19 */ nrrdBinaryOpLast }; ! #define NRRD_BINARY_OP_MAX 19 /* Index: enumsNrrd.c =================================================================== RCS file: /cvsroot/teem/teem/src/nrrd/enumsNrrd.c,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** enumsNrrd.c 23 Jun 2004 01:42:14 -0000 1.36 --- enumsNrrd.c 26 Jul 2004 01:21:19 -0000 1.37 *************** *** 854,857 **** --- 854,858 ---- "/", "^", + "spow", "%", "fmod", *************** *** 877,880 **** --- 878,882 ---- "divide", "power", + "signed power", "integer modulo", "fractional modulo", *************** *** 897,900 **** --- 899,903 ---- #define nbDiv nrrdBinaryOpDivide #define nbPow nrrdBinaryOpPow + #define nbSpw nrrdBinaryOpSgnPow #define nbMod nrrdBinaryOpMod #define nbFmd nrrdBinaryOpFmod *************** *** 918,921 **** --- 921,925 ---- "/", "divide", "quotient", "^", "pow", "power", + "spow", "sgnpow", "sgnpower", "%", "mod", "modulo", "fmod", *************** *** 941,944 **** --- 945,949 ---- nbDiv, nbDiv, nbDiv, nbPow, nbPow, nbPow, + nbSpw, nbSpw, nbSpw, nbMod, nbMod, nbMod, nbFmd, |
|
From: Gordon K. <kin...@us...> - 2004-07-26 01:21:27
|
Update of /cvsroot/teem/teem/src/unrrdu In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2342/unrrdu Modified Files: 2op.c Log Message: added signed exponentiation Index: 2op.c =================================================================== RCS file: /cvsroot/teem/teem/src/unrrdu/2op.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** 2op.c 7 Jan 2004 15:34:31 -0000 1.23 --- 2op.c 26 Jul 2004 01:21:18 -0000 1.24 *************** *** 43,46 **** --- 43,47 ---- "add, subtract, multiply, divide\n " "\b\bo \"^\": exponentiation (pow)\n " + "\b\bo \"spow\": signed exponentiation: sgn(x)pow(abs(x),p)\n " "\b\bo \"%\": integer modulo\n " "\b\bo \"fmod\": same as fmod() in C\n " |
|
From: Gordon K. <kin...@us...> - 2004-07-13 21:41:55
|
Update of /cvsroot/teem/NrrdIO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20043 Modified Files: biffbiff.c encodingHex.c enum.c methodsNrrd.c parseNrrd.c simple.c string.c Log Message: fixing warnings Index: methodsNrrd.c =================================================================== RCS file: /cvsroot/teem/NrrdIO/methodsNrrd.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** methodsNrrd.c 26 May 2004 12:52:21 -0000 1.2 --- methodsNrrd.c 13 Jul 2004 21:41:45 -0000 1.3 *************** *** 93,97 **** nio->dataFN = airFree(nio->dataFN); nio->line = airFree(nio->line); ! nio = airFree(nio); /* the NrrdIoState never owned nio->oldData; we don't free it */ return NULL; --- 93,97 ---- nio->dataFN = airFree(nio->dataFN); nio->line = airFree(nio->line); ! airFree(nio); /* no NULL assignment, else compile warnings */ /* the NrrdIoState never owned nio->oldData; we don't free it */ return NULL; *************** *** 210,214 **** nrrdKeyValueClear(nrrd); nrrd->kvpArr = airArrayNix(nrrd->kvpArr); ! nrrd = airFree(nrrd); } return NULL; --- 210,214 ---- nrrdKeyValueClear(nrrd); nrrd->kvpArr = airArrayNix(nrrd->kvpArr); ! airFree(nrrd); /* no NULL assignment, else compile warnings */ } return NULL; Index: enum.c =================================================================== RCS file: /cvsroot/teem/NrrdIO/enum.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** enum.c 26 May 2004 12:52:21 -0000 1.3 --- enum.c 13 Jul 2004 21:41:45 -0000 1.4 *************** *** 80,84 **** char * airEnumStr(airEnum *enm, int val) { ! int idx = 0; idx = _airEnumIndex(enm, val); --- 80,84 ---- char * airEnumStr(airEnum *enm, int val) { ! int idx; idx = _airEnumIndex(enm, val); *************** *** 88,92 **** char * airEnumDesc(airEnum *enm, int val) { ! int idx = 0; idx = _airEnumIndex(enm, val); --- 88,92 ---- char * airEnumDesc(airEnum *enm, int val) { ! int idx; idx = _airEnumIndex(enm, val); Index: simple.c =================================================================== RCS file: /cvsroot/teem/NrrdIO/simple.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** simple.c 26 May 2004 13:10:19 -0000 1.3 --- simple.c 13 Jul 2004 21:41:45 -0000 1.4 *************** *** 129,133 **** sprintf(nout->content, "%s(%s%s%s)", func, content, airStrlen(buff) ? "," : "", buff); ! buff = airFree(buff); return 0; } --- 129,133 ---- sprintf(nout->content, "%s(%s%s%s)", func, content, airStrlen(buff) ? "," : "", buff); ! airFree(buff); /* no NULL assignment, else compile warnings */ return 0; } Index: biffbiff.c =================================================================== RCS file: /cvsroot/teem/NrrdIO/biffbiff.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** biffbiff.c 26 May 2004 12:52:21 -0000 1.2 --- biffbiff.c 13 Jul 2004 21:41:45 -0000 1.3 *************** *** 322,326 **** biffGet(const char *key) { int i, max, len, sum; ! char me[] = "biffGet", *ret = NULL, *buf; _biffEntry *e; --- 322,326 ---- biffGet(const char *key) { int i, max, len, sum; ! char me[] = "biffGet", *ret, *buf; _biffEntry *e; *************** *** 356,360 **** strcat(ret, buf); } ! free(buf); return(ret); --- 356,360 ---- strcat(ret, buf); } ! free(buf); /* no NULL assignment, else compile warnings */ return(ret); Index: string.c =================================================================== RCS file: /cvsroot/teem/NrrdIO/string.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** string.c 26 May 2004 12:52:21 -0000 1.2 --- string.c 13 Jul 2004 21:41:45 -0000 1.3 *************** *** 143,147 **** t = airStrtok(NULL, ct, &l); } ! s = airFree(s); } return n; --- 143,147 ---- t = airStrtok(NULL, ct, &l); } ! airFree(s); /* no NULL assignment to s, else compile warnings */ } return n; Index: parseNrrd.c =================================================================== RCS file: /cvsroot/teem/NrrdIO/parseNrrd.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** parseNrrd.c 26 May 2004 12:52:21 -0000 1.2 --- parseNrrd.c 13 Jul 2004 21:41:45 -0000 1.3 *************** *** 645,649 **** char me[]="_nrrdReadNrrdParseField", err[AIR_STRLEN_MED], *next, *buff, *colon, *keysep; ! int fld=nrrdField_unknown, noField=AIR_FALSE, badField=AIR_FALSE; next = nio->line + nio->pos; --- 645,649 ---- char me[]="_nrrdReadNrrdParseField", err[AIR_STRLEN_MED], *next, *buff, *colon, *keysep; ! int fld=nrrdField_unknown, noField, badField=AIR_FALSE; next = nio->line + nio->pos; Index: encodingHex.c =================================================================== RCS file: /cvsroot/teem/NrrdIO/encodingHex.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** encodingHex.c 26 May 2004 12:52:21 -0000 1.2 --- encodingHex.c 13 Jul 2004 21:41:45 -0000 1.3 *************** *** 85,89 **** nibIdx = 0; nibNum = 2*nrrdElementNumber(nrrd)*nrrdElementSize(nrrd); ! if (nibNum/nrrdElementNumber(nrrd) != 2*nrrdElementSize(nrrd)) { sprintf(err, "%s: size_t can't hold 2*(#bytes in array)\n", me); biffAdd(NRRD, err); return 1; --- 85,89 ---- nibIdx = 0; nibNum = 2*nrrdElementNumber(nrrd)*nrrdElementSize(nrrd); ! if (nibNum/nrrdElementNumber(nrrd) != (size_t)(2*nrrdElementSize(nrrd))) { sprintf(err, "%s: size_t can't hold 2*(#bytes in array)\n", me); biffAdd(NRRD, err); return 1; |
|
From: Gordon K. <kin...@us...> - 2004-07-13 21:40:38
|
Update of /cvsroot/teem/teem/src/air In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19641/air Modified Files: enum.c string.c Log Message: fixing warnings in NrrdIO-related code Index: enum.c =================================================================== RCS file: /cvsroot/teem/teem/src/air/enum.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** enum.c 13 Feb 2004 03:40:58 -0000 1.7 --- enum.c 13 Jul 2004 21:40:20 -0000 1.8 *************** *** 69,73 **** char * airEnumStr(airEnum *enm, int val) { ! int idx = 0; idx = _airEnumIndex(enm, val); --- 69,73 ---- char * airEnumStr(airEnum *enm, int val) { ! int idx; idx = _airEnumIndex(enm, val); *************** *** 77,81 **** char * airEnumDesc(airEnum *enm, int val) { ! int idx = 0; idx = _airEnumIndex(enm, val); --- 77,81 ---- char * airEnumDesc(airEnum *enm, int val) { ! int idx; idx = _airEnumIndex(enm, val); Index: string.c =================================================================== RCS file: /cvsroot/teem/teem/src/air/string.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** string.c 13 Mar 2004 20:03:08 -0000 1.8 --- string.c 13 Jul 2004 21:40:20 -0000 1.9 *************** *** 132,136 **** t = airStrtok(NULL, ct, &l); } ! s = airFree(s); } return n; --- 132,136 ---- t = airStrtok(NULL, ct, &l); } ! airFree(s); /* no NULL assignment to s, else compile warnings */ } return n; |
|
From: Gordon K. <kin...@us...> - 2004-07-13 21:40:38
|
Update of /cvsroot/teem/teem/src/nrrd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19641/nrrd Modified Files: encodingHex.c methodsNrrd.c parseNrrd.c simple.c Log Message: fixing warnings in NrrdIO-related code Index: parseNrrd.c =================================================================== RCS file: /cvsroot/teem/teem/src/nrrd/parseNrrd.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** parseNrrd.c 30 Mar 2004 19:25:09 -0000 1.22 --- parseNrrd.c 13 Jul 2004 21:40:21 -0000 1.23 *************** *** 634,638 **** char me[]="_nrrdReadNrrdParseField", err[AIR_STRLEN_MED], *next, *buff, *colon, *keysep; ! int fld=nrrdField_unknown, noField=AIR_FALSE, badField=AIR_FALSE; next = nio->line + nio->pos; --- 634,638 ---- char me[]="_nrrdReadNrrdParseField", err[AIR_STRLEN_MED], *next, *buff, *colon, *keysep; ! int fld=nrrdField_unknown, noField, badField=AIR_FALSE; next = nio->line + nio->pos; Index: encodingHex.c =================================================================== RCS file: /cvsroot/teem/teem/src/nrrd/encodingHex.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** encodingHex.c 7 Jan 2004 15:34:30 -0000 1.6 --- encodingHex.c 13 Jul 2004 21:40:21 -0000 1.7 *************** *** 74,78 **** nibIdx = 0; nibNum = 2*nrrdElementNumber(nrrd)*nrrdElementSize(nrrd); ! if (nibNum/nrrdElementNumber(nrrd) != 2*nrrdElementSize(nrrd)) { sprintf(err, "%s: size_t can't hold 2*(#bytes in array)\n", me); biffAdd(NRRD, err); return 1; --- 74,78 ---- nibIdx = 0; nibNum = 2*nrrdElementNumber(nrrd)*nrrdElementSize(nrrd); ! if (nibNum/nrrdElementNumber(nrrd) != (size_t)(2*nrrdElementSize(nrrd))) { sprintf(err, "%s: size_t can't hold 2*(#bytes in array)\n", me); biffAdd(NRRD, err); return 1; Index: methodsNrrd.c =================================================================== RCS file: /cvsroot/teem/teem/src/nrrd/methodsNrrd.c,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** methodsNrrd.c 25 May 2004 15:41:52 -0000 1.43 --- methodsNrrd.c 13 Jul 2004 21:40:21 -0000 1.44 *************** *** 82,86 **** nio->dataFN = airFree(nio->dataFN); nio->line = airFree(nio->line); ! nio = airFree(nio); /* the NrrdIoState never owned nio->oldData; we don't free it */ return NULL; --- 82,86 ---- nio->dataFN = airFree(nio->dataFN); nio->line = airFree(nio->line); ! airFree(nio); /* no NULL assignment, else compile warnings */ /* the NrrdIoState never owned nio->oldData; we don't free it */ return NULL; *************** *** 293,297 **** nrrdKeyValueClear(nrrd); nrrd->kvpArr = airArrayNix(nrrd->kvpArr); ! nrrd = airFree(nrrd); } return NULL; --- 293,297 ---- nrrdKeyValueClear(nrrd); nrrd->kvpArr = airArrayNix(nrrd->kvpArr); ! airFree(nrrd); /* no NULL assignment, else compile warnings */ } return NULL; Index: simple.c =================================================================== RCS file: /cvsroot/teem/teem/src/nrrd/simple.c,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** simple.c 26 May 2004 13:09:32 -0000 1.61 --- simple.c 13 Jul 2004 21:40:21 -0000 1.62 *************** *** 118,122 **** sprintf(nout->content, "%s(%s%s%s)", func, content, airStrlen(buff) ? "," : "", buff); ! buff = airFree(buff); return 0; } --- 118,122 ---- sprintf(nout->content, "%s(%s%s%s)", func, content, airStrlen(buff) ? "," : "", buff); ! airFree(buff); /* no NULL assignment, else compile warnings */ return 0; } |
|
From: Gordon K. <kin...@us...> - 2004-07-13 21:40:38
|
Update of /cvsroot/teem/teem/src/biff In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19641/biff Modified Files: biffbiff.c Log Message: fixing warnings in NrrdIO-related code Index: biffbiff.c =================================================================== RCS file: /cvsroot/teem/teem/src/biff/biffbiff.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** biffbiff.c 7 Jan 2004 15:34:28 -0000 1.2 --- biffbiff.c 13 Jul 2004 21:40:21 -0000 1.3 *************** *** 311,315 **** biffGet(const char *key) { int i, max, len, sum; ! char me[] = "biffGet", *ret = NULL, *buf; _biffEntry *e; --- 311,315 ---- biffGet(const char *key) { int i, max, len, sum; ! char me[] = "biffGet", *ret, *buf; _biffEntry *e; *************** *** 345,349 **** strcat(ret, buf); } ! free(buf); return(ret); --- 345,349 ---- strcat(ret, buf); } ! free(buf); /* no NULL assignment, else compile warnings */ return(ret); |
|
From: Gordon K. <kin...@us...> - 2004-07-13 21:39:18
|
Update of /cvsroot/teem/teem/src/ell/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19417 Modified Files: wheel.c Log Message: more options, hooray Index: wheel.c =================================================================== RCS file: /cvsroot/teem/teem/src/ell/test/wheel.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wheel.c 23 Jun 2004 01:45:05 -0000 1.3 --- wheel.c 13 Jul 2004 21:39:09 -0000 1.4 *************** *** 216,220 **** airArray *mop; ! double tval[6], ABC[3], geom[3], xroot[3], yroot[3], bbox[4], psc; wheelPS wps; int correct, labels; --- 216,220 ---- airArray *mop; ! double tval[6], ABC[3], geom[3], xroot[3], yroot[3], bbox[4], htick, psc; wheelPS wps; int correct, labels; *************** *** 240,243 **** --- 240,245 ---- hestOptAdd(&hopt, "labels", NULL, airTypeInt, 0, 0, &labels, NULL, "put little labels on things; fix with psfrag in LaTeX"); + hestOptAdd(&hopt, "htick", "pos", airTypeDouble, 1, 1, &htick, "nan", + "location of single tick mark on horizontal axis"); hestOptAdd(&hopt, "bb", "bbox", airTypeDouble, 4, 4, bbox, "nan nan nan nan", "bounding box, in world space around the " *************** *** 344,347 **** --- 346,354 ---- wheelLine(&wps, xroot[1], -0.02*geom[1], xroot[1], 0.02*geom[1]); wheelLine(&wps, xroot[2], -0.02*geom[1], xroot[2], 0.02*geom[1]); + if (AIR_EXISTS(htick)) { + wheelWidth(&wps, 10); + wheelLine(&wps, htick, -0.04, htick, 0.04); + } + /* labels, if wanted */ |
|
From: Gordon K. <kin...@us...> - 2004-06-30 17:18:48
|
Update of /cvsroot/teem/NrrdIO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7720 Modified Files: enumsNrrd.c sane.c Log Message: new sanity checks for nan, and fixes for nrrd kinds Index: sane.c =================================================================== RCS file: /cvsroot/teem/NrrdIO/sane.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** sane.c 26 May 2004 12:52:21 -0000 1.3 --- sane.c 30 Jun 2004 17:18:38 -0000 1.4 *************** *** 40,44 **** int airSanity(void) { ! double nan, pinf, ninf; float nanF, pinfF, ninfF; int tmpI, sign, exp, frac, size; --- 40,44 ---- int airSanity(void) { ! double nan, pinf, ninf, pzero; float nanF, pinfF, ninfF; int tmpI, sign, exp, frac, size; *************** *** 90,94 **** return airInsane_nInfExists; } ! nan = pinf/pinf; if (AIR_EXISTS(nan)) { return airInsane_NaNExists; --- 90,95 ---- return airInsane_nInfExists; } ! pzero = 0.0; ! nan = pzero/pzero; if (AIR_EXISTS(nan)) { return airInsane_NaNExists; Index: enumsNrrd.c =================================================================== RCS file: /cvsroot/teem/NrrdIO/enumsNrrd.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** enumsNrrd.c 26 May 2004 12:52:21 -0000 1.2 --- enumsNrrd.c 30 Jun 2004 17:18:38 -0000 1.3 *************** *** 360,377 **** "scalar", "complex", ! "2-vector", "2vector", ! "3-color", "3color", ! "4-color", "4color", ! "3-vector", "3vector", ! "3-normal", "3normal", ! "4-vector", "4vector", ! "2D-sym-tensor", "2Dsymtensor", ! "2D-mask-sym-tensor", "2Dmasksymtensor", ! "2D-tensor", "2Dtensor", ! "2D-mask-tensor", "2Dmasktensor", ! "3D-sym-tensor", "3Dsymtensor", "6-tensor", ! "3D-mask-sym-tensor", "3Dmasksymtensor", "7-tensor", ! "3D-tensor", "3Dtensor", "9-tensor", ! "3D-mask-tensor", "3Dmasktensor", "" }; --- 360,377 ---- "scalar", "complex", ! "2-vector", ! "3-color", ! "4-color", ! "3-vector", ! "3-normal", ! "4-vector", ! "2D-symmetric-tensor", "2D-sym-tensor", ! "2D-masked-symmetric-tensor", "2D-masked-sym-tensor", ! "2D-tensor", ! "2D-masked-tensor", ! "3D-symmetric-tensor", "3D-sym-tensor", ! "3D-masked-symmetric-tensor", "3D-masked-sym-tensor", ! "3D-tensor", ! "3D-masked-tensor", "" }; *************** *** 385,402 **** nrrdKindComplex, nrrdKind2Vector, ! nrrdKind3Color, nrrdKind3Color, ! nrrdKind4Color, nrrdKind4Color, ! nrrdKind3Vector, nrrdKind3Vector, ! nrrdKind3Normal, nrrdKind3Normal, ! nrrdKind4Vector, nrrdKind4Vector, nrrdKind2DSymTensor, nrrdKind2DSymTensor, nrrdKind2DMaskedSymTensor, nrrdKind2DMaskedSymTensor, ! nrrdKind2DTensor, nrrdKind2DTensor, ! nrrdKind2DMaskedTensor, nrrdKind2DMaskedTensor, ! nrrdKind3DSymTensor, nrrdKind3DSymTensor, nrrdKind3DSymTensor, nrrdKind3DMaskedSymTensor, nrrdKind3DMaskedSymTensor, ! nrrdKind3DMaskedSymTensor, ! nrrdKind3DTensor, nrrdKind3DTensor, nrrdKind3DTensor, ! nrrdKind3DMaskedTensor, nrrdKind3DMaskedTensor }; --- 385,401 ---- nrrdKindComplex, nrrdKind2Vector, ! nrrdKind3Color, ! nrrdKind4Color, ! nrrdKind3Vector, ! nrrdKind3Normal, ! nrrdKind4Vector, nrrdKind2DSymTensor, nrrdKind2DSymTensor, nrrdKind2DMaskedSymTensor, nrrdKind2DMaskedSymTensor, ! nrrdKind2DTensor, ! nrrdKind2DMaskedTensor, ! nrrdKind3DSymTensor, nrrdKind3DSymTensor, nrrdKind3DMaskedSymTensor, nrrdKind3DMaskedSymTensor, ! nrrdKind3DTensor, ! nrrdKind3DMaskedTensor, }; |
|
From: Milan I. <ik...@us...> - 2004-06-28 22:24:23
|
Update of /cvsroot/teem/teem/src/air In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23182 Modified Files: sane.c Log Message: switched to M#% safe qnan checking (zero/zero instead of inf/inf) Index: sane.c =================================================================== RCS file: /cvsroot/teem/teem/src/air/sane.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** sane.c 9 Feb 2004 06:47:50 -0000 1.8 --- sane.c 28 Jun 2004 22:24:14 -0000 1.9 *************** *** 29,33 **** int airSanity(void) { ! double nan, pinf, ninf; float nanF, pinfF, ninfF; int tmpI, sign, exp, frac, size; --- 29,33 ---- int airSanity(void) { ! double nan, pinf, ninf, pzero; float nanF, pinfF, ninfF; int tmpI, sign, exp, frac, size; *************** *** 79,83 **** return airInsane_nInfExists; } ! nan = pinf/pinf; if (AIR_EXISTS(nan)) { return airInsane_NaNExists; --- 79,84 ---- return airInsane_nInfExists; } ! pzero = 0.0; ! nan = pzero/pzero; if (AIR_EXISTS(nan)) { return airInsane_NaNExists; |
|
From: Gordon K. <kin...@us...> - 2004-06-28 10:04:56
|
Update of /cvsroot/teem/teem/src/unrrdu In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3468 Modified Files: make.c Log Message: clarified relationship between big-vs-little endian, and most-vs-least significant byte first Index: make.c =================================================================== RCS file: /cvsroot/teem/teem/src/unrrdu/make.c,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** make.c 30 Mar 2004 19:25:17 -0000 1.50 --- make.c 28 Jun 2004 10:04:43 -0000 1.51 *************** *** 95,99 **** /* so that long lists of filenames can be read from file */ - airStrtokQuoting = AIR_TRUE; hparm->respFileEnable = AIR_TRUE; hparm->greedySingleString = AIR_TRUE; --- 95,98 ---- *************** *** 161,166 **** "Endianness of data; relevent for any data with value " "representation bigger than 8 bits, with a non-ascii encoding: " ! "\"little\" for Intel and " ! "friends; \"big\" for everyone else. " "Defaults to endianness of this machine", NULL, airEndian); --- 160,166 ---- "Endianness of data; relevent for any data with value " "representation bigger than 8 bits, with a non-ascii encoding: " ! "\"little\" for Intel and friends " ! "(least significant byte first, at lower address); " ! "\"big\" for everyone else (most significant byte first). " "Defaults to endianness of this machine", NULL, airEndian); *************** *** 175,178 **** --- 175,179 ---- USAGE(_unrrdu_makeInfoL); + airStrtokQuoting = AIR_TRUE; PARSE(); airMopAdd(mop, opt, (airMopper)hestParseFree, airMopAlways); |
|
From: Gordon K. <kin...@us...> - 2004-06-26 09:50:45
|
Update of /cvsroot/teem/teem/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17382 Modified Files: TODO.txt Log Message: the long road ahead Index: TODO.txt =================================================================== RCS file: /cvsroot/teem/teem/src/TODO.txt,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** TODO.txt 26 May 2004 17:10:00 -0000 1.17 --- TODO.txt 26 Jun 2004 09:50:35 -0000 1.18 *************** *** 3,6 **** --- 3,40 ---- Do you see the problem? Grrr. + PLEASE figure out why I can't say + + -t "unsigned char" + + to unu make, unu convert and the like. + Does it have to do with airStrtokQuoting? + Why not? I hate this crap. + + debug rendering of ML with windowed sinc + + add { } commenting to hest + + have to add more internal types to stuff in arith.c for these: + new nrrdBinaryOps: bit-wise and (&), or (|), xor (^) + new nrrdUnaryOps: bit-wise not (^), expm1 + + + It would be good if per-axis field specifications failed (or at least warned) if there are more fields than there should be + + SEGFAULT: in muse/usr/sci/data/Medical/cat-array/bisti/rend + gkms hvol -s a:-1200,6000 a:0,3100 a:-1000,1000 -i CFC.nrrd -o CFC-hvol.nrrd + + speed up nrrdCCFind + + finish updating bane tutorial + make nrrdMake from guts of "unu make" + re-modularize gage to facilitate probing bricked data + + nrrdKernel*Parse should allocate the thing and return it, instead of returning an int error code + see if dyeColorParse should do the same + + unu jhisto works with axis[0] elements when given a single nrrd + + FAQ on teem coding standards Banks's policy.txt: *************** *** 58,59 **** --- 92,94 ---- air: think about implementing a fabs() and dabs() with bitmasking + nrrd: figure out some framework for lazy evaluation stuff |
|
From: Gordon K. <kin...@us...> - 2004-06-26 08:29:50
|
Update of /cvsroot/teem/teem/src/limn/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5438 Modified Files: plot.c Log Message: great, great, more cryptic command-line options Index: plot.c =================================================================== RCS file: /cvsroot/teem/teem/src/limn/test/plot.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** plot.c 23 Jun 2004 00:53:41 -0000 1.1 --- plot.c 26 Jun 2004 08:29:41 -0000 1.2 *************** *** 32,41 **** typedef struct { - double axisThick; /* these are allocated per-graph BY HEST */ double *graphThick, *graphGray, *dotDiameter, *dotGray; /* also hest-allocated */ char *axisHorzLabel, *axisVertLabel; double dotInnerDiameterFraction; double axisOrig[2]; --- 32,46 ---- typedef struct { /* these are allocated per-graph BY HEST */ double *graphThick, *graphGray, *dotDiameter, *dotGray; + /* also hest-allocated */ char *axisHorzLabel, *axisVertLabel; + double *horzTick, *vertTick; + int numHorzTick, numVertTick; + int labelHorzTick, labelVertTick; + double axisThick, tickThick, tickLabelSize, tickLength; + double horzTickLabelOffset, vertTickLabelOffset; double dotInnerDiameterFraction; double axisOrig[2]; *************** *** 101,107 **** void plotLine(plotPS *pps, plotParm *pparm, ! double width, double x0, double y0, double x1, double y1) { - fprintf(pps->file, "%g W\n", pps->psc*width); fprintf(pps->file, "%g %g M\n", PPS_X(x0), PPS_Y(y0)); fprintf(pps->file, "%g %g L S\n", PPS_X(x1), PPS_Y(y1)); --- 106,111 ---- void plotLine(plotPS *pps, plotParm *pparm, ! double x0, double y0, double x1, double y1) { fprintf(pps->file, "%g %g M\n", PPS_X(x0), PPS_Y(y0)); fprintf(pps->file, "%g %g L S\n", PPS_X(x1), PPS_Y(y1)); *************** *** 110,117 **** void ! plotLabel(plotPS *pps, plotParm *pparm, double x, double y, char *str) { ! fprintf(pps->file, "%g %g M (%s) show\n", PPS_X(x), PPS_Y(y), str); return; } --- 114,132 ---- void ! plotLabel(plotPS *pps, plotParm *pparm, int centered, double x, double y, char *str) { ! fprintf(pps->file, "gsave\n"); ! plotWidth(pps, pparm, 0); ! if (centered) { ! fprintf(pps->file, ! "0 0 M (%s) false charpath pathbbox\n" ! "exch 4 1 roll sub 2 div 3 1 roll sub -2 div\n" /* don't ask */ ! "newpath %g add exch %g add M (%s) show\n", ! str, PPS_X(x), PPS_Y(y), str); ! } else { ! fprintf(pps->file, "%g %g M (%s) show\n", PPS_X(x), PPS_Y(y), str); ! } ! fprintf(pps->file, "grestore\n"); return; } *************** *** 119,132 **** void plotAxes(plotPS *pps, plotParm *pparm, Nrrd *ndata) { ! double axX, axY; ! axX = AIR_AFFINE(ndata->axis[1].min, pparm->axisOrig[0], ndata->axis[1].max, pps->bbox[0], pps->bbox[2]); axY = AIR_AFFINE(pparm->dbox[1], pparm->axisOrig[1], pparm->dbox[3], pps->bbox[1], pps->bbox[3]); plotGray(pps, pparm, 0); ! plotLine(pps, pparm, pparm->axisThick, axX, pps->bbox[1], axX, pps->bbox[3]); ! plotLine(pps, pparm, pparm->axisThick, pps->bbox[0], axY, pps->bbox[2], axY); --- 134,150 ---- void plotAxes(plotPS *pps, plotParm *pparm, Nrrd *ndata) { ! double axX, axY, xx, yy, toff; ! char buff[AIR_STRLEN_SMALL]; ! int ti; ! axX = AIR_AFFINE(pparm->dbox[0], pparm->axisOrig[0], pparm->dbox[2], pps->bbox[0], pps->bbox[2]); axY = AIR_AFFINE(pparm->dbox[1], pparm->axisOrig[1], pparm->dbox[3], pps->bbox[1], pps->bbox[3]); plotGray(pps, pparm, 0); ! plotWidth(pps, pparm, pparm->axisThick); ! plotLine(pps, pparm, axX, pps->bbox[1], axX, pps->bbox[3]); ! plotLine(pps, pparm, pps->bbox[0], axY, pps->bbox[2], axY); *************** *** 134,141 **** fprintf(pps->file, "/Helvetica findfont 20 scalefont setfont\n"); if (strlen(pparm->axisHorzLabel)) { ! plotLabel(pps, pparm, pps->bbox[2], axY, pparm->axisHorzLabel); } if (strlen(pparm->axisVertLabel)) { ! plotLabel(pps, pparm, axX, pps->bbox[3], pparm->axisVertLabel); } } --- 152,208 ---- fprintf(pps->file, "/Helvetica findfont 20 scalefont setfont\n"); if (strlen(pparm->axisHorzLabel)) { ! plotLabel(pps, pparm, AIR_FALSE, ! pps->bbox[2], axY, pparm->axisHorzLabel); } if (strlen(pparm->axisVertLabel)) { ! plotLabel(pps, pparm, AIR_FALSE, ! axX, pps->bbox[3], pparm->axisVertLabel); ! } ! } ! ! if (pparm->numHorzTick) { ! if (pparm->tickThick > 0) { ! toff = pparm->tickLength/2; ! plotGray(pps, pparm, 0); ! plotWidth(pps, pparm, pparm->tickThick); ! for (ti=0; ti<pparm->numHorzTick; ti++) { ! xx = AIR_AFFINE(pparm->dbox[0], pparm->horzTick[ti], pparm->dbox[2], ! pps->bbox[0], pps->bbox[2]); ! plotLine(pps, pparm, xx, axY - toff, xx, axY + toff); ! } ! } ! if (pparm->tickLabelSize) { ! fprintf(pps->file, "/Helvetica findfont %g scalefont setfont\n", ! pparm->tickLabelSize); ! for (ti=0; ti<pparm->numHorzTick; ti++) { ! xx = AIR_AFFINE(pparm->dbox[0], pparm->horzTick[ti], pparm->dbox[2], ! pps->bbox[0], pps->bbox[2]); ! yy = axY + pparm->horzTickLabelOffset; ! sprintf(buff, "%g", pparm->horzTick[ti]); ! plotLabel(pps, pparm, AIR_TRUE, xx, yy, buff); ! } ! } ! } ! if (pparm->numVertTick) { ! if (pparm->tickThick > 0) { ! toff = pparm->tickLength/2; ! plotGray(pps, pparm, 0); ! plotWidth(pps, pparm, pparm->tickThick); ! for (ti=0; ti<pparm->numVertTick; ti++) { ! yy = AIR_AFFINE(pparm->dbox[1], pparm->vertTick[ti], pparm->dbox[3], ! pps->bbox[1], pps->bbox[3]); ! plotLine(pps, pparm, axX - toff, yy, axX + toff, yy); ! } ! } ! if (pparm->tickLabelSize) { ! fprintf(pps->file, "/Helvetica findfont %g scalefont setfont\n", ! pparm->tickLabelSize); ! for (ti=0; ti<pparm->numVertTick; ti++) { ! yy = AIR_AFFINE(pparm->dbox[1], pparm->vertTick[ti], pparm->dbox[3], ! pps->bbox[1], pps->bbox[3]); ! xx = axX + pparm->vertTickLabelOffset; ! sprintf(buff, "%g", pparm->vertTick[ti]); ! plotLabel(pps, pparm, AIR_TRUE, xx, yy, buff); ! } } } *************** *** 179,182 **** --- 246,250 ---- fprintf(pps->file, "gsave\n"); + fprintf(pps->file, "newpath\n"); plotWidth(pps, pparm, 0); data = (double *)(ndata[nidx]->data); *************** *** 231,264 **** "input nrrd containing data to plot", &numNrrd, NULL, nrrdHestNrrd); ! hestOptAdd(&hopt, "dbox", "minX minY maxX maxY", airTypeDouble, 4, 4, pparm.dbox, NULL, "bounding box, in data space"); ! hestOptAdd(&hopt, "bbox", "minX minY maxX maxY", airTypeDouble, 4, 4, pps.bbox, NULL, "bounding box, in graph space"); hestOptAdd(&hopt, "psc", "PS scale", airTypeDouble, 1, 1, &(pps.psc), "300", "scaling from graph space to PostScript points"); ! ! hestOptAdd(&hopt, "grth", "graph thickness", airTypeDouble, 1, -1, &(pparm.graphThick), "0.01", ! "thickness of line for graph, or \"0\" for no graph line", &numGrth); ! hestOptAdd(&hopt, "grgr", "graph gray", airTypeDouble, 1, -1, &(pparm.graphGray), "0", "grayscale to use for graph", &numGrgr); ! hestOptAdd(&hopt, "dtdi", "dot diameter", airTypeDouble, 1, -1, &(pparm.dotDiameter), "0.1", ! "radius of dot drawn at data points, or \"0\" for no dots", &numDtdi); ! hestOptAdd(&hopt, "dtgr", "dot gray", airTypeDouble, 1, -1, &(pparm.dotGray), "0", "grayscale to use for dots", &numDtgr); ! hestOptAdd(&hopt, "dtid", "dot inner diam frac", airTypeDouble, 1, 1, ! &(pparm.dotInnerDiameterFraction), "0.0", "fractional radius of white dot drawn within dot"); ! hestOptAdd(&hopt, "axth", "axis thickness", airTypeDouble, 1, 1, &(pparm.axisThick), "0.01", "thickness of lines for axes"); ! hestOptAdd(&hopt, "axor", "axis origin", airTypeDouble, 2, 2, &(pparm.axisOrig), "0 0", "origin of lines for axes, in data space"); ! hestOptAdd(&hopt, "axhl", "horiz axis label", airTypeString, 1, 1, &(pparm.axisHorzLabel), "", "label on horizontal axis"); ! hestOptAdd(&hopt, "axvl", "vert axis label", airTypeString, 1, 1, &(pparm.axisVertLabel), "", "label on vertical axis"); ! hestOptAdd(&hopt, "o", "output PS", airTypeString, 1, 1, &outS, "out.ps", "output file to render postscript into"); hestParseOrDie(hopt, argc-1, argv+1, NULL, --- 299,369 ---- "input nrrd containing data to plot", &numNrrd, NULL, nrrdHestNrrd); ! hestOptAdd(&hopt, "dbox", "minX minY maxX maxY", airTypeDouble, ! 4, 4, pparm.dbox, NULL, "bounding box, in data space"); ! hestOptAdd(&hopt, "bbox", "minX minY maxX maxY", airTypeDouble, ! 4, 4, pps.bbox, NULL, "bounding box, in graph space"); hestOptAdd(&hopt, "psc", "PS scale", airTypeDouble, 1, 1, &(pps.psc), "300", "scaling from graph space to PostScript points"); ! ! hestOptAdd(&hopt, "grth", "graph thickness", airTypeDouble, ! 1, -1, &(pparm.graphThick), "0.01", ! "thickness of line for graph, or \"0\" for no graph line", ! &numGrth); ! hestOptAdd(&hopt, "grgr", "graph gray", airTypeDouble, ! 1, -1, &(pparm.graphGray), "0", "grayscale to use for graph", &numGrgr); ! hestOptAdd(&hopt, "dtdi", "dot diameter", airTypeDouble, ! 1, -1, &(pparm.dotDiameter), "0.1", ! "radius of dot drawn at data points, or \"0\" for no dots", ! &numDtdi); ! hestOptAdd(&hopt, "dtgr", "dot gray", airTypeDouble, ! 1, -1, &(pparm.dotGray), "0", "grayscale to use for dots", &numDtgr); ! hestOptAdd(&hopt, "dtid", "dot inner diam frac", airTypeDouble, ! 1, 1, &(pparm.dotInnerDiameterFraction), "0.0", "fractional radius of white dot drawn within dot"); ! hestOptAdd(&hopt, "tihz", "pos", airTypeDouble, ! 0, -1, &(pparm.horzTick), "", ! "locations for tickmarks on horizontal axis", ! &(pparm.numHorzTick)); ! hestOptAdd(&hopt, "tivt", "pos", airTypeDouble, ! 0, -1, &(pparm.vertTick), "", ! "locations for tickmarks on vertical axis", ! &(pparm.numVertTick)); ! hestOptAdd(&hopt, "tiho", "offset", airTypeDouble, ! 1, 1, &(pparm.horzTickLabelOffset), "0", ! "horizontal tick label offset"); ! hestOptAdd(&hopt, "tivo", "offset", airTypeDouble, ! 1, 1, &(pparm.vertTickLabelOffset), "0", ! "vertical tick label offset"); ! hestOptAdd(&hopt, "tils", "size", airTypeDouble, ! 1, 1, &(pparm.tickLabelSize), "0", ! "font size for labels on tick marks, or \"0\" for no labels"); ! hestOptAdd(&hopt, "tith", "tick thickness", airTypeDouble, ! 1, 1, &(pparm.tickThick), "0.01", ! "thickness of lines for tick marks"); ! hestOptAdd(&hopt, "tiln", "tick length", airTypeDouble, ! 1, 1, &(pparm.tickLength), "0.08", ! "length of lines for tick marks"); ! ! hestOptAdd(&hopt, "axth", "axis thickness", airTypeDouble, ! 1, 1, &(pparm.axisThick), "0.01", "thickness of lines for axes"); ! hestOptAdd(&hopt, "axor", "axis origin", airTypeDouble, ! 2, 2, &(pparm.axisOrig), "0 0", "origin of lines for axes, in data space"); ! hestOptAdd(&hopt, "axhl", "horiz axis label", airTypeString, ! 1, 1, &(pparm.axisHorzLabel), "", "label on horizontal axis"); ! hestOptAdd(&hopt, "axvl", "vert axis label", airTypeString, ! 1, 1, &(pparm.axisVertLabel), "", "label on vertical axis"); ! hestOptAdd(&hopt, "o", "output PS", airTypeString, ! 1, 1, &outS, "out.ps", "output file to render postscript into"); hestParseOrDie(hopt, argc-1, argv+1, NULL, *************** *** 285,289 **** if (!( (1 == _ndata[ni]->dim || 2 == _ndata[ni]->dim) && nrrdTypeBlock != _ndata[ni]->type )) { ! fprintf(stderr, "%s: input nrrd must be 1-D or 2-D array of scalars", me); airMopError(mop); return 1; } --- 390,395 ---- if (!( (1 == _ndata[ni]->dim || 2 == _ndata[ni]->dim) && nrrdTypeBlock != _ndata[ni]->type )) { ! fprintf(stderr, "%s: input nrrd must be 1-D or 2-D array of scalars", ! me); airMopError(mop); return 1; } |
|
From: Gordon K. <kin...@us...> - 2004-06-23 01:46:52
|
Update of /cvsroot/teem/teem/src/ten In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8676 Modified Files: GNUmakefile enumsTen.c glyph.c ten.h tenGage.c tenMacros.h tendGlyph.c tensor.c Log Message: phd-related hacking Index: GNUmakefile =================================================================== RCS file: /cvsroot/teem/teem/src/ten/GNUmakefile,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** GNUmakefile 27 Feb 2004 10:23:55 -0000 1.38 --- GNUmakefile 23 Jun 2004 01:46:41 -0000 1.39 *************** *** 55,59 **** tendSlice.o tendEllipse.o tendEvecrgb.o tendNorm.o tendAnscale.o \ tendEvalpow.o tendEvalclamp.o tendEvaladd.o tendHelix.o ! $(L).TESTS = test/tg test/tt test/tem #### #### --- 55,59 ---- tendSlice.o tendEllipse.o tendEvecrgb.o tendNorm.o tendAnscale.o \ tendEvalpow.o tendEvalclamp.o tendEvaladd.o tendHelix.o ! $(L).TESTS = test/tg test/tt test/tem test/rotedge #### #### Index: glyph.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/glyph.c,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** glyph.c 26 May 2004 02:02:24 -0000 1.40 --- glyph.c 23 Jun 2004 01:46:41 -0000 1.41 *************** *** 92,95 **** --- 92,99 ---- biffAdd(TEN, err); return 1; } + if (!( parm->glyphScale > 0)) { + sprintf(err, "%s: glyphScale must be > 0 (not %g)", me, parm->glyphScale); + biffAdd(TEN, err); return 1; + } if (parm->nmask) { if (npos) { *************** *** 254,257 **** --- 258,265 ---- for (idx=0; idx<numGlyphs; idx++, _idx = idx) { tdata = (float*)(nten->data) + 7*idx; + if (!( TEN_T_EXISTS(tdata) )) { + /* there's nothing we can do here */ + continue; + } if (npos) { ELL_3V_COPY(pW, (float*)(npos->data) + 3*idx); Index: tensor.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/tensor.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** tensor.c 11 May 2004 02:39:54 -0000 1.31 --- tensor.c 23 Jun 2004 01:46:41 -0000 1.32 *************** *** 504,514 **** } - void - tenShapeGradients_d(double mean[7], - double var[7], double *varNorm, - double skew[7], double *skewNorm, - double evec[9], double eval[9], int *didEigen, - double ten[7]) { - double meanDot, varDot; #define Txx (ten[1]) #define Txy (ten[2]) --- 504,507 ---- *************** *** 518,524 **** #define Tzz (ten[6]) ! /* 0.57735027 == 1/sqrt(3) */ TEN_T_SET(mean, ten[0], ! 0.57735027, 0, 0, 0.57735027, 0, 0.57735027); --- 511,534 ---- #define Tzz (ten[6]) ! /* ! ** eval and evec are given merely as space into which ! ** we may compute the eigensystem ! */ ! void ! tenShapeGradients_d(double mean[7], ! double var[7], double *varNorm, ! double skew[7], double *skewNorm, ! double eval[3], double evec[9], int *didEigen, ! double ten[7]) { ! double meanDot, varDot, dot, mev, third, matR[9], ! matA[9], matB[9], norm, epsilon; ! ! /* largest allowable dot product betwen two normals */ ! epsilon = 0.00001; ! ! *didEigen = AIR_FALSE; ! TEN_T_SET(mean, ten[0], ! 0.57735027, 0, 0, /* sqrt(1/3) = 0.57735027 */ 0.57735027, 0, 0.57735027); *************** *** 528,547 **** 2*Tzz - Txx - Tyy); *varNorm = TEN_T_NORM(var); ! if (*varNorm) { TEN_T_SCALE(var, 1.0/(*varNorm), var); } ! TEN_T_SET(skew, ten[0], ! Tyy*Tzz - Tyz*Tyz, Txz*Tyz - Txy*Tzz, Txy*Tyz - Txz*Tyy, ! Txx*Tzz - Txz*Txz, Txy*Txz - Tyz*Txx, ! Txx*Tyy - Txy*Txy); ! meanDot = TEN_T_DOT(skew, mean); ! varDot = TEN_T_DOT(skew, var); ! TEN_T_SCALE_INCR2(skew, -meanDot, mean, -varDot, var); ! *skewNorm = TEN_T_NORM(skew); ! if (*skewNorm) { ! TEN_T_SCALE(skew, 1.0/(*skewNorm), skew); } - *didEigen = AIR_FALSE; return; } --- 538,679 ---- 2*Tzz - Txx - Tyy); *varNorm = TEN_T_NORM(var); ! if (*varNorm < epsilon) { ! /* they gave us a diagonal matrix */ ! TEN_T_SET(var, ten[0], ! 0, 0, 0, ! 0.707106781, 0, /* sqrt(1/2) = 0.707106781 */ ! -0.707106781); ! TEN_T_SET(skew, ten[0], ! 0.816496581, 0, 0, /* sqrt(2/3) = 0.816496581 */ ! -0.408248290, 0, /* sqrt(1/6) = 0.408248290 */ ! -0.408248290); ! *skewNorm = 0; /* have to invent a value, this works */ ! } else { ! /* we have some variance */ TEN_T_SCALE(var, 1.0/(*varNorm), var); + /* make damn sure var is orthogonal to mean */ + dot = TEN_T_DOT(var, mean); + if (AIR_ABS(dot) > epsilon) { + TEN_T_SCALE_INCR(var, -dot, mean); + norm = TEN_T_NORM(var); + TEN_T_SCALE(var, 1.0/(norm), var); + } + TEN_T_SET(skew, ten[0], + Tyy*Tzz - Tyz*Tyz, Txz*Tyz - Txy*Tzz, Txy*Tyz - Txz*Tyy, + Txx*Tzz - Txz*Txz, Txy*Txz - Tyz*Txx, + Txx*Tyy - Txy*Txy); + meanDot = TEN_T_DOT(skew, mean); + varDot = TEN_T_DOT(skew, var); + TEN_T_SCALE_INCR2(skew, -meanDot, mean, -varDot, var); + *skewNorm = TEN_T_NORM(skew); + if (*skewNorm < epsilon) { + /* skew is at an extremum, have to diagonalize */ + tenEigensolve_d(eval, evec, ten); + *didEigen = AIR_TRUE; + mev = (eval[0] + eval[1] + eval[2])/3; + third = ((eval[0] - mev)*(eval[0] - mev)*(eval[0] - mev) + + (eval[1] - mev)*(eval[1] - mev)*(eval[1] - mev) + + (eval[2] - mev)*(eval[2] - mev)*(eval[2] - mev))/3; + if (third > 0) { + /* skew is positive: linear: eval[1] = eval[2] */ + ELL_3V_SET(matA + 0*3, 0, 0, 0); + ELL_3V_SET(matA + 1*3, 0, 0.707106781, 0); + ELL_3V_SET(matA + 2*3, 0, 0, -0.707106781); + } else { + /* skew is negative: planar: eval[0] = eval[1] */ + ELL_3V_SET(matA + 0*3, 0.707106781, 0, 0); + ELL_3V_SET(matA + 1*3, 0, -0.707106781, 0); + ELL_3V_SET(matA + 2*3, 0, 0, 0); + } + ELL_3M_TRANSPOSE(matR, evec); + ELL_3M_MUL(matB, matA, evec); + ELL_3M_MUL(matA, matR, matB); + TEN_M2T(skew, matA); + } else { + /* skew not at extremum */ + TEN_T_SCALE(skew, 1.0/(*skewNorm), skew); + /* make damn sure skew is orthogonal to mean ... */ + dot = TEN_T_DOT(skew, mean); + if (AIR_ABS(dot) > epsilon) { + TEN_T_SCALE_INCR(skew, -dot, mean); + } + /* ... and to var */ + dot = TEN_T_DOT(skew, var); + if (AIR_ABS(dot) > epsilon) { + TEN_T_SCALE_INCR(skew, -dot, var); + } + norm = TEN_T_NORM(skew); + TEN_T_SCALE(skew, 1.0/(norm), skew); + } } ! if (fabs(TEN_T_DOT(skew, mean)) > 0.7) { ! fprintf(stderr, "tenShapeGradients_d : PANIC\n"); ! fprintf(stderr, "dots = %g %g %g\n", ! TEN_T_DOT(mean, var), ! TEN_T_DOT(mean, skew), ! TEN_T_DOT(var, skew)); ! fprintf(stderr, "ten = (%g) %g %g %g %g %g %g\n", ! ten[0], ! ten[1], ten[2], ten[3], ! ten[4], ten[5], ! ten[6]); ! fprintf(stderr, "varNorm = %g; var = (%g) %g %g %g %g %g %g\n", ! *varNorm, ! var[0], ! var[1], var[2], var[3], ! var[4], var[5], ! var[6]); ! fprintf(stderr, "skewNorm = %g; skew = (%g) %g %g %g %g %g %g\n", ! *skewNorm, ! skew[0], ! skew[1], skew[2], skew[3], ! skew[4], skew[5], ! skew[6]); ! exit(0); } + + return; + } + + /* + ** eval and evec must be pre-computed and given to us + */ + void + tenRotationTangents_d(double ups1[7], double *ups1Mag, + double ups2[7], double *ups2Mag, + double ups3[7], double *ups3Mag, + double eval[3], double evec[9], + double ten[7]) { + double anti[9], mat[9], wM[9], Mw[9], diff[9]; + int ii; + + TEN_T2M(mat, ten); + for (ii=0; ii<=2; ii++) { + /* the matrix macros for setting/getting rows + are pretty stupid, so unfortunately they aren't + being used here */ + ELL_3V_SET(anti + 0*3, 0, -(evec + ii*3)[2], (evec + ii*3)[1]); + ELL_3V_SET(anti + 1*3, (evec + ii*3)[2], 0, -(evec + ii*3)[0]); + ELL_3V_SET(anti + 2*3, -(evec + ii*3)[1], (evec + ii*3)[0], 0); + ELL_3M_MUL(wM, anti, mat); + ELL_3M_MUL(Mw, mat, anti); + ELL_3M_SUB(diff, wM, Mw); + switch (ii) { + case 0: + TEN_M2T(ups1, diff); ups1[0] = 1; + break; + case 1: + TEN_M2T(ups2, diff); ups2[0] = 1; + break; + case 2: + TEN_M2T(ups3, diff); ups3[0] = 1; + break; + } + } + *ups1Mag = eval[1] - eval[2]; + *ups2Mag = eval[0] - eval[2]; + *ups3Mag = eval[0] - eval[1]; return; } + Index: tenMacros.h =================================================================== RCS file: /cvsroot/teem/teem/src/ten/tenMacros.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tenMacros.h 7 May 2004 19:13:34 -0000 1.11 --- tenMacros.h 23 Jun 2004 01:46:41 -0000 1.12 *************** *** 58,61 **** --- 58,70 ---- (t)[6] = (m)[8] ) + #define TEN_T_EXISTS(t) ( \ + AIR_EXISTS((t)[0]) \ + && AIR_EXISTS((t)[1]) \ + && AIR_EXISTS((t)[2]) \ + && AIR_EXISTS((t)[3]) \ + && AIR_EXISTS((t)[4]) \ + && AIR_EXISTS((t)[5]) \ + && AIR_EXISTS((t)[6]) ) + #define TEN_T_SET(t, conf, a, b, c, d, e, f) ( \ (t)[0] = (conf), \ Index: enumsTen.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/enumsTen.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** enumsTen.c 22 Apr 2004 07:14:54 -0000 1.22 --- enumsTen.c 23 Jun 2004 01:46:41 -0000 1.23 *************** *** 125,128 **** --- 125,135 ---- "P normal", + "shape gradients", + "shape gradient mags", + "rotation tangents", + "rotation tangent mags", + + "eigenvalue gradients", + "anisotropies" }; *************** *** 174,177 **** --- 181,189 ---- "P grad mag", "P normal", + "shape gradients", + "shape gradient mags", + "rotation tangents", + "rotation tangent mags", + "eigenvalue gradients", "anisotropies" }; *************** *** 198,202 **** tenGageEvec1, /* "evec1", medium eigenvectors of tensor: GT[3] */ tenGageEvec2, /* "evec2", minor eigenvectors of tensor: GT[3] */ ! tenGageTensorGrad, /* "tg, all tensor component gradients: GT[21] */ tenGageTraceGradVec, /* "trgv": gradient (vector) of trace: GT[3] */ tenGageTraceGradMag, /* "trgm": gradient magnitude of trace: GT[1] */ --- 210,214 ---- tenGageEvec1, /* "evec1", medium eigenvectors of tensor: GT[3] */ tenGageEvec2, /* "evec2", minor eigenvectors of tensor: GT[3] */ ! tenGageTensorGrad, /* "tg", all tensor component gradients: GT[21] */ tenGageTraceGradVec, /* "trgv": gradient (vector) of trace: GT[3] */ tenGageTraceGradMag, /* "trgm": gradient magnitude of trace: GT[1] */ *************** *** 223,226 **** --- 235,243 ---- tenGageThetaGradMag, /* "thgm", gradient magnitude of P: GT[1] */ tenGageThetaNormal, /* "thn", normalized gradient of P: GT[3] */ + tenGageShapeGrads, /* "shgs" */ + tenGageShapeGradMags, /* "shgms" */ + tenGageRotTans, /* "rts" */ + tenGageRotTanMags, /* "rtms" */ + tenGageEvalGrads, /* "evgs" */ tenGageAniso /* "an", all anisotropies: GT[TEN_ANISO_MAX+1] */ }; *************** *** 271,274 **** --- 288,296 ---- "thgm", "th grad mag", "thn", "th normal", + "shgs", "shape gradients", + "shgms", "shape gradient mags", + "rts", "rotation tangents", + "rtms", "rotation tangent mags", + "evgs", "eigenvalue gradients", "an", "aniso", "anisotropies", "" *************** *** 320,323 **** --- 342,350 ---- tenGageThetaGradMag, tenGageThetaGradMag, tenGageThetaNormal, tenGageThetaNormal, + tenGageShapeGrads, tenGageShapeGrads, + tenGageShapeGradMags, tenGageShapeGradMags, + tenGageRotTans, tenGageRotTans, + tenGageRotTanMags, tenGageRotTanMags, + tenGageEvalGrads, tenGageEvalGrads, tenGageAniso, tenGageAniso, tenGageAniso }; *************** *** 352,356 **** "Weinstein-Kindlmann tensorlines", "based on tensor multiplication only", ! "Zhukov's oriented tensors" }; --- 379,383 ---- "Weinstein-Kindlmann tensorlines", "based on tensor multiplication only", ! "Zhukov\'s oriented tensors" }; Index: tenGage.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/tenGage.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** tenGage.c 11 May 2004 02:39:54 -0000 1.20 --- tenGage.c 23 Jun 2004 01:46:41 -0000 1.21 *************** *** 18,29 **** */ - extern void - tenShapeGradients_d(double mean[7], - double var[7], double *varNorm, - double skew[7], double *skewNorm, - double evec[9], double eval[9], int *didEigen, - double ten[7]); - - #include "ten.h" #include "privateTen.h" --- 18,21 ---- *************** *** 86,89 **** --- 78,90 ---- {tenGageThetaGradMag, 1, 1, {tenGageThetaGradVec, -1, -1, -1, -1}, -1, -1}, {tenGageThetaNormal, 3, 1, {tenGageThetaGradVec, tenGageThetaGradMag, -1, -1, -1}, -1, -1}, + + /* the ...Mags item doesn't actually require all of the previous item, + but its the easiest way to implement it for now */ + {tenGageShapeGrads, 9, 1, {tenGageTensor, tenGageTensorGrad, -1, -1, -1}, -1, -1}, + {tenGageShapeGradMags, 3, 1, {tenGageShapeGrads, -1, -1, -1, -1}, -1, -1}, + {tenGageRotTans, 9, 1, {tenGageTensor, tenGageTensorGrad, tenGageEval, tenGageEvec, -1}, -1, -1}, + {tenGageRotTanMags, 3, 1, {tenGageRotTans, -1, -1, -1, -1}, -1, -1}, + + {tenGageEvalGrads, 9, 1, {tenGageTensorGrad, tenGageEval, tenGageEvec, -1}, -1, -1}, {tenGageAniso, TEN_ANISO_MAX+1, 0, {tenGageEval0, tenGageEval1, tenGageEval2, -1, -1}, -1, -1} *************** *** 155,158 **** --- 156,160 ---- *gradDtA=NULL, *gradDtB=NULL, *gradDtC=NULL, *gradDtD=NULL, *gradDtE=NULL, *gradDtF=NULL, + gradDdXYZ[21], *gradCbS=NULL, *gradCbB=NULL, *gradCbQ=NULL, *gradCbR=NULL; double tmp0, tmp1, magTmp=0, *************** *** 235,238 **** --- 237,242 ---- if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageTensorGrad)) { /* done if doD1 */ + /* still have to set up point variables that item answers + below will rely on as short-cuts */ vecTmp = pvl->directAnswer[tenGageTensorGrad]; gradDtA = vecTmp + 1*3; *************** *** 242,278 **** gradDtE = vecTmp + 5*3; gradDtF = vecTmp + 6*3; ! } ! ! /* --- Trace --- */ ! if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageTraceGradVec)) { ! /* ! double tmpT[7], meanGrad[7], varGrad[7], varNorm, skewGrad[7], skewNorm, ! copyT[7]; ! int didEigen=0; ! ! TEN_T_COPY(copyT, tenAns); ! tenShapeGradients_d(meanGrad, ! varGrad, &varNorm, ! skewGrad, &skewNorm, ! NULL, NULL, &didEigen, ! copyT); ! vecTmp = pvl->directAnswer[tenGageTraceGradVec]; ! TEN_T_SET(tmpT, tenAns[0], gradDtA[0], gradDtB[0], gradDtC[0], gradDtD[0], gradDtE[0], gradDtF[0]); ! vecTmp[0] = TEN_T_DOT(meanGrad, tmpT); ! TEN_T_SET(tmpT, tenAns[0], gradDtA[1], gradDtB[1], gradDtC[1], gradDtD[1], gradDtE[1], gradDtF[1]); ! vecTmp[1] = TEN_T_DOT(meanGrad, tmpT); ! TEN_T_SET(tmpT, tenAns[0], gradDtA[2], gradDtB[2], gradDtC[2], gradDtD[2], gradDtE[2], gradDtF[2]); ! vecTmp[2] = TEN_T_DOT(meanGrad, tmpT); ! */ vecTmp = pvl->directAnswer[tenGageTraceGradVec]; ELL_3V_ADD3(vecTmp, gradDtA, gradDtD, gradDtF); --- 246,265 ---- gradDtE = vecTmp + 5*3; gradDtF = vecTmp + 6*3; ! TEN_T_SET(gradDdXYZ + 0*7, tenAns[0], gradDtA[0], gradDtB[0], gradDtC[0], gradDtD[0], gradDtE[0], gradDtF[0]); ! TEN_T_SET(gradDdXYZ + 1*7, tenAns[0], gradDtA[1], gradDtB[1], gradDtC[1], gradDtD[1], gradDtE[1], gradDtF[1]); ! TEN_T_SET(gradDdXYZ + 2*7, tenAns[0], gradDtA[2], gradDtB[2], gradDtC[2], gradDtD[2], gradDtE[2], gradDtF[2]); ! } + /* --- Trace --- */ + if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageTraceGradVec)) { vecTmp = pvl->directAnswer[tenGageTraceGradVec]; ELL_3V_ADD3(vecTmp, gradDtA, gradDtD, gradDtF); *************** *** 344,376 **** /* --- Q --- */ if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageQGradVec)) { - /* - double tmpT[7], meanGrad[7], varGrad[7], varNorm, skewGrad[7], skewNorm, - copyT[7]; - int didEigen=0; - - TEN_T_COPY(copyT, tenAns); - tenShapeGradients_d(meanGrad, - varGrad, &varNorm, - skewGrad, &skewNorm, - NULL, NULL, &didEigen, - copyT); - gradCbQ = vecTmp = pvl->directAnswer[tenGageQGradVec]; - TEN_T_SET(tmpT, tenAns[0], - gradDtA[0], gradDtB[0], gradDtC[0], - gradDtD[0], gradDtE[0], - gradDtF[0]); - vecTmp[0] = TEN_T_DOT(varGrad, tmpT); - TEN_T_SET(tmpT, tenAns[0], - gradDtA[1], gradDtB[1], gradDtC[1], - gradDtD[1], gradDtE[1], - gradDtF[1]); - vecTmp[1] = TEN_T_DOT(varGrad, tmpT); - TEN_T_SET(tmpT, tenAns[0], - gradDtA[2], gradDtB[2], gradDtC[2], - gradDtD[2], gradDtE[2], - gradDtF[2]); - vecTmp[2] = TEN_T_DOT(varGrad, tmpT); - */ - gradCbQ = vecTmp = pvl->directAnswer[tenGageQGradVec]; ELL_3V_SCALE_ADD2(vecTmp, --- 331,334 ---- *************** *** 437,440 **** --- 395,470 ---- 1.0/(epsilon + magTmp), vecTmp); } + /* --- Shape gradients + rotation tangents --- */ + if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageShapeGrads) + || GAGE_QUERY_ITEM_TEST(pvl->query, tenGageShapeGradMags)) { + double meanGrad[7], varGrad[7], varNorm, + skewGrad[7], skewNorm, copyT[7], + locEval[3], locEvec[9]; + int didEigen=0; + + TEN_T_COPY(copyT, tenAns); + tenShapeGradients_d(meanGrad, + varGrad, &varNorm, + skewGrad, &skewNorm, + locEval, locEvec, &didEigen, + copyT); + vecTmp[0] = TEN_T_DOT(meanGrad, gradDdXYZ + 0*7); + vecTmp[1] = TEN_T_DOT(meanGrad, gradDdXYZ + 1*7); + vecTmp[2] = TEN_T_DOT(meanGrad, gradDdXYZ + 2*7); + ELL_3V_COPY(pvl->directAnswer[tenGageShapeGrads] + 0*3, vecTmp); + vecTmp[0] = TEN_T_DOT(varGrad, gradDdXYZ + 0*7); + vecTmp[1] = TEN_T_DOT(varGrad, gradDdXYZ + 1*7); + vecTmp[2] = TEN_T_DOT(varGrad, gradDdXYZ + 2*7); + ELL_3V_COPY(pvl->directAnswer[tenGageShapeGrads] + 1*3, vecTmp); + vecTmp[0] = TEN_T_DOT(skewGrad, gradDdXYZ + 0*7); + vecTmp[1] = TEN_T_DOT(skewGrad, gradDdXYZ + 1*7); + vecTmp[2] = TEN_T_DOT(skewGrad, gradDdXYZ + 2*7); + ELL_3V_COPY(pvl->directAnswer[tenGageShapeGrads] + 2*3, vecTmp); + pvl->directAnswer[tenGageShapeGradMags][0] = 1; + pvl->directAnswer[tenGageShapeGradMags][1] = varNorm; + pvl->directAnswer[tenGageShapeGradMags][2] = skewNorm; + } + if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageEvalGrads)) { + double matOut[9], tenOut[9]; + int evi; + + for (evi=0; evi<=2; evi++) { + ELL_3MV_OUTER(matOut, evecAns + evi*3, evecAns + evi*3); + TEN_M2T(tenOut, matOut); + vecTmp[0] = TEN_T_DOT(tenOut, gradDdXYZ + 0*7); + vecTmp[1] = TEN_T_DOT(tenOut, gradDdXYZ + 1*7); + vecTmp[2] = TEN_T_DOT(tenOut, gradDdXYZ + 2*7); + ELL_3V_COPY(pvl->directAnswer[tenGageEvalGrads] + evi*3, vecTmp); + } + } + if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageRotTans) + || GAGE_QUERY_ITEM_TEST(pvl->query, tenGageRotTanMags)) { + double ups1[7], ups2[7], ups3[7], + ups1Mag, ups2Mag, ups3Mag, + eval[3], evec[9], copyT[7]; + + TEN_T_COPY(copyT, tenAns); + ELL_3V_COPY(eval, evalAns); + ELL_9V_COPY(evec, evecAns); + tenRotationTangents_d(ups1, &ups1Mag, + ups2, &ups2Mag, + ups3, &ups3Mag, + eval, evec, copyT); + vecTmp[0] = TEN_T_DOT(ups1, gradDdXYZ + 0*7); + vecTmp[1] = TEN_T_DOT(ups1, gradDdXYZ + 1*7); + vecTmp[2] = TEN_T_DOT(ups1, gradDdXYZ + 2*7); + ELL_3V_COPY(pvl->directAnswer[tenGageRotTans] + 0*3, vecTmp); + vecTmp[0] = TEN_T_DOT(ups2, gradDdXYZ + 0*7); + vecTmp[1] = TEN_T_DOT(ups2, gradDdXYZ + 1*7); + vecTmp[2] = TEN_T_DOT(ups2, gradDdXYZ + 2*7); + ELL_3V_COPY(pvl->directAnswer[tenGageRotTans] + 1*3, vecTmp); + vecTmp[0] = TEN_T_DOT(ups3, gradDdXYZ + 0*7); + vecTmp[1] = TEN_T_DOT(ups3, gradDdXYZ + 1*7); + vecTmp[2] = TEN_T_DOT(ups3, gradDdXYZ + 2*7); + ELL_3V_COPY(pvl->directAnswer[tenGageRotTans] + 2*3, vecTmp); + pvl->directAnswer[tenGageRotTanMags][0] = ups1Mag; + pvl->directAnswer[tenGageRotTanMags][1] = ups2Mag; + pvl->directAnswer[tenGageRotTanMags][2] = ups3Mag; + } /* --- Aniso --- */ if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageAniso)) { Index: ten.h =================================================================== RCS file: /cvsroot/teem/teem/src/ten/ten.h,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** ten.h 13 May 2004 15:30:40 -0000 1.86 --- ten.h 23 Jun 2004 01:46:41 -0000 1.87 *************** *** 182,186 **** tenGageEvec2, /* 17: "evec2", minor eigenvectors of tensor: GT[3] */ ! tenGageTensorGrad, /* 18: "tg, all tensor component gradients, starting with the confidence gradient: GT[21] */ --- 182,186 ---- tenGageEvec2, /* 17: "evec2", minor eigenvectors of tensor: GT[3] */ ! tenGageTensorGrad, /* 18: "tg", all tensor component gradients, starting with the confidence gradient: GT[21] */ *************** *** 217,224 **** tenGageThetaNormal, /* 42: "thn", normalized gradient of Th: GT[3] */ ! tenGageAniso, /* 43: "an", all anisotropies: GT[TEN_ANISO_MAX+1] */ tenGageLast }; ! #define TEN_GAGE_ITEM_MAX 43 /* --- 217,234 ---- tenGageThetaNormal, /* 42: "thn", normalized gradient of Th: GT[3] */ ! tenGageShapeGrads, /* 43, "shgs", projections of tensor gradient onto the ! normalized shape gradients: eigenvalue ! ean, variance, skew, in that order: GT[9] */ ! tenGageShapeGradMags, /* 44: "shgms", what the tensor-valued shape gradients ! where to be normalized by: GT[3] */ ! tenGageRotTans, /* 45: "rts", projections of the tensor gradient onto ! non-normalized rotation tangents: GT[9] */ ! tenGageRotTanMags, /* 46: "rtms", lengths of rotation tangents: GT[3] */ ! tenGageEvalGrads, /* 47: "evgs", projections of tensor gradient onto ! gradients of eigenvalues: GT[9] */ ! tenGageAniso, /* 48: "an", all anisotropies: GT[TEN_ANISO_MAX+1] */ tenGageLast }; ! #define TEN_GAGE_ITEM_MAX 48 /* *************** *** 443,446 **** --- 453,467 ---- 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); + TEEM_API void tenShapeGradients_d(double mean[7], + double var[7], double *varNorm, + double skew[7], double *skewNorm, + double eval[3], double evec[9], + int *didEigen, + double ten[7]); + TEEM_API void tenRotationTangents_d(double ups1[7], double *ups1Mag, + double ups2[7], double *ups2Mag, + double ups3[7], double *ups3Mag, + double eval[3], double evec[9], + double ten[7]); /* chan.c */ Index: tendGlyph.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/tendGlyph.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** tendGlyph.c 26 May 2004 02:02:24 -0000 1.31 --- tendGlyph.c 23 Jun 2004 01:46:41 -0000 1.32 *************** *** 127,131 **** cam = limnCameraNew(); airMopAdd(mop, cam, (airMopper)limnCameraNix, airMopAlways); ! glyph = limnObjectNew(100, AIR_TRUE); airMopAdd(mop, glyph, (airMopper)limnObjectNix, airMopAlways); scene = echoSceneNew(); --- 127,131 ---- cam = limnCameraNew(); airMopAdd(mop, cam, (airMopper)limnCameraNix, airMopAlways); ! glyph = limnObjectNew(1000, AIR_TRUE); airMopAdd(mop, glyph, (airMopper)limnObjectNix, airMopAlways); scene = echoSceneNew(); |
|
From: Gordon K. <kin...@us...> - 2004-06-23 01:46:51
|
Update of /cvsroot/teem/teem/src/ten/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8676/test Modified Files: tt.c Log Message: phd-related hacking Index: tt.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/test/tt.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tt.c 7 May 2004 19:13:34 -0000 1.14 --- tt.c 23 Jun 2004 01:46:41 -0000 1.15 *************** *** 43,46 **** --- 43,47 ---- AIR_AFFINE(0.0, 0.9, 1.0, mean, cp), AIR_AFFINE(0.0, 0.9, 1.0, mean, cs)); + ELL_3V_SET(xyz, cl, cp, cs); } else { if (1 == version) { |
|
From: Gordon K. <kin...@us...> - 2004-06-23 01:45:44
|
Update of /cvsroot/teem/teem/src/make In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8517/make Modified Files: darwin.mk Log Message: dynamic libraries seem to basically work Index: darwin.mk =================================================================== RCS file: /cvsroot/teem/teem/src/make/darwin.mk,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** darwin.mk 26 May 2004 11:09:35 -0000 1.10 --- darwin.mk 23 Jun 2004 01:45:36 -0000 1.11 *************** *** 19,23 **** # - # we'll figure out shared libraries eventually... TEEM_SHEXT = dylib --- 19,22 ---- *************** *** 29,33 **** OPT_CFLAG ?= -O2 ! STATIC_CFLAG = SHARED_CFLAG = SHARED_LDFLAG = -dynamic -dynamiclib -fno-common --- 28,32 ---- OPT_CFLAG ?= -O2 ! STATIC_CFLAG = -Wl,-prebind SHARED_CFLAG = SHARED_LDFLAG = -dynamic -dynamiclib -fno-common *************** *** 39,49 **** ifeq ($(SUBARCH),64) TEEM_32BIT = 0 - ARCH_CFLAG = -Wall - ARCH_LDFLAG = else ifeq ($(SUBARCH),32) TEEM_32BIT = 1 - ARCH_CFLAG = -Wall - ARCH_LDFLAG = else $(error darwin sub-architecture "$(SUBARCH)" not recognized) --- 38,44 ---- |
|
From: Gordon K. <kin...@us...> - 2004-06-23 01:45:14
|
Update of /cvsroot/teem/teem/src/ell/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8427/ell/test Modified Files: wheel.c Log Message: changed defaults Index: wheel.c =================================================================== RCS file: /cvsroot/teem/teem/src/ell/test/wheel.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** wheel.c 11 Apr 2004 15:06:35 -0000 1.2 --- wheel.c 23 Jun 2004 01:45:05 -0000 1.3 *************** *** 316,324 **** /* circle */ ! wheelWidth(&wps, 4); wheelCircle(&wps, geom[0], 0, geom[1]); /* spokes */ ! wheelWidth(&wps, 2); wheelLine(&wps, geom[0], 0, xroot[0], yroot[0]); wheelLine(&wps, geom[0], 0, xroot[1], yroot[1]); --- 316,324 ---- /* circle */ ! wheelWidth(&wps, 3); wheelCircle(&wps, geom[0], 0, geom[1]); /* spokes */ ! wheelWidth(&wps, 4); wheelLine(&wps, geom[0], 0, xroot[0], yroot[0]); wheelLine(&wps, geom[0], 0, xroot[1], yroot[1]); |
|
From: Gordon K. <kin...@us...> - 2004-06-23 01:43:55
|
Update of /cvsroot/teem/teem/src/nrrd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8204 Modified Files: nrrdEnums.h measure.c Log Message: added skew measurement Index: measure.c =================================================================== RCS file: /cvsroot/teem/teem/src/nrrd/measure.c,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** measure.c 13 Mar 2004 20:03:10 -0000 1.47 --- measure.c 23 Jun 2004 01:43:46 -0000 1.48 *************** *** 394,397 **** --- 394,459 ---- } + void + _nrrdMeasureSkew(void *ans, int ansType, + const void *line, int lineType, int len, + double axmin, double axmax) { + double val, diff, mean, vari, third; + int i, count; + + /* we don't try to do any one-pass short-cuts */ + + /* find the mean */ + mean = 0; + if (nrrdTypeIsIntegral[lineType]) { + count = len; + for (i=0; i<len; i++) { + val = nrrdDLookup[lineType](line, i); + mean += val; + } + } else { + count = 0; + for (i=0; i<len; i++) { + val = nrrdDLookup[lineType](line, i); + if (AIR_EXISTS(val)) { + count++; + mean += val; + } + } + } + if (0 == count) { + nrrdDStore[ansType](ans, AIR_NAN); + return; + } + mean /= count; + + /* find the variance and third moment */ + vari = third = 0; + if (nrrdTypeIsIntegral[lineType]) { + for (i=0; i<len; i++) { + diff = nrrdDLookup[lineType](line, i) - mean; + vari += diff*diff; + third += diff*diff*diff; + } + } else { + for (i=0; i<len; i++) { + val = nrrdDLookup[lineType](line, i); + if (AIR_EXISTS(val)) { + diff = val - mean; + vari += diff*diff; + third += diff*diff*diff; + } + } + } + if (0 == vari) { + /* why not have an existant value ... */ + nrrdDStore[ansType](ans, 0); + return; + } + vari /= count; + third /= count; + + nrrdDStore[ansType](ans, third/(vari*sqrt(vari))); + } + /* ** one thing which ALL the _nrrdMeasureHisto measures assume is that, *************** *** 700,703 **** --- 762,766 ---- _nrrdMeasureVariance, _nrrdMeasureSD, + _nrrdMeasureSkew, _nrrdMeasureHistoMin, _nrrdMeasureHistoMax, *************** *** 739,742 **** --- 802,806 ---- case nrrdMeasureVariance: case nrrdMeasureSD: + case nrrdMeasureSkew: type = nrrdStateMeasureType; break; Index: nrrdEnums.h =================================================================== RCS file: /cvsroot/teem/teem/src/nrrd/nrrdEnums.h,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** nrrdEnums.h 9 Apr 2004 19:47:26 -0000 1.46 --- nrrdEnums.h 23 Jun 2004 01:43:46 -0000 1.47 *************** *** 333,357 **** nrrdMeasureVariance, /* 11 */ nrrdMeasureSD, /* 12: standard deviation */ /* ** the nrrduMeasureHisto... measures interpret the array as a ** histogram of some implied value distribution */ ! nrrdMeasureHistoMin, /* 13 */ ! nrrdMeasureHistoMax, /* 14 */ ! nrrdMeasureHistoMean, /* 15 */ ! nrrdMeasureHistoMedian, /* 16 */ ! nrrdMeasureHistoMode, /* 17 */ ! nrrdMeasureHistoProduct, /* 18 */ ! nrrdMeasureHistoSum, /* 19 */ ! nrrdMeasureHistoL2, /* 20 */ ! nrrdMeasureHistoVariance, /* 21 */ ! nrrdMeasureHistoSD, /* 22 */ nrrdMeasureLast }; ! #define NRRD_MEASURE_MAX 22 #define NRRD_MEASURE_DESC \ "Possibilities include:\n " \ ! "\b\bo \"min\", \"max\", \"mean\", \"median\", \"mode\", \"variance\"\n " \ ! "(self-explanatory)\n " \ "\b\bo \"sd\": standard deviation\n " \ "\b\bo \"product\", \"sum\": product or sum of all values\n " \ --- 333,358 ---- nrrdMeasureVariance, /* 11 */ nrrdMeasureSD, /* 12: standard deviation */ + nrrdMeasureSkew, /* 13: skew */ /* ** the nrrduMeasureHisto... measures interpret the array as a ** histogram of some implied value distribution */ ! nrrdMeasureHistoMin, /* 14 */ ! nrrdMeasureHistoMax, /* 15 */ ! nrrdMeasureHistoMean, /* 16 */ ! nrrdMeasureHistoMedian, /* 17 */ ! nrrdMeasureHistoMode, /* 18 */ ! nrrdMeasureHistoProduct, /* 19 */ ! nrrdMeasureHistoSum, /* 20 */ ! nrrdMeasureHistoL2, /* 21 */ ! nrrdMeasureHistoVariance, /* 22 */ ! nrrdMeasureHistoSD, /* 23 */ nrrdMeasureLast }; ! #define NRRD_MEASURE_MAX 23 #define NRRD_MEASURE_DESC \ "Possibilities include:\n " \ ! "\b\bo \"min\", \"max\", \"mean\", \"median\", \"mode\", \"variance\", " \ ! "\"skew\"\n (self-explanatory)\n " \ "\b\bo \"sd\": standard deviation\n " \ "\b\bo \"product\", \"sum\": product or sum of all values\n " \ |