From: <kin...@us...> - 2010-01-19 20:04:19
|
Revision: 4519 http://teem.svn.sourceforge.net/teem/?rev=4519&view=rev Author: kindlmann Date: 2010-01-19 20:04:13 +0000 (Tue, 19 Jan 2010) Log Message: ----------- added pullInfoLiveThresh3, and fixed a major bug in _pullPointInitializeRandom by added a missing break in a switch statement Modified Paths: -------------- teem/trunk/src/pull/contextPull.c teem/trunk/src/pull/infoPull.c teem/trunk/src/pull/pointPull.c teem/trunk/src/pull/popcntl.c teem/trunk/src/pull/pull.h Modified: teem/trunk/src/pull/contextPull.c =================================================================== --- teem/trunk/src/pull/contextPull.c 2010-01-17 21:54:16 UTC (rev 4518) +++ teem/trunk/src/pull/contextPull.c 2010-01-19 20:04:13 UTC (rev 4519) @@ -213,6 +213,7 @@ case pullInfoSeedThresh: case pullInfoLiveThresh: case pullInfoLiveThresh2: + case pullInfoLiveThresh3: case pullInfoTangentMode: case pullInfoIsovalue: case pullInfoStrength: Modified: teem/trunk/src/pull/infoPull.c =================================================================== --- teem/trunk/src/pull/infoPull.c 2010-01-17 21:54:16 UTC (rev 4518) +++ teem/trunk/src/pull/infoPull.c 2010-01-19 20:04:13 UTC (rev 4519) @@ -39,6 +39,7 @@ "seedthresh", "livethresh", "livethresh2", + "livethresh3", "tan1", "tan2", "tanmode", @@ -65,6 +66,7 @@ pullInfoSeedThresh, /* [1] scalar for thresholding seeding */ pullInfoLiveThresh, /* [1] */ pullInfoLiveThresh2, /* [1] */ + pullInfoLiveThresh3, /* [1] */ pullInfoTangent1, /* [3] first tangent to constraint surf */ pullInfoTangent2, /* [3] second tangent to constraint surf */ pullInfoTangentMode, /* [1] for morphing between co-dim 1 and 2 */ @@ -90,6 +92,7 @@ "seedthresh", "sthr", "livethresh", "lthr", "livethresh2", "lthr2", + "livethresh3", "lthr3", "tan1", "tan2", "tanmode", "tmode", @@ -116,6 +119,7 @@ pullInfoSeedThresh, pullInfoSeedThresh, pullInfoLiveThresh, pullInfoLiveThresh, pullInfoLiveThresh2, pullInfoLiveThresh2, + pullInfoLiveThresh3, pullInfoLiveThresh3, pullInfoTangent1, pullInfoTangent2, pullInfoTangentMode, pullInfoTangentMode, @@ -154,6 +158,7 @@ 1, /* pullInfoSeedThresh */ 1, /* pullInfoLiveThresh */ 1, /* pullInfoLiveThresh2 */ + 1, /* pullInfoLiveThresh3 */ 3, /* pullInfoTangent1 */ 3, /* pullInfoTangent2 */ 1, /* pullInfoTangentMode */ Modified: teem/trunk/src/pull/pointPull.c =================================================================== --- teem/trunk/src/pull/pointPull.c 2010-01-17 21:54:16 UTC (rev 4518) +++ teem/trunk/src/pull/pointPull.c 2010-01-19 20:04:13 UTC (rev 4519) @@ -270,6 +270,7 @@ 0, /* pullInfoSeedThresh */ 0, /* pullInfoLiveThresh */ 0, /* pullInfoLiveThresh2 */ + 0, /* pullInfoLiveThresh3 */ 0, /* pullInfoTangent1 */ 0, /* pullInfoTangent2 */ 0, /* pullInfoTangentMode */ @@ -293,6 +294,7 @@ 0, /* pullInfoSeedThresh */ 0, /* pullInfoLiveThresh */ 0, /* pullInfoLiveThresh2 */ + 0, /* pullInfoLiveThresh3 */ 0, /* pullInfoTangent1 */ 0, /* pullInfoTangent2 */ 0, /* pullInfoTangentMode */ @@ -618,12 +620,20 @@ NULL, NULL); reject |= (seedv < 0); } - if (!reject && pctx->ispec[pullInfoLiveThresh2]) { + /* HEY copy & paste */ + if (!reject && pctx->ispec[pullInfoLiveThresh2]) { double seedv; seedv = _pullPointScalar(pctx, point, pullInfoLiveThresh2, NULL, NULL); reject |= (seedv < 0); } + /* HEY copy & paste */ + if (!reject && pctx->ispec[pullInfoLiveThresh3]) { + double seedv; + seedv = _pullPointScalar(pctx, point, pullInfoLiveThresh3, + NULL, NULL); + reject |= (seedv < 0); + } } break; case 2: @@ -658,7 +668,7 @@ /* output */ int *createFailP) { static const char me[]="_pullPointInitializeRandom"; - int reject, threshFail, constrFail; + int reject, threshFail, constrFail, verbo; airRandMTState *rng; unsigned int threshFailCount = 0, constrFailCount = 0; rng = pctx->task[0]->rng; @@ -684,13 +694,24 @@ } else { point->pos[3] = 0.0; } + /* + verbo = (AIR_ABS(-0.246015 - point->pos[0]) < 0.1 && + AIR_ABS(-144.78 - point->pos[0]) < 0.1 && + AIR_ABS(-85.3813 - point->pos[0]) < 0.1); + */ + verbo = AIR_FALSE; + if (verbo) { + fprintf(stderr, "%s: verbo on for point %u at %g %g %g %g\n", me, + point->idtag, point->pos[0], point->pos[1], + point->pos[2], point->pos[3]); + } _pullPointHistAdd(point, pullCondOld); /* Do a tentative probe */ if (_pullProbe(pctx->task[0], point)) { biffAddf(PULL, "%s: probing pointIdx %u of world", me, pointIdx); return 1; } - /* Enforce constrains and thresholds */ + /* Enforce constraints and thresholds */ threshFail = AIR_FALSE; for (task=0; task<3; task++) { double seedv; @@ -702,6 +723,7 @@ NULL, NULL); reject |= (seedv < 0); } + break; case 1: if (!reject && pctx->ispec[pullInfoSeedThresh]) { seedv = _pullPointScalar(pctx, point, pullInfoSeedThresh, @@ -719,6 +741,7 @@ } else { threshFail = AIR_FALSE; } + /* HEY copy & paste */ if (!reject && pctx->ispec[pullInfoLiveThresh2]) { seedv = _pullPointScalar(pctx, point, pullInfoLiveThresh2, NULL, NULL); @@ -726,6 +749,14 @@ } else { threshFail = AIR_FALSE; } + /* HEY copy & paste */ + if (!reject && pctx->ispec[pullInfoLiveThresh3]) { + seedv = _pullPointScalar(pctx, point, pullInfoLiveThresh3, + NULL, NULL); + threshFailCount += (threshFail = (seedv < 0)); + } else { + threshFail = AIR_FALSE; + } } reject |= threshFail; break; @@ -795,11 +826,18 @@ NULL, NULL); reject |= (seedv < 0); } + /* HEY copy & paste */ if (!reject && pctx->ispec[pullInfoLiveThresh2]) { seedv = _pullPointScalar(pctx, point, pullInfoLiveThresh2, NULL, NULL); reject |= (seedv < 0); } + /* HEY copy & paste */ + if (!reject && pctx->ispec[pullInfoLiveThresh3]) { + seedv = _pullPointScalar(pctx, point, pullInfoLiveThresh3, + NULL, NULL); + reject |= (seedv < 0); + } } if (reject) { *createFailP = AIR_TRUE; Modified: teem/trunk/src/pull/popcntl.c =================================================================== --- teem/trunk/src/pull/popcntl.c 2010-01-17 21:54:16 UTC (rev 4518) +++ teem/trunk/src/pull/popcntl.c 2010-01-19 20:04:13 UTC (rev 4519) @@ -236,6 +236,14 @@ task->processMode = pullProcessModeAdding; return 0; } + if (task->pctx->ispec[pullInfoLiveThresh3] /* HEY: copy & paste */ + && 0 > _pullPointScalar(task->pctx, newpnt, pullInfoLiveThresh3, + NULL, NULL)) { + /* didn't meet threshold */ + newpnt = pullPointNix(newpnt); + task->processMode = pullProcessModeAdding; + return 0; + } /* see if the new point should be nixed because its at a volume edge */ if (task->pctx->flag.nixAtVolumeEdgeSpace && (newpnt->status & PULL_STATUS_EDGE_BIT)) { @@ -299,12 +307,20 @@ point->status |= PULL_STATUS_NIXME_BIT; return 0; } + /* HEY copy & paste */ if (task->pctx->ispec[pullInfoLiveThresh2] && 0 > _pullPointScalar(task->pctx, point, pullInfoLiveThresh2, NULL, NULL)) { point->status |= PULL_STATUS_NIXME_BIT; return 0; } + /* HEY copy & paste */ + if (task->pctx->ispec[pullInfoLiveThresh3] + && 0 > _pullPointScalar(task->pctx, point, pullInfoLiveThresh3, + NULL, NULL)) { + point->status |= PULL_STATUS_NIXME_BIT; + return 0; + } /* is energy lower without us around? */ enrWith = (_pullEnergyFromPoints(task, bin, point, NULL) + _pointEnergyOfNeighbors(task, bin, point, &fracNixed)); Modified: teem/trunk/src/pull/pull.h =================================================================== --- teem/trunk/src/pull/pull.h 2010-01-17 21:54:16 UTC (rev 4518) +++ teem/trunk/src/pull/pull.h 2010-01-19 20:04:13 UTC (rev 4519) @@ -111,19 +111,20 @@ particles, AND for future additions from population control */ pullInfoLiveThresh2, /* 13: [1] another pullInfoLiveThresh */ - pullInfoTangent1, /* 14: [3] first tangent to constraint surf */ - pullInfoTangent2, /* 15: [3] second tangent to constraint surf */ - pullInfoTangentMode, /* 16: [1] for morphing between co-dim 1 and 2; + pullInfoLiveThresh3, /* 14: [1] yet another pullInfoLiveThresh */ + pullInfoTangent1, /* 15: [3] first tangent to constraint surf */ + pullInfoTangent2, /* 16: [3] second tangent to constraint surf */ + pullInfoTangentMode, /* 17: [1] for morphing between co-dim 1 and 2; User must set scale so mode from -1 to 1 means co-dim 1 (surface) to 2 (line) */ - pullInfoIsovalue, /* 17: [1] for isosurface extraction */ - pullInfoIsovalueGradient, /* 18: [3] */ - pullInfoIsovalueHessian, /* 19: [9] */ - pullInfoStrength, /* 20: [1] */ - pullInfoQuality, /* 21: [1] */ + pullInfoIsovalue, /* 18: [1] for isosurface extraction */ + pullInfoIsovalueGradient, /* 19: [3] */ + pullInfoIsovalueHessian, /* 20: [9] */ + pullInfoStrength, /* 21: [1] */ + pullInfoQuality, /* 22: [1] */ pullInfoLast }; -#define PULL_INFO_MAX 21 +#define PULL_INFO_MAX 22 /* ******** pullVal* enum This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |