From: Gordon K. <kin...@us...> - 2007-02-05 01:38:39
|
Update of /cvsroot/teem/teem/src/ten In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv22174 Modified Files: aniso.c glyph.c miscTen.c ten.h tenGage.c tendPoint.c Log Message: The tenAnisoCalc_f function has been removed. It was one of the earliest and stupidest functions in the ten library, it was incapable of high accuracy for mode-related invariants, and it has been superceded by other functions. Specifically, use tenAnisoEval_f() or tenAnisoEval_d() to go from pre-computed eigenvalues to a particular anisotropy value, or use tenAnisoTen_f() or tenAnisoTen_d() to go from the full tensor value to an anisotropy value. Some functions (like tenAniso_Cl1 and related) make more sense computed from the individual eigenvalues, but others (like tenAniso_FA) can be quickly computed directly from the tensor value, no eigensolution required. The tenAniso_* enum and tenAniso airEnum are alive and well, and are used as with the tenAniso{Eval,Ten}_{f,d} to identify which anisotropy to compute. Index: aniso.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/aniso.c,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** aniso.c 3 Feb 2007 23:36:07 -0000 1.57 --- aniso.c 5 Feb 2007 01:38:37 -0000 1.58 *************** *** 849,852 **** --- 849,853 ---- } + #if 0 /* ******** tenAnisoCalc_f *************** *** 953,956 **** --- 954,958 ---- return; } + #endif int Index: glyph.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/glyph.c,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** glyph.c 14 Jan 2006 20:29:15 -0000 1.55 --- glyph.c 5 Feb 2007 01:38:37 -0000 1.56 *************** *** 180,185 **** gageShape *shape; airArray *mop; ! float *tdata, eval[3], evec[9], *cvec, rotEvec[9], mA_f[16], ! aniso[TEN_ANISO_MAX+1]; double pI[3], pW[3], cl, cp, sRot[16], mA[16], mB[16], msFr[9], tmpvec[3], R, G, B, qA, qB, glyphAniso, sliceGray; --- 180,184 ---- gageShape *shape; airArray *mop; ! float *tdata, eval[3], evec[9], *cvec, rotEvec[9], mA_f[16]; double pI[3], pW[3], cl, cp, sRot[16], mA[16], mB[16], msFr[9], tmpvec[3], R, G, B, qA, qB, glyphAniso, sliceGray; *************** *** 345,349 **** } ELL_3M_TRANSPOSE(rotEvec, evec); - tenAnisoCalc_f(aniso, eval); if (parm->doSlice && pI[parm->sliceAxis] == parm->slicePos) { --- 344,347 ---- *************** *** 372,376 **** continue; } ! sliceGray = aniso[parm->sliceAnisoType]; } if (parm->sliceGamma > 0) { --- 370,374 ---- continue; } ! sliceGray = tenAnisoEval_f(eval, parm->sliceAnisoType); } if (parm->sliceGamma > 0) { *************** *** 442,454 **** continue; } ! if (!( aniso[parm->anisoType] >= parm->anisoThresh )) { if (parm->verbose >= 2) { fprintf(stderr, "%s: glyph %d/%d: aniso[%d] %g < thresh %g\n", me, idx, numGlyphs, parm->anisoType, ! aniso[parm->anisoType], parm->anisoThresh); } continue; } ! glyphAniso = aniso[parm->colAnisoType]; /* fprintf(stderr, "%s: eret = %d; evals = %g %g %g\n", me, --- 440,452 ---- continue; } ! if (!( tenAnisoEval_f(eval, parm->anisoType) >= parm->anisoThresh )) { if (parm->verbose >= 2) { fprintf(stderr, "%s: glyph %d/%d: aniso[%d] %g < thresh %g\n", me, idx, numGlyphs, parm->anisoType, ! tenAnisoEval_f(eval, parm->anisoType), parm->anisoThresh); } continue; } ! glyphAniso = tenAnisoEval_f(eval, parm->colAnisoType); /* fprintf(stderr, "%s: eret = %d; evals = %g %g %g\n", me, *************** *** 497,502 **** /* which is the axis of revolution */ ! cl = AIR_MIN(0.99, aniso[tenAniso_Cl1]); ! cp = AIR_MIN(0.99, aniso[tenAniso_Cp1]); if (cl > cp) { axis = 0; --- 495,500 ---- /* which is the axis of revolution */ ! cl = AIR_MIN(0.99, tenAnisoEval_f(eval, tenAniso_Cl1)); ! cp = AIR_MIN(0.99, tenAnisoEval_f(eval, tenAniso_Cp1)); if (cl > cp) { axis = 0; Index: miscTen.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/miscTen.c,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** miscTen.c 14 Jan 2006 20:29:15 -0000 1.44 --- miscTen.c 5 Feb 2007 01:38:37 -0000 1.45 *************** *** 156,160 **** short *qdata; const float *tdata; ! float eval[3], evec[9], c[TEN_ANISO_MAX+1], an; size_t N, I, sx, sy, sz; --- 156,160 ---- short *qdata; const float *tdata; ! float eval[3], evec[9], an; size_t N, I, sx, sy, sz; *************** *** 191,196 **** tenEigensolve_f(eval, evec, tdata); if (scaleByAniso) { ! tenAnisoCalc_f(c, eval); ! an = c[aniso]; } else { an = 1.0; --- 191,195 ---- tenEigensolve_f(eval, evec, tdata); if (scaleByAniso) { ! an = tenAnisoEval_f(eval, aniso); } else { an = 1.0; Index: tenGage.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/tenGage.c,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** tenGage.c 3 Feb 2007 23:34:50 -0000 1.59 --- tenGage.c 5 Feb 2007 01:38:37 -0000 1.60 *************** *** 325,329 **** hessCbC[9]={0,0,0,0,0,0,0,0,0}; int ci; - float evalAnsF[3], aniso[TEN_ANISO_MAX+1]; tenAns = pvl->directAnswer[tenGageTensor]; --- 325,328 ---- *************** *** 1099,1106 **** /* --- Aniso --- */ if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageAniso)) { ! ELL_3V_COPY_TT(evalAnsF, float, evalAns); ! tenAnisoCalc_f(aniso, evalAnsF); ! for (ci=0; ci<=TEN_ANISO_MAX; ci++) { ! pvl->directAnswer[tenGageAniso][ci] = aniso[ci]; } } --- 1098,1103 ---- /* --- Aniso --- */ if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageAniso)) { ! for (ci=tenAnisoUnknown+1; ci<=TEN_ANISO_MAX; ci++) { ! pvl->directAnswer[tenGageAniso][ci] = tenAnisoEval_d(evalAns, ci); } } Index: ten.h =================================================================== RCS file: /cvsroot/teem/teem/src/ten/ten.h,v retrieving revision 1.164 retrieving revision 1.165 diff -C2 -d -r1.164 -r1.165 *** ten.h 3 Feb 2007 23:36:07 -0000 1.164 --- ten.h 5 Feb 2007 01:38:37 -0000 1.165 *************** *** 1060,1064 **** TEN_EXPORT double tenAnisoTen_d(const double ten[7], int aniso); - TEN_EXPORT void tenAnisoCalc_f(float c[TEN_ANISO_MAX+1], const float eval[3]); TEN_EXPORT int tenAnisoPlot(Nrrd *nout, int aniso, unsigned int res, int hflip, int whole, int nanout); --- 1060,1063 ---- Index: tendPoint.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/tendPoint.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tendPoint.c 14 Jan 2006 20:29:15 -0000 1.16 --- tendPoint.c 5 Feb 2007 01:38:37 -0000 1.17 *************** *** 38,43 **** int loc[3], idx, sx, sy, sz, i; Nrrd *nin; ! float *tdata, eval[3], evec[9], c[TEN_ANISO_MAX+1], ! angle, axis[3], mat[9]; hestOptAdd(&hopt, "p", "x y z", airTypeInt, 3, 3, loc, NULL, --- 38,42 ---- int loc[3], idx, sx, sy, sz, i; Nrrd *nin; ! float *tdata, eval[3], evec[9], angle, axis[3], mat[9]; hestOptAdd(&hopt, "p", "x y z", airTypeInt, 3, 3, loc, NULL, *************** *** 98,106 **** fprintf(stderr, "% 15.7f % 15.7f % 15.7f\n", mat[6], mat[7], mat[8]); - tenAnisoCalc_f(c, eval); fprintf(stderr, "anisotropies = \n"); for (i=1; i<=TEN_ANISO_MAX; i++) { fprintf(stderr, "%s: % 15.7f\n", ! airEnumStr(tenAniso, i), c[i]); } --- 97,104 ---- fprintf(stderr, "% 15.7f % 15.7f % 15.7f\n", mat[6], mat[7], mat[8]); fprintf(stderr, "anisotropies = \n"); for (i=1; i<=TEN_ANISO_MAX; i++) { fprintf(stderr, "%s: % 15.7f\n", ! airEnumStr(tenAniso, i), tenAnisoEval_f(eval, i)); } |