|
From: Gordon K. <kin...@us...> - 2004-05-02 21:43:20
|
Update of /cvsroot/teem/teem/src/coil In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17698 Modified Files: coil.h methodsCoil.c realmethods.c scalarCoil.c Log Message: trick to help regularize modified curvature diffusion: mix in a tiny bit of laplacian-based smoothing Index: scalarCoil.c =================================================================== RCS file: /cvsroot/teem/teem/src/coil/scalarCoil.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** scalarCoil.c 25 Mar 2004 03:11:50 -0000 1.3 --- scalarCoil.c 2 May 2004 21:43:02 -0000 1.4 *************** *** 137,141 **** double parm[COIL_PARMS_NUM]) { coil_t forwX[3], backX[3], forwY[3], backY[3], forwZ[3], backZ[3], ! grad[3], gm, eps, KK, LL, rspX, rspY, rspZ; /* reciprocals of spacings in X, Y, and Z */ --- 137,141 ---- double parm[COIL_PARMS_NUM]) { coil_t forwX[3], backX[3], forwY[3], backY[3], forwZ[3], backZ[3], ! grad[3], gm, eps, KK, LL, rspX, rspY, rspZ, lerp; /* reciprocals of spacings in X, Y, and Z */ *************** *** 169,176 **** LL = ELL_3V_DOT(backZ, backZ); backZ[2] *= _COIL_CONDUCT(LL, KK)/(eps + sqrt(LL)); ! ! delta[0] = gm*parm[0]*(rspX*(forwX[0] - backX[0]) ! + rspY*(forwY[1] - backY[1]) ! + rspZ*(forwZ[2] - backZ[2])); } --- 169,179 ---- LL = ELL_3V_DOT(backZ, backZ); backZ[2] *= _COIL_CONDUCT(LL, KK)/(eps + sqrt(LL)); ! ! lerp = parm[2]; ! delta[0] = (lerp*_coilLaplacian3(iv3, spacing) ! + (1-lerp)*gm*(rspX*(forwX[0] - backX[0]) ! + rspY*(forwY[1] - backY[1]) ! + rspZ*(forwZ[2] - backZ[2]))); ! delta[0] *= parm[0]; } Index: realmethods.c =================================================================== RCS file: /cvsroot/teem/teem/src/coil/realmethods.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** realmethods.c 25 Mar 2004 03:11:50 -0000 1.4 --- realmethods.c 2 May 2004 21:43:02 -0000 1.5 *************** *** 55,59 **** "modified-curvature", coilMethodTypeModifiedCurvature, ! 2 }; const coilMethod* --- 55,59 ---- "modified-curvature", coilMethodTypeModifiedCurvature, ! 3 }; const coilMethod* Index: coil.h =================================================================== RCS file: /cvsroot/teem/teem/src/coil/coil.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** coil.h 25 Mar 2004 03:11:50 -0000 1.3 --- coil.h 2 May 2004 21:43:02 -0000 1.4 *************** *** 159,163 **** typedef struct coilContext_t { /* ---------- input */ ! const Nrrd *nin; /* input volume, converted to coil_t nvol */ const coilKind *kind; /* what kind of volume is nin */ const coilMethod *method; /* what method of filtering to use */ --- 159,164 ---- typedef struct coilContext_t { /* ---------- input */ ! const Nrrd *nin; /* input volume (converted to type coil_t ! in nvol, below) */ const coilKind *kind; /* what kind of volume is nin */ const coilMethod *method; /* what method of filtering to use */ Index: methodsCoil.c =================================================================== RCS file: /cvsroot/teem/teem/src/coil/methodsCoil.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** methodsCoil.c 25 Mar 2004 03:11:50 -0000 1.4 --- methodsCoil.c 2 May 2004 21:43:02 -0000 1.5 *************** *** 198,203 **** } baseDim = (1 == cctx->kind->valLen ? 0 : 1); ! if (nrrdSlice(nout, cctx->nvol, baseDim, 0)) { ! sprintf(err, "%s: trouble slicing to get output", me); biffMove(COIL, err, NRRD); return 1; } --- 198,204 ---- } baseDim = (1 == cctx->kind->valLen ? 0 : 1); ! if (nrrdSlice(nout, cctx->nvol, baseDim, 0) ! || nrrdAxisInfoCopy(nout, cctx->nin, NULL, NRRD_AXIS_INFO_NONE)) { ! sprintf(err, "%s: trouble getting output", me); biffMove(COIL, err, NRRD); return 1; } |