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-04-22 07:59:55
|
Update of /cvsroot/teem/teem/src/ten In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8015 Modified Files: aniso.c Log Message: fixed bug to avoid NaN generation Index: aniso.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/aniso.c,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** aniso.c 22 Apr 2004 04:49:26 -0000 1.29 --- aniso.c 22 Apr 2004 07:13:01 -0000 1.30 *************** *** 102,106 **** c[tenAniso_S] = e0*e0 + e1*e1 + e2*e2; c[tenAniso_Skew] = R/(FLT_EPSILON + sqrt(2*Q*Q*Q)); ! c[tenAniso_Th] = acos(sqrt(2)*c[tenAniso_Skew])/3; c[tenAniso_Cz] = ((e0 + e1)/(FLT_EPSILON + e2) + (e1 + e2)/(FLT_EPSILON + e0) --- 102,106 ---- c[tenAniso_S] = e0*e0 + e1*e1 + e2*e2; c[tenAniso_Skew] = R/(FLT_EPSILON + sqrt(2*Q*Q*Q)); ! c[tenAniso_Th] = acos(AIR_CLAMP(-1, sqrt(2)*c[tenAniso_Skew], 1))/3; c[tenAniso_Cz] = ((e0 + e1)/(FLT_EPSILON + e2) + (e1 + e2)/(FLT_EPSILON + e0) |
|
From: Gordon K. <kin...@us...> - 2004-04-22 07:56:31
|
Update of /cvsroot/teem/teem/src/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6356 Modified Files: overrgb.c Log Message: added ability to do contrast and contrast fixed point Index: overrgb.c =================================================================== RCS file: /cvsroot/teem/teem/src/bin/overrgb.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** overrgb.c 16 Jan 2004 17:52:37 -0000 1.12 --- overrgb.c 22 Apr 2004 07:01:40 -0000 1.13 *************** *** 36,39 **** --- 36,55 ---- "image; it will be resampled (with linear interpolation) to fit. "); + double + docontrast(double val, double cfp, double cpow) { + double v; + + if (val < cfp) { + v = AIR_AFFINE(0.0, val, cfp, 0.0, 1.0); + v = pow(v, cpow); + val = AIR_AFFINE(0.0, v, 1.0, 0.0, cfp); + } else { + v = AIR_AFFINE(cfp, val, 1.0, 1.0, 0.0); + v = pow(v, cpow); + val = AIR_AFFINE(1.0, v, 0.0, cfp, 1.0); + } + return val; + } + int main(int argc, char *argv[]) { *************** *** 45,49 **** *nrgbaD; /* rgba input as double */ char *me, *outS, *errS; ! double gamma, back[3], *rgbaD, r, g, b, a; airArray *mop; int E, min[3], max[3], i, rI, gI, bI, sx, sy; --- 61,65 ---- *nrgbaD; /* rgba input as double */ char *me, *outS, *errS; ! double gamma, contr, cfp, cpow, back[3], *rgbaD, r, g, b, a; airArray *mop; int E, min[3], max[3], i, rI, gI, bI, sx, sy; *************** *** 55,60 **** hestOptAdd(&hopt, "i", "nin", airTypeOther, 1, 1, &nin, NULL, "input nrrd to composite", NULL, NULL, nrrdHestNrrd); hestOptAdd(&hopt, "g", "gamma", airTypeDouble, 1, 1, &gamma, "1.0", ! "gamma to apply to image data"); hestOptAdd(&hopt, "b", "background", airTypeDouble, 3, 3, back, "0 0 0", "background color to composite against; white is " --- 71,82 ---- hestOptAdd(&hopt, "i", "nin", airTypeOther, 1, 1, &nin, NULL, "input nrrd to composite", NULL, NULL, nrrdHestNrrd); + hestOptAdd(&hopt, "c", "contrast", airTypeDouble, 1, 1, &contr, "0.0", + "contrast to apply to RGB values, before gamma. \"0.0\" " + "means no change, \"1.0\" means thresholding, \"-1.0\" " + "means a complete washout."); + hestOptAdd(&hopt, "cfp", "fixed point", airTypeDouble, 1, 1, &cfp, "0.5", + "component level that doesn't change with contrast"); hestOptAdd(&hopt, "g", "gamma", airTypeDouble, 1, 1, &gamma, "1.0", ! "gamma to apply to image data, after contrast"); hestOptAdd(&hopt, "b", "background", airTypeDouble, 3, 3, back, "0 0 0", "background color to composite against; white is " *************** *** 146,150 **** free(errS); return 1; } ! outUC = (unsigned char*)nout->data; bgUC = nbg ? nbg->data : NULL; --- 168,174 ---- free(errS); return 1; } ! ! contr = AIR_CLAMP(-1, contr, 1); ! cpow = tan(AIR_AFFINE(-1.000001, contr, 1.000001, 0, AIR_PI/2)); outUC = (unsigned char*)nout->data; bgUC = nbg ? nbg->data : NULL; *************** *** 155,158 **** --- 179,187 ---- b = AIR_CLAMP(0, rgbaD[2], 1); a = AIR_CLAMP(0, rgbaD[3], 1); + if (1 != cpow) { + r = docontrast(r, cfp, cpow); + g = docontrast(g, cfp, cpow); + b = docontrast(b, cfp, cpow); + } r = pow(r, 1.0/gamma); g = pow(g, 1.0/gamma); |
|
From: Gordon K. <kin...@us...> - 2004-04-22 07:27:59
|
Update of /cvsroot/teem/teem/src/gage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8925 Modified Files: gage.h vecGage.c Log Message: added sub-items for the individual vector components Index: gage.h =================================================================== RCS file: /cvsroot/teem/teem/src/gage/gage.h,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** gage.h 11 Apr 2004 02:31:41 -0000 1.65 --- gage.h 22 Apr 2004 07:19:00 -0000 1.66 *************** *** 279,296 **** gageVecUnknown=-1, /* -1: nobody knows */ gageVecVector, /* 0: "v", component-wise-intrpolated (CWI) vec: GT[3] */ ! gageVecLength, /* 1: "l", length of CWI vector: GT[1] */ ! gageVecNormalized, /* 2: "n", normalized CWI vector: GT[3] */ ! gageVecJacobian, /* 3: "j", component-wise Jacobian: GT[9] 0:dv_x/dx 3:dv_x/dy 6:dv_x/dz 1:dv_y/dx 4:dv_y/dy 7:dv_y/dz 2:dv_z/dx 5:dv_z/dy 8:dv_z/dz */ ! gageVecDivergence, /* 4: "d", divergence (based on Jacobian): GT[1] */ ! gageVecCurl, /* 5: "c", curl (based on Jacobian): GT[3] */ ! gageVecCurlNorm, /* 6: "cm", curl magnitude: GT[1] */ ! gageVecHelicity, /* 7: "h", helicity: vec . curl: GT[1] */ ! gageVecNormHelicity,/* 8: "nh", normalized helicity: GT[1] */ ! gageVecLambda2, /* 9: "lmbda2", lambda2 criterion: GT[1] */ ! gageVecImaginaryPart,/* 10: "imag", imag. part of jacobian's eigenv: GT[1] */ ! gageVecHessian, /* 11: "vh", second-order derivative: GT[27] 0:d2v_x/dxdx 1:d2v_x/dxdy 2:d2v_x/dxdz 3:d2v_x/dydx 4:d2v_x/dydy 5:d2v_x/dydz --- 279,299 ---- gageVecUnknown=-1, /* -1: nobody knows */ gageVecVector, /* 0: "v", component-wise-intrpolated (CWI) vec: GT[3] */ ! gageVecVector0, /* 1: "v0", vector[0]: GT[1] */ ! gageVecVector1, /* 2: "v1", vector[0]: GT[1] */ ! gageVecVector2, /* 3: "v2", vector[0]: GT[1] */ ! gageVecLength, /* 4: "l", length of CWI vector: GT[1] */ ! gageVecNormalized, /* 5: "n", normalized CWI vector: GT[3] */ ! gageVecJacobian, /* 6: "j", component-wise Jacobian: GT[9] 0:dv_x/dx 3:dv_x/dy 6:dv_x/dz 1:dv_y/dx 4:dv_y/dy 7:dv_y/dz 2:dv_z/dx 5:dv_z/dy 8:dv_z/dz */ ! gageVecDivergence, /* 7: "d", divergence (based on Jacobian): GT[1] */ ! gageVecCurl, /* 8: "c", curl (based on Jacobian): GT[3] */ ! gageVecCurlNorm, /* 9: "cm", curl magnitude: GT[1] */ ! gageVecHelicity, /* 10: "h", helicity: vec . curl: GT[1] */ ! gageVecNormHelicity,/*11: "nh", normalized helicity: GT[1] */ ! gageVecLambda2, /* 12: "lmbda2", lambda2 criterion: GT[1] */ ! gageVecImaginaryPart,/* 13: "imag", imag. part of jacobian's eigenv: GT[1] */ ! gageVecHessian, /* 14: "vh", second-order derivative: GT[27] 0:d2v_x/dxdx 1:d2v_x/dxdy 2:d2v_x/dxdz 3:d2v_x/dydx 4:d2v_x/dydy 5:d2v_x/dydz *************** *** 299,319 **** [...] 24:dv2_z/dzdx 25:d2v_z/dzdy 26:d2v_z/dzdz */ ! gageVecDivGradient,/* 12: "dg", divergence gradient: GT[3] */ ! gageVecCurlGradient,/*13: "cg", curl gradient: GT[9] */ ! gageVecCurlNormGrad,/*14: "cng", curl norm gradient: GT[3] */ ! gageVecNCurlNormGrad, /* 15: "ncng", normalized curl norm gradient: GT[3] */ ! gageVecHelGradient,/* 16: "hg", helicity gradient: GT[3] */ ! gageVecDirHelDeriv,/* 17: "dhd", directional derivative of helicity: GT[1] */ ! gageVecProjHelGradient, /* 18: "phg", projected helicity gradient: GT[3] */ ! gageVecGradient0, /* 19: "g0", gradient of 1st component of vector: GT[3] */ ! gageVecGradient1, /* 20: "g1", gradient of 2nd component of vector: GT[3] */ ! gageVecGradient2, /* 21: "g2", gradient of 3rd component of vector: GT[3] */ ! gageVecMultiGrad, /* 22: "mg", sum of outer products of gradients: GT[9] */ ! gageVecMGFrob, /* 23: "mgfrob", frob norm of multi-gradient: GT[1] */ ! gageVecMGEval, /* 24: "mgeval", eigenvalues of multi-gradient: GT[3] */ ! gageVecMGEvec, /* 25: "mgevec", eigenvectors of multi-gradient: GT[9] */ gageVecLast }; ! #define GAGE_VEC_ITEM_MAX 25 struct gageKind_t; /* dumb forward declaraction, ignore */ --- 302,322 ---- [...] 24:dv2_z/dzdx 25:d2v_z/dzdy 26:d2v_z/dzdz */ ! gageVecDivGradient,/* 15: "dg", divergence gradient: GT[3] */ ! gageVecCurlGradient,/*16: "cg", curl gradient: GT[9] */ ! gageVecCurlNormGrad,/*17: "cng", curl norm gradient: GT[3] */ ! gageVecNCurlNormGrad, /* 18: "ncng", normalized curl norm gradient: GT[3] */ ! gageVecHelGradient,/* 19: "hg", helicity gradient: GT[3] */ ! gageVecDirHelDeriv,/* 20: "dhd", directional derivative of helicity: GT[1] */ ! gageVecProjHelGradient, /* 21: "phg", projected helicity gradient: GT[3] */ ! gageVecGradient0, /* 22: "g0", gradient of 1st component of vector: GT[3] */ ! gageVecGradient1, /* 23: "g1", gradient of 2nd component of vector: GT[3] */ ! gageVecGradient2, /* 24: "g2", gradient of 3rd component of vector: GT[3] */ ! gageVecMultiGrad, /* 25: "mg", sum of outer products of gradients: GT[9] */ ! gageVecMGFrob, /* 26: "mgfrob", frob norm of multi-gradient: GT[1] */ ! gageVecMGEval, /* 27: "mgeval", eigenvalues of multi-gradient: GT[3] */ ! gageVecMGEvec, /* 28: "mgevec", eigenvectors of multi-gradient: GT[9] */ gageVecLast }; ! #define GAGE_VEC_ITEM_MAX 28 struct gageKind_t; /* dumb forward declaraction, ignore */ Index: vecGage.c =================================================================== RCS file: /cvsroot/teem/teem/src/gage/vecGage.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** vecGage.c 11 Apr 2004 02:31:41 -0000 1.20 --- vecGage.c 22 Apr 2004 07:19:00 -0000 1.21 *************** *** 62,65 **** --- 62,68 ---- /* enum value len,deriv, prereqs, parent item, index*/ {gageVecVector, 3, 0, {-1, -1, -1, -1, -1}, -1, -1}, + {gageVecVector0, 1, 0, {gageVecVector, -1, -1, -1, -1}, gageVecVector, 0}, + {gageVecVector1, 1, 0, {gageVecVector, -1, -1, -1, -1}, gageVecVector, 1}, + {gageVecVector2, 1, 0, {gageVecVector, -1, -1, -1, -1}, gageVecVector, 2}, {gageVecLength, 1, 0, {gageVecVector, -1, -1, -1, -1}, -1, -1}, {gageVecNormalized, 3, 0, {gageVecVector, gageVecLength, -1, -1, -1}, -1, -1}, *************** *** 150,154 **** gage_t *vecAns, *normAns, *jacAns, *curlAns, *hesAns, *curlGradAns, *helGradAns, *dirHelDirAns, *curlnormgradAns; ! int asw; vecAns = pvl->directAnswer[gageVecVector]; --- 153,157 ---- gage_t *vecAns, *normAns, *jacAns, *curlAns, *hesAns, *curlGradAns, *helGradAns, *dirHelDirAns, *curlnormgradAns; ! /* int asw; */ vecAns = pvl->directAnswer[gageVecVector]; *************** *** 169,172 **** --- 172,179 ---- } } + /* done if doV + if (GAGE_QUERY_ITEM_TEST(pvl->query, gageVecVector{0,1,2})) { + } + */ if (GAGE_QUERY_ITEM_TEST(pvl->query, gageVecLength)) { pvl->directAnswer[gageVecLength][0] = ELL_3V_LEN(vecAns); *************** *** 232,236 **** ELL_3M_ADD2(symm, symm, tmpMat); /* get eigenvalues in sorted order */ ! asw = ell_3m_eigenvalues_d(eval, symm, AIR_TRUE); pvl->directAnswer[gageVecLambda2][0] = eval[1]; } --- 239,243 ---- ELL_3M_ADD2(symm, symm, tmpMat); /* get eigenvalues in sorted order */ ! /* asw = */ ell_3m_eigenvalues_d(eval, symm, AIR_TRUE); pvl->directAnswer[gageVecLambda2][0] = eval[1]; } *************** *** 383,386 **** --- 390,396 ---- "(unknown gageVec)", "vector", + "vector0", + "vector1", + "vector2", "length", "normalized", *************** *** 413,416 **** --- 423,429 ---- "unknown gageVec query", "component-wise-interpolated vector", + "vector[0]", + "vector[1]", + "vector[2]", "length of vector", "normalized vector", *************** *** 443,446 **** --- 456,462 ---- gageVecUnknown, gageVecVector, + gageVecVector0, + gageVecVector1, + gageVecVector2, gageVecLength, gageVecNormalized, *************** *** 471,474 **** --- 487,493 ---- #define GV_V gageVecVector + #define GV_V0 gageVecVector0 + #define GV_V1 gageVecVector1 + #define GV_V2 gageVecVector2 #define GV_L gageVecLength #define GV_N gageVecNormalized *************** *** 500,503 **** --- 519,525 ---- _gageVecStrEqv[][AIR_STRLEN_SMALL] = { "v", "vector", "vec", + "v0", "vector0", "vec0", + "v1", "vector1", "vec1", + "v2", "vector2", "vec2", "l", "length", "len", "n", "normalized", "normalized vector", *************** *** 531,534 **** --- 553,559 ---- _gageVecValEqv[] = { GV_V, GV_V, GV_V, + GV_V0, GV_V0, GV_V0, + GV_V1, GV_V1, GV_V1, + GV_V2, GV_V2, GV_V2, GV_L, GV_L, GV_L, GV_N, GV_N, GV_N, |
|
From: Gordon K. <kin...@us...> - 2004-04-22 07:22:03
|
Update of /cvsroot/teem/teem/src/ten In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8348 Modified Files: enumsTen.c ten.h tenGage.c Log Message: changing variable names from ...P... to ...Theta... Index: enumsTen.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/enumsTen.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** enumsTen.c 22 Apr 2004 04:49:27 -0000 1.21 --- enumsTen.c 22 Apr 2004 07:14:54 -0000 1.22 *************** *** 189,193 **** tenGageFA, /* "fa", fractional anisotropy: GT[1] */ tenGageR, /* "r", 9*A*B - 2*A^3 - 27*C: GT[1] */ ! tenGageP, /* "p", arccos(R/sqrt(Q^3)): GT[1] */ tenGageEval, /* "eval", all eigenvalues of tensor : GT[3] */ tenGageEval0, /* "eval0", major eigenvalue of tensor : GT[1] */ --- 189,193 ---- tenGageFA, /* "fa", fractional anisotropy: GT[1] */ tenGageR, /* "r", 9*A*B - 2*A^3 - 27*C: GT[1] */ ! tenGageTheta, /* "th", arccos(R/sqrt(Q^3))/3: GT[1] */ tenGageEval, /* "eval", all eigenvalues of tensor : GT[3] */ tenGageEval0, /* "eval0", major eigenvalue of tensor : GT[1] */ *************** *** 220,226 **** tenGageRGradMag, /* "rgm", gradient magnitude of Q: GT[1] */ tenGageRNormal, /* "rn", normalized gradient of Q: GT[3] */ ! tenGagePGradVec, /* "pgv", gradient vector of P: GT[3] */ ! tenGagePGradMag, /* "pgm", gradient magnitude of P: GT[1] */ ! tenGagePNormal, /* "pn", normalized gradient of P: GT[3] */ tenGageAniso /* "an", all anisotropies: GT[TEN_ANISO_MAX+1] */ }; --- 220,226 ---- tenGageRGradMag, /* "rgm", gradient magnitude of Q: GT[1] */ tenGageRNormal, /* "rn", normalized gradient of Q: GT[3] */ ! tenGageThetaGradVec, /* "thgv", gradient vector of P: GT[3] */ ! tenGageThetaGradMag, /* "thgm", gradient magnitude of P: GT[1] */ ! tenGageThetaNormal, /* "thn", normalized gradient of P: GT[3] */ tenGageAniso /* "an", all anisotropies: GT[TEN_ANISO_MAX+1] */ }; *************** *** 237,241 **** "fa", "r", ! "p", "eval", "eval0", --- 237,241 ---- "fa", "r", ! "th", "theta", "eval", "eval0", *************** *** 268,274 **** "rgm", "r grad mag", "rn", "r normal", ! "pgv", "p grad vec", ! "pgm", "p grad mag", ! "pn", "p normal", "an", "aniso", "anisotropies", "" --- 268,274 ---- "rgm", "r grad mag", "rn", "r normal", ! "thgv", "th grad vec", ! "thgm", "th grad mag", ! "thn", "th normal", "an", "aniso", "anisotropies", "" *************** *** 286,290 **** tenGageFA, tenGageR, ! tenGageP, tenGageEval, tenGageEval0, --- 286,290 ---- tenGageFA, tenGageR, ! tenGageTheta, tenGageTheta, tenGageEval, tenGageEval0, *************** *** 317,323 **** tenGageRGradMag, tenGageRGradMag, tenGageRNormal, tenGageRNormal, ! tenGagePGradVec, tenGagePGradVec, ! tenGagePGradMag, tenGagePGradMag, ! tenGagePNormal, tenGagePNormal, tenGageAniso, tenGageAniso, tenGageAniso }; --- 317,323 ---- tenGageRGradMag, tenGageRGradMag, tenGageRNormal, tenGageRNormal, ! tenGageThetaGradVec, tenGageThetaGradVec, ! tenGageThetaGradMag, tenGageThetaGradMag, ! tenGageThetaNormal, tenGageThetaNormal, tenGageAniso, tenGageAniso, tenGageAniso }; Index: tenGage.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/tenGage.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tenGage.c 15 Apr 2004 14:55:07 -0000 1.16 --- tenGage.c 22 Apr 2004 07:14:54 -0000 1.17 *************** *** 35,39 **** {tenGageFA, 1, 0, {tenGageQ, tenGageS, -1, -1, -1}, -1, -1}, {tenGageR, 1, 0, {tenGageTrace, tenGageB, tenGageDet, tenGageS, -1}, -1, -1}, ! {tenGageP, 1, 0, {tenGageR, tenGageQ, -1, -1, -1}, -1, -1}, {tenGageEval, 3, 0, {tenGageTensor, -1, -1, -1, -1}, -1, -1}, --- 35,39 ---- {tenGageFA, 1, 0, {tenGageQ, tenGageS, -1, -1, -1}, -1, -1}, {tenGageR, 1, 0, {tenGageTrace, tenGageB, tenGageDet, tenGageS, -1}, -1, -1}, ! {tenGageTheta, 1, 0, {tenGageR, tenGageQ, -1, -1, -1}, -1, -1}, {tenGageEval, 3, 0, {tenGageTensor, -1, -1, -1, -1}, -1, -1}, *************** *** 76,82 **** {tenGageRNormal, 3, 1, {tenGageRGradVec, tenGageRGradMag, -1, -1, -1}, -1, -1}, ! {tenGagePGradVec, 3, 1, {tenGageRGradVec, tenGageQGradVec, tenGageP, -1, -1}, -1, -1}, ! {tenGagePGradMag, 1, 1, {tenGagePGradVec, -1, -1, -1, -1}, -1, -1}, ! {tenGagePNormal, 3, 1, {tenGagePGradVec, tenGagePGradMag, -1, -1, -1}, -1, -1}, {tenGageAniso, TEN_ANISO_MAX+1, 0, {tenGageEval0, tenGageEval1, tenGageEval2, -1, -1}, -1, -1} --- 76,82 ---- {tenGageRNormal, 3, 1, {tenGageRGradVec, tenGageRGradMag, -1, -1, -1}, -1, -1}, ! {tenGageThetaGradVec, 3, 1, {tenGageRGradVec, tenGageQGradVec, tenGageTheta, -1, -1}, -1, -1}, ! {tenGageThetaGradMag, 1, 1, {tenGageThetaGradVec, -1, -1, -1, -1}, -1, -1}, ! {tenGageThetaNormal, 3, 1, {tenGageThetaGradVec, tenGageThetaGradMag, -1, -1, -1}, -1, -1}, {tenGageAniso, TEN_ANISO_MAX+1, 0, {tenGageEval0, tenGageEval1, tenGageEval2, -1, -1}, -1, -1} *************** *** 175,181 **** } } if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageConfidence)) { - pvl->directAnswer[tenGageConfidence][0] = tenAns[0]; } if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageTrace)) { cbA = -(pvl->directAnswer[tenGageTrace][0] = dtA + dtD + dtF); --- 175,182 ---- } } + /* done if doV if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageConfidence)) { } + */ if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageTrace)) { cbA = -(pvl->directAnswer[tenGageTrace][0] = dtA + dtD + dtF); *************** *** 203,211 **** cbR = pvl->directAnswer[tenGageR][0] = (5*cbA*cbB - 27*cbC - 2*cbA*cbS)/54; } ! if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageP)) { cbQQQ = cbQ*cbQ*cbQ; tmp0 = cbR/(epsilon + sqrt(cbQQQ)); ! tmp0 = AIR_CLAMP(0.0, tmp0, 1.0); ! pvl->directAnswer[tenGageP][0] = acos(tmp0); } if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageEvec)) { --- 204,212 ---- cbR = pvl->directAnswer[tenGageR][0] = (5*cbA*cbB - 27*cbC - 2*cbA*cbS)/54; } ! if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageTheta)) { cbQQQ = cbQ*cbQ*cbQ; tmp0 = cbR/(epsilon + sqrt(cbQQQ)); ! tmp0 = AIR_CLAMP(-1.0, tmp0, 1.0); ! pvl->directAnswer[tenGageTheta][0] = acos(tmp0)/3; } if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageEvec)) { *************** *** 356,362 **** 1.0/(epsilon + magTmp), vecTmp); } ! /* --- P --- */ ! if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGagePGradVec)) { ! vecTmp = pvl->directAnswer[tenGagePGradVec]; tmp1 = cbQ*cbQ*cbQ; tmp1 = sqrt(tmp1)*sqrt(1.0 - cbR*cbR/(epsilon + tmp1)); --- 357,363 ---- 1.0/(epsilon + magTmp), vecTmp); } ! /* --- Theta --- */ ! if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageThetaGradVec)) { ! vecTmp = pvl->directAnswer[tenGageThetaGradVec]; tmp1 = cbQ*cbQ*cbQ; tmp1 = sqrt(tmp1)*sqrt(1.0 - cbR*cbR/(epsilon + tmp1)); *************** *** 367,375 **** -tmp1, gradCbR); } ! if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGagePGradMag)) { ! magTmp = pvl->directAnswer[tenGagePGradMag][0] = ELL_3V_LEN(vecTmp); } ! if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGagePNormal)) { ! ELL_3V_SCALE(pvl->directAnswer[tenGagePNormal], 1.0/(epsilon + magTmp), vecTmp); } --- 368,376 ---- -tmp1, gradCbR); } ! if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageThetaGradMag)) { ! magTmp = pvl->directAnswer[tenGageThetaGradMag][0] = ELL_3V_LEN(vecTmp); } ! if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageThetaNormal)) { ! ELL_3V_SCALE(pvl->directAnswer[tenGageThetaNormal], 1.0/(epsilon + magTmp), vecTmp); } Index: ten.h =================================================================== RCS file: /cvsroot/teem/teem/src/ten/ten.h,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** ten.h 22 Apr 2004 04:54:33 -0000 1.83 --- ten.h 22 Apr 2004 07:14:54 -0000 1.84 *************** *** 153,157 **** ** R = (9*A*B - 2*A^3 - 27*C)/54 = (5*A*B - 2*A*S - 27*C)/54 = thirdmoment({v1,v2,v3})/2 ! ** P = arccos(R/sqrt(Q)^3) = phase angle of cubic solution ** ** !!! Changes to this list need to be propogated to tenGage.c's --- 153,157 ---- ** R = (9*A*B - 2*A^3 - 27*C)/54 = (5*A*B - 2*A*S - 27*C)/54 = thirdmoment({v1,v2,v3})/2 ! ** P = arccos(R/sqrt(Q)^3)/3 = phase angle of cubic solution ** ** !!! Changes to this list need to be propogated to tenGage.c's *************** *** 171,175 **** tenGageFA, /* 7: "fa", fractional anisotropy: GT[1] */ tenGageR, /* 8: "r", 9*A*B - 2*A^3 - 27*C: GT[1] */ ! tenGageP, /* 9: "p", arccos(R/sqrt(Q^3)): GT[1] */ tenGageEval, /* 10: "eval", all eigenvalues of tensor : GT[3] */ --- 171,175 ---- tenGageFA, /* 7: "fa", fractional anisotropy: GT[1] */ tenGageR, /* 8: "r", 9*A*B - 2*A^3 - 27*C: GT[1] */ ! tenGageTheta, /* 9: "th", arccos(R/sqrt(Q^3))/3: GT[1] */ tenGageEval, /* 10: "eval", all eigenvalues of tensor : GT[3] */ *************** *** 213,219 **** tenGageRNormal, /* 39: "rn", normalized gradient of Q: GT[3] */ ! tenGagePGradVec, /* 40: "pgv", gradient vector of P: GT[3] */ ! tenGagePGradMag, /* 41: "pgm", gradient magnitude of P: GT[1] */ ! tenGagePNormal, /* 42: "pn", normalized gradient of P: GT[3] */ tenGageAniso, /* 43: "an", all anisotropies: GT[TEN_ANISO_MAX+1] */ --- 213,219 ---- tenGageRNormal, /* 39: "rn", normalized gradient of Q: GT[3] */ ! tenGageThetaGradVec, /* 40: "thgv", gradient vector of Th: GT[3] */ ! tenGageThetaGradMag, /* 41: "thgm", gradient magnitude of Th: GT[1] */ ! tenGageThetaNormal, /* 42: "thn", normalized gradient of Th: GT[3] */ tenGageAniso, /* 43: "an", all anisotropies: GT[TEN_ANISO_MAX+1] */ |
|
From: Gordon K. <kin...@us...> - 2004-04-22 05:04:03
|
Update of /cvsroot/teem/teem/src/ten/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22601 Modified Files: tt.c Log Message: allows tt to make glyphs for whole trace plane instead of usual barycentric space Index: tt.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/test/tt.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tt.c 7 Jan 2004 15:34:31 -0000 1.12 --- tt.c 22 Apr 2004 04:58:34 -0000 1.13 *************** *** 21,32 **** #include "../ten.h" ! char *info = ("Sample space of tensor orientation."); void ! _cap2xyz(double xyz[3], double ca, double cp, int version) { ! double cl, cs; cs = 1 - ca; cl = 1 - cs - cp; /* xyz[0] = cs*0.333 + cl*1.0 + cp*0.5; --- 21,33 ---- #include "../ten.h" ! char *info = ("Sample space of tensor shape."); void ! _cap2xyz(double xyz[3], double ca, double cp, int version, int whole) { ! double cl, cs, mean; cs = 1 - ca; cl = 1 - cs - cp; + mean = (cs + cp + cl)/3; /* xyz[0] = cs*0.333 + cl*1.0 + cp*0.5; *************** *** 37,48 **** xyz[2] = AIR_AFFINE(0, ca, 1, 1.1*xyz[2], 0.86*xyz[2]); */ ! if (1 == version) { ! xyz[0] = (3 + 3*cl - cs)/6; ! xyz[1] = (2 - 2*cl + cp)/6; ! xyz[2] = 2*cs/6; } else { ! xyz[0] = 1; ! xyz[1] = 1 - cl; ! xyz[2] = cs; } } --- 38,55 ---- xyz[2] = AIR_AFFINE(0, ca, 1, 1.1*xyz[2], 0.86*xyz[2]); */ ! if (whole) { ! ELL_3V_SET(xyz, ! AIR_AFFINE(0.0, 0.9, 1.0, mean, cl), ! AIR_AFFINE(0.0, 0.9, 1.0, mean, cp), ! AIR_AFFINE(0.0, 0.9, 1.0, mean, cs)); } else { ! if (1 == version) { ! ELL_3V_SET(xyz, ! (3 + 3*cl - cs)/6, ! (2 - 2*cl + cp)/6, ! 2*cs/6); ! } else { ! ELL_3V_SET(xyz, 1, 1 - cl, cs); ! } } } *************** *** 81,87 **** airArray *mop; ! int xi, yi, samp, version; float *tdata; ! double p[3], xyz[3], q[4], len, hackcp, maxca; double ca, cp, mD[9], mRF[9], mRI[9], mT[9], hack; Nrrd *nten; --- 88,94 ---- airArray *mop; ! int xi, yi, samp, version, whole; float *tdata; ! double p[3], xyz[3], q[4], len, hackcp=0, maxca; double ca, cp, mD[9], mRF[9], mRI[9], mT[9], hack; Nrrd *nten; *************** *** 95,98 **** --- 102,110 ---- hestOptAdd(&hopt, "ca", "max ca", airTypeDouble, 1, 1, &maxca, "0.8", "maximum ca to use at bottom edge of triangle"); + hestOptAdd(&hopt, "w", NULL, airTypeInt, 0, 0, &whole, NULL, + "sample the whole triangle of constant trace, " + "instead of just the " + "sixth of it in which the eigenvalues have the " + "traditional sorted order. "); hestOptAdd(&hopt, "hack", "hack", airTypeDouble, 1, 1, &hack, "0.04", "this is a hack"); *************** *** 131,139 **** ELL_3M_TRANSPOSE(mRI, mRF); for (yi=0; yi<samp; yi++) { ! ca = AIR_AFFINE(0, yi, samp-1, hack, maxca); ! hackcp = AIR_AFFINE(0, yi, samp-1, hack, 0); for (xi=0; xi<=yi; xi++) { ! cp = AIR_AFFINE(0, xi, samp-1, hackcp, maxca-hack/2.0); ! _cap2xyz(xyz, ca, cp, version); /* fprintf(stderr, "%s: (%d,%d) -> (%g,%g) -> %g %g %g\n", me, --- 143,159 ---- ELL_3M_TRANSPOSE(mRI, mRF); for (yi=0; yi<samp; yi++) { ! if (whole) { ! ca = AIR_AFFINE(0, yi, samp-1, 0.0, 1.0); ! } else { ! ca = AIR_AFFINE(0, yi, samp-1, hack, maxca); ! hackcp = AIR_AFFINE(0, yi, samp-1, hack, 0); ! } for (xi=0; xi<=yi; xi++) { ! if (whole) { ! cp = AIR_AFFINE(0, xi, samp-1, 0.0, 1.0); ! } else { ! cp = AIR_AFFINE(0, xi, samp-1, hackcp, maxca-hack/2.0); ! } ! _cap2xyz(xyz, ca, cp, version, whole); /* fprintf(stderr, "%s: (%d,%d) -> (%g,%g) -> %g %g %g\n", me, |
|
From: Gordon K. <kin...@us...> - 2004-04-22 04:59:39
|
Update of /cvsroot/teem/teem/src/ten In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22041 Modified Files: ten.h Log Message: fixed description of FA and RA in comments Index: ten.h =================================================================== RCS file: /cvsroot/teem/teem/src/ten/ten.h,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** ten.h 15 Apr 2004 14:55:07 -0000 1.82 --- ten.h 22 Apr 2004 04:54:33 -0000 1.83 *************** *** 67,71 **** tenAnisoLast }; ! #define TEN_ANISO_MAX 22 /* --- 67,71 ---- tenAnisoLast }; ! #define TEN_ANISO_MAX 25 /* *************** *** 134,139 **** "\b\bo \"cs1\", \"cs2\": Westin's spherical (1-ca)\n " \ "\b\bo \"ct1\", \"ct2\": GK's anisotropy type (cp/ca)\n " \ ! "\b\bo \"ra\": Basser/Pierpaoli relative anisotropy\n " \ ! "\b\bo \"fa\": Basser/Pierpaoli fractional anisotropy/sqrt(2)\n " \ "\b\bo \"vf\": volume fraction = 1-(Basser/Pierpaoli volume ratio)\n " \ "\b\bo \"tr\": trace" --- 134,139 ---- "\b\bo \"cs1\", \"cs2\": Westin's spherical (1-ca)\n " \ "\b\bo \"ct1\", \"ct2\": GK's anisotropy type (cp/ca)\n " \ ! "\b\bo \"ra\": Basser/Pierpaoli relative anisotropy/sqrt(2)\n " \ ! "\b\bo \"fa\": Basser/Pierpaoli fractional anisotropy\n " \ "\b\bo \"vf\": volume fraction = 1-(Basser/Pierpaoli volume ratio)\n " \ "\b\bo \"tr\": trace" |
|
From: Gordon K. <kin...@us...> - 2004-04-22 04:55:03
|
Update of /cvsroot/teem/teem/src/ten In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21467 Modified Files: aniso.c enumsTen.c Log Message: added hacks to learn eigenvalues from aniso Index: aniso.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/aniso.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** aniso.c 30 Mar 2004 19:25:14 -0000 1.28 --- aniso.c 22 Apr 2004 04:49:26 -0000 1.29 *************** *** 108,111 **** --- 108,114 ---- c[tenAniso_Det] = e0*e1*e2; c[tenAniso_Tr] = e0 + e1 + e2; + c[TEN_ANISO_MAX-2] = e0; + c[TEN_ANISO_MAX-1] = e1; + c[TEN_ANISO_MAX-0] = e2; return; } Index: enumsTen.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/enumsTen.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** enumsTen.c 15 Apr 2004 14:55:07 -0000 1.20 --- enumsTen.c 22 Apr 2004 04:49:27 -0000 1.21 *************** *** 47,51 **** "Cz", "Det", ! "Tr" }; --- 47,54 ---- "Cz", "Det", ! "Tr", ! "hack0", ! "hack1", ! "hack2" }; |
|
From: Gordon K. <kin...@us...> - 2004-04-22 04:48:11
|
Update of /cvsroot/teem/teem/src/limn/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20434 Modified Files: off2eps.c Log Message: added -bg flag Index: off2eps.c =================================================================== RCS file: /cvsroot/teem/teem/src/limn/test/off2eps.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** off2eps.c 3 Mar 2004 13:14:08 -0000 1.7 --- off2eps.c 22 Apr 2004 04:40:39 -0000 1.8 *************** *** 27,31 **** char *me, *err, *inS, *outS; limnCamera *cam; ! float winscale, edgeWidth[5], creaseAngle; hestOpt *hopt=NULL; airArray *mop; --- 27,31 ---- char *me, *err, *inS, *outS; limnCamera *cam; ! float bg[3], winscale, edgeWidth[5], creaseAngle; hestOpt *hopt=NULL; airArray *mop; *************** *** 73,76 **** --- 73,78 ---- hestOptAdd(&hopt, "describe", NULL, airTypeInt, 0, 0, &describe, NULL, "for debugging: list object definition of OFF read"); + hestOptAdd(&hopt, "bg", "background", airTypeFloat, 3, 3, bg, "1 1 1", + "background RGB color; each component in range [0.0,1.0]"); hestOptAdd(&hopt, "nobg", NULL, airTypeInt, 0, 0, &nobg, NULL, "don't initially fill with background color"); *************** *** 139,142 **** --- 141,145 ---- win->ps.creaseAngle = creaseAngle; win->ps.noBackground = nobg; + ELL_3V_COPY(win->ps.bg, bg); win->file = airFopen(outS, stdout, "w"); |
|
From: Gordon K. <kin...@us...> - 2004-04-15 14:55:20
|
Update of /cvsroot/teem/teem/src/ten In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1888 Modified Files: enumsTen.c ten.h tenGage.c Log Message: shockingly, tensor confidence was not a gage-accessible value until now Index: enumsTen.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/enumsTen.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** enumsTen.c 30 Mar 2004 19:25:14 -0000 1.19 --- enumsTen.c 15 Apr 2004 14:55:07 -0000 1.20 *************** *** 68,71 **** --- 68,73 ---- "tensor", + "confidence", + "trace", "B", *************** *** 127,130 **** --- 129,133 ---- "(unknown tenGage item)", "tensor", + "confidence", "trace", "B", *************** *** 175,178 **** --- 178,182 ---- tenGageUnknown, tenGageTensor, /* "t", the reconstructed tensor: GT[7] */ + tenGageConfidence, /* "c", first of seven tensor values: GT[1] */ tenGageTrace, /* "tr", trace of tensor: GT[1] */ tenGageB, /* "b": GT[1] */ *************** *** 222,225 **** --- 226,230 ---- _tenGageStrEqv[][AIR_STRLEN_SMALL] = { "t", "tensor", + "c", "conf", "tr", "trace", "b", *************** *** 270,273 **** --- 275,279 ---- _tenGageValEqv[] = { tenGageTensor, tenGageTensor, + tenGageConfidence, tenGageConfidence, tenGageTrace, tenGageTrace, tenGageB, *************** *** 392,396 **** "length", "len", "steps", ! "confidence", "conf", "bounds", "" --- 398,402 ---- "length", "len", "steps", ! "confidence", "conf", "c", "bounds", "" *************** *** 402,406 **** tenFiberStopLength, tenFiberStopLength, tenFiberStopNumSteps, ! tenFiberStopConfidence, tenFiberStopConfidence, tenFiberStopBounds }; --- 408,412 ---- tenFiberStopLength, tenFiberStopLength, tenFiberStopNumSteps, ! tenFiberStopConfidence, tenFiberStopConfidence, tenFiberStopConfidence, tenFiberStopBounds }; Index: tenGage.c =================================================================== RCS file: /cvsroot/teem/teem/src/ten/tenGage.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tenGage.c 23 Feb 2004 06:03:13 -0000 1.15 --- tenGage.c 15 Apr 2004 14:55:07 -0000 1.16 *************** *** 26,29 **** --- 26,30 ---- /* enum value len,deriv, prereqs, parent item, index*/ {tenGageTensor, 7, 0, {-1, -1, -1, -1, -1}, -1, -1}, + {tenGageConfidence, 1, 0, {tenGageTensor, -1, -1, -1, -1}, tenGageTensor, 0}, {tenGageTrace, 1, 0, {tenGageTensor, -1, -1, -1, -1}, -1, -1}, *************** *** 174,177 **** --- 175,181 ---- } } + if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageConfidence)) { + pvl->directAnswer[tenGageConfidence][0] = tenAns[0]; + } if (GAGE_QUERY_ITEM_TEST(pvl->query, tenGageTrace)) { cbA = -(pvl->directAnswer[tenGageTrace][0] = dtA + dtD + dtF); Index: ten.h =================================================================== RCS file: /cvsroot/teem/teem/src/ten/ten.h,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** ten.h 30 Mar 2004 19:25:14 -0000 1.81 --- ten.h 15 Apr 2004 14:55:07 -0000 1.82 *************** *** 154,157 **** --- 154,161 ---- = (5*A*B - 2*A*S - 27*C)/54 = thirdmoment({v1,v2,v3})/2 ** P = arccos(R/sqrt(Q)^3) = phase angle of cubic solution + ** + ** !!! Changes to this list need to be propogated to tenGage.c's + ** !!! _tenGageTable[] and _tenGageAnswer(), + ** !!! and to enumsTen.c's tenGage airEnum. */ enum { *************** *** 159,219 **** tenGageTensor, /* 0: "t", the reconstructed tensor: GT[7] */ ! tenGageTrace, /* 1: "tr", trace of tensor: GT[1] */ ! tenGageB, /* 2: "b": GT[1] */ ! tenGageDet, /* 3: "det", determinant of tensor: GT[1] */ ! tenGageS, /* 4: "s", square of frobenius norm: GT[1] */ ! tenGageQ, /* 5: "q", (S - B)/9: GT[1] */ ! tenGageFA, /* 6: "fa", fractional anisotropy: GT[1] */ ! tenGageR, /* 7: "r", 9*A*B - 2*A^3 - 27*C: GT[1] */ ! tenGageP, /* 8: "p", arccos(R/sqrt(Q^3)): GT[1] */ ! tenGageEval, /* 9: "eval", all eigenvalues of tensor : GT[3] */ ! tenGageEval0, /* 10: "eval0", major eigenvalue of tensor : GT[1] */ ! tenGageEval1, /* 11: "eval1", medium eigenvalue of tensor : GT[1] */ ! tenGageEval2, /* 12: "eval2", minor eigenvalue of tensor : GT[1] */ ! tenGageEvec, /* 13: "evec", major eigenvectors of tensor: GT[9] */ ! tenGageEvec0, /* 14: "evec0", major eigenvectors of tensor: GT[3] */ ! tenGageEvec1, /* 15: "evec1", medium eigenvectors of tensor: GT[3] */ ! tenGageEvec2, /* 16: "evec2", minor eigenvectors of tensor: GT[3] */ ! tenGageTensorGrad, /* 17: "tg, all tensor component gradients, starting with the confidence gradient: GT[21] */ ! tenGageTraceGradVec, /* 18: "trgv": gradient (vector) of trace: GT[3] */ ! tenGageTraceGradMag, /* 19: "trgm": gradient magnitude of trace: GT[1] */ ! tenGageTraceNormal, /* 20: "trn": normal of trace: GT[3] */ ! tenGageBGradVec, /* 21: "bgv", gradient (vector) of B: GT[3] */ ! tenGageBGradMag, /* 22: "bgm", gradient magnitude of B: GT[1] */ ! tenGageBNormal, /* 23: "bn", normal of B: GT[3] */ ! tenGageDetGradVec, /* 24: "detgv", gradient (vector) of Det: GT[3] */ ! tenGageDetGradMag, /* 25: "detgm", gradient magnitude of Det: GT[1] */ ! tenGageDetNormal, /* 26: "detn", normal of Det: GT[3] */ ! tenGageSGradVec, /* 27: "sgv", gradient (vector) of S: GT[3] */ ! tenGageSGradMag, /* 28: "sgm", gradient magnitude of S: GT[1] */ ! tenGageSNormal, /* 29: "sn", normal of S: GT[3] */ ! tenGageQGradVec, /* 30: "qgv", gradient vector of Q: GT[3] */ ! tenGageQGradMag, /* 31: "qgm", gradient magnitude of Q: GT[1] */ ! tenGageQNormal, /* 32: "qn", normalized gradient of Q: GT[3] */ ! tenGageFAGradVec, /* 33: "fagv", gradient vector of FA: GT[3] */ ! tenGageFAGradMag, /* 34: "fagm", gradient magnitude of FA: GT[1] */ ! tenGageFANormal, /* 35: "fan", normalized gradient of FA: GT[3] */ ! tenGageRGradVec, /* 36: "rgv", gradient vector of Q: GT[3] */ ! tenGageRGradMag, /* 37: "rgm", gradient magnitude of Q: GT[1] */ ! tenGageRNormal, /* 38: "rn", normalized gradient of Q: GT[3] */ ! tenGagePGradVec, /* 39: "pgv", gradient vector of P: GT[3] */ ! tenGagePGradMag, /* 40: "pgm", gradient magnitude of P: GT[1] */ ! tenGagePNormal, /* 41: "pn", normalized gradient of P: GT[3] */ ! tenGageAniso, /* 42: "an", all anisotropies: GT[TEN_ANISO_MAX+1] */ tenGageLast }; ! #define TEN_GAGE_ITEM_MAX 42 /* --- 163,224 ---- tenGageTensor, /* 0: "t", the reconstructed tensor: GT[7] */ ! tenGageConfidence, /* 1: "c", first of seven tensor values: GT[1] */ ! tenGageTrace, /* 2: "tr", trace of tensor: GT[1] */ ! tenGageB, /* 3: "b": GT[1] */ ! tenGageDet, /* 4: "det", determinant of tensor: GT[1] */ ! tenGageS, /* 5: "s", square of frobenius norm: GT[1] */ ! tenGageQ, /* 6: "q", (S - B)/9: GT[1] */ ! tenGageFA, /* 7: "fa", fractional anisotropy: GT[1] */ ! tenGageR, /* 8: "r", 9*A*B - 2*A^3 - 27*C: GT[1] */ ! tenGageP, /* 9: "p", arccos(R/sqrt(Q^3)): GT[1] */ ! tenGageEval, /* 10: "eval", all eigenvalues of tensor : GT[3] */ ! tenGageEval0, /* 11: "eval0", major eigenvalue of tensor : GT[1] */ ! tenGageEval1, /* 12: "eval1", medium eigenvalue of tensor : GT[1] */ ! tenGageEval2, /* 13: "eval2", minor eigenvalue of tensor : GT[1] */ ! tenGageEvec, /* 14: "evec", major eigenvectors of tensor: GT[9] */ ! tenGageEvec0, /* 15: "evec0", major eigenvectors of tensor: GT[3] */ ! tenGageEvec1, /* 16: "evec1", medium eigenvectors of tensor: GT[3] */ ! tenGageEvec2, /* 17: "evec2", minor eigenvectors of tensor: GT[3] */ ! tenGageTensorGrad, /* 18: "tg, all tensor component gradients, starting with the confidence gradient: GT[21] */ ! tenGageTraceGradVec, /* 19: "trgv": gradient (vector) of trace: GT[3] */ ! tenGageTraceGradMag, /* 20: "trgm": gradient magnitude of trace: GT[1] */ ! tenGageTraceNormal, /* 21: "trn": normal of trace: GT[3] */ ! tenGageBGradVec, /* 22: "bgv", gradient (vector) of B: GT[3] */ ! tenGageBGradMag, /* 23: "bgm", gradient magnitude of B: GT[1] */ ! tenGageBNormal, /* 24: "bn", normal of B: GT[3] */ ! tenGageDetGradVec, /* 25: "detgv", gradient (vector) of Det: GT[3] */ ! tenGageDetGradMag, /* 26: "detgm", gradient magnitude of Det: GT[1] */ ! tenGageDetNormal, /* 27: "detn", normal of Det: GT[3] */ ! tenGageSGradVec, /* 28: "sgv", gradient (vector) of S: GT[3] */ ! tenGageSGradMag, /* 29: "sgm", gradient magnitude of S: GT[1] */ ! tenGageSNormal, /* 30: "sn", normal of S: GT[3] */ ! tenGageQGradVec, /* 31: "qgv", gradient vector of Q: GT[3] */ ! tenGageQGradMag, /* 32: "qgm", gradient magnitude of Q: GT[1] */ ! tenGageQNormal, /* 33: "qn", normalized gradient of Q: GT[3] */ ! tenGageFAGradVec, /* 34: "fagv", gradient vector of FA: GT[3] */ ! tenGageFAGradMag, /* 35: "fagm", gradient magnitude of FA: GT[1] */ ! tenGageFANormal, /* 36: "fan", normalized gradient of FA: GT[3] */ ! tenGageRGradVec, /* 37: "rgv", gradient vector of Q: GT[3] */ ! tenGageRGradMag, /* 38: "rgm", gradient magnitude of Q: GT[1] */ ! tenGageRNormal, /* 39: "rn", normalized gradient of Q: GT[3] */ ! tenGagePGradVec, /* 40: "pgv", gradient vector of P: GT[3] */ ! tenGagePGradMag, /* 41: "pgm", gradient magnitude of P: GT[1] */ ! tenGagePNormal, /* 42: "pn", normalized gradient of P: GT[3] */ ! tenGageAniso, /* 43: "an", all anisotropies: GT[TEN_ANISO_MAX+1] */ tenGageLast }; ! #define TEN_GAGE_ITEM_MAX 43 /* |
|
From: Gordon K. <kin...@us...> - 2004-04-15 14:54:47
|
Update of /cvsroot/teem/teem/src/mite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1762 Modified Files: txf.c Log Message: comment change Index: txf.c =================================================================== RCS file: /cvsroot/teem/teem/src/mite/txf.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** txf.c 4 Mar 2004 14:04:08 -0000 1.20 --- txf.c 15 Apr 2004 14:54:38 -0000 1.21 *************** *** 499,503 **** if (!isp->kind) { /* we got a NULL kind (as happens with output of ! gageItemSpecNew()); only NULL return is sensible */ return NULL; } --- 499,504 ---- if (!isp->kind) { /* we got a NULL kind (as happens with output of ! gageItemSpecNew(), or miteVariableParse of an ! empty string); only NULL return is sensible */ return NULL; } |
|
From: Gordon K. <kin...@us...> - 2004-04-15 14:54:13
|
Update of /cvsroot/teem/teem/src/mite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1678/mite Modified Files: ray.c Log Message: pretty serious bug: crashed if a normal spec had not been given, even if it wasn't needed, BUT, I'm not sure this is the right fix Index: ray.c =================================================================== RCS file: /cvsroot/teem/teem/src/mite/ray.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** ray.c 11 Apr 2004 15:07:27 -0000 1.22 --- ray.c 15 Apr 2004 14:54:04 -0000 1.23 *************** *** 175,182 **** ELL_3V_COPY(mtt->directAnsMiteVal[miteValView], mtt->V); NN = mtt->directAnsMiteVal[miteValNormal]; ! if (1 == muu->normalSide) { ! ELL_3V_SCALE(NN, -1, mtt->_normal); ! } else { ! ELL_3V_COPY(NN, mtt->_normal); } --- 175,184 ---- ELL_3V_COPY(mtt->directAnsMiteVal[miteValView], mtt->V); NN = mtt->directAnsMiteVal[miteValNormal]; ! if (mtt->_normal) { ! if (1 == muu->normalSide) { ! ELL_3V_SCALE(NN, -1, mtt->_normal); ! } else { ! ELL_3V_COPY(NN, mtt->_normal); ! } } |
|
From: Gordon K. <kin...@us...> - 2004-04-11 15:21:07
|
Update of /cvsroot/teem/teem/src/mite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29580 Modified Files: kindnot.c mite.h ray.c user.c Log Message: added fakeFrom for faking out view-dependent txfs, and started to added miteValWdotD Index: ray.c =================================================================== RCS file: /cvsroot/teem/teem/src/mite/ray.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** ray.c 25 Mar 2004 03:13:33 -0000 1.21 --- ray.c 11 Apr 2004 15:07:27 -0000 1.22 *************** *** 145,148 **** --- 145,154 ---- } + /* set (fake) view based on fake from */ + if (AIR_EXISTS(muu->fakeFrom[0])) { + ELL_3V_SUB(mtt->V, samplePosWorld, muu->fakeFrom); + ELL_3V_NORM(mtt->V, mtt->V, len); + } + /* do probing at this location to determine values of everything that might appear in the txf domain */ Index: kindnot.c =================================================================== RCS file: /cvsroot/teem/teem/src/mite/kindnot.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** kindnot.c 4 Mar 2004 14:04:07 -0000 1.3 --- kindnot.c 11 Apr 2004 15:07:27 -0000 1.4 *************** *** 39,43 **** "GTdotV", "VdefT", ! "VdefTdotV" }; --- 39,44 ---- "GTdotV", "VdefT", ! "VdefTdotV", ! "WdotD" }; *************** *** 60,64 **** miteValGTdotV, miteValVdefT, ! miteValVdefTdotV }; --- 61,66 ---- miteValGTdotV, miteValVdefT, ! miteValVdefTdotV, ! miteValWdotD, }; *************** *** 80,84 **** "gtdotv", "vdeft", ! "vdeftdotv" "" }; --- 82,87 ---- "gtdotv", "vdeft", ! "vdeftdotv", ! "wdotd", "" }; *************** *** 101,105 **** miteValGTdotV, miteValVdefT, ! miteValVdefTdotV }; --- 104,109 ---- miteValGTdotV, miteValVdefT, ! miteValVdefTdotV, ! miteValWdotD }; *************** *** 140,144 **** {miteValGTdotV, 1, 0, {-1, -1, -1, -1, -1}, -1, -1}, {miteValVdefT, 3, 0, {-1, -1, -1, -1, -1}, -1, -1}, ! {miteValVdefTdotV, 1, 0, {-1, -1, -1, -1, -1}, -1, -1} }; --- 144,149 ---- {miteValGTdotV, 1, 0, {-1, -1, -1, -1, -1}, -1, -1}, {miteValVdefT, 3, 0, {-1, -1, -1, -1, -1}, -1, -1}, ! {miteValVdefTdotV, 1, 0, {-1, -1, -1, -1, -1}, -1, -1}, ! {miteValWdotD, 1, 0, {-1, -1, -1, -1, -1}, -1, -1} }; Index: user.c =================================================================== RCS file: /cvsroot/teem/teem/src/mite/user.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** user.c 13 Mar 2004 20:03:10 -0000 1.18 --- user.c 11 Apr 2004 15:07:27 -0000 1.19 *************** *** 48,51 **** --- 48,53 ---- muu->opacNear1 = miteDefOpacNear1; muu->hctx = hooverContextNew(); + ELL_3V_SET(muu->fakeFrom, AIR_NAN, AIR_NAN, AIR_NAN); + ELL_3V_SET(muu->vectorD, 0, 0, 0); airMopAdd(muu->umop, muu->hctx, (airMopper)hooverContextNix, airMopAlways); for (i=0; i<GAGE_KERNEL_NUM; i++) { Index: mite.h =================================================================== RCS file: /cvsroot/teem/teem/src/mite/mite.h,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** mite.h 4 Mar 2004 14:04:08 -0000 1.29 --- mite.h 11 Apr 2004 15:07:27 -0000 1.30 *************** *** 150,153 **** --- 150,157 ---- hooverContext *hctx; /* context and input for all hoover-related things, including camera and image parameters */ + double fakeFrom[3], /* if non-NaN, then the "V"-dependent miteVal's will + use this as the nominal eye point, instead of what + is actually being used in the hooverContext */ + vectorD[3]; /* some vector to use for something */ /* local initial copies of kernels, later passed to gageKernelSet */ NrrdKernelSpec *ksp[GAGE_KERNEL_NUM]; *************** *** 187,191 **** miteShadeMethodNone, /* 1: no direction shading based on anything in the miteShadeSpec: just ambient, though ! things are still compositited with the over operator, and transfer functions are free to implement whatever shading they can */ --- 191,195 ---- miteShadeMethodNone, /* 1: no direction shading based on anything in the miteShadeSpec: just ambient, though ! things are still composited with the over operator, and transfer functions are free to implement whatever shading they can */ *************** *** 333,337 **** miteValGTdotV, /* 13: "GTdotV", normal curvature in view direction, the contraction of the geometry tensor along ! he view vector (gage_t[1]) */ miteValVdefT, /* 14: "defT", view direction, deflected by tensor, then normalized (gage_t[3]) */ --- 337,341 ---- miteValGTdotV, /* 13: "GTdotV", normal curvature in view direction, the contraction of the geometry tensor along ! the view vector (gage_t[1]) */ miteValVdefT, /* 14: "defT", view direction, deflected by tensor, then normalized (gage_t[3]) */ *************** *** 339,345 **** same as the tensor contraction along V, (gage_t[1]) */ miteValLast }; ! #define MITE_VAL_ITEM_MAX 15 /* --- 343,351 ---- same as the tensor contraction along V, (gage_t[1]) */ + miteValWdotD, /* 16: "WdotD", world space position dotted with + muu->vectorD */ miteValLast }; ! #define MITE_VAL_ITEM_MAX 16 /* |
|
From: Gordon K. <kin...@us...> - 2004-04-11 15:20:15
|
Update of /cvsroot/teem/teem/src/ell/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29410 Modified Files: wheel.c Log Message: something Index: wheel.c =================================================================== RCS file: /cvsroot/teem/teem/src/ell/test/wheel.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wheel.c 29 Mar 2004 21:15:17 -0000 1.1 --- wheel.c 11 Apr 2004 15:06:35 -0000 1.2 *************** *** 217,224 **** double tval[6], ABC[3], geom[3], xroot[3], yroot[3], bbox[4], psc; - me = argv[0]; wheelPS wps; int correct, labels; mop = airMopNew(); hparm = hestParmNew(); --- 217,224 ---- double tval[6], ABC[3], geom[3], xroot[3], yroot[3], bbox[4], psc; wheelPS wps; int correct, labels; + me = argv[0]; mop = airMopNew(); hparm = hestParmNew(); *************** *** 363,367 **** } - wheelEpilog(&wps); --- 363,366 ---- |
|
From: Gordon K. <kin...@us...> - 2004-04-11 15:19:45
|
Update of /cvsroot/teem/teem/src/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29321 Modified Files: miter.c Log Message: added -ffr fake from option Index: miter.c =================================================================== RCS file: /cvsroot/teem/teem/src/bin/miter.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** miter.c 4 Mar 2004 14:04:52 -0000 1.26 --- miter.c 11 Apr 2004 15:06:05 -0000 1.27 *************** *** 49,52 **** --- 49,53 ---- hparm->respFileEnable = AIR_TRUE; + hparm->elideMultipleNonExistFloatDefault = AIR_TRUE; hestOptAdd(&hopt, "i", "nsin", airTypeOther, 1, 1, &(muu->nsin), "", "input scalar volume to render", NULL, NULL, nrrdHestNrrd); *************** *** 62,65 **** --- 63,71 ---- NULL, NULL, NULL, "-1 1", "-1 1"); + hestOptAdd(&hopt, "ffr", "fake from", airTypeDouble, 3, 3, + &(muu->fakeFrom), "nan nan nan", + "eye point to use for view-dependent transfer functions. " + "By default (not using this option), the point used is the " + "normally specified camera eye point."); hestOptAdd(&hopt, "am", "ambient", airTypeFloat, 3, 3, muu->lit->amb, "1 1 1", "ambient light color"); |
|
From: Gordon K. <kin...@us...> - 2004-04-11 15:19:22
|
Update of /cvsroot/teem/teem/src/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29219 Modified Files: GNUmakefile Log Message: added gkms back to list of binaries, even though its probably broken Index: GNUmakefile =================================================================== RCS file: /cvsroot/teem/teem/src/bin/GNUmakefile,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** GNUmakefile 26 Feb 2004 06:26:49 -0000 1.31 --- GNUmakefile 11 Apr 2004 15:05:42 -0000 1.32 *************** *** 50,54 **** # pos2idx unu pprobe vprobe qbert mrender miter gkms ungantry ilk tend spots BINS = airSanity affine cubic nrrdSanity overrgb idx2pos emap undos talkweb \ ! pos2idx unu pprobe vprobe qbert mrender miter ungantry ilk tend spots ## _binD(bins): list of development locations for given bins --- 50,54 ---- # pos2idx unu pprobe vprobe qbert mrender miter gkms ungantry ilk tend spots BINS = airSanity affine cubic nrrdSanity overrgb idx2pos emap undos talkweb \ ! pos2idx unu pprobe vprobe qbert mrender miter gkms ungantry ilk tend spots ## _binD(bins): list of development locations for given bins |
|
From: Gordon K. <kin...@us...> - 2004-04-11 15:18:36
|
Update of /cvsroot/teem/teem/src/bane In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29105 Modified Files: gkmsTxf.c Log Message: brought txf axis labels up to par with recent mite; added minimum value width at bottom of Levoy triangle Index: gkmsTxf.c =================================================================== RCS file: /cvsroot/teem/teem/src/bane/gkmsTxf.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** gkmsTxf.c 7 Jan 2004 15:34:27 -0000 1.7 --- gkmsTxf.c 11 Apr 2004 15:04:56 -0000 1.8 *************** *** 35,39 **** airArray *mop; int pret, E, res[2], vi, gi, step; ! float min[2], max[2], top[2], v0, g0, *data, v, g, gwidth, width, tvl, tvr, vl, vr, tmp, maxa; --- 35,40 ---- airArray *mop; int pret, E, res[2], vi, gi, step; ! float min[2], max[2], top[2], v0, g0, *data, v, g, ! gwidth, width, mwidth, tvl, tvr, vl, vr, tmp, maxa; *************** *** 56,59 **** --- 57,62 ---- hestOptAdd(&opt, "w", "value width", airTypeFloat, 1, 1, &width, NULL, "range of values to be spanned at top of triangle"); + hestOptAdd(&opt, "mw", "value width", airTypeFloat, 1, 1, &mwidth, "0", + "range of values to be spanned at BOTTOM of triangle"); hestOptAdd(&opt, "step", NULL, airTypeInt, 0, 0, &step, NULL, "instead of assigning opacity inside a triangular region, " *************** *** 76,85 **** if (!E) E |= nrrdMaybeAlloc(nout, nrrdTypeFloat, 3, 1, res[0], res[1]); if (!E) E |= !(nout->axis[0].label = airStrdup("A")); ! if (!E) E |= !(nout->axis[1].label = airStrdup("gage(v)")); if (!E) nrrdAxisInfoSet(nout, nrrdAxisInfoMin, AIR_NAN, (double)min[0], (double)min[1]); if (!E) nrrdAxisInfoSet(nout, nrrdAxisInfoMax, AIR_NAN, (double)max[0], (double)max[1]); ! if (!E) E |= !(nout->axis[2].label = airStrdup("gage(gm)")); if (E) { sprintf(err, "%s: trouble creating opacity function nrrd", me); --- 79,88 ---- if (!E) E |= nrrdMaybeAlloc(nout, nrrdTypeFloat, 3, 1, res[0], res[1]); if (!E) E |= !(nout->axis[0].label = airStrdup("A")); ! if (!E) E |= !(nout->axis[1].label = airStrdup("gage(scalar:v)")); if (!E) nrrdAxisInfoSet(nout, nrrdAxisInfoMin, AIR_NAN, (double)min[0], (double)min[1]); if (!E) nrrdAxisInfoSet(nout, nrrdAxisInfoMax, AIR_NAN, (double)max[0], (double)max[1]); ! if (!E) E |= !(nout->axis[2].label = airStrdup("gage(scalar:gm)")); if (E) { sprintf(err, "%s: trouble creating opacity function nrrd", me); *************** *** 89,98 **** tvl = top[0] - width/2; tvr = top[0] + width/2; for (gi=0; gi<res[1]; gi++) { g = NRRD_CELL_POS(min[1], max[1], res[1], gi); for (vi=0; vi<res[0]; vi++) { v = NRRD_CELL_POS(min[0], max[0], res[0], vi); ! vl = AIR_AFFINE(0, g, top[1], v0, tvl); ! vr = AIR_AFFINE(0, g, top[1], v0, tvr); if (g > top[1]) { data[vi + res[0]*gi] = 0; --- 92,102 ---- tvl = top[0] - width/2; tvr = top[0] + width/2; + mwidth /= 2; for (gi=0; gi<res[1]; gi++) { g = NRRD_CELL_POS(min[1], max[1], res[1], gi); for (vi=0; vi<res[0]; vi++) { v = NRRD_CELL_POS(min[0], max[0], res[0], vi); ! vl = AIR_AFFINE(0, g, top[1], v0-mwidth, tvl); ! vr = AIR_AFFINE(0, g, top[1], v0+mwidth, tvr); if (g > top[1]) { data[vi + res[0]*gi] = 0; |
|
From: xav <xa...@us...> - 2004-04-11 02:45:16
|
Update of /cvsroot/teem/teem/src/gage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7404 Modified Files: gage.h vecGage.c Log Message: added new functions in vecGage.c, especially useful in the context of vortical flows. Index: gage.h =================================================================== RCS file: /cvsroot/teem/teem/src/gage/gage.h,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** gage.h 1 Apr 2004 22:37:26 -0000 1.64 --- gage.h 11 Apr 2004 02:31:41 -0000 1.65 *************** *** 287,294 **** gageVecDivergence, /* 4: "d", divergence (based on Jacobian): GT[1] */ gageVecCurl, /* 5: "c", curl (based on Jacobian): GT[3] */ ! gageVecHelicity, /* 6: "h", helicity: vec . curl: GT[1] */ ! gageVecNormHelicity,/* 7: "nh", normalized helicity: GT[1] */ ! gageVecLambda2, /* 8: "lmabda2", lambda2 criterion: GT[1] */ ! gageVecHessian, /* 9: "vh", second-order derivative: GT[27] 0:d2v_x/dxdx 1:d2v_x/dxdy 2:d2v_x/dxdz 3:d2v_x/dydx 4:d2v_x/dydy 5:d2v_x/dydz --- 287,296 ---- gageVecDivergence, /* 4: "d", divergence (based on Jacobian): GT[1] */ gageVecCurl, /* 5: "c", curl (based on Jacobian): GT[3] */ ! gageVecCurlNorm, /* 6: "cm", curl magnitude: GT[1] */ ! gageVecHelicity, /* 7: "h", helicity: vec . curl: GT[1] */ ! gageVecNormHelicity,/* 8: "nh", normalized helicity: GT[1] */ ! gageVecLambda2, /* 9: "lmbda2", lambda2 criterion: GT[1] */ ! gageVecImaginaryPart,/* 10: "imag", imag. part of jacobian's eigenv: GT[1] */ ! gageVecHessian, /* 11: "vh", second-order derivative: GT[27] 0:d2v_x/dxdx 1:d2v_x/dxdy 2:d2v_x/dxdz 3:d2v_x/dydx 4:d2v_x/dydy 5:d2v_x/dydz *************** *** 297,316 **** [...] 24:dv2_z/dzdx 25:d2v_z/dzdy 26:d2v_z/dzdz */ ! gageVecCurlGradient,/*10: "cg", curl gradient: GT[9] */ ! gageVecCurlNormGrad,/*11: "cng", curl norm gradient: GT[3] */ ! gageVecNCurlNormGrad, /* 12: "ncng", normalized curl norm gradient: GT[3] */ ! gageVecHelGradient,/* 13: "hg", helicity gradient: GT[3] */ ! gageVecDirHelDeriv,/* 14: "dhd", directional derivative of helicity: GT[1] */ ! gageVecProjHelGradient, /* 15: "phg", projected helicity gradient: GT[3] */ ! gageVecGradient0, /* 16: "g0", gradient of 1st component of vector: GT[3] */ ! gageVecGradient1, /* 17: "g1", gradient of 2nd component of vector: GT[3] */ ! gageVecGradient2, /* 18: "g2", gradient of 3rd component of vector: GT[3] */ ! gageVecMultiGrad, /* 19: "mg", sum of outer products of gradients: GT[9] */ ! gageVecMGFrob, /* 20: "mgfrob", frob norm of multi-gradient: GT[1] */ ! gageVecMGEval, /* 21: "mgeval", eigenvalues of multi-gradient: GT[3] */ ! gageVecMGEvec, /* 22: "mgevec", eigenvectors of multi-gradient: GT[9] */ gageVecLast }; ! #define GAGE_VEC_ITEM_MAX 22 struct gageKind_t; /* dumb forward declaraction, ignore */ --- 299,319 ---- [...] 24:dv2_z/dzdx 25:d2v_z/dzdy 26:d2v_z/dzdz */ ! gageVecDivGradient,/* 12: "dg", divergence gradient: GT[3] */ ! gageVecCurlGradient,/*13: "cg", curl gradient: GT[9] */ ! gageVecCurlNormGrad,/*14: "cng", curl norm gradient: GT[3] */ ! gageVecNCurlNormGrad, /* 15: "ncng", normalized curl norm gradient: GT[3] */ ! gageVecHelGradient,/* 16: "hg", helicity gradient: GT[3] */ ! gageVecDirHelDeriv,/* 17: "dhd", directional derivative of helicity: GT[1] */ ! gageVecProjHelGradient, /* 18: "phg", projected helicity gradient: GT[3] */ ! gageVecGradient0, /* 19: "g0", gradient of 1st component of vector: GT[3] */ ! gageVecGradient1, /* 20: "g1", gradient of 2nd component of vector: GT[3] */ ! gageVecGradient2, /* 21: "g2", gradient of 3rd component of vector: GT[3] */ ! gageVecMultiGrad, /* 22: "mg", sum of outer products of gradients: GT[9] */ ! gageVecMGFrob, /* 23: "mgfrob", frob norm of multi-gradient: GT[1] */ ! gageVecMGEval, /* 24: "mgeval", eigenvalues of multi-gradient: GT[3] */ ! gageVecMGEvec, /* 25: "mgevec", eigenvectors of multi-gradient: GT[9] */ gageVecLast }; ! #define GAGE_VEC_ITEM_MAX 25 struct gageKind_t; /* dumb forward declaraction, ignore */ Index: vecGage.c =================================================================== RCS file: /cvsroot/teem/teem/src/gage/vecGage.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** vecGage.c 1 Apr 2004 22:37:27 -0000 1.19 --- vecGage.c 11 Apr 2004 02:31:41 -0000 1.20 *************** *** 21,24 **** --- 21,61 ---- #include "privateGage.h" + /* + * highly inefficient computation of the imaginary part of complex + * conjugate eigenvalues of a 3x3 non-symmetric matrix + */ + double + gage_imaginary_part_eigenvalues( gage_t *M ) + { + double A, B, C, scale, frob, m[9], _eval[3]; + double beta, gamma; + int roots; + + frob = ELL_3M_FROB(M); + scale = frob > 10 ? 10.0/frob : 1.0; + ELL_3M_SCALE(m, scale, M); + /* + ** from gordon with mathematica; these are the coefficients of the + ** cubic polynomial in x: det(x*I - M). The full cubic is + ** x^3 + A*x^2 + B*x + C. + */ + A = -m[0] - m[4] - m[8]; + B = m[0]*m[4] - m[3]*m[1] + + m[0]*m[8] - m[6]*m[2] + + m[4]*m[8] - m[7]*m[5]; + C = (m[6]*m[4] - m[3]*m[7])*m[2] + + (m[0]*m[7] - m[6]*m[1])*m[5] + + (m[3]*m[1] - m[0]*m[4])*m[8]; + roots = ell_cubic(_eval, A, B, C, AIR_TRUE); + if ( roots != ell_cubic_root_single ) + return 0.; + + /* 2 complex conjuguate eigenvalues */ + beta = A + _eval[0]; + gamma = -C/_eval[0]; + return sqrt( 4.*gamma - beta*beta ); + } + + gageItemEntry _gageVecTable[GAGE_VEC_ITEM_MAX+1] = { *************** *** 30,37 **** --- 67,77 ---- {gageVecDivergence, 1, 1, {gageVecJacobian, -1, -1, -1, -1}, -1, -1}, {gageVecCurl, 3, 1, {gageVecJacobian, -1, -1, -1, -1}, -1, -1}, + {gageVecCurlNorm, 1, 1, {gageVecCurl, -1, -1, -1, -1}, -1, -1}, {gageVecHelicity, 1, 1, {gageVecVector, gageVecCurl, -1, -1, -1}, -1, -1}, {gageVecNormHelicity, 1, 1, {gageVecNormalized, gageVecCurl, -1, -1, -1}, -1, -1}, {gageVecLambda2, 1, 1, {gageVecJacobian, -1, -1, -1, -1}, -1, -1}, + {gageVecImaginaryPart, 1, 1, {gageVecJacobian, -1, -1, -1, -1}, -1, -1}, {gageVecHessian, 27, 2, {-1, -1, -1, -1, -1}, -1, -1}, + {gageVecDivGradient, 3, 1, {gageVecHessian, -1, -1, -1, -1}, -1, -1}, {gageVecCurlGradient, 9, 2, {gageVecHessian, -1, -1, -1, -1}, -1, -1}, {gageVecCurlNormGrad, 3, 2, {gageVecHessian, gageVecCurl, -1, -1, -1}, -1, -1}, *************** *** 59,65 **** fd = GAGE_FD(ctx); ! vec = pvl->directAnswer[gageVecVector]; ! jac = pvl->directAnswer[gageVecJacobian]; ! hes = pvl->directAnswer[gageVecHessian]; if (!ctx->parm.k3pack) { fprintf(stderr, "!%s: sorry, 6pack filtering not implemented\n", me); --- 99,105 ---- fd = GAGE_FD(ctx); ! vec = pvl->directAnswer[gageVecVector]; ! jac = pvl->directAnswer[gageVecJacobian]; ! hes = pvl->directAnswer[gageVecHessian]; if (!ctx->parm.k3pack) { fprintf(stderr, "!%s: sorry, 6pack filtering not implemented\n", me); *************** *** 165,168 **** --- 205,212 ---- jacAns[3] - jacAns[1]); } + if (GAGE_QUERY_ITEM_TEST(pvl->query, gageVecCurlNorm)) { + pvl->directAnswer[gageVecCurlNorm][0] = + ELL_3V_LEN( curlAns ); + } if (GAGE_QUERY_ITEM_TEST(pvl->query, gageVecHelicity)) { pvl->directAnswer[gageVecHelicity][0] = *************** *** 191,194 **** --- 235,242 ---- pvl->directAnswer[gageVecLambda2][0] = eval[1]; } + if (GAGE_QUERY_ITEM_TEST(pvl->query, gageVecImaginaryPart)) { + pvl->directAnswer[gageVecImaginaryPart][0] = + gage_imaginary_part_eigenvalues( jacAns ); + } /* 2nd order vector derivative continued */ if (GAGE_QUERY_ITEM_TEST(pvl->query, gageVecHessian)) { *************** *** 207,210 **** --- 255,263 ---- } } + if (GAGE_QUERY_ITEM_TEST(pvl->query, gageVecDivGradient)) { + pvl->directAnswer[gageVecDivGradient][0] = hesAns[0] + hesAns[12] + hesAns[24]; + pvl->directAnswer[gageVecDivGradient][1] = hesAns[1] + hesAns[13] + hesAns[25]; + pvl->directAnswer[gageVecDivGradient][2] = hesAns[2] + hesAns[14] + hesAns[26]; + } if (GAGE_QUERY_ITEM_TEST(pvl->query, gageVecCurlGradient)) { pvl->directAnswer[gageVecCurlGradient][0] = hesAns[21]-hesAns[15]; *************** *** 335,342 **** --- 388,397 ---- "divergence", "curl", + "curl norm", "helicity", "normalized helicity", "lambda2", "vector hessian", + "div gradient", "curl gradient", "curl norm gradient", *************** *** 363,370 **** --- 418,427 ---- "divergence", "curl", + "curl magnitude", "helicity: dot(vector,curl)", "normalized helicity", "lambda2 value for vortex characterization", "3x3x3 second-order vector derivative", + "gradient of divergence", "3x3 derivative of curl", "gradient of curl norm", *************** *** 391,398 **** --- 448,458 ---- gageVecDivergence, gageVecCurl, + gageVecCurlNorm, gageVecHelicity, gageVecNormHelicity, gageVecLambda2, + gageVecImaginaryPart, gageVecHessian, + gageVecDivGradient, gageVecCurlGradient, gageVecCurlNormGrad, *************** *** 416,423 **** --- 476,486 ---- #define GV_D gageVecDivergence #define GV_C gageVecCurl + #define GV_CM gageVecCurlNorm #define GV_H gageVecHelicity #define GV_NH gageVecNormHelicity #define GV_LB gageVecLambda2 + #define GV_IM gageVecImaginaryPart #define GV_VH gageVecHessian + #define GV_DG gageVecDivGradient #define GV_CG gageVecCurlGradient #define GV_CNG gageVecCurlNormGrad *************** *** 442,449 **** --- 505,515 ---- "divergence", "div", "d", "curl", "c", + "curlnorm", "curl magnitude", "cm", "h", "hel", "hell", "nh", "nhel", "normhel", "normhell", "lbda2", "lambda2", + "imag", "imagpart", "vh", "vhes", "vhessian", "vector hessian", + "dg", "divgrad", "cg", "curlgrad", "curlg", "curljac", "curl gradient", "cng", "curl norm gradient", *************** *** 470,477 **** --- 536,546 ---- GV_D, GV_D, GV_D, GV_C, GV_C, + GV_CM, GV_CM, GV_CM, GV_H, GV_H, GV_H, GV_NH, GV_NH, GV_NH, GV_NH, GV_LB, GV_LB, + GV_IM, GV_IM, GV_VH, GV_VH, GV_VH, GV_VH, + GV_DG, GV_DG, GV_CG, GV_CG, GV_CG, GV_CG, GV_CG, GV_CNG, GV_CNG, |
|
From: xav <xa...@us...> - 2004-04-11 02:41:49
|
Update of /cvsroot/teem/teem/src/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6564 Modified Files: vprobe.c Log Message: removed the annoying explicit '-o' requirement Index: vprobe.c =================================================================== RCS file: /cvsroot/teem/teem/src/bin/vprobe.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** vprobe.c 13 Feb 2004 23:01:12 -0000 1.20 --- vprobe.c 11 Apr 2004 02:28:15 -0000 1.21 *************** *** 125,129 **** hestOptAdd(&hopt, "t", "type", airTypeEnum, 1, 1, &otype, "float", "type of output volume", NULL, nrrdType); ! hestOptAdd(&hopt, "o", "nout", airTypeString, 1, 1, &outS, NULL, "output volume"); hestParseOrDie(hopt, argc-1, argv+1, hparm, --- 125,129 ---- hestOptAdd(&hopt, "t", "type", airTypeEnum, 1, 1, &otype, "float", "type of output volume", NULL, nrrdType); ! hestOptAdd(&hopt, "o", "nout", airTypeString, 1, 1, &outS, "-", "output volume"); hestParseOrDie(hopt, argc-1, argv+1, hparm, |
|
From: xav <xa...@us...> - 2004-04-09 20:00:48
|
Update of /cvsroot/teem/teem/src/nrrd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv905 Modified Files: enumsNrrd.c arith.c nrrdEnums.h Log Message: added log2 as new unary op Index: arith.c =================================================================== RCS file: /cvsroot/teem/teem/src/nrrd/arith.c,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** arith.c 14 Feb 2004 20:01:07 -0000 1.34 --- arith.c 9 Apr 2004 19:47:26 -0000 1.35 *************** *** 124,127 **** --- 124,128 ---- double _nrrdUnaryOpExp(double a) {return exp(a);} double _nrrdUnaryOpLog(double a) {return log(a);} + double _nrrdUnaryOpLog2(double a) {return log(a)/0.69314718;} double _nrrdUnaryOpLog10(double a) {return log10(a);} double _nrrdUnaryOpLog1p(double a) { *************** *** 160,163 **** --- 161,165 ---- _nrrdUnaryOpExp, _nrrdUnaryOpLog, + _nrrdUnaryOpLog2, _nrrdUnaryOpLog10, _nrrdUnaryOpLog1p, Index: nrrdEnums.h =================================================================== RCS file: /cvsroot/teem/teem/src/nrrd/nrrdEnums.h,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** nrrdEnums.h 1 Apr 2004 19:29:35 -0000 1.45 --- nrrdEnums.h 9 Apr 2004 19:47:26 -0000 1.46 *************** *** 398,417 **** nrrdUnaryOpExp, /* 9 */ nrrdUnaryOpLog, /* 10 */ ! nrrdUnaryOpLog10, /* 11 */ ! nrrdUnaryOpLog1p, /* 12 */ ! nrrdUnaryOpSqrt, /* 13 */ ! nrrdUnaryOpCbrt, /* 14 */ ! nrrdUnaryOpErf, /* 15 */ ! nrrdUnaryOpCeil, /* 16 */ ! nrrdUnaryOpFloor, /* 17 */ ! nrrdUnaryOpRoundUp, /* 18 */ ! nrrdUnaryOpRoundDown, /* 19 */ ! nrrdUnaryOpAbs, /* 20 */ ! nrrdUnaryOpSgn, /* 21 */ ! nrrdUnaryOpExists, /* 22 */ ! nrrdUnaryOpRand, /* 23 */ nrrdUnaryOpLast }; ! #define NRRD_UNARY_OP_MAX 23 /* --- 398,418 ---- nrrdUnaryOpExp, /* 9 */ nrrdUnaryOpLog, /* 10 */ ! nrrdUnaryOpLog2, /* 11 */ ! nrrdUnaryOpLog10, /* 12 */ ! nrrdUnaryOpLog1p, /* 13 */ ! nrrdUnaryOpSqrt, /* 14 */ ! nrrdUnaryOpCbrt, /* 15 */ ! nrrdUnaryOpErf, /* 16 */ ! nrrdUnaryOpCeil, /* 17 */ ! nrrdUnaryOpFloor, /* 18 */ ! nrrdUnaryOpRoundUp, /* 19 */ ! nrrdUnaryOpRoundDown, /* 20 */ ! nrrdUnaryOpAbs, /* 21 */ ! nrrdUnaryOpSgn, /* 22 */ ! nrrdUnaryOpExists, /* 23 */ ! nrrdUnaryOpRand, /* 24 */ nrrdUnaryOpLast }; ! #define NRRD_UNARY_OP_MAX 24 /* Index: enumsNrrd.c =================================================================== RCS file: /cvsroot/teem/teem/src/nrrd/enumsNrrd.c,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** enumsNrrd.c 9 Apr 2004 17:27:59 -0000 1.34 --- enumsNrrd.c 9 Apr 2004 19:47:25 -0000 1.35 *************** *** 699,702 **** --- 699,703 ---- #define nuExp nrrdUnaryOpExp #define nuLge nrrdUnaryOpLog + #define nuLg2 nrrdUnaryOpLog2 #define nuLgt nrrdUnaryOpLog10 #define nuL1p nrrdUnaryOpLog1p *************** *** 726,729 **** --- 727,731 ---- "exp", "log", + "log2", "log10", "log1p", *************** *** 754,757 **** --- 756,760 ---- "e raised to something", "natural (base e) logarithm", + "base 2 logarithm", "base 10 logarithm", "ln(1+x), accurate for small x", *************** *** 781,784 **** --- 784,788 ---- "exp", "ln", "log", + "log2", "log10", "ln1p", "log1p", *************** *** 809,812 **** --- 813,817 ---- nuExp, nuLge, nuLge, + nuLg2, nuLgt, nuL1p, nuL1p, |
|
From: Gordon K. <kin...@us...> - 2004-04-09 17:41:19
|
Update of /cvsroot/teem/teem/src/nrrd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5181 Modified Files: enumsNrrd.c Log Message: added some aliases for different tensor kinds Index: enumsNrrd.c =================================================================== RCS file: /cvsroot/teem/teem/src/nrrd/enumsNrrd.c,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** enumsNrrd.c 1 Apr 2004 19:29:34 -0000 1.33 --- enumsNrrd.c 9 Apr 2004 17:27:59 -0000 1.34 *************** *** 359,365 **** "2D-tensor", "2Dtensor", "2D-mask-tensor", "2Dmasktensor", ! "3D-sym-tensor", "3Dsymtensor", ! "3D-mask-sym-tensor", "3Dmasksymtensor", ! "3D-tensor", "3Dtensor", "3D-mask-tensor", "3Dmasktensor", "" --- 359,365 ---- "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", "" *************** *** 383,389 **** nrrdKind2DTensor, nrrdKind2DTensor, nrrdKind2DMaskedTensor, nrrdKind2DMaskedTensor, ! nrrdKind3DSymTensor, nrrdKind3DSymTensor, nrrdKind3DMaskedSymTensor, nrrdKind3DMaskedSymTensor, ! nrrdKind3DTensor, nrrdKind3DTensor, nrrdKind3DMaskedTensor, nrrdKind3DMaskedTensor }; --- 383,390 ---- nrrdKind2DTensor, nrrdKind2DTensor, nrrdKind2DMaskedTensor, nrrdKind2DMaskedTensor, ! nrrdKind3DSymTensor, nrrdKind3DSymTensor, nrrdKind3DSymTensor, nrrdKind3DMaskedSymTensor, nrrdKind3DMaskedSymTensor, ! nrrdKind3DMaskedSymTensor, ! nrrdKind3DTensor, nrrdKind3DTensor, nrrdKind3DTensor, nrrdKind3DMaskedTensor, nrrdKind3DMaskedTensor }; |
|
From: Gordon K. <kin...@us...> - 2004-04-04 21:38:43
|
Update of /cvsroot/teem/teem/src/nrrd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20500/nrrd Modified Files: apply1D.c nrrd.h Log Message: unused variable, better usage info Index: nrrd.h =================================================================== RCS file: /cvsroot/teem/teem/src/nrrd/nrrd.h,v retrieving revision 1.137 retrieving revision 1.138 diff -C2 -d -r1.137 -r1.138 *** nrrd.h 30 Mar 2004 19:25:09 -0000 1.137 --- nrrd.h 4 Apr 2004 21:26:11 -0000 1.138 *************** *** 711,717 **** --- 711,723 ---- const Nrrd *nin, const NrrdRange *range, const Nrrd *nlut, int typeOut, int rescale); + TEEM_API int nrrdApplyMulti1DLut(Nrrd *nout, const Nrrd *nin, + const NrrdRange *_range, const Nrrd *nmlut, + int typeOut, int rescale); TEEM_API int nrrdApply1DRegMap(Nrrd *nout, const Nrrd *nin, const NrrdRange *range, const Nrrd *nmap, int typeOut, int rescale); + TEEM_API int nrrdApplyMulti1DRegMap(Nrrd *nout, const Nrrd *nin, + const NrrdRange *_range, const Nrrd *nmmap, + int typeOut, int rescale); TEEM_API int nrrd1DIrregMapCheck(const Nrrd *nmap); TEEM_API int nrrd1DIrregAclGenerate(Nrrd *nacl, const Nrrd *nmap, int aclLen); Index: apply1D.c =================================================================== RCS file: /cvsroot/teem/teem/src/nrrd/apply1D.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** apply1D.c 27 Feb 2004 19:10:31 -0000 1.24 --- apply1D.c 4 Apr 2004 21:26:11 -0000 1.25 *************** *** 49,57 **** double ! _nrrdApply1DDomainMin(const Nrrd *nmap, int ramps) { double ret; - int mapAxis; - mapAxis = nmap->dim-1; ret = nmap->axis[mapAxis].min; ret = AIR_EXISTS(ret) ? ret : 0; --- 49,55 ---- double ! _nrrdApply1DDomainMin(const Nrrd *nmap, int ramps, int mapAxis) { double ret; ret = nmap->axis[mapAxis].min; ret = AIR_EXISTS(ret) ? ret : 0; *************** *** 60,68 **** double ! _nrrdApply1DDomainMax(const Nrrd *nmap, int ramps) { double ret; - int mapAxis; - mapAxis = nmap->dim-1; ret = nmap->axis[mapAxis].max; if (!AIR_EXISTS(ret)) { --- 58,64 ---- double ! _nrrdApply1DDomainMax(const Nrrd *nmap, int ramps, int mapAxis) { double ret; ret = nmap->axis[mapAxis].max; if (!AIR_EXISTS(ret)) { *************** *** 88,100 **** int _nrrdApply1DSetUp(Nrrd *nout, const Nrrd *nin, const NrrdRange *range, ! const Nrrd *nmap, int kind, int typeOut, int rescale) { char me[]="_nrrdApply1DSetUp", err[AIR_STRLEN_MED], *mapcnt; char nounStr[][AIR_STRLEN_SMALL]={"lut", "regular map", "irregular map"}; char verbStr[][AIR_STRLEN_SMALL]={"lut", "rmap", "imap"}; ! int mapAxis, size[NRRD_DIM_MAX], axisMap[NRRD_DIM_MAX], d, colLen; double domMin, domMax; --- 84,104 ---- int _nrrdApply1DSetUp(Nrrd *nout, const Nrrd *nin, const NrrdRange *range, ! const Nrrd *nmap, int kind, int typeOut, ! int rescale, int multi) { char me[]="_nrrdApply1DSetUp", err[AIR_STRLEN_MED], *mapcnt; char nounStr[][AIR_STRLEN_SMALL]={"lut", "regular map", "irregular map"}; + char mnounStr[][AIR_STRLEN_SMALL]={"multi lut", + "multi regular map", + "multi irregular map"}; + /* wishful thinking */ char verbStr[][AIR_STRLEN_SMALL]={"lut", "rmap", "imap"}; ! char mverbStr[][AIR_STRLEN_SMALL]={"mlut", ! "mrmap", ! "mimap"}; /* wishful thinking */ ! int mapAxis, ax, size[NRRD_DIM_MAX], axisMap[NRRD_DIM_MAX], d, colLen; double domMin, domMax; *************** *** 120,131 **** } if (kindLut == kind || kindRmap == kind) { ! mapAxis = nmap->dim - 1; ! if (!(0 == mapAxis || 1 == mapAxis)) { ! sprintf(err, "%s: dimension of %s should be 1 or 2, not %d", ! me, nounStr[kind], nmap->dim); ! biffAdd(NRRD, err); return 1; } ! domMin = _nrrdApply1DDomainMin(nmap, AIR_FALSE); ! domMax = _nrrdApply1DDomainMax(nmap, AIR_FALSE); if (!( domMin < domMax )) { sprintf(err, "%s: (axis %d) domain min (%g) not less than max (%g)", me, --- 124,155 ---- } if (kindLut == kind || kindRmap == kind) { ! if (!multi) { ! mapAxis = nmap->dim - 1; ! if (!(0 == mapAxis || 1 == mapAxis)) { ! sprintf(err, "%s: dimension of %s should be 1 or 2, not %d", ! me, nounStr[kind], nmap->dim); ! biffAdd(NRRD, err); return 1; ! } ! } else { ! mapAxis = nmap->dim - nin->dim - 1; ! if (!(0 == mapAxis || 1 == mapAxis)) { ! sprintf(err, "%s: dimension of %s should be %d or %d, not %d", ! me, mnounStr[kind], ! nin->dim + 1, nin->dim + 2, nmap->dim); ! biffAdd(NRRD, err); return 1; ! } ! /* need to make sure the relevant sizes match */ ! for (ax=0; ax<nin->dim; ax++) { ! if (nin->axis[ax].size != nmap->axis[mapAxis + 1 + ax].size) { ! sprintf(err, "%s: input and mmap don't have compatible sizes: " ! "nin->axis[%d].size (%d) != nmap->axis[%d].size (%d): ", ! me, ax, nin->axis[ax].size, ! mapAxis + 1 + ax, nmap->axis[mapAxis + 1 + ax].size); ! biffAdd(NRRD, err); return 1; ! } ! } } ! domMin = _nrrdApply1DDomainMin(nmap, AIR_FALSE, mapAxis); ! domMax = _nrrdApply1DDomainMax(nmap, AIR_FALSE, mapAxis); if (!( domMin < domMax )) { sprintf(err, "%s: (axis %d) domain min (%g) not less than max (%g)", me, *************** *** 135,143 **** if (nrrdHasNonExist(nmap)) { sprintf(err, "%s: %s nrrd has non-existent values", ! me, nounStr[kind]); biffAdd(NRRD, err); return 1; } colLen = mapAxis ? nmap->axis[0].size : 1; } else { /* its an irregular map */ if (nrrd1DIrregMapCheck(nmap)) { --- 159,171 ---- if (nrrdHasNonExist(nmap)) { sprintf(err, "%s: %s nrrd has non-existent values", ! me, multi ? mnounStr[kind] : nounStr[kind]); biffAdd(NRRD, err); return 1; } colLen = mapAxis ? nmap->axis[0].size : 1; } else { + if (multi) { + sprintf(err, "%s: sorry, multi irregular maps not implemented", me); + biffAdd(NRRD, err); return 1; + } /* its an irregular map */ if (nrrd1DIrregMapCheck(nmap)) { *************** *** 152,156 **** sprintf(err, "%s: input nrrd dim %d through non-scalar %s exceeds " "NRRD_DIM_MAX %d", ! me, nin->dim, nounStr[kind], NRRD_DIM_MAX); biffAdd(NRRD, err); return 1; } --- 180,185 ---- sprintf(err, "%s: input nrrd dim %d through non-scalar %s exceeds " "NRRD_DIM_MAX %d", ! me, nin->dim, ! multi ? mnounStr[kind] : nounStr[kind], NRRD_DIM_MAX); biffAdd(NRRD, err); return 1; } *************** *** 193,197 **** } mapcnt = _nrrdContentGet(nmap); ! if (nrrdContentSet(nout, verbStr[kind], nin, "%s", mapcnt)) { sprintf(err, "%s:", me); biffAdd(NRRD, err); free(mapcnt); return 1; --- 222,227 ---- } mapcnt = _nrrdContentGet(nmap); ! if (nrrdContentSet(nout, multi ? mverbStr[kind] : verbStr[kind], ! nin, "%s", mapcnt)) { sprintf(err, "%s:", me); biffAdd(NRRD, err); free(mapcnt); return 1; *************** *** 224,228 **** int _nrrdApply1DLutOrRegMap(Nrrd *nout, const Nrrd *nin, const NrrdRange *range, ! const Nrrd *nmap, int ramps, int rescale) { /* char me[]="_nrrdApply1DLutOrRegMap"; */ char *inData, *outData, *mapData, *entData0, *entData1; --- 254,258 ---- int _nrrdApply1DLutOrRegMap(Nrrd *nout, const Nrrd *nin, const NrrdRange *range, ! const Nrrd *nmap, int ramps, int rescale, int multi) { /* char me[]="_nrrdApply1DLutOrRegMap"; */ char *inData, *outData, *mapData, *entData0, *entData1; *************** *** 233,242 **** int i, mapAxis, mapLen, mapIdx, entSize, entLen, inSize, outSize; ! mapAxis = nmap->dim - 1; /* axis of nmap containing entries */ mapData = nmap->data; /* map data, as char* */ /* low end of map domain */ ! domMin = _nrrdApply1DDomainMin(nmap, ramps); /* high end of map domain */ ! domMax = _nrrdApply1DDomainMax(nmap, ramps); mapLen = nmap->axis[mapAxis].size; /* number of entries in map */ mapLup = nrrdDLookup[nmap->type]; /* how to get doubles out of map */ --- 263,276 ---- int i, mapAxis, mapLen, mapIdx, entSize, entLen, inSize, outSize; ! if (!multi) { ! mapAxis = nmap->dim - 1; /* axis of nmap containing entries */ ! } else { ! mapAxis = nmap->dim - nin->dim - 1; ! } mapData = nmap->data; /* map data, as char* */ /* low end of map domain */ ! domMin = _nrrdApply1DDomainMin(nmap, ramps, mapAxis); /* high end of map domain */ ! domMax = _nrrdApply1DDomainMax(nmap, ramps, mapAxis); mapLen = nmap->axis[mapAxis].size; /* number of entries in map */ mapLup = nrrdDLookup[nmap->type]; /* how to get doubles out of map */ *************** *** 291,294 **** --- 325,331 ---- inData += inSize; outData += outSize; + if (multi) { + mapData += mapLen*entSize; + } } } else { *************** *** 313,316 **** --- 350,356 ---- inData += inSize; outData += outSize; + if (multi) { + mapData += mapLen*entSize; + } } } *************** *** 356,361 **** } airMopAdd(mop, range, (airMopper)nrrdRangeNix, airMopAlways); ! if (_nrrdApply1DSetUp(nout, nin, range, nlut, kindLut, typeOut, rescale) ! || _nrrdApply1DLutOrRegMap(nout, nin, range, nlut, AIR_FALSE, rescale)) { sprintf(err, "%s:", me); biffAdd(NRRD, err); airMopError(mop); return 1; --- 396,434 ---- } airMopAdd(mop, range, (airMopper)nrrdRangeNix, airMopAlways); ! if (_nrrdApply1DSetUp(nout, nin, range, nlut, kindLut, typeOut, ! rescale, AIR_FALSE) ! || _nrrdApply1DLutOrRegMap(nout, nin, range, nlut, AIR_FALSE, ! rescale, AIR_FALSE)) { ! sprintf(err, "%s:", me); ! biffAdd(NRRD, err); airMopError(mop); return 1; ! } ! airMopOkay(mop); ! return 0; ! } ! ! int ! nrrdApplyMulti1DLut(Nrrd *nout, const Nrrd *nin, ! const NrrdRange *_range, const Nrrd *nmlut, ! int typeOut, int rescale) { ! char me[]="nrrdApplyMulti1DLut", err[AIR_STRLEN_MED]; ! NrrdRange *range; ! airArray *mop; ! ! if (!(nout && nmlut && nin)) { ! sprintf(err, "%s: got NULL pointer", me); ! biffAdd(NRRD, err); return 1; ! } ! mop = airMopNew(); ! if (_range) { ! range = nrrdRangeCopy(_range); ! nrrdRangeSafeSet(range, nin, nrrdBlind8BitRangeState); ! } else { ! range = nrrdRangeNewSet(nin, nrrdBlind8BitRangeState); ! } ! airMopAdd(mop, range, (airMopper)nrrdRangeNix, airMopAlways); ! if (_nrrdApply1DSetUp(nout, nin, range, nmlut, kindLut, typeOut, ! rescale, AIR_TRUE) ! || _nrrdApply1DLutOrRegMap(nout, nin, range, nmlut, AIR_FALSE, ! rescale, AIR_TRUE)) { sprintf(err, "%s:", me); biffAdd(NRRD, err); airMopError(mop); return 1; *************** *** 412,417 **** } airMopAdd(mop, range, (airMopper)nrrdRangeNix, airMopAlways); ! if (_nrrdApply1DSetUp(nout, nin, range, nmap, kindRmap, typeOut, rescale) ! || _nrrdApply1DLutOrRegMap(nout, nin, range, nmap, AIR_TRUE, rescale)) { sprintf(err, "%s:", me); biffAdd(NRRD, err); airMopError(mop); return 1; --- 485,523 ---- } airMopAdd(mop, range, (airMopper)nrrdRangeNix, airMopAlways); ! if (_nrrdApply1DSetUp(nout, nin, range, nmap, kindRmap, typeOut, ! rescale, AIR_FALSE) ! || _nrrdApply1DLutOrRegMap(nout, nin, range, nmap, AIR_TRUE, ! rescale, AIR_FALSE)) { ! sprintf(err, "%s:", me); ! biffAdd(NRRD, err); airMopError(mop); return 1; ! } ! airMopOkay(mop); ! return 0; ! } ! ! int ! nrrdApplyMulti1DRegMap(Nrrd *nout, const Nrrd *nin, ! const NrrdRange *_range, const Nrrd *nmmap, ! int typeOut, int rescale) { ! char me[]="nrrdApplyMulti1DRegMap", err[AIR_STRLEN_MED]; ! NrrdRange *range; ! airArray *mop; ! ! if (!(nout && nmmap && nin)) { ! sprintf(err, "%s: got NULL pointer", me); ! biffAdd(NRRD, err); return 1; ! } ! mop = airMopNew(); ! if (_range) { ! range = nrrdRangeCopy(_range); ! nrrdRangeSafeSet(range, nin, nrrdBlind8BitRangeState); ! } else { ! range = nrrdRangeNewSet(nin, nrrdBlind8BitRangeState); ! } ! airMopAdd(mop, range, (airMopper)nrrdRangeNix, airMopAlways); ! if (_nrrdApply1DSetUp(nout, nin, range, nmmap, kindRmap, typeOut, ! rescale, AIR_TRUE) ! || _nrrdApply1DLutOrRegMap(nout, nin, range, nmmap, AIR_TRUE, ! rescale, AIR_TRUE)) { sprintf(err, "%s:", me); biffAdd(NRRD, err); airMopError(mop); return 1; *************** *** 734,738 **** airMopAdd(mop, range, (airMopper)nrrdRangeNix, airMopAlways); if (_nrrdApply1DSetUp(nout, nin, range, nmap, ! kindImap, typeOut, rescale)) { sprintf(err, "%s:", me); biffAdd(NRRD, err); airMopError(mop); return 1; --- 840,844 ---- airMopAdd(mop, range, (airMopper)nrrdRangeNix, airMopAlways); if (_nrrdApply1DSetUp(nout, nin, range, nmap, ! kindImap, typeOut, rescale, AIR_FALSE)) { sprintf(err, "%s:", me); biffAdd(NRRD, err); airMopError(mop); return 1; |
|
From: Gordon K. <kin...@us...> - 2004-04-04 21:38:42
|
Update of /cvsroot/teem/teem/src/unrrdu In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20500/unrrdu Modified Files: mrmap.c Log Message: unused variable, better usage info Index: mrmap.c =================================================================== RCS file: /cvsroot/teem/teem/src/unrrdu/mrmap.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mrmap.c 4 Apr 2004 21:21:06 -0000 1.1 --- mrmap.c 4 Apr 2004 21:26:11 -0000 1.2 *************** *** 25,29 **** (INFO ", one map per sample in input. The \"mmap\" nrrd has the same dimensional " ! "constraints as the \"mlut\" nrrd for \"unu mlut\". "); int --- 25,31 ---- (INFO ", one map per sample in input. The \"mmap\" nrrd has the same dimensional " ! "constraints as the \"mlut\" nrrd for \"unu mlut\". This functionality " ! "is a generalization of \"unu 3op lerp\": it allows you to lerp through " ! "multiple nrrds, instead of just two."); int |
|
From: Gordon K. <kin...@us...> - 2004-04-04 21:38:42
|
Update of /cvsroot/teem/teem/src/ell In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20500/ell Modified Files: eigen.c Log Message: unused variable, better usage info Index: eigen.c =================================================================== RCS file: /cvsroot/teem/teem/src/ell/eigen.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** eigen.c 1 Apr 2004 15:02:47 -0000 1.20 --- eigen.c 4 Apr 2004 21:26:11 -0000 1.21 *************** *** 175,179 **** int ell_3m_eigenvalues_d(double _eval[3], double _m[9], int newton) { ! double A, B, C, scale, frob, m[9], eval[3], tmp; int roots; --- 175,179 ---- int ell_3m_eigenvalues_d(double _eval[3], double _m[9], int newton) { ! double A, B, C, scale, frob, m[9], eval[3]; int roots; |
|
From: Gordon K. <kin...@us...> - 2004-04-04 21:33:38
|
Update of /cvsroot/teem/teem/src/unrrdu In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19622 Modified Files: GNUmakefile lut.c rmap.c subst.c unrrdu.h Added Files: mlut.c mrmap.c Log Message: added nrrdApplyMulti1DLut (unu mlut) and nrrdApplyMulti1DRegMap (unu mrmap), which seem to work, but no promises --- NEW FILE: mlut.c --- /* teem: Gordon Kindlmann's research software Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998 University of Utah This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "unrrdu.h" #include "privateUnrrdu.h" #define INFO "Map nrrd through whole nrrd of univariate lookup tables" char *_unrrdu_mlutInfoL = (INFO ", with one lookup table per element of input nrrd. The multiple " "tables are stored in a nrrd with a dimension which is either 1 or 2 " "more than the dimension of the input nrrd, resulting in an output " "which has either the same or one more dimension than the input, " "resptectively. "); int unrrdu_mlutMain(int argc, char **argv, char *me, hestParm *hparm) { hestOpt *opt = NULL; char *out, *err; Nrrd *nin, **_nmlut, *nmlut, *nout; airArray *mop; int typeOut, rescale, pret, mapAxis, _nmlutLen; double min, max; NrrdRange *range=NULL; hestOptAdd(&opt, "m", "mlut", airTypeOther, 1, -1, &_nmlut, NULL, "one nrrd of lookup tables to map input nrrd through, or, " "list of nrrds which contain the individual entries of " "the lookup table at each voxel, which will be joined together.", &_nmlutLen, NULL, nrrdHestNrrd); hestOptAdd(&opt, "r", NULL, airTypeInt, 0, 0, &rescale, NULL, "rescale the input values from the input range to the " "lut domain. The lut domain is either explicitly " "defined by the axis min,max along axis 0 or 1, or, it " "is implicitly defined as zero to the length of that axis " "minus one."); hestOptAdd(&opt, "min", "value", airTypeDouble, 1, 1, &min, "nan", "Low end of input range. Defaults to lowest value " "found in input nrrd. Explicitly setting this is useful " "only with rescaling (\"-r\")"); hestOptAdd(&opt, "max", "value", airTypeDouble, 1, 1, &max, "nan", "High end of input range. Defaults to highest value " "found in input nrrd. Explicitly setting this is useful " "only with rescaling (\"-r\")"); hestOptAdd(&opt, "t", "type", airTypeOther, 1, 1, &typeOut, "default", "specify the type (\"int\", \"float\", etc.) of the " "output nrrd. " "By default (not using this option), the output type " "is the lut's type.", NULL, NULL, &unrrduHestMaybeTypeCB); OPT_ADD_NIN(nin, "input nrrd"); OPT_ADD_NOUT(out, "output nrrd"); mop = airMopNew(); airMopAdd(mop, opt, (airMopper)hestOptFree, airMopAlways); USAGE(_unrrdu_mlutInfoL); PARSE(); airMopAdd(mop, opt, (airMopper)hestParseFree, airMopAlways); nout = nrrdNew(); airMopAdd(mop, nout, (airMopper)nrrdNuke, airMopAlways); /* by the end of this block we need to have nmlut and mapAxis */ if (1 == _nmlutLen) { /* we got the mlut as a single nrrd */ nmlut = _nmlut[0]; mapAxis = nmlut->dim - nin->dim - 1; /* its not our job to do real error checking ... */ mapAxis = AIR_CLAMP(0, mapAxis, nmlut->dim - 1); } else { /* we have to join together multiple nrrds to get the mlut */ nmlut = nrrdNew(); airMopAdd(mop, nmlut, (airMopper)nrrdNuke, airMopAlways); /* assume that mlut component nrrds are all compatible sizes, nrrdJoin will fail if they aren't */ mapAxis = _nmlut[0]->dim - nin->dim; if (nrrdJoin(nmlut, (const Nrrd**)_nmlut, _nmlutLen, mapAxis, AIR_TRUE)) { airMopAdd(mop, err = biffGetDone(NRRD), airFree, airMopAlways); fprintf(stderr, "%s: trouble joining mlut:\n%s", me, err); airMopError(mop); return 1; } /* set these if they were given, they'll be NaN otherwise */ nmlut->axis[mapAxis].min = min; nmlut->axis[mapAxis].max = max; } if (!( AIR_EXISTS(nmlut->axis[mapAxis].min) && AIR_EXISTS(nmlut->axis[mapAxis].max) )) { rescale = AIR_TRUE; } if (rescale) { range = nrrdRangeNew(min, max); airMopAdd(mop, range, (airMopper)nrrdRangeNix, airMopAlways); nrrdRangeSafeSet(range, nin, nrrdBlind8BitRangeState); } if (nrrdTypeDefault == typeOut) { typeOut = nmlut->type; } if (nrrdApplyMulti1DLut(nout, nin, range, nmlut, typeOut, rescale)) { airMopAdd(mop, err = biffGetDone(NRRD), airFree, airMopAlways); fprintf(stderr, "%s: trouble applying multi-LUT:\n%s", me, err); airMopError(mop); return 1; } SAVE(out, nout, NULL); airMopOkay(mop); return 0; } UNRRDU_CMD(mlut, INFO); Index: subst.c =================================================================== RCS file: /cvsroot/teem/teem/src/unrrdu/subst.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** subst.c 27 Feb 2004 06:05:18 -0000 1.2 --- subst.c 4 Apr 2004 21:21:06 -0000 1.3 *************** *** 21,25 **** #include "privateUnrrdu.h" ! #define INFO "Map nrrd through univariate substitution table" char *_unrrdu_substInfoL = (INFO --- 21,25 ---- #include "privateUnrrdu.h" ! #define INFO "Map nrrd through a univariate substitution table" char *_unrrdu_substInfoL = (INFO Index: lut.c =================================================================== RCS file: /cvsroot/teem/teem/src/unrrdu/lut.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** lut.c 7 Jan 2004 15:34:31 -0000 1.19 --- lut.c 4 Apr 2004 21:21:06 -0000 1.20 *************** *** 21,25 **** #include "privateUnrrdu.h" ! #define INFO "Map nrrd through univariate lookup table" char *_unrrdu_lutInfoL = (INFO --- 21,25 ---- #include "privateUnrrdu.h" ! #define INFO "Map nrrd through one univariate lookup table" char *_unrrdu_lutInfoL = (INFO *************** *** 48,52 **** "lut domain. The lut domain is either explicitly " "defined by the axis min,max along axis 0 or 1, or, it " ! "is implicitly defined as zero to the length of that axis."); hestOptAdd(&opt, "min", "value", airTypeDouble, 1, 1, &min, "nan", "Low end of input range. Defaults to lowest value " --- 48,53 ---- "lut domain. The lut domain is either explicitly " "defined by the axis min,max along axis 0 or 1, or, it " ! "is implicitly defined as zero to the length of that axis " ! "minus one."); hestOptAdd(&opt, "min", "value", airTypeDouble, 1, 1, &min, "nan", "Low end of input range. Defaults to lowest value " Index: unrrdu.h =================================================================== RCS file: /cvsroot/teem/teem/src/unrrdu/unrrdu.h,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** unrrdu.h 26 Feb 2004 20:59:45 -0000 1.26 --- unrrdu.h 4 Apr 2004 21:21:06 -0000 1.27 *************** *** 129,134 **** --- 129,136 ---- F(3op) \ F(lut) \ + F(mlut) \ F(subst) \ F(rmap) \ + F(mrmap) \ F(imap) \ F(ccfind) \ --- NEW FILE: mrmap.c --- /* teem: Gordon Kindlmann's research software Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998 University of Utah This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "unrrdu.h" #include "privateUnrrdu.h" #define INFO "Map nrrd through a whole nrrd of regular univariate maps" char *_unrrdu_mrmapInfoL = (INFO ", one map per sample in input. The \"mmap\" nrrd has the same dimensional " "constraints as the \"mlut\" nrrd for \"unu mlut\". "); int unrrdu_mrmapMain(int argc, char **argv, char *me, hestParm *hparm) { hestOpt *opt = NULL; char *out, *err; Nrrd *nin, **_nmmap, *nmmap, *nout; airArray *mop; NrrdRange *range=NULL; int typeOut, rescale, pret, mapAxis, _nmmapLen; double min, max; hestOptAdd(&opt, "m", "mmap", airTypeOther, 1, -1, &_nmmap, NULL, "one nrrd of regular maps to map input nrrd through, or, " "list of nrrds which contain the individual entries of the map " "at each voxel, which will be joined together.", &_nmmapLen, NULL, nrrdHestNrrd); hestOptAdd(&opt, "r", NULL, airTypeInt, 0, 0, &rescale, NULL, "rescale the input values from the input range to the " "map domain. The map domain is either explicitly " "defined by the axis min,max along axis 0 or 1, or, it " "is implicitly defined as zero to one minus the length of " "that axis."); hestOptAdd(&opt, "min", "value", airTypeDouble, 1, 1, &min, "nan", "Low end of input range. Defaults to lowest value " "found in input nrrd. Explicitly setting this is useful " "only with rescaling (\"-r\") or if the map domain is only " "implicitly defined"); hestOptAdd(&opt, "max", "value", airTypeDouble, 1, 1, &max, "nan", "High end of input range. Defaults to highest value " "found in input nrrd. Explicitly setting this is useful " "only with rescaling (\"-r\") or if the map domain is only " "implicitly defined"); hestOptAdd(&opt, "t", "type", airTypeOther, 1, 1, &typeOut, "default", "specify the type (\"int\", \"float\", etc.) of the " "output nrrd. " "By default (not using this option), the output type " "is the map's type.", NULL, NULL, &unrrduHestMaybeTypeCB); OPT_ADD_NIN(nin, "input nrrd"); OPT_ADD_NOUT(out, "output nrrd"); mop = airMopNew(); airMopAdd(mop, opt, (airMopper)hestOptFree, airMopAlways); USAGE(_unrrdu_mrmapInfoL); PARSE(); airMopAdd(mop, opt, (airMopper)hestParseFree, airMopAlways); nout = nrrdNew(); airMopAdd(mop, nout, (airMopper)nrrdNuke, airMopAlways); /* see comment rmap.c */ /* by the end of this block we need to have nmmap and mapAxis */ if (1 == _nmmapLen) { /* we got the mmap as a single nrrd */ nmmap = _nmmap[0]; mapAxis = nmmap->dim - nin->dim - 1; /* its not our job to do real error checking ... */ mapAxis = AIR_CLAMP(0, mapAxis, nmmap->dim - 1); } else { /* we have to join together multiple nrrds to get the mmap */ nmmap = nrrdNew(); airMopAdd(mop, nmmap, (airMopper)nrrdNuke, airMopAlways); /* assume that mmap component nrrds are all compatible sizes, nrrdJoin will fail if they aren't */ mapAxis = _nmmap[0]->dim - nin->dim; if (nrrdJoin(nmmap, (const Nrrd**)_nmmap, _nmmapLen, mapAxis, AIR_TRUE)) { airMopAdd(mop, err = biffGetDone(NRRD), airFree, airMopAlways); fprintf(stderr, "%s: trouble joining mmap:\n%s", me, err); airMopError(mop); return 1; } /* set these if they were given, they'll be NaN otherwise */ nmmap->axis[mapAxis].min = min; nmmap->axis[mapAxis].max = max; } if (!( AIR_EXISTS(nmmap->axis[mapAxis].min) && AIR_EXISTS(nmmap->axis[mapAxis].max) )) { rescale = AIR_TRUE; } if (rescale) { range = nrrdRangeNew(min, max); airMopAdd(mop, range, (airMopper)nrrdRangeNix, airMopAlways); nrrdRangeSafeSet(range, nin, nrrdBlind8BitRangeState); } if (nrrdTypeDefault == typeOut) { typeOut = nmmap->type; } if (nrrdApplyMulti1DRegMap(nout, nin, range, nmmap, typeOut, rescale)) { airMopAdd(mop, err = biffGetDone(NRRD), airFree, airMopAlways); fprintf(stderr, "%s: trouble applying map:\n%s", me, err); airMopError(mop); return 1; } SAVE(out, nout, NULL); airMopOkay(mop); return 0; } UNRRDU_CMD(mrmap, INFO); Index: GNUmakefile =================================================================== RCS file: /cvsroot/teem/teem/src/unrrdu/GNUmakefile,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** GNUmakefile 26 Feb 2004 20:59:45 -0000 1.21 --- GNUmakefile 4 Apr 2004 21:21:06 -0000 1.22 *************** *** 58,62 **** lut.o subst.o rmap.o imap.o save.o head.o data.o splice.o inset.o \ axinsert.o axdelete.o axinfo.o ccfind.o ccadj.o ccmerge.o \ ! ccsettle.o about.o axsplit.o axmerge.o #### #### --- 58,62 ---- lut.o subst.o rmap.o imap.o save.o head.o data.o splice.o inset.o \ axinsert.o axdelete.o axinfo.o ccfind.o ccadj.o ccmerge.o \ ! ccsettle.o about.o axsplit.o axmerge.o mlut.o mrmap.o #### #### Index: rmap.c =================================================================== RCS file: /cvsroot/teem/teem/src/unrrdu/rmap.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** rmap.c 7 Jan 2004 15:34:31 -0000 1.19 --- rmap.c 4 Apr 2004 21:21:06 -0000 1.20 *************** *** 21,25 **** #include "privateUnrrdu.h" ! #define INFO "Map nrrd through *regular* univariate map (\"colormap\")" char *_unrrdu_rmapInfoL = (INFO --- 21,25 ---- #include "privateUnrrdu.h" ! #define INFO "Map nrrd through one *regular* univariate map (\"colormap\")" char *_unrrdu_rmapInfoL = (INFO *************** *** 55,60 **** "map domain. The map domain is either explicitly " "defined by the axis min,max along axis 0 or 1, or, it " ! "is implicitly defined as zero to one minus the length of " ! "that axis."); hestOptAdd(&opt, "min", "value", airTypeDouble, 1, 1, &min, "nan", "Low end of input range. Defaults to lowest value " --- 55,60 ---- "map domain. The map domain is either explicitly " "defined by the axis min,max along axis 0 or 1, or, it " ! "is implicitly defined as zero to the length of " ! "that axis minus one."); hestOptAdd(&opt, "min", "value", airTypeDouble, 1, 1, &min, "nan", "Low end of input range. Defaults to lowest value " |
|
From: xav <xa...@us...> - 2004-04-01 22:49:29
|
Update of /cvsroot/teem/teem/src/gage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29029 Modified Files: gage.h vecGage.c Log Message: added 2 new vector-derived quantities: - gageVecCurlNormGrad: gradient of curl norm ("cng") - gageVecNCurlNormGrad: normalized version of this gradient ("ncng") Index: gage.h =================================================================== RCS file: /cvsroot/teem/teem/src/gage/gage.h,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** gage.h 1 Apr 2004 07:07:35 -0000 1.63 --- gage.h 1 Apr 2004 22:37:26 -0000 1.64 *************** *** 290,308 **** gageVecNormHelicity,/* 7: "nh", normalized helicity: GT[1] */ gageVecLambda2, /* 8: "lmabda2", lambda2 criterion: GT[1] */ ! gageVecHessian, /* 9: "vh", second-order derivative: GT[27] */ gageVecCurlGradient,/*10: "cg", curl gradient: GT[9] */ ! gageVecHelGradient,/* 11: "hg", helicity gradient: GT[3] */ ! gageVecDirHelDeriv,/* 12: "dhd", directional derivative of helicity: GT[1] */ ! gageVecProjHelGradient,/* 13: "phg", projected helicity gradient: GT[3] */ ! gageVecGradient0, /* 14: "g0", gradient of 1st component of vector: GT[3] */ ! gageVecGradient1, /* 15: "g1", gradient of 2nd component of vector: GT[3] */ ! gageVecGradient2, /* 16: "g2", gradient of 3rd component of vector: GT[3] */ ! gageVecMultiGrad, /* 17: "mg", sum of outer products of gradients: GT[9] */ ! gageVecMGFrob, /* 18: "mgfrob", frob norm of multi-gradient: GT[1] */ ! gageVecMGEval, /* 19: "mgeval", eigenvalues of multi-gradient: GT[3] */ ! gageVecMGEvec, /* 20: "mgevec", eigenvectors of multi-gradient: GT[9] */ gageVecLast }; ! #define GAGE_VEC_ITEM_MAX 20 struct gageKind_t; /* dumb forward declaraction, ignore */ --- 290,316 ---- gageVecNormHelicity,/* 7: "nh", normalized helicity: GT[1] */ gageVecLambda2, /* 8: "lmabda2", lambda2 criterion: GT[1] */ ! gageVecHessian, /* 9: "vh", second-order derivative: GT[27] ! 0:d2v_x/dxdx 1:d2v_x/dxdy 2:d2v_x/dxdz ! 3:d2v_x/dydx 4:d2v_x/dydy 5:d2v_x/dydz ! 6:d2v_x/dzdx 7:d2v_x/dzdy 8:d2v_x/dzdz ! 9:d2v_y/dxdx [...] ! [...] ! 24:dv2_z/dzdx 25:d2v_z/dzdy 26:d2v_z/dzdz */ gageVecCurlGradient,/*10: "cg", curl gradient: GT[9] */ ! gageVecCurlNormGrad,/*11: "cng", curl norm gradient: GT[3] */ ! gageVecNCurlNormGrad, /* 12: "ncng", normalized curl norm gradient: GT[3] */ ! gageVecHelGradient,/* 13: "hg", helicity gradient: GT[3] */ ! gageVecDirHelDeriv,/* 14: "dhd", directional derivative of helicity: GT[1] */ ! gageVecProjHelGradient, /* 15: "phg", projected helicity gradient: GT[3] */ ! gageVecGradient0, /* 16: "g0", gradient of 1st component of vector: GT[3] */ ! gageVecGradient1, /* 17: "g1", gradient of 2nd component of vector: GT[3] */ ! gageVecGradient2, /* 18: "g2", gradient of 3rd component of vector: GT[3] */ ! gageVecMultiGrad, /* 19: "mg", sum of outer products of gradients: GT[9] */ ! gageVecMGFrob, /* 20: "mgfrob", frob norm of multi-gradient: GT[1] */ ! gageVecMGEval, /* 21: "mgeval", eigenvalues of multi-gradient: GT[3] */ ! gageVecMGEvec, /* 22: "mgevec", eigenvectors of multi-gradient: GT[9] */ gageVecLast }; ! #define GAGE_VEC_ITEM_MAX 22 struct gageKind_t; /* dumb forward declaraction, ignore */ Index: vecGage.c =================================================================== RCS file: /cvsroot/teem/teem/src/gage/vecGage.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** vecGage.c 1 Apr 2004 07:07:35 -0000 1.18 --- vecGage.c 1 Apr 2004 22:37:27 -0000 1.19 *************** *** 35,38 **** --- 35,40 ---- {gageVecHessian, 27, 2, {-1, -1, -1, -1, -1}, -1, -1}, {gageVecCurlGradient, 9, 2, {gageVecHessian, -1, -1, -1, -1}, -1, -1}, + {gageVecCurlNormGrad, 3, 2, {gageVecHessian, gageVecCurl, -1, -1, -1}, -1, -1}, + {gageVecNCurlNormGrad, 3, 2, {gageVecCurlNormGrad, -1, -1, -1, -1}, -1, -1}, {gageVecHelGradient, 3, 2, {gageVecVector, gageVecJacobian, gageVecCurl, gageVecCurlGradient, -1}, -1, -1}, *************** *** 105,121 **** char me[]="_gageVecAnswer"; double cmag, tmpMat[9], mgevec[9], mgeval[3]; ! double symm[9], asym[9], tran[9], eval[3]; gage_t *vecAns, *normAns, *jacAns, *curlAns, *hesAns, *curlGradAns, ! *helGradAns, *dirHelDirAns; int asw; ! vecAns = pvl->directAnswer[gageVecVector]; ! normAns = pvl->directAnswer[gageVecNormalized]; ! jacAns = pvl->directAnswer[gageVecJacobian]; ! curlAns = pvl->directAnswer[gageVecCurl]; ! hesAns = pvl->directAnswer[gageVecHessian]; ! curlGradAns = pvl->directAnswer[gageVecCurlGradient]; ! helGradAns = pvl->directAnswer[gageVecHelGradient]; ! dirHelDirAns = pvl->directAnswer[gageVecDirHelDeriv]; if (GAGE_QUERY_ITEM_TEST(pvl->query, gageVecVector)) { --- 107,124 ---- char me[]="_gageVecAnswer"; double cmag, tmpMat[9], mgevec[9], mgeval[3]; ! double symm[9], asym[9], tran[9], eval[3], tmpVec[3], norm; gage_t *vecAns, *normAns, *jacAns, *curlAns, *hesAns, *curlGradAns, ! *helGradAns, *dirHelDirAns, *curlnormgradAns; int asw; ! vecAns = pvl->directAnswer[gageVecVector]; ! normAns = pvl->directAnswer[gageVecNormalized]; ! jacAns = pvl->directAnswer[gageVecJacobian]; ! curlAns = pvl->directAnswer[gageVecCurl]; ! hesAns = pvl->directAnswer[gageVecHessian]; ! curlGradAns = pvl->directAnswer[gageVecCurlGradient]; ! curlnormgradAns = pvl->directAnswer[gageVecCurlNormGrad]; ! helGradAns = pvl->directAnswer[gageVecHelGradient]; ! dirHelDirAns = pvl->directAnswer[gageVecDirHelDeriv]; if (GAGE_QUERY_ITEM_TEST(pvl->query, gageVecVector)) { *************** *** 173,211 **** if (GAGE_QUERY_ITEM_TEST(pvl->query, gageVecLambda2)) { ELL_3M_TRANSPOSE(tran, jacAns); ! // symmetric part ELL_3M_SCALE_ADD2(symm, 0.5, jacAns, 0.5, tran); ! // antisymmetric part ELL_3M_SCALE_ADD2(asym, 0.5, jacAns, -0.5, tran); ! // square symmetric part ELL_3M_MUL(tmpMat, symm, symm); ELL_3M_COPY(symm, tmpMat); ! // square antisymmetric part ELL_3M_MUL(tmpMat, asym, asym); ! // sum of both ELL_3M_ADD2(symm, symm, tmpMat); asw = ell_3m_eigenvalues_d(eval, symm, AIR_TRUE); ! if (asw == ell_cubic_root_triple) ! pvl->directAnswer[gageVecLambda2][0] = eval[0]; ! else if (asw == ell_cubic_root_single_double) ! pvl->directAnswer[gageVecLambda2][0] = eval[1]; ! else if (asw == ell_cubic_root_three) ! { ! if (eval[0]<=eval[1]) ! if (eval[1]<=eval[2]) ! pvl->directAnswer[gageVecLambda2][0] = eval[1]; ! else ! if (eval[0]<=eval[2]) ! pvl->directAnswer[gageVecLambda2][0] = eval[2]; ! else ! pvl->directAnswer[gageVecLambda2][0] = eval[0]; ! else ! if (eval[2]<=eval[1]) ! pvl->directAnswer[gageVecLambda2][0] = eval[1]; ! else ! if (eval[0]<=eval[2]) ! pvl->directAnswer[gageVecLambda2][0] = eval[0]; ! else ! pvl->directAnswer[gageVecLambda2][0] = eval[2]; ! } } /* 2nd order vector derivative continued */ --- 176,193 ---- if (GAGE_QUERY_ITEM_TEST(pvl->query, gageVecLambda2)) { ELL_3M_TRANSPOSE(tran, jacAns); ! /* symmetric part */ ELL_3M_SCALE_ADD2(symm, 0.5, jacAns, 0.5, tran); ! /* antisymmetric part */ ELL_3M_SCALE_ADD2(asym, 0.5, jacAns, -0.5, tran); ! /* square symmetric part */ ELL_3M_MUL(tmpMat, symm, symm); ELL_3M_COPY(symm, tmpMat); ! /* square antisymmetric part */ ELL_3M_MUL(tmpMat, asym, asym); ! /* sum of both */ ELL_3M_ADD2(symm, symm, tmpMat); + /* get eigenvalues in sorted order */ asw = ell_3m_eigenvalues_d(eval, symm, AIR_TRUE); ! pvl->directAnswer[gageVecLambda2][0] = eval[1]; } /* 2nd order vector derivative continued */ *************** *** 236,239 **** --- 218,247 ---- pvl->directAnswer[gageVecCurlGradient][8] = hesAns[11]-hesAns[ 3]; } + if (GAGE_QUERY_ITEM_TEST(pvl->query, gageVecCurlNormGrad)) { + norm = 1./ELL_3V_LEN(curlAns); + + tmpVec[0] = hesAns[21] - hesAns[15]; + tmpVec[1] = hesAns[ 6] - hesAns[18]; + tmpVec[2] = hesAns[ 9] - hesAns[ 3]; + pvl->directAnswer[gageVecCurlNormGrad][0]= + norm*ELL_3V_DOT(tmpVec, curlAns); + + tmpVec[0] = hesAns[22] - hesAns[16]; + tmpVec[1] = hesAns[ 7] - hesAns[19]; + tmpVec[2] = hesAns[10] - hesAns[ 4]; + pvl->directAnswer[gageVecCurlNormGrad][1]= + norm*ELL_3V_DOT(tmpVec, curlAns); + + tmpVec[0] = hesAns[23] - hesAns[17]; + tmpVec[1] = hesAns[ 8] - hesAns[20]; + tmpVec[2] = hesAns[11] - hesAns[ 5]; + pvl->directAnswer[gageVecCurlNormGrad][2]= + norm*ELL_3V_DOT(tmpVec, curlAns); + } + if (GAGE_QUERY_ITEM_TEST(pvl->query, gageVecNCurlNormGrad)) { + norm = 1./ELL_3V_LEN(curlnormgradAns); + ELL_3V_SCALE(pvl->directAnswer[gageVecNCurlNormGrad], + norm, pvl->directAnswer[gageVecCurlNormGrad]); + } if (GAGE_QUERY_ITEM_TEST(pvl->query, gageVecHelGradient)) { pvl->directAnswer[gageVecHelGradient][0] = *************** *** 332,335 **** --- 340,345 ---- "vector hessian", "curl gradient", + "curl norm gradient", + "normalized curl norm gradient", "helicity gradient", "directional helicity derivative", *************** *** 358,361 **** --- 368,373 ---- "3x3x3 second-order vector derivative", "3x3 derivative of curl", + "gradient of curl norm", + "normalized gradient of curl norm", "gradient of helicity", "directional derivative of helicity along flow", *************** *** 384,387 **** --- 396,401 ---- gageVecHessian, gageVecCurlGradient, + gageVecCurlNormGrad, + gageVecNCurlNormGrad, gageVecHelGradient, gageVecDirHelDeriv, *************** *** 396,420 **** }; ! #define GV_V gageVecVector ! #define GV_L gageVecLength ! #define GV_N gageVecNormalized ! #define GV_J gageVecJacobian ! #define GV_D gageVecDivergence ! #define GV_C gageVecCurl ! #define GV_H gageVecHelicity ! #define GV_NH gageVecNormHelicity ! #define GV_LB gageVecLambda2 ! #define GV_VH gageVecHessian ! #define GV_CG gageVecCurlGradient ! #define GV_HG gageVecHelGradient ! #define GV_DH gageVecDirHelDeriv ! #define GV_PH gageVecProjHelGradient ! #define GV_G0 gageVecGradient0 ! #define GV_G1 gageVecGradient1 ! #define GV_G2 gageVecGradient2 ! #define GV_MG gageVecMultiGrad ! #define GV_MF gageVecMGFrob ! #define GV_ML gageVecMGEval ! #define GV_MC gageVecMGEvec char --- 410,436 ---- }; ! #define GV_V gageVecVector ! #define GV_L gageVecLength ! #define GV_N gageVecNormalized ! #define GV_J gageVecJacobian ! #define GV_D gageVecDivergence ! #define GV_C gageVecCurl ! #define GV_H gageVecHelicity ! #define GV_NH gageVecNormHelicity ! #define GV_LB gageVecLambda2 ! #define GV_VH gageVecHessian ! #define GV_CG gageVecCurlGradient ! #define GV_CNG gageVecCurlNormGrad ! #define GV_NCG gageVecNCurlNormGrad ! #define GV_HG gageVecHelGradient ! #define GV_DH gageVecDirHelDeriv ! #define GV_PH gageVecProjHelGradient ! #define GV_G0 gageVecGradient0 ! #define GV_G1 gageVecGradient1 ! #define GV_G2 gageVecGradient2 ! #define GV_MG gageVecMultiGrad ! #define GV_MF gageVecMGFrob ! #define GV_ML gageVecMGEval ! #define GV_MC gageVecMGEvec char *************** *** 431,434 **** --- 447,452 ---- "vh", "vhes", "vhessian", "vector hessian", "cg", "curlgrad", "curlg", "curljac", "curl gradient", + "cng", "curl norm gradient", + "ncng", "norm curl norm gradient", "hg", "helg", "helgrad", "helicity gradient", "dirhelderiv", "dhd", "ddh", "directional helicity derivative", *************** *** 457,460 **** --- 475,480 ---- GV_VH, GV_VH, GV_VH, GV_VH, GV_CG, GV_CG, GV_CG, GV_CG, GV_CG, + GV_CNG, GV_CNG, + GV_NCG, GV_NCG, GV_HG, GV_HG, GV_HG, GV_HG, GV_DH, GV_DH, GV_DH, GV_DH, |