|
From: <kin...@us...> - 2024-06-21 07:45:02
|
Revision: 7167
http://sourceforge.net/p/teem/code/7167
Author: kindlmann
Date: 2024-06-21 07:44:59 +0000 (Fri, 21 Jun 2024)
Log Message:
-----------
synching with source
Modified Paths:
--------------
teem/trunk/python/cffi/biffdata/limn.csv
teem/trunk/python/cffi/cdef/cdef_limn.h
teem/trunk/python/cffi/teem.py
Modified: teem/trunk/python/cffi/biffdata/limn.csv
===================================================================
--- teem/trunk/python/cffi/biffdata/limn.csv 2024-06-21 07:43:16 UTC (rev 7166)
+++ teem/trunk/python/cffi/biffdata/limn.csv 2024-06-21 07:44:59 UTC (rev 7167)
@@ -60,11 +60,14 @@
limnSplineUpdate,int,1,0,limn,limn/splineMethods.c:422
limnSplineTypeSpecParse,limnSplineTypeSpec *,NULL,0,limn,limn/splineMisc.c:222
limnSplineParse,limnSpline *,NULL,0,limn,limn/splineMisc.c:278
-limnCBFCheck,int,1,0,limn,limn/splineFit.c:589
-limnCBFitSingle,int,1,0,limn,limn/splineFit.c:860
-limnCBFMulti,int,1,0,limn,limn/splineFit.c:951
-limnCBFCorners,int,1,0,limn,limn/splineFit.c:1053
-limnCBFit,int,1,0,limn,limn/splineFit.c:1123
+limnCBFPointsCheck,int,1,0,limn,limn/splineFit.c:73
+limnCBFCtxNew,limnCBFCtx *,NULL,0,limn,limn/splineFit.c:222
+limnCBFFindVT,int,1,0,limn,limn/splineFit.c:357
+limnCBFCtxCheck,int,1,0,limn,limn/splineFit.c:751
+limnCBFitSingle,int,1,0,limn,limn/splineFit.c:925
+limnCBFMulti,int,1,0,limn,limn/splineFit.c:1016
+limnCBFCorners,int,1,0,limn,limn/splineFit.c:1116
+limnCBFit,int,1,0,limn,limn/splineFit.c:1184
limnObjectWorldHomog,int,1,0,limn,limn/transform.c:25
limnObjectFaceNormals,int,1,0,limn,limn/transform.c:47
limnObjectSpaceTransform,int,1,0,limn,limn/transform.c:210
Modified: teem/trunk/python/cffi/cdef/cdef_limn.h
===================================================================
--- teem/trunk/python/cffi/cdef/cdef_limn.h 2024-06-21 07:43:16 UTC (rev 7166)
+++ teem/trunk/python/cffi/cdef/cdef_limn.h 2024-06-21 07:44:59 UTC (rev 7167)
@@ -451,11 +451,12 @@
******** limnCBFSeg
**
** how one cubic Bezier spline segment is represented for limnCBF functions
+** (using DIM=2 to mark places where the 2D-ness of the code surfaces )
*/
typedef struct {
double xy[8]; /* four control points of cubic Bezier:
x0, y0, x1, y1, x2, y2, x3, y3
- 0 1 2 3 4 5 6 7 */
+ 0 1 2 3 4 5 6 7 DIM=2 */
int corner[2]; /* corner[0,1] non-zero if xy[0,3] are corner vertices;
segments otherwise assumed geometrically continuous */
unsigned int pNum; /* (if non-zero) this segment approximates pNum points */
@@ -472,13 +473,9 @@
int isLoop; /* path is closed loop */
} limnCBFPath;
/*
-******** limnCBFContext
+******** limnCBFCtx
**
-** The bag of state for limnCBF functions. Callers of limnCBF functions do not
-** need to worry about the dynamically allocated things within (so: no
-** limnCBFContextNew or limnCBFContextNix), but a limnCBFContext variable
-** should be initialized with limnCBFContextInit() in order to set default
-** parameters, before passing to limnCBF functions.
+** The bag of state for limnCBF functions.
**
** note: "nrp" = Newton-based Re-Parameterization of where the given points
** fall along the spline, the iterative process inside limnCBFSingle
@@ -489,38 +486,31 @@
cornNMS; /* non-minimal-suppression of corners: accept as
corners only those with locally minimal angle */
unsigned int nrpIterMax; /* max # iters of nrp */
- double scale, /* scale (in sense of nrrdKernelDiscreteGaussian)
- at which to estimate spline endpoints and
- tangents; scale=0 means the endpoints are
- exactly on vertices, and tangents are from
- the smallest-support finite differences */
- distMin, /* min distance to given points: this controls
- both splitting done by limnCBFMulti, and nrp
- within limnCBFSingle */
- nrpDeltaMax, /* in nrp, capping parameterization change to this
- scaling of average u[i+1]-u[i]. This wasn't in
- author's original code (so their idea of doing
- at most ~5 iters of nrp may no longer hold), but
- it can help stabilize things */
- nrpDistScl, /* scaling on distMin to use when testing distance
- during nrp; setting this < 1 means that nrp
- tries to be more stringent that the overall
- fitting, but with the benefit of sometimes
- being smarter about where to split, when that
- is needed */
- nrpPsi, /* don't even try nrp if max dist is bigger than
- nrpPsi*distMin, instead just subdivide */
- nrpDeltaMin, /* min total parameterization change by nrp */
- alphaMin, /* alpha can't be negative, and we enforce
- distinct positivity to ensure that spline
- doesn't slow down too much near endpoints */
- detMin, /* absolute value of determinant of 2x2 matrix
- to invert can't below this */
- cornAngle; /* angle, in degrees, between (one-sided) incoming
- and outgoing tangents, *below* which a vertex
- should be considered a corner. Vertices in a
- straight line have an angle of 180 degrees. Or,
- if 0, no effort is made to detect corners. */
+ double scale, /* scale (in sense of nrrdKernelDiscreteGaussian) at which to estimate
+ spline endpoints and tangents; scale=0 means the endpoints are
+ exactly on vertices, and tangents are from the smallest-support
+ finite differences. This is the ONLY floating point that should be set
+ by a method (limnCBFScaleSet); the rest can be set directly. */
+ distMin, /* min distance to given points: this controls both splitting done by
+ limnCBFMulti, and nrp within limnCBFSingle */
+ nrpDeltaMax, /* in nrp, capping parameterization change to this scaling of average
+ u[i+1]-u[i]. This wasn't in author's original code (so their idea of
+ doing at most ~5 iters of nrp may no longer hold), but it can help
+ stabilize things */
+ nrpDistScl, /* scaling on distMin to use when testing distance during nrp; setting
+ this < 1 means that nrp tries to be more stringent than the overall
+ fitting, but with the benefit of sometimes being smarter about where
+ to split, when that is needed */
+ nrpPsi, /* don't even try nrp if max dist is bigger than nrpPsi*distMin, instead just
+ subdivide */
+ nrpDeltaMin, /* min total parameterization change by nrp */
+ alphaMin, /* alpha can't be negative, and we enforce distinct positivity to ensure
+ that spline doesn't slow down too much near endpoints */
+ detMin, /* abs(determinant) of 2x2 matrix to invert can't go below this */
+ cornAngle; /* angle, in degrees, between (one-sided) incoming and outgoing tangents,
+ *below* which a vertex should be considered a corner. Vertices in a
+ straight line have an angle of 180 degrees. Or, if 0, no effort is made
+ to detect corners. */
/* ----------- internal --------- */
double *uu, /* buffer used for nrp */
*vw, /* weights for endpoint vertex calculation */
@@ -540,12 +530,12 @@
2: DM < dist <= fD
3: fD < dist
where
+ nD = nrpDistScl*distMin,
DM = distMin,
- nD = nrpDistScl*distMin,
fD = nrpPsi*distMin: */
-} limnCBFContext;
+} limnCBFCtx;
/*
-******** limnPoints
+******** limnCBFPoints
**
** a container for 1D array of points; currently used for limnCBF functions
** Both pp and ppOwn can point to the array of point locations, but exactly
@@ -552,9 +542,11 @@
** one of pp and ppOwn can be non-NULL.
**
** NOTE: For now, point data is only double (not float), and only in 2D (not
-** 3D), but if this becomes more general, that generality will be inside here
+** 3D), but if this becomes more general, that generality will be inside here.
+** For time being DIM=2 tags locations where 2D-ness is explicit in code.
*/
typedef struct {
+ /* assuming DIM=2: 2 values per logical element pp */
const double *pp; /* point coords, we do not own buffer */
double *ppOwn; /* point coords, we DO own buffer */
unsigned int num; /* how many points */
@@ -561,7 +553,7 @@
int isLoop; /* points form a loop: logical indices into coord
array are . . . num-2, num-1, 0, 1, . . .
and index 0 is effectively arbitrary */
-} limnPoints;
+} limnCBFPoints;
/* defaultsLimn.c */
extern const int limnPresent;
extern const char *const limnBiffKey;
@@ -819,27 +811,33 @@
extern int limnSplineSample(Nrrd *nout, limnSpline *spline, double minT, size_t M,
double maxT);
/* splineFit.c */
-extern limnPoints *limnPointsNew(const double *pp, unsigned int nn, int isLoop);
-extern limnPoints *limnPointsNix(limnPoints *lpnt);
+extern limnCBFPoints *limnCBFPointsNew(const double *pp, unsigned int nn,
+ int isLoop);
+extern limnCBFPoints *limnCBFPointsNix(limnCBFPoints *lpnt);
+extern int limnCBFPointsCheck(const limnCBFPoints *lpnt);
+extern limnCBFCtx *limnCBFCtxNew(unsigned int pointNum, double scale);
+extern limnCBFCtx *limnCBFCtxNix(limnCBFCtx *fctx);
extern void limnCBFSegEval(double *xy, const limnCBFSeg *seg, double tt);
extern limnCBFPath *limnCBFPathNew(void);
extern limnCBFPath *limnCBFPathNix(limnCBFPath *path);
-extern void limnCBFPathSample(double *xy, unsigned int pNum,
+extern void limnCBFPathSample(double *xy, unsigned int pointNum,
const limnCBFPath *path);
-extern void limnCBFContextInit(limnCBFContext *fctx, int outputOnly);
-extern int limnCBFCheck(const limnCBFContext *fctx, const limnPoints *lpnt);
-extern int limnCBFitSingle(double alpha[2], limnCBFContext *fctx,
- const double vv0[2], const double tt1[2],
- const double tt2[2], const double vv3[2],
- const double *xy, unsigned int pNum, int isLoop);
-extern int limnCBFMulti(limnCBFPath *path, limnCBFContext *fctx,
- const double vv0[2], const double tt1[2],
- const double tt2[2], const double vv3[2],
- const limnPoints *lpnt, unsigned int loi, unsigned int hii);
+extern int limnCBFFindVT(double vv[2], double tt[2], const limnCBFCtx *fctx,
+ const limnCBFPoints *lpnt, unsigned int loi,
+ unsigned int hii, unsigned int ofi, int dir);
+extern int limnCBFCtxCheck(const limnCBFCtx *fctx, const limnCBFPoints *lpnt);
+extern int limnCBFitSingle(double alpha[2], limnCBFCtx *fctx, const double vv0[2],
+ const double tt1[2], const double tt2[2],
+ const double vv3[2], const double *xy,
+ unsigned int pointNum, int isLoop);
+extern int limnCBFMulti(limnCBFPath *path, limnCBFCtx *fctx, const double vv0[2],
+ const double tt1[2], const double tt2[2],
+ const double vv3[2], const limnCBFPoints *lpnt,
+ unsigned int loi, unsigned int hii);
extern int limnCBFCorners(unsigned int **cornIdx, unsigned int *cornNum,
- limnCBFContext *fctx, const limnPoints *lpnt);
-extern int limnCBFit(limnCBFPath *path, limnCBFContext *fctx, const double *xy,
- unsigned int pNum, int isLoop);
+ limnCBFCtx *fctx, const limnCBFPoints *lpnt);
+extern int limnCBFit(limnCBFPath *path, limnCBFCtx *fctx, const double *xy,
+ unsigned int pointNum, int isLoop);
/* lpu{Flotsam,. . .}.c */
/* F(clip) \ */
/* F(vwflip) \ */
Modified: teem/trunk/python/cffi/teem.py
===================================================================
--- teem/trunk/python/cffi/teem.py 2024-06-21 07:43:16 UTC (rev 7166)
+++ teem/trunk/python/cffi/teem.py 2024-06-21 07:44:59 UTC (rev 7167)
@@ -293,14 +293,6 @@
'mossSamplerSample': (_equals_one, 0, b'moss', 'moss/sampler.c:195'),
'mossLinearTransform': (_equals_one, 0, b'moss', 'moss/xform.c:140'),
'mossFourPointTransform': (_equals_one, 0, b'moss', 'moss/xform.c:219'),
- 'alanUpdate': (_equals_one, 0, b'alan', 'alan/coreAlan.c:60'),
- 'alanInit': (_equals_one, 0, b'alan', 'alan/coreAlan.c:99'),
- 'alanRun': (_equals_one, 0, b'alan', 'alan/coreAlan.c:453'),
- 'alanDimensionSet': (_equals_one, 0, b'alan', 'alan/methodsAlan.c:104'),
- 'alan2DSizeSet': (_equals_one, 0, b'alan', 'alan/methodsAlan.c:119'),
- 'alan3DSizeSet': (_equals_one, 0, b'alan', 'alan/methodsAlan.c:139'),
- 'alanTensorSet': (_equals_one, 0, b'alan', 'alan/methodsAlan.c:161'),
- 'alanParmSet': (_equals_one, 0, b'alan', 'alan/methodsAlan.c:208'),
'gageContextCopy': (_equals_null, 0, b'gage', 'gage/ctx.c:88'),
'gageKernelSet': (_equals_one, 0, b'gage', 'gage/ctx.c:199'),
'gagePerVolumeAttach': (_equals_one, 0, b'gage', 'gage/ctx.c:398'),
@@ -347,31 +339,6 @@
'gageOptimSigErrorPlotSliding': (_equals_one, 0, b'gage', 'gage/optimsig.c:1253'),
'dyeConvert': (_equals_one, 0, b'dye', 'dye/convertDye.c:351'),
'dyeColorParse': (_equals_one, 0, b'dye', 'dye/methodsDye.c:185'),
- 'baneClipNew': (_equals_null, 0, b'bane', 'bane/clip.c:102'),
- 'baneClipAnswer': (_equals_one, 0, b'bane', 'bane/clip.c:152'),
- 'baneClipCopy': (_equals_null, 0, b'bane', 'bane/clip.c:167'),
- 'baneFindInclusion': (_equals_one, 0, b'bane', 'bane/hvol.c:87'),
- 'baneMakeHVol': (_equals_one, 0, b'bane', 'bane/hvol.c:248'),
- 'baneGKMSHVol': (_equals_null, 0, b'bane', 'bane/hvol.c:447'),
- 'baneIncNew': (_equals_null, 0, b'bane', 'bane/inc.c:251'),
- 'baneIncAnswer': (_equals_one, 0, b'bane', 'bane/inc.c:360'),
- 'baneIncCopy': (_equals_null, 0, b'bane', 'bane/inc.c:375'),
- 'baneMeasrNew': (_equals_null, 0, b'bane', 'bane/measr.c:33'),
- 'baneMeasrCopy': (_equals_null, 0, b'bane', 'bane/measr.c:149'),
- 'baneRangeNew': (_equals_null, 0, b'bane', 'bane/rangeBane.c:89'),
- 'baneRangeCopy': (_equals_null, 0, b'bane', 'bane/rangeBane.c:130'),
- 'baneRangeAnswer': (_equals_one, 0, b'bane', 'bane/rangeBane.c:144'),
- 'baneRawScatterplots': (_equals_one, 0, b'bane', 'bane/scat.c:26'),
- 'baneOpacInfo': (_equals_one, 0, b'bane', 'bane/trnsf.c:29'),
- 'bane1DOpacInfoFrom2D': (_equals_one, 0, b'bane', 'bane/trnsf.c:144'),
- 'baneSigmaCalc': (_equals_one, 0, b'bane', 'bane/trnsf.c:222'),
- 'banePosCalc': (_equals_one, 0, b'bane', 'bane/trnsf.c:253'),
- 'baneOpacCalc': (_equals_one, 0, b'bane', 'bane/trnsf.c:403'),
- 'baneInputCheck': (_equals_one, 0, b'bane', 'bane/valid.c:26'),
- 'baneHVolCheck': (_equals_one, 0, b'bane', 'bane/valid.c:64'),
- 'baneInfoCheck': (_equals_one, 0, b'bane', 'bane/valid.c:106'),
- 'banePosCheck': (_equals_one, 0, b'bane', 'bane/valid.c:144'),
- 'baneBcptsCheck': (_equals_one, 0, b'bane', 'bane/valid.c:179'),
'limnCameraUpdate': (_equals_one, 0, b'limn', 'limn/cam.c:33'),
'limnCameraAspectSet': (_equals_one, 0, b'limn', 'limn/cam.c:130'),
'limnCameraPathMake': (_equals_one, 0, b'limn', 'limn/cam.c:189'),
@@ -433,11 +400,14 @@
'limnSplineUpdate': (_equals_one, 0, b'limn', 'limn/splineMethods.c:422'),
'limnSplineTypeSpecParse': (_equals_null, 0, b'limn', 'limn/splineMisc.c:222'),
'limnSplineParse': (_equals_null, 0, b'limn', 'limn/splineMisc.c:278'),
- 'limnCBFCheck': (_equals_one, 0, b'limn', 'limn/splineFit.c:589'),
- 'limnCBFitSingle': (_equals_one, 0, b'limn', 'limn/splineFit.c:860'),
- 'limnCBFMulti': (_equals_one, 0, b'limn', 'limn/splineFit.c:951'),
- 'limnCBFCorners': (_equals_one, 0, b'limn', 'limn/splineFit.c:1053'),
- 'limnCBFit': (_equals_one, 0, b'limn', 'limn/splineFit.c:1123'),
+ 'limnCBFPointsCheck': (_equals_one, 0, b'limn', 'limn/splineFit.c:73'),
+ 'limnCBFCtxNew': (_equals_null, 0, b'limn', 'limn/splineFit.c:222'),
+ 'limnCBFFindVT': (_equals_one, 0, b'limn', 'limn/splineFit.c:357'),
+ 'limnCBFCtxCheck': (_equals_one, 0, b'limn', 'limn/splineFit.c:751'),
+ 'limnCBFitSingle': (_equals_one, 0, b'limn', 'limn/splineFit.c:925'),
+ 'limnCBFMulti': (_equals_one, 0, b'limn', 'limn/splineFit.c:1016'),
+ 'limnCBFCorners': (_equals_one, 0, b'limn', 'limn/splineFit.c:1116'),
+ 'limnCBFit': (_equals_one, 0, b'limn', 'limn/splineFit.c:1184'),
'limnObjectWorldHomog': (_equals_one, 0, b'limn', 'limn/transform.c:25'),
'limnObjectFaceNormals': (_equals_one, 0, b'limn', 'limn/transform.c:47'),
'limnObjectSpaceTransform': (_equals_one, 0, b'limn', 'limn/transform.c:210'),
@@ -612,21 +582,6 @@
'pullTraceMultiPlotAdd': (_equals_one, 0, b'pull', 'pull/trace.c:704'),
'pullTraceMultiWrite': (_equals_one, 0, b'pull', 'pull/trace.c:1014'),
'pullTraceMultiRead': (_equals_one, 0, b'pull', 'pull/trace.c:1119'),
- 'coilStart': (_equals_one, 0, b'coil', 'coil/coreCoil.c:287'),
- 'coilIterate': (_equals_one, 0, b'coil', 'coil/coreCoil.c:362'),
- 'coilFinish': (_equals_one, 0, b'coil', 'coil/coreCoil.c:407'),
- 'coilVolumeCheck': (_equals_one, 0, b'coil', 'coil/methodsCoil.c:25'),
- 'coilContextAllSet': (_equals_one, 0, b'coil', 'coil/methodsCoil.c:69'),
- 'coilOutputGet': (_equals_one, 0, b'coil', 'coil/methodsCoil.c:200'),
- 'pushOutputGet': (_equals_one, 0, b'push', 'push/action.c:71'),
- 'pushBinProcess': (_equals_one, 0, b'push', 'push/action.c:161'),
- 'pushBinPointAdd': (_equals_one, 0, b'push', 'push/binning.c:180'),
- 'pushRebin': (_equals_one, 0, b'push', 'push/binning.c:197'),
- 'pushStart': (_equals_one, 0, b'push', 'push/corePush.c:183'),
- 'pushIterate': (_equals_one, 0, b'push', 'push/corePush.c:233'),
- 'pushRun': (_equals_one, 0, b'push', 'push/corePush.c:306'),
- 'pushFinish': (_equals_one, 0, b'push', 'push/corePush.c:396'),
- 'pushEnergySpecParse': (_equals_one, 0, b'push', 'push/forces.c:304'),
'miteSample': (_math.isnan, 0, b'mite', 'mite/ray.c:151'),
'miteRenderBegin': (_equals_one, 0, b'mite', 'mite/renderMite.c:63'),
'miteShadeSpecParse': (_equals_one, 0, b'mite', 'mite/shade.c:69'),
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|