|
From: <kin...@us...> - 2023-07-13 12:27:58
|
Revision: 7087
http://sourceforge.net/p/teem/code/7087
Author: kindlmann
Date: 2023-07-13 12:27:54 +0000 (Thu, 13 Jul 2023)
Log Message:
-----------
updated hest usage
Modified Paths:
--------------
teem/trunk/src/bin/deconv.c
teem/trunk/src/bin/emap.c
teem/trunk/src/bin/gprobe.c
teem/trunk/src/bin/ilk.c
teem/trunk/src/bin/miter.c
teem/trunk/src/bin/mrender.c
teem/trunk/src/bin/overrgb.c
teem/trunk/src/bin/pprobe.c
teem/trunk/src/bin/qbert.c
teem/trunk/src/bin/spots.c
teem/trunk/src/bin/talkweb.c
teem/trunk/src/bin/ungantry.c
teem/trunk/src/bin/vprobe.c
Modified: teem/trunk/src/bin/deconv.c
===================================================================
--- teem/trunk/src/bin/deconv.c 2023-07-13 11:59:58 UTC (rev 7086)
+++ teem/trunk/src/bin/deconv.c 2023-07-13 12:27:54 UTC (rev 7087)
@@ -57,29 +57,27 @@
airMopAdd(mop, hparm, AIR_CAST(airMopper, hestParmFree), airMopAlways);
hparm->elideSingleOtherType = AIR_TRUE;
hparm->respectDashDashHelp = AIR_TRUE;
- hestOptAdd(&hopt, "i", "nin", airTypeOther, 1, 1, &nin, NULL, "input volume", NULL,
- NULL, nrrdHestNrrd);
- hestOptAdd(&hopt, "k", "kind", airTypeOther, 1, 1, &kind, NULL,
- "\"kind\" of volume (\"scalar\", \"vector\", "
- "\"tensor\", or \"dwi\")",
- NULL, NULL, meetHestGageKind);
- hestOptAdd(&hopt, "k00", "kernel", airTypeOther, 1, 1, &ksp, NULL,
- "convolution kernel", NULL, NULL, nrrdHestKernelSpec);
- hestOptAdd(&hopt, "mi", "max # iters", airTypeUInt, 1, 1, &maxIter, "100",
- "maximum number of iterations with which to compute the "
- "deconvolution");
- hestOptAdd(&hopt, "e", "epsilon", airTypeDouble, 1, 1, &epsilon, "0.00000001",
- "convergence threshold");
- hestOptAdd(&hopt, "s", "step", airTypeDouble, 1, 1, &step, "1.0",
- "scaling of value update");
- hestOptAdd(&hopt, "t", "type", airTypeOther, 1, 1, &otype, "default",
- "type to save output as. By default (not using this option), "
- "the output type is the same as the input type",
- NULL, NULL, &unrrduHestMaybeTypeCB);
- hestOptAdd(&hopt, "sep", "bool", airTypeBool, 1, 1, &separ, "false",
- "use fast separable deconvolution instead of brain-dead "
- "brute-force iterative method");
- hestOptAdd(&hopt, "o", "nout", airTypeString, 1, 1, &outS, "-", "output volume");
+ hestOptAdd_1_Other(&hopt, "i", "nin", &nin, NULL, "input volume", nrrdHestNrrd);
+ hestOptAdd_1_Other(&hopt, "k", "kind", &kind, NULL,
+ "\"kind\" of volume (\"scalar\", \"vector\", "
+ "\"tensor\", or \"dwi\")",
+ meetHestGageKind);
+ hestOptAdd_1_Other(&hopt, "k00", "kernel", &ksp, NULL, "convolution kernel",
+ nrrdHestKernelSpec);
+ hestOptAdd_1_UInt(&hopt, "mi", "max # iters", &maxIter, "100",
+ "maximum number of iterations with which to compute the "
+ "deconvolution");
+ hestOptAdd_1_Double(&hopt, "e", "epsilon", &epsilon, "0.00000001",
+ "convergence threshold");
+ hestOptAdd_1_Double(&hopt, "s", "step", &step, "1.0", "scaling of value update");
+ hestOptAdd_1_Other(&hopt, "t", "type", &otype, "default",
+ "type to save output as. By default (not using this option), "
+ "the output type is the same as the input type",
+ &unrrduHestMaybeTypeCB);
+ hestOptAdd_1_Bool(&hopt, "sep", "bool", &separ, "false",
+ "use fast separable deconvolution instead of brain-dead "
+ "brute-force iterative method");
+ hestOptAdd_1_String(&hopt, "o", "nout", &outS, "-", "output volume");
hestParseOrDie(hopt, argc - 1, argv + 1, hparm, me, deconvInfo, AIR_TRUE, AIR_TRUE,
AIR_TRUE);
airMopAdd(mop, hopt, AIR_CAST(airMopper, hestOptFree), airMopAlways);
Modified: teem/trunk/src/bin/emap.c
===================================================================
--- teem/trunk/src/bin/emap.c 2023-07-13 11:59:58 UTC (rev 7086)
+++ teem/trunk/src/bin/emap.c 2023-07-13 12:27:54 UTC (rev 7087)
@@ -45,8 +45,8 @@
char *outS, *errS, *debugS;
airArray *mop;
float amb[3], *linfo, *debug, *map, vscl;
- unsigned li, ui, vi;
- int qn, bits, method, doerr;
+ unsigned int li, ui, vi, bits;
+ int qn, method, doerr;
limnLight *light;
limnCamera *cam;
double u, v, r, w, V2W[9], diff, WW[3], VV[3];
@@ -59,35 +59,34 @@
hparm->respectDashDashHelp = AIR_TRUE;
cam = limnCameraNew();
airMopAdd(mop, cam, (airMopper)limnCameraNix, airMopAlways);
- hestOptAdd(&hopt, "i", "nlight", airTypeOther, 1, 1, &nlight, NULL,
- "input nrrd containing light information", NULL, NULL, nrrdHestNrrd);
- hestOptAdd(&hopt, "b", "# bits", airTypeInt, 1, 1, &bits, "16",
- "number of bits to use for normal quantization, "
- "between 8 and 16 inclusive. ");
- hestOptAdd(&hopt, "amb", "ambient RGB", airTypeFloat, 3, 3, amb, "0 0 0",
- "ambient light color");
- hestOptAdd(&hopt, "fr", "from point", airTypeDouble, 3, 3, cam->from, "1 0 0",
- "position of camera, used to determine view vector");
- hestOptAdd(&hopt, "at", "at point", airTypeDouble, 3, 3, cam->at, "0 0 0",
- "camera look-at point, used to determine view vector");
- hestOptAdd(&hopt, "up", "up vector", airTypeDouble, 3, 3, cam->up, "0 0 1",
- "camera pseudo-up vector, used to determine view coordinates");
- hestOptAdd(&hopt, "rh", NULL, airTypeInt, 0, 0, &(cam->rightHanded), NULL,
- "use a right-handed UVN frame (V points down)");
- hestOptAdd(&hopt, "vs", "view-dir scaling", airTypeFloat, 1, 1, &vscl, "1",
- "scaling along view-direction of location of "
- "view-space lights");
- hestOptAdd(&hopt, "o", "filename", airTypeString, 1, 1, &outS, NULL,
- "file to write output envmap to");
- hestOptAdd(&hopt, "d", "filename", airTypeString, 1, 1, &debugS, "",
- "Use this option to save out (to the given filename) a rendering "
- "of the front (on the left) and back (on the right) of a sphere "
- "as shaded with the new environment map. U increases "
- "right-ward, V increases downward. The back sphere half is "
- "rendered as though the front half was removed");
- hestOptAdd(&hopt, "err", NULL, airTypeInt, 0, 0, &doerr, NULL,
- "If using \"-d\", make the image represent the error between the "
- "real and quantized vector");
+ hestOptAdd_1_Other(&hopt, "i", "nlight", &nlight, NULL,
+ "input nrrd containing light information", nrrdHestNrrd);
+ hestOptAdd_1_UInt(&hopt, "b", "# bits", &bits, "16",
+ "number of bits to use for normal quantization, "
+ "between 8 and 16 inclusive. ");
+ hestOptAdd_3_Float(&hopt, "amb", "ambient RGB", amb, "0 0 0", "ambient light color");
+ hestOptAdd_3_Double(&hopt, "fr", "from point", cam->from, "1 0 0",
+ "position of camera, used to determine view vector");
+ hestOptAdd_3_Double(&hopt, "at", "at point", cam->at, "0 0 0",
+ "camera look-at point, used to determine view vector");
+ hestOptAdd_3_Double(&hopt, "up", "up vector", cam->up, "0 0 1",
+ "camera pseudo-up vector, used to determine view coordinates");
+ hestOptAdd_Flag(&hopt, "rh", &(cam->rightHanded),
+ "use a right-handed UVN frame (V points down)");
+ hestOptAdd_1_Float(&hopt, "vs", "view-dir scaling", &vscl, "1",
+ "scaling along view-direction of location of "
+ "view-space lights");
+ hestOptAdd_1_String(&hopt, "o", "filename", &outS, NULL,
+ "file to write output envmap to");
+ hestOptAdd_1_String(&hopt, "d", "filename", &debugS, "",
+ "Use this option to save out (to the given filename) a rendering "
+ "of the front (on the left) and back (on the right) of a sphere "
+ "as shaded with the new environment map. U increases "
+ "right-ward, V increases downward. The back sphere half is "
+ "rendered as though the front half was removed");
+ hestOptAdd_Flag(&hopt, "err", &doerr,
+ "If using \"-d\", make the image represent the error between the "
+ "real and quantized vector");
hestParseOrDie(hopt, argc - 1, argv + 1, hparm, me, emapInfo, AIR_TRUE, AIR_TRUE,
AIR_TRUE);
airMopAdd(mop, hopt, (airMopper)hestOptFree, airMopAlways);
@@ -122,7 +121,7 @@
method = limnQN8octa;
break;
default:
- fprintf(stderr, "%s: requested #bits (%d) not in valid range [8,16]\n", me, bits);
+ fprintf(stderr, "%s: requested #bits (%u) not in valid range [8,16]\n", me, bits);
airMopError(mop);
return 1;
}
Modified: teem/trunk/src/bin/gprobe.c
===================================================================
--- teem/trunk/src/bin/gprobe.c 2023-07-13 11:59:58 UTC (rev 7086)
+++ teem/trunk/src/bin/gprobe.c 2023-07-13 12:27:54 UTC (rev 7087)
@@ -272,64 +272,65 @@
airMopAdd(mop, hparm, AIR_CAST(airMopper, hestParmFree), airMopAlways);
hparm->elideSingleOtherType = AIR_TRUE;
hparm->respectDashDashHelp = AIR_TRUE;
- hestOptAdd(&hopt, "i", "nin", airTypeOther, 1, 1, &nin, NULL, "input volume", NULL,
- NULL, nrrdHestNrrd);
- hestOptAdd(&hopt, "k", "kind", airTypeOther, 1, 1, &kind, NULL,
- "\"kind\" of volume (\"scalar\", \"vector\", "
- "\"tensor\", or \"dwi\")",
- NULL, NULL, meetHestGageKind);
- hestOptAdd(&hopt, "v", "verbosity", airTypeInt, 1, 1, &verbose, "1",
- "verbosity level");
- hestOptAdd(&hopt, "q", "query", airTypeString, 1, 1, &whatS, NULL,
- "the quantity (scalar, vector, or matrix) to learn by probing");
- hestOptAdd(&hopt, "gmc", "min gradmag", airTypeDouble, 1, 1, &gmc, "0.0",
- "For curvature-based queries, use zero when gradient "
- "magnitude is below this");
- hestOptAdd(&hopt, "ofs", "ofs", airTypeInt, 0, 0, &orientationFromSpacing, NULL,
- "If only per-axis spacing is available, use that to "
- "contrive full orientation info");
- hestOptAdd(&hopt, "seed", "N", airTypeUInt, 1, 1, &seed, "42",
- "RNG seed; mostly for debugging");
- hestOptAdd(&hopt, "c", "bool", airTypeBool, 1, 1, &clamp, "false",
- "clamp positions as part of probing");
- hestOptAdd(&hopt, "ev", "thresh val", airTypeDouble, 2, 2, edgeFracInfo, "1 0",
- "if using position clamping (with \"-c true\"), the fraction "
- "of values invented for the kernel support, or \"edge frac\" "
- "is saved per probe (0 means kernel support was entirely within "
- "data; 1 means everything was invented). "
- "If this frac exceeds the first \"thresh\" "
- "value given here, then the saved value for the probe will be "
- "the second value \"val\" given here");
- hestOptAdd(&hopt, "zz", "bool", airTypeBool, 1, 1, &zeroZ, "false",
- "enable \"zeroZ\" behavior in gage that partially "
- "implements working with 3D images as if they are 2D");
+ hestOptAdd_1_Other(&hopt, "i", "nin", &nin, NULL, "input volume", nrrdHestNrrd);
+ hestOptAdd_1_Other(&hopt, "k", "kind", &kind, NULL,
+ "\"kind\" of volume (\"scalar\", \"vector\", "
+ "\"tensor\", or \"dwi\")",
+ meetHestGageKind);
+ hestOptAdd_1_Int(&hopt, "v", "verbosity", &verbose, "1", "verbosity level");
+ hestOptAdd_1_String(&hopt, "q", "query", &whatS, NULL,
+ "the quantity (scalar, vector, or matrix) to learn by probing");
+ hestOptAdd_1_Double(&hopt, "gmc", "min gradmag", &gmc, "0.0",
+ "For curvature-based queries, use zero when gradient "
+ "magnitude is below this");
+ hestOptAdd_Flag(&hopt, "ofs", &orientationFromSpacing,
+ "If only per-axis spacing is available, use that to "
+ "contrive full orientation info");
+ hestOptAdd_1_UInt(&hopt, "seed", "N", &seed, "42", "RNG seed; mostly for debugging");
+ hestOptAdd_1_Bool(&hopt, "c", "bool", &clamp, "false",
+ "clamp positions as part of probing");
+ hestOptAdd_2_Double(&hopt, "ev", "thresh val", edgeFracInfo, "1 0",
+ "if using position clamping (with \"-c true\"), the fraction "
+ "of values invented for the kernel support, or \"edge frac\" "
+ "is saved per probe (0 means kernel support was entirely within "
+ "data; 1 means everything was invented). "
+ "If this frac exceeds the first \"thresh\" "
+ "value given here, then the saved value for the probe will be "
+ "the second value \"val\" given here");
+ hestOptAdd_1_Bool(&hopt, "zz", "bool", &zeroZ, "false",
+ "enable \"zeroZ\" behavior in gage that partially "
+ "implements working with 3D images as if they are 2D");
- hestOptAdd(&hopt, "k00", "kern00", airTypeOther, 1, 1, &k00, "tent",
- "kernel for gageKernel00", NULL, NULL, nrrdHestKernelSpec);
- hestOptAdd(&hopt, "k11", "kern11", airTypeOther, 1, 1, &k11, "cubicd:1,0",
- "kernel for gageKernel11", NULL, NULL, nrrdHestKernelSpec);
- hestOptAdd(&hopt, "k22", "kern22", airTypeOther, 1, 1, &k22, "cubicdd:1,0",
- "kernel for gageKernel22", NULL, NULL, nrrdHestKernelSpec);
- hestOptAdd(&hopt, "rn", NULL, airTypeInt, 0, 0, &renorm, NULL,
- "renormalize kernel weights at each new sample location. "
- "\"Accurate\" kernels don't need this; doing it always "
- "makes things go slower");
+ hestOptAdd_1_Other(&hopt, "k00", "kern00", &k00, "tent", "kernel for gageKernel00",
+ nrrdHestKernelSpec);
+ hestOptAdd_1_Other(&hopt, "k11", "kern11", &k11, "cubicd:1,0",
+ "kernel for gageKernel11", nrrdHestKernelSpec);
+ hestOptAdd_1_Other(&hopt, "k22", "kern22", &k22, "cubicdd:1,0",
+ "kernel for gageKernel22", nrrdHestKernelSpec);
+ hestOptAdd_Flag(&hopt, "rn", &renorm,
+ "renormalize kernel weights at each new sample location. "
+ "\"Accurate\" kernels don't need this; doing it always "
+ "makes things go slower");
nsi = 0;
- nonSbpOpi[nsi++] = hestOptAdd(&hopt, "ssn", "SS #", airTypeUInt, 1, 1, &numSS, "0",
- "how many scale-space samples to evaluate, or, "
- "0 to turn-off all scale-space behavior");
- nonSbpOpi[nsi++] = hestOptAdd(&hopt, "ssr", "scale range", airTypeDouble, 2, 2,
- rangeSS, "nan nan", "range of scales in scale-space");
- nonSbpOpi[nsi++] = hestOptAdd(&hopt, "ssu", NULL, airTypeInt, 0, 0, &uniformSS, NULL,
- "do uniform samples along sigma, and not (by default) "
- "samples according to the effective diffusion scale");
- nonSbpOpi[nsi++] = hestOptAdd(&hopt, "sso", NULL, airTypeInt, 0, 0, &optimSS, NULL,
- "if not using \"-ssu\", use pre-computed optimal "
- "sigmas when possible");
- nonSbpOpi[nsi++] = hestOptAdd(&hopt, "kssb", "kernel", airTypeOther, 1, 1, &kSSblur,
- "dgauss:1,5", "blurring kernel, to sample scale space",
- NULL, NULL, nrrdHestKernelSpec);
+ nonSbpOpi[nsi++] /* */
+ = hestOptAdd_1_UInt(&hopt, "ssn", "SS #", &numSS, "0",
+ "how many scale-space samples to evaluate, or, "
+ "0 to turn-off all scale-space behavior");
+ nonSbpOpi[nsi++] /* */
+ = hestOptAdd_2_Double(&hopt, "ssr", "scale range", rangeSS, "nan nan",
+ "range of scales in scale-space");
+ nonSbpOpi[nsi++] /* */
+ = hestOptAdd_Flag(&hopt, "ssu", &uniformSS,
+ "do uniform samples along sigma, and not (by default) "
+ "samples according to the effective diffusion scale");
+ nonSbpOpi[nsi++] /* */
+ = hestOptAdd_Flag(&hopt, "sso", &optimSS,
+ "if not using \"-ssu\", use pre-computed optimal "
+ "sigmas when possible");
+ nonSbpOpi[nsi++] /* */
+ = hestOptAdd_1_Other(&hopt, "kssb", "kernel", &kSSblur, "dgauss:1,5",
+ "blurring kernel, to sample scale space", nrrdHestKernelSpec);
if (nsi != NON_SBP_OPT_NUM) {
fprintf(stderr, "%s: PANIC nsi %u != %u", me, nsi, NON_SBP_OPT_NUM);
exit(1);
@@ -341,56 +342,55 @@
/* These two options are needed even if sbp is used, because they are *not*
part of the gageStackBlurParm. In meet, this info is handled by the
extraFlag/extraParm construct, which is not available here */
- hestOptAdd(&hopt, "ssnd", NULL, airTypeInt, 0, 0, &normdSS, NULL,
- "normalize derivatives by scale");
- hestOptAdd(&hopt, "ssnb", "bias", airTypeDouble, 1, 1, &biasSS, "0.0",
- "bias on scale-based derivative normalization");
+ hestOptAdd_Flag(&hopt, "ssnd", &normdSS, "normalize derivatives by scale");
+ hestOptAdd_1_Double(&hopt, "ssnb", "bias", &biasSS, "0.0",
+ "bias on scale-based derivative normalization");
- hestOptAdd(&hopt, "ssf", "SS read/save format", airTypeString, 1, 1, &stackFnameFormat,
- "",
- "printf-style format (including a \"%u\") for the "
- "filenames from which to read "
- "pre-blurred volumes computed for the stack, if they "
- "exist and match the stack parameters, and where to save "
- "them if they had to be re-computed. Leave this as empty "
- "string to disable this.");
+ hestOptAdd_1_String(&hopt, "ssf", "SS read/save format", &stackFnameFormat, "",
+ "printf-style format (including a \"%u\") for the "
+ "filenames from which to read "
+ "pre-blurred volumes computed for the stack, if they "
+ "exist and match the stack parameters, and where to save "
+ "them if they had to be re-computed. Leave this as empty "
+ "string to disable this.");
- hestOptAdd(&hopt, "kssr", "kernel", airTypeOther, 1, 1, &kSS, "hermite",
- "kernel for reconstructing from scale space samples", NULL, NULL,
- nrrdHestKernelSpec);
- hestOptAdd(&hopt, "sit", "sit", airTypeBool, 1, 1, &scaleIsTau, "false",
- "in some places, scale should be interpreted as tau, not "
- "sigma. Currently limited to grid probing (via \"-pg\")");
+ hestOptAdd_1_Other(&hopt, "kssr", "kernel", &kSS, "hermite",
+ "kernel for reconstructing from scale space samples",
+ nrrdHestKernelSpec);
+ hestOptAdd_1_Bool(&hopt, "sit", "sit", &scaleIsTau, "false",
+ "in some places, scale should be interpreted as tau, not "
+ "sigma. Currently limited to grid probing (via \"-pg\")");
- hestOptAdd(&hopt, "s", "sclX sclY sxlZ", airTypeDouble, 3, 3, scale, "1 1 1",
- "scaling factor for resampling on each axis "
- "(>1.0: supersampling); use \"-ssp\" (and \"-psi\") "
- "to specify scale position of sampling");
- hestOptAdd(&hopt, "ssp", "pos", airTypeDouble, 1, 1, &posSS, "0",
- "when using scale-space, scale-position at which to probe");
- hestOptAdd(&hopt, "pg", "nrrd", airTypeOther, 1, 1, &_ngrid, "",
- "overrides \"-s\": "
- "2-D nrrd which specifies origin and direction vectors "
- "for sampling grid",
- NULL, NULL, nrrdHestNrrd);
- hestOptAdd(&hopt, "pi", "nrrd", airTypeOther, 1, 1, &_npos, "",
- "overrides \"-pg\": probes at this list of 3-vec or "
- "4-vec positions",
- NULL, NULL, nrrdHestNrrd);
- hestOptAdd(&hopt, "pp", "pos", airTypeDouble, 3, 4, &pntPos, "nan nan nan",
- "overrides \"-pi\": only sample at this specified point", &pntPosNum);
- hestOptAdd(&hopt, "eps", "epsilon", airTypeDouble, 1, 1, &eps, "0",
- "if non-zero, and if query is a scalar, and if using \"pp\" "
- "to query at a single point, then do epsilon offset probes "
- "to calculate discrete differences, to find the numerical "
- "gradient and hessian (for debugging)");
- hestOptAdd(&hopt, "psi", "p", airTypeBool, 1, 1, &probeSpaceIndex, "false",
- "whether the probe location specification (by any of "
- "the four previous flags) are in index space");
+ hestOptAdd_3_Double(&hopt, "s", "sclX sclY sxlZ", scale, "1 1 1",
+ "scaling factor for resampling on each axis "
+ "(>1.0: supersampling); use \"-ssp\" (and \"-psi\") "
+ "to specify scale position of sampling");
+ hestOptAdd_1_Double(&hopt, "ssp", "pos", &posSS, "0",
+ "when using scale-space, scale-position at which to probe");
+ hestOptAdd_1_Other(&hopt, "pg", "nrrd", &_ngrid, "",
+ "overrides \"-s\": "
+ "2-D nrrd which specifies origin and direction vectors "
+ "for sampling grid",
+ nrrdHestNrrd);
+ hestOptAdd_1_Other(&hopt, "pi", "nrrd", &_npos, "",
+ "overrides \"-pg\": probes at this list of 3-vec or "
+ "4-vec positions",
+ nrrdHestNrrd);
+ hestOptAdd_Nv_Double(&hopt, "pp", "pos", 3, 4, &pntPos, "nan nan nan",
+ "overrides \"-pi\": only sample at this specified point",
+ &pntPosNum);
+ hestOptAdd_1_Double(&hopt, "eps", "epsilon", &eps, "0",
+ "if non-zero, and if query is a scalar, and if using \"pp\" "
+ "to query at a single point, then do epsilon offset probes "
+ "to calculate discrete differences, to find the numerical "
+ "gradient and hessian (for debugging)");
+ hestOptAdd_1_Bool(&hopt, "psi", "p", &probeSpaceIndex, "false",
+ "whether the probe location specification (by any of "
+ "the four previous flags) are in index space");
- 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");
+ hestOptAdd_1_Enum(&hopt, "t", "type", &otype, "float", "type of output volume",
+ nrrdType);
+ hestOptAdd_1_String(&hopt, "o", "nout", &outS, "-", "output volume");
hestParseOrDie(hopt, argc - 1, argv + 1, hparm, me, probeInfo, AIR_TRUE, AIR_TRUE,
AIR_TRUE);
airMopAdd(mop, hopt, AIR_CAST(airMopper, hestOptFree), airMopAlways);
Modified: teem/trunk/src/bin/ilk.c
===================================================================
--- teem/trunk/src/bin/ilk.c 2023-07-13 11:59:58 UTC (rev 7086)
+++ teem/trunk/src/bin/ilk.c 2023-07-13 12:27:54 UTC (rev 7087)
@@ -68,62 +68,62 @@
(which may be a hest bug) */
hparm->columns = AIR_MAX(59, wsz.ws_col - 2);
- hestOptAdd(&hopt, "i", "image", airTypeOther, 1, 1, &nin, "-", "input image", NULL,
- NULL, nrrdHestNrrd);
- hestOptAdd(&hopt, "0", "origin", airTypeOther, 1, 1, &origInfo, "p:0,0",
- "where to location (0,0) prior to applying transforms.\n "
- "\b\bo \"u:<float>,<float>\" locate origin in a unit box "
- "[0,1]x[0,1] which covers the original image\n "
- "\b\bo \"p:<float>,<float>\" locate origin at a particular "
- "pixel location, in the index space of the image",
- NULL, NULL, mossHestOrigin);
- hestOptAdd(&hopt, "t", "xform0", airTypeOther, 1, -1, &matList, NULL,
- "transform(s) to apply to image. Transforms "
- "are applied in the order in which they appear.\n "
- "\b\bo \"identity\": no geometric transform, just resampling\n "
- "\b\bo \"translate:x,y\": shift image by vector (x,y), as "
- "measured in pixels\n "
- "\b\bo \"rotate:ang\": rotate CCW by ang degrees\n "
- "\b\bo \"scale:xs,ys\": scale by xs in X, and ys in Y\n "
- "\b\bo \"shear:fix,amnt\": shear by amnt, keeping fixed "
- "the pixels along a direction <fix> degrees from the X axis\n "
- "\b\bo \"flip:ang\": flip along axis an angle <ang> degrees from "
- "the X axis\n "
- "\b\bo \"a,b,tx,c,d,ty\": specify the transform explicitly "
- "in row-major order (opposite of PostScript) ",
- &matListLen, NULL, mossHestTransform);
- hestOptAdd(&hopt, "k", "kernel", airTypeOther, 1, 1, &ksp, "cubic:0,0.5",
- "reconstruction kernel", NULL, NULL, nrrdHestKernelSpec);
- hestOptAdd(&hopt, "min", "xMin yMin", airTypeDouble, 2, 2, min, "nan nan",
- "lower bounding corner of output image. Default (by not "
- "using this option) is the lower corner of input image. ");
- hestOptAdd(&hopt, "max", "xMax yMax", airTypeDouble, 2, 2, max, "nan nan",
- "upper bounding corner of output image. Default (by not "
- "using this option) is the upper corner of input image. ");
- hestOptAdd(&hopt, "b", "boundary", airTypeEnum, 1, 1, &bound, "bleed",
- "what to do when sampling outside original image.\n "
- "\b\bo \"bleed\": copy values at image border outward\n "
- "\b\bo \"wrap\": do wrap-around on image locations\n "
- "\b\bo \"pad\": use a given background value (via \"-bg\")",
- NULL, nrrdBoundary);
- bkgIdx = hestOptAdd(&hopt, "bg", "bg0 bg1", airTypeDouble, 1, -1, &_bkg, "nan",
- "background color to use with boundary behavior \"pad\". "
- "Defaults to all zeroes.",
- &_bkgLen);
- hestOptAdd(&hopt, "s", "xSize ySize", airTypeOther, 2, 2, scale, "x1 x1",
- "For each axis, information about how many samples in output:\n "
- "\b\bo \"x<float>\": number of output samples is some scaling of "
- " the number input of samples; multiplied by <float>\n "
- "\b\bo \"<int>\": specify exact number of samples",
- NULL, NULL, &unrrduHestScaleCB);
- hestOptAdd(&hopt, "a", "avg #", airTypeUInt, 1, 1, &avgNum, "0",
- "number of averages (if there there is only one "
- "rotation as transform)");
- hestOptAdd(&hopt, "db", "x y", airTypeInt, 2, 2, debug, "-1 -1",
- "if both non-negative, turn on verbose debugging for this output "
- "image pixel");
- hestOptAdd(&hopt, "o", "filename", airTypeString, 1, 1, &outS, "-",
- "file to write output nrrd to");
+ hestOptAdd_1_Other(&hopt, "i", "image", &nin, "-", "input image", nrrdHestNrrd);
+ hestOptAdd_1_Other(&hopt, "0", "origin", &origInfo, "p:0,0",
+ "where to location (0,0) prior to applying transforms.\n "
+ "\b\bo \"u:<float>,<float>\" locate origin in a unit box "
+ "[0,1]x[0,1] which covers the original image\n "
+ "\b\bo \"p:<float>,<float>\" locate origin at a particular "
+ "pixel location, in the index space of the image",
+ mossHestOrigin);
+ hestOptAdd_Nv_Other(&hopt, "t", "xform0", 1, -1, &matList, NULL,
+ "transform(s) to apply to image. Transforms "
+ "are applied in the order in which they appear.\n "
+ "\b\bo \"identity\": no geometric transform, just resampling\n "
+ "\b\bo \"translate:x,y\": shift image by vector (x,y), as "
+ "measured in pixels\n "
+ "\b\bo \"rotate:ang\": rotate CCW by ang degrees\n "
+ "\b\bo \"scale:xs,ys\": scale by xs in X, and ys in Y\n "
+ "\b\bo \"shear:fix,amnt\": shear by amnt, keeping fixed "
+ "the pixels along a direction <fix> degrees from the X axis\n "
+ "\b\bo \"flip:ang\": flip along axis an angle <ang> degrees from "
+ "the X axis\n "
+ "\b\bo \"a,b,tx,c,d,ty\": specify the transform explicitly "
+ "in row-major order (opposite of PostScript) ",
+ &matListLen, mossHestTransform);
+ hestOptAdd_1_Other(&hopt, "k", "kernel", &ksp, "cubic:0,0.5", "reconstruction kernel",
+ nrrdHestKernelSpec);
+ hestOptAdd_2_Double(&hopt, "min", "xMin yMin", min, "nan nan",
+ "lower bounding corner of output image. Default (by not "
+ "using this option) is the lower corner of input image. ");
+ hestOptAdd_2_Double(&hopt, "max", "xMax yMax", max, "nan nan",
+ "upper bounding corner of output image. Default (by not "
+ "using this option) is the upper corner of input image. ");
+ hestOptAdd_1_Enum(&hopt, "b", "boundary", &bound, "bleed",
+ "what to do when sampling outside original image.\n "
+ "\b\bo \"bleed\": copy values at image border outward\n "
+ "\b\bo \"wrap\": do wrap-around on image locations\n "
+ "\b\bo \"pad\": use a given background value (via \"-bg\")",
+ nrrdBoundary);
+ bkgIdx
+ = hestOptAdd_Nv_Double(&hopt, "bg", "bg0 bg1", 1, -1, &_bkg, "nan",
+ "background color to use with boundary behavior \"pad\". "
+ "Defaults to all zeroes.",
+ &_bkgLen);
+ hestOptAdd_2_Other(&hopt, "s", "xSize ySize", scale, "x1 x1",
+ "For each axis, information about how many samples in output:\n "
+ "\b\bo \"x<float>\": number of output samples is some scaling of "
+ " the number input of samples; multiplied by <float>\n "
+ "\b\bo \"<int>\": specify exact number of samples",
+ &unrrduHestScaleCB);
+ hestOptAdd_1_UInt(&hopt, "a", "avg #", &avgNum, "0",
+ "number of averages (if there there is only one "
+ "rotation as transform)");
+ hestOptAdd_2_Int(&hopt, "db", "x y", debug, "-1 -1",
+ "if both non-negative, turn on verbose debugging for this output "
+ "image pixel");
+ hestOptAdd_1_String(&hopt, "o", "filename", &outS, "-",
+ "file to write output nrrd to");
hestParseOrDie(hopt, argc - 1, argv + 1, hparm, me, ilkInfo, AIR_TRUE, AIR_TRUE,
AIR_TRUE);
airMopAdd(mop, hopt, (airMopper)hestOptFree, airMopAlways);
Modified: teem/trunk/src/bin/miter.c
===================================================================
--- teem/trunk/src/bin/miter.c 2023-07-13 11:59:58 UTC (rev 7086)
+++ teem/trunk/src/bin/miter.c 2023-07-13 12:27:54 UTC (rev 7087)
@@ -54,80 +54,79 @@
hparm->respectDashDashHelp = AIR_TRUE;
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);
- hestOptAdd(&hopt, "vi", "nvin", airTypeOther, 1, 1, &(muu->nvin), "",
- "input vector volume to render", NULL, NULL, nrrdHestNrrd);
- hestOptAdd(&hopt, "ti", "ntin", airTypeOther, 1, 1, &(muu->ntin), "",
- "input tensor volume to render", NULL, NULL, nrrdHestNrrd);
- hestOptAdd(&hopt, "txf", "nin", airTypeOther, 1, -1, &(muu->ntxf), NULL,
- "one or more transfer functions", &(muu->ntxfNum), NULL, nrrdHestNrrd);
+ hestOptAdd_1_Other(&hopt, "i", "nsin", &(muu->nsin), "",
+ "input scalar volume to render", nrrdHestNrrd);
+ hestOptAdd_1_Other(&hopt, "vi", "nvin", &(muu->nvin), "",
+ "input vector volume to render", nrrdHestNrrd);
+ hestOptAdd_1_Other(&hopt, "ti", "ntin", &(muu->ntin), "",
+ "input tensor volume to render", nrrdHestNrrd);
+ hestOptAdd_Nv_Other(&hopt, "txf", "nin", 1, -1, &(muu->ntxf), NULL,
+ "one or more transfer functions", &(muu->ntxfNum), nrrdHestNrrd);
limnHestCameraOptAdd(&hopt, muu->hctx->cam, NULL, "0 0 0", "0 0 1", NULL, NULL, NULL,
"nan nan", "nan nan", "20");
- hestOptAdd(&hopt, "offfr", NULL, airTypeInt, 0, 0, &offfr, NULL,
- "the given eye point (\"-fr\") is to be interpreted "
- "as an offset from the at point.");
- 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, "turn", "angle", airTypeDouble, 1, 1, &turn, "0.0",
- "angle (degrees) by which to rotate the from point around "
- "true up, for making stereo pairs. Positive means move "
- "towards positive U (the right)");
- hestOptAdd(&hopt, "am", "ambient", airTypeFloat, 3, 3, muu->lit->amb, "1 1 1",
- "ambient light color");
- hestOptAdd(&hopt, "ld", "light pos", airTypeFloat, 3, 3, muu->lit->_dir[0], "0 0 -1",
- "view space light position (extended to infinity)");
- hestOptAdd(&hopt, "is", "image size", airTypeInt, 2, 2, muu->hctx->imgSize, "256 256",
- "image dimensions");
- hestOptAdd(&hopt, "iss", "scale", airTypeFloat, 1, 1, &isScale, "1.0",
- "scaling of image size (from \"is\")");
- hestOptAdd(&hopt, "ads", "ka kd ks", airTypeFloat, 3, 3, ads, "0.1 0.6 0.3",
- "phong components");
+ hestOptAdd_Flag(&hopt, "offfr", &offfr,
+ "the given eye point (\"-fr\") is to be interpreted "
+ "as an offset from the at point.");
+ hestOptAdd_3_Double(&hopt, "ffr", "fake from", 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_1_Double(&hopt, "turn", "angle", &turn, "0.0",
+ "angle (degrees) by which to rotate the from point around "
+ "true up, for making stereo pairs. Positive means move "
+ "towards positive U (the right)");
+ hestOptAdd_3_Float(&hopt, "am", "ambient", muu->lit->amb, "1 1 1",
+ "ambient light color");
+ hestOptAdd_3_Float(&hopt, "ld", "light pos", muu->lit->_dir[0], "0 0 -1",
+ "view space light position (extended to infinity)");
+ hestOptAdd_2_UInt(&hopt, "is", "image size", muu->hctx->imgSize, "256 256",
+ "image dimensions");
+ hestOptAdd_1_Float(&hopt, "iss", "scale", &isScale, "1.0",
+ "scaling of image size (from \"is\")");
+ hestOptAdd_3_Float(&hopt, "ads", "ka kd ks", ads, "0.1 0.6 0.3", "phong components");
+ /* mite_at could be float or double */
hestOptAdd(&hopt, "sp", "spec pow", mite_at, 1, 1, &(muu->rangeInit[miteRangeSP]),
"30", "phong specular power");
- hestOptAdd(&hopt, "k00", "kernel", airTypeOther, 1, 1, &(muu->ksp[gageKernel00]),
- "tent", "value reconstruction kernel", NULL, NULL, nrrdHestKernelSpec);
- hestOptAdd(&hopt, "k11", "kernel", airTypeOther, 1, 1, &(muu->ksp[gageKernel11]),
- "cubicd:1,0", "first derivative kernel", NULL, NULL, nrrdHestKernelSpec);
- hestOptAdd(&hopt, "k22", "kernel", airTypeOther, 1, 1, &(muu->ksp[gageKernel22]),
- "cubicdd:1,0", "second derivative kernel", NULL, NULL, nrrdHestKernelSpec);
- hestOptAdd(&hopt, "ss", "shading spec", airTypeString, 1, 1, &shadeStr,
- "phong:gage(scalar:n)", "how to do shading");
- hestOptAdd(&hopt, "ns", "normal spec", airTypeString, 1, 1, &normalStr, "",
- "\"normal\" to use for those miteVal's that need one");
- hestOptAdd(&hopt, "side", "normal side", airTypeInt, 1, 1, &(muu->normalSide), "1",
- "how to interpret gradients as normals:\n "
- "\b\bo \"1\": normal points to lower values (higher == "
- "more \"inside\")\n "
- "\b\bo \"0\": \"two-sided\": dot-products are abs()'d\n "
- "\b\bo \"-1\": normal points to higher values (lower == "
- "more \"inside\")");
- hestOptAdd(&hopt, "rn", NULL, airTypeBool, 0, 0, &renorm, NULL,
- "renormalize kernel weights at each new sample location. "
- "\"Accurate\" kernels don't need this; doing it always "
- "makes things go slower");
- hestOptAdd(&hopt, "gmc", "min gradmag", airTypeDouble, 1, 1, &gmc, "0.0",
- "For curvature-based transfer functions, set curvature to "
- "zero when gradient magnitude is below this");
- hestOptAdd(&hopt, "step", "size", airTypeDouble, 1, 1, &(muu->rayStep), "0.01",
- "step size along ray in world space");
- hestOptAdd(&hopt, "ref", "size", airTypeDouble, 1, 1, &(muu->refStep), "0.01",
- "\"reference\" step size (world space) for doing "
- "opacity correction in compositing");
- hestOptAdd(&hopt, "vp", "verbose pixel", airTypeInt, 2, 2, verbPix, "-1 -1",
- "pixel for which to turn on verbose messages");
- hestOptAdd(&hopt, "n1", "near1", airTypeDouble, 1, 1, &(muu->opacNear1), "0.99",
- "opacity close enough to 1.0 to terminate ray");
- hestOptAdd(&hopt, "nt", "# threads", airTypeInt, 1, 1, &(muu->hctx->numThreads), "1",
- (airThreadCapable
- ? "number of threads hoover should use"
- : "if pthreads where enabled in this Teem build, this is how "
- "you would control the number of threads hoover should use"));
- hestOptAdd(&hopt, "o", "filename", airTypeString, 1, 1, &outS, NULL,
- "file to write output nrrd to");
+ hestOptAdd_1_Other(&hopt, "k00", "kernel", &(muu->ksp[gageKernel00]), "tent",
+ "value reconstruction kernel", nrrdHestKernelSpec);
+ hestOptAdd_1_Other(&hopt, "k11", "kernel", &(muu->ksp[gageKernel11]), "cubicd:1,0",
+ "first derivative kernel", nrrdHestKernelSpec);
+ hestOptAdd_1_Other(&hopt, "k22", "kernel", &(muu->ksp[gageKernel22]), "cubicdd:1,0",
+ "second derivative kernel", nrrdHestKernelSpec);
+ hestOptAdd_1_String(&hopt, "ss", "shading spec", &shadeStr, "phong:gage(scalar:n)",
+ "how to do shading");
+ hestOptAdd_1_String(&hopt, "ns", "normal spec", &normalStr, "",
+ "\"normal\" to use for those miteVal's that need one");
+ hestOptAdd_1_Int(&hopt, "side", "normal side", &(muu->normalSide), "1",
+ "how to interpret gradients as normals:\n "
+ "\b\bo \"1\": normal points to lower values (higher == "
+ "more \"inside\")\n "
+ "\b\bo \"0\": \"two-sided\": dot-products are abs()'d\n "
+ "\b\bo \"-1\": normal points to higher values (lower == "
+ "more \"inside\")");
+ hestOptAdd_Flag(&hopt, "rn", &renorm,
+ "renormalize kernel weights at each new sample location. "
+ "\"Accurate\" kernels don't need this; doing it always "
+ "makes things go slower");
+ hestOptAdd_1_Double(&hopt, "gmc", "min gradmag", &gmc, "0.0",
+ "For curvature-based transfer functions, set curvature to "
+ "zero when gradient magnitude is below this");
+ hestOptAdd_1_Double(&hopt, "step", "size", &(muu->rayStep), "0.01",
+ "step size along ray in world space");
+ hestOptAdd_1_Double(&hopt, "ref", "size", &(muu->refStep), "0.01",
+ "\"reference\" step size (world space) for doing "
+ "opacity correction in compositing");
+ hestOptAdd_2_Int(&hopt, "vp", "verbose pixel", verbPix, "-1 -1",
+ "pixel for which to turn on verbose messages");
+ hestOptAdd_1_Double(&hopt, "n1", "near1", &(muu->opacNear1), "0.99",
+ "opacity close enough to 1.0 to terminate ray");
+ hestOptAdd_1_UInt(&hopt, "nt", "# threads", &(muu->hctx->numThreads), "1",
+ (airThreadCapable
+ ? "number of threads hoover should use"
+ : "if pthreads where enabled in this Teem build, this is how "
+ "you would control the number of threads hoover should use"));
+ hestOptAdd_1_String(&hopt, "o", "filename", &outS, NULL,
+ "file to write output nrrd to");
hestParseOrDie(hopt, argc - 1, argv + 1, hparm, me, miteInfo, AIR_TRUE, AIR_TRUE,
AIR_TRUE);
airMopAdd(mop, hopt, (airMopper)hestOptFree, airMopAlways);
Modified: teem/trunk/src/bin/mrender.c
===================================================================
--- teem/trunk/src/bin/mrender.c 2023-07-13 11:59:58 UTC (rev 7086)
+++ teem/trunk/src/bin/mrender.c 2023-07-13 12:27:54 UTC (rev 7087)
@@ -460,54 +460,55 @@
uu = mrendUserNew();
airMopAdd(mop, uu, (airMopper)mrendUserNix, airMopAlways);
- hestOptAdd(&hopt, "i", "nin", airTypeOther, 1, 1, &(uu->nin), NULL,
- "input nrrd to render", NULL, NULL, nrrdHestNrrd);
- hestOptAdd(&hopt, "k", "kind", airTypeOther, 1, 1, &(uu->kind), NULL,
- "\"kind\" of volume (\"scalar\", \"vector\", or \"tensor\")", NULL, NULL,
- meetHestGageKind);
+ hestOptAdd_1_Other(&hopt, "i", "nin", &(uu->nin), NULL, "input nrrd to render",
+ nrrdHestNrrd);
+ hestOptAdd_1_Other(&hopt, "k", "kind", &(uu->kind), NULL,
+ "\"kind\" of volume (\"scalar\", \"vector\", or \"tensor\")",
+ meetHestGageKind);
limnHestCameraOptAdd(&hopt, uu->hctx->cam, NULL, "0 0 0", "0 0 1", NULL, NULL, NULL,
"nan nan", "nan nan", "20");
- hestOptAdd(&hopt, "offfr", NULL, airTypeInt, 0, 0, &offfr, NULL,
- "the given eye point (\"-fr\") is to be interpreted "
- "as an offset from the at point.");
- hestOptAdd(&hopt, "turn", "angle", airTypeDouble, 1, 1, &turn, "0.0",
- "angle (degrees) by which to rotate the from point around "
- "true up, for making stereo pairs. Positive means move "
- "towards positive U (the right)");
- hestOptAdd(&hopt, "is", "image size", airTypeInt, 2, 2, uu->hctx->imgSize, "256 256",
- "image dimensions");
- hestOptAdd(&hopt, "iss", "scale", airTypeFloat, 1, 1, &isScale, "1.0",
- "scaling of image size (from \"is\")");
- hestOptAdd(&hopt, "k00", "kernel", airTypeOther, 1, 1, &(uu->ksp[gageKernel00]),
- "tent", "value reconstruction kernel", NULL, NULL, nrrdHestKernelSpec);
- hestOptAdd(&hopt, "k11", "kernel", airTypeOther, 1, 1, &(uu->ksp[gageKernel11]),
- "cubicd:1,0", "first derivative kernel", NULL, NULL, nrrdHestKernelSpec);
- hestOptAdd(&hopt, "k22", "kernel", airTypeOther, 1, 1, &(uu->ksp[gageKernel22]),
- "cubicdd:1,0", "second derivative kernel", NULL, NULL, nrrdHestKernelSpec);
- hestOptAdd(&hopt, "rn", NULL, airTypeBool, 0, 0, &renorm, NULL,
- "renormalize kernel weights at each new sample location. "
- "\"Accurate\" kernels don't need this; doing it always "
- "makes things go slower");
- hestOptAdd(&hopt, "q", "query", airTypeString, 1, 1, &whatS, NULL,
- "the quantity (scalar, vector, or matrix) to learn by probing");
- hestOptAdd(&hopt, "m", "measure", airTypeEnum, 1, 1, &(uu->measr), NULL,
- "how to collapse list of ray samples into one scalar. " NRRD_MEASURE_DESC,
- NULL, nrrdMeasure);
- hestOptAdd(&hopt, "gmc", "min gradmag", airTypeDouble, 1, 1, &gmc, "0.0",
- "For curvature-related queries, set answer to zero when "
- "gradient magnitude is below this");
- hestOptAdd(&hopt, "fn", "from nan", airTypeDouble, 1, 1, &(uu->fromNaN), "nan",
- "When histo-based measures generate NaN answers, the "
- "value that should be substituted for NaN.");
- hestOptAdd(&hopt, "step", "size", airTypeDouble, 1, 1, &(uu->rayStep), "0.01",
- "step size along ray in world space");
- hestOptAdd(&hopt, "nt", "# threads", airTypeInt, 1, 1, &(uu->hctx->numThreads), "1",
- "number of threads hoover should use");
- hestOptAdd(&hopt, "vp", "img coords", airTypeInt, 2, 2, &(uu->verbPixel), "-1 -1",
- "pixel coordinates for which to turn on all verbose "
- "debugging messages, or \"-1 -1\" to disable this.");
- hestOptAdd(&hopt, "o", "filename", airTypeString, 1, 1, &(uu->outS), "-",
- "file to write output nrrd to. Defaults to stdout (\"-\").");
+ hestOptAdd_Flag(&hopt, "offfr", &offfr,
+ "the given eye point (\"-fr\") is to be interpreted "
+ "as an offset from the at point.");
+ hestOptAdd_1_Double(&hopt, "turn", "angle", &turn, "0.0",
+ "angle (degrees) by which to rotate the from point around "
+ "true up, for making stereo pairs. Positive means move "
+ "towards positive U (the right)");
+ hestOptAdd_2_UInt(&hopt, "is", "image size", uu->hctx->imgSize, "256 256",
+ "image dimensions");
+ hestOptAdd_1_Float(&hopt, "iss", "scale", &isScale, "1.0",
+ "scaling of image size (from \"is\")");
+ hestOptAdd_1_Other(&hopt, "k00", "kernel", &(uu->ksp[gageKernel00]), "tent",
+ "value reconstruction kernel", nrrdHestKernelSpec);
+ hestOptAdd_1_Other(&hopt, "k11", "kernel", &(uu->ksp[gageKernel11]), "cubicd:1,0",
+ "first derivative kernel", nrrdHestKernelSpec);
+ hestOptAdd_1_Other(&hopt, "k22", "kernel", &(uu->ksp[gageKernel22]), "cubicdd:1,0",
+ "second derivative kernel", nrrdHestKernelSpec);
+ hestOptAdd_Flag(&hopt, "rn", &renorm,
+ "renormalize kernel weights at each new sample location. "
+ "\"Accurate\" kernels don't need this; doing it always "
+ "makes things go slower");
+ hestOptAdd_1_String(&hopt, "q", "query", &whatS, NULL,
+ "the quantity (scalar, vector, or matrix) to learn by probing");
+ hestOptAdd_1_Enum(&hopt, "m", "measure", &(uu->measr), NULL,
+ "how to collapse list of "
+ "ray samples into one scalar. " NRRD_MEASURE_DESC,
+ nrrdMeasure);
+ hestOptAdd_1_Double(&hopt, "gmc", "min gradmag", &gmc, "0.0",
+ "For curvature-related queries, set answer to zero when "
+ "gradient magnitude is below this");
+ hestOptAdd_1_Double(&hopt, "fn", "from nan", &(uu->fromNaN), "nan",
+ "When histo-based measures generate NaN answers, the "
+ "value that should be substituted for NaN.");
+ hestOptAdd_1_Double(&hopt, "step", "size", &(uu->rayStep), "0.01",
+ "step size along ray in world space");
+ hestOptAdd_1_UInt(&hopt, "nt", "# threads", &(uu->hctx->numThreads), "1",
+ "number of threads hoover should use");
+ hestOptAdd_2_Int(&hopt, "vp", "img coords", uu->verbPixel, "-1 -1",
+ "pixel coordinates for which to turn on all verbose "
+ "debugging messages, or \"-1 -1\" to disable this.");
+ hestOptAdd_1_String(&hopt, "o", "filename", &(uu->outS), "-",
+ "file to write output nrrd to. Defaults to stdout (\"-\").");
airMopAdd(mop, hopt, (airMopper)hestOptFree, airMopAlways);
hestParseOrDie(hopt, argc - 1, argv + 1, hparm, me, info, AIR_TRUE, AIR_TRUE,
Modified: teem/trunk/src/bin/overrgb.c
===================================================================
--- teem/trunk/src/bin/overrgb.c 2023-07-13 11:59:58 UTC (rev 7086)
+++ teem/trunk/src/bin/overrgb.c 2023-07-13 12:27:54 UTC (rev 7087)
@@ -78,37 +78,36 @@
hparm = hestParmNew();
airMopAdd(mop, hparm, (airMopper)hestParmFree, airMopAlways);
hparm->respectDashDashHelp = AIR_TRUE;
- 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", airTypeString, 1, 1, &gammaS, "1.0",
- "gamma to apply to image data, after contrast. Can be "
- "a number (<1 to darken >1 to brighten) or the string "
- "\"srgb\" to apply the roughly 2.2 gamma associated "
- "with sRGB (see https://en.wikipedia.org/wiki/SRGB). ");
+ hestOptAdd_1_Other(&hopt, "i", "nin", &nin, NULL, "input nrrd to composite",
+ nrrdHestNrrd);
+ hestOptAdd_1_Double(&hopt, "c", "contrast", &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_1_Double(&hopt, "cfp", "fixed point", &cfp, "0.5",
+ "component level that doesn't change with contrast");
+ hestOptAdd_1_String(&hopt, "g", "gamma", &gammaS, "1.0",
+ "gamma to apply to image data, after contrast. Can be "
+ "a number (<1 to darken >1 to brighten) or the string "
+ "\"srgb\" to apply the roughly 2.2 gamma associated "
+ "with sRGB (see https://en.wikipedia.org/wiki/SRGB). ");
srgbIdx = /* HEY copied to unrrdu/quantize.c */
- hestOptAdd(&hopt, "srgb", "intent", airTypeEnum, 1, 1, &srgb, "none",
- /* the default is "none" for backwards compatibility: until now
- Teem's support of PNG hasn't handled the sRGB intent, so
- we shouldn't start using it without being asked */
- "If saving to PNG (when supported), how to set the rendering "
- "intent in the sRGB chunk of the PNG file format. Can be "
- "absolute, relative, perceptual, saturation, or none. This is "
- "independent of using \"srgb\" as the -g gamma",
- NULL, nrrdFormatPNGsRGBIntent);
- hestOptAdd(&hopt, "b", "background", airTypeDouble, 3, 3, back, "0 0 0",
- "background color to composite against; white is "
- "1 1 1, not 255 255 255.");
- hestOptAdd(&hopt, "bi", "nbg", airTypeOther, 1, 1, &_nbg, "",
- "8-bit RGB background image to composite against", NULL, NULL,
- nrrdHestNrrd);
- hestOptAdd(&hopt, "o", "filename", airTypeString, 1, 1, &outS, NULL,
- "file to write output PPM image to");
+ hestOptAdd_1_Enum(&hopt, "srgb", "intent", &srgb, "none",
+ /* the default is "none" for backwards compatibility: until now
+ Teem's support of PNG hasn't handled the sRGB intent, so
+ we shouldn't start using it without being asked */
+ "If saving to PNG (when supported), how to set the rendering "
+ "intent in the sRGB chunk of the PNG file format. Can be "
+ "absolute, relative, perceptual, saturation, or none. This is "
+ "independent of using \"srgb\" as the -g gamma",
+ NULL, nrrdFormatPNGsRGBIntent);
+ hestOptAdd_3_Double(&hopt, "b", "background", back, "0 0 0",
+ "background color to composite against; white is "
+ "1 1 1, not 255 255 255.");
+ hestOptAdd_1_Other(&hopt, "bi", "nbg", &_nbg, "",
+ "8-bit RGB background image to composite against", nrrdHestNrrd);
+ hestOptAdd_1_String(&hopt, "o", "filename", &outS, NULL,
+ "file to write output PPM image to");
hestParseOrDie(hopt, argc - 1, argv + 1, hparm, me, overInfo, AIR_TRUE, AIR_TRUE,
AIR_TRUE);
airMopAdd(mop, hopt, (airMopper)hestOptFree, airMopAlways);
Modified: teem/trunk/src/bin/pprobe.c
===================================================================
--- teem/trunk/src/bin/pprobe.c 2023-07-13 11:59:58 UTC (rev 7086)
+++ teem/trunk/src/bin/pprobe.c 2023-07-13 12:27:54 UTC (rev 7087)
@@ -82,76 +82,74 @@
airMopAdd(mop, hparm, (airMopper)hestParmFree, airMopAlways);
hparm->elideSingleOtherType = AIR_TRUE;
hparm->respectDashDashHelp = AIR_TRUE;
- hestOptAdd(&hopt, "i", "nin", airTypeOther, 1, 1, &nin, NULL, "input volume", NULL,
- NULL, nrrdHestNrrd);
- hestOptAdd(&hopt, "k", "kind", airTypeOther, 1, 1, &kind, NULL,
- "\"kind\" of volume (\"scalar\", \"vector\", or \"tensor\")", NULL, NULL,
- meetHestGageKind);
- hestOptAdd(&hopt, "p", "x y z", airTypeFloat, 3, 3, pos, NULL,
- "the position in space at which to probe");
- hestOptAdd(&hopt, "wsp", NULL, airTypeInt, 0, 0, &worldSpace, NULL,
- "if using this option, position (\"-p\") will be in world "
- "space, instead of index space (the default)");
- hestOptAdd(&hopt, "pi", "lpld in", airTypeOther, 1, 1, &lpld, "",
- "input polydata (overrides \"-p\")", NULL, NULL, limnHestPolyDataLMPD);
- hestOptAdd(&hopt, "pl", "x y z s", airTypeFloat, 4, 4, lineInfo, "0 0 0 0",
- "probe along line, instead of at point. "
- "The \"-p\" three coords are the line start point. "
- "If \"s\" is zero, (x,y,z) is the line end point. "
- "If \"s\" is non-zero, (x,y,z) is the line direction, "
- "which is scaled to have length \"s\", "
- "and then used as the step between line samples. ");
- hestOptAdd(&hopt, "pln", "num", airTypeUInt, 1, 1, &lineStepNum, "0",
- "if non-zero, number of steps of probing to do along line, "
- "which overrides \"-p\" and \"-pi\"");
- hestOptAdd(&hopt, "v", "verbosity", airTypeInt, 1, 1, &verbose, "1",
- "verbosity level");
- hestOptAdd(&hopt, "q", "query", airTypeString, 1, 1, &whatS, NULL,
- "the quantity (scalar, vector, or matrix) to learn by probing");
- hestOptAdd(&hopt, "eps", "epsilon", airTypeDouble, 1, 1, &eps, "0",
- "if non-zero, and if query is a scalar, epsilon around probe "
- "location where we will do discrete differences to find the "
- "gradient and hessian (for debugging)");
- hestOptAdd(&hopt, "k00", "kern00", airTypeOther, 1, 1, &k00, "tent",
- "kernel for gageKernel00", NULL, NULL, nrrdHestKernelSpec);
- hestOptAdd(&hopt, "k11", "kern11", airTypeOther, 1, 1, &k11, "cubicd:1,0",
- "kernel for gageKernel11", NULL, NULL, nrrdHestKernelSpec);
- hestOptAdd(&hopt, "k22", "kern22", airTypeOther, 1, 1, &k22, "cubicdd:1,0",
- "kernel for gageKernel22", NULL, NULL, nrrdHestKernelSpec);
+ hestOptAdd_1_Other(&hopt, "i", "nin", &nin, NULL, "input volume", nrrdHestNrrd);
+ hestOptAdd_1_Other(&hopt, "k", "kind", &kind, NULL,
+ "\"kind\" of volume (\"scalar\", \"vector\", or \"tensor\")",
+ meetHestGageKind);
+ hestOptAdd_3_Float(&hopt, "p", "x y z", pos, NULL,
+ "the position in space at which to probe");
+ hestOptAdd_Flag(&hopt, "wsp", &worldSpace,
+ "if using this option, position (\"-p\") will be in world "
+ "space, instead of index space (the default)");
+ hestOptAdd_1_Other(&hopt, "pi", "lpld in", &lpld, "",
+ "input polydata (overrides \"-p\")", limnHestPolyDataLMPD);
+ hestOptAdd_4_Float(&hopt, "pl", "x y z s", lineInfo, "0 0 0 0",
+ "probe along line, instead of at point. "
+ "The \"-p\" three coords are the line start point. "
+ "If \"s\" is zero, (x,y,z) is the line end point. "
+ "If \"s\" is non-zero, (x,y,z) is the line direction, "
+ "which is scaled to have length \"s\", "
+ "and then used as the step between line samples. ");
+ hestOptAdd_1_UInt(&hopt, "pln", "num", &lineStepNum, "0",
+ "if non-zero, number of steps of probing to do along line, "
+ "which overrides \"-p\" and \"-pi\"");
+ hestOptAdd_1_Int(&hopt, "v", "verbosity", &verbose, "1", "verbosity level");
+ hestOptAdd_1_String(&hopt, "q", "query", &whatS, NULL,
+ "the quantity (scalar, vector, or matrix) to learn by probing");
+ hestOptAdd_1_Double(&hopt, "eps", "epsilon", &eps, "0",
+ "if non-zero, and if query is a scalar, epsilon around probe "
+ "location where we will do discrete differences to find the "
+ "gradient and hessian (for debugging)");
+ hestOptAdd_1_Other(&hopt, "k00", "kern00", &k00, "tent", /* */
+ "kernel for gageKernel00", nrrdHestKernelSpec);
+ hestOptAdd_1_Other(&hopt, "k11", "kern11", &k11, "cubicd:1,0",
+ "kernel for gageKernel11", nrrdHestKernelSpec);
+ hestOptAdd_1_Other(&hopt, "k22", "kern22", &k22, "cubicdd:1,0",
+ "kernel for gageKernel22", nrrdHestKernelSpec);
- hestOptAdd(&hopt, "ssn", "SS #", airTypeUInt, 1, 1, &numSS, "0",
- "how many scale-space samples to evaluate, or, "
- "0 to turn-off all scale-space behavior");
- hestOptAdd(&hopt, "ssr", "scale range", airTypeDouble, 2, 2, rangeSS, "nan nan",
- "range of scales in scale-space");
- hestOptAdd(&hopt, "sss", "scale save path", airTypeString, 1, 1, &stackSavePath, "",
- "give a non-empty path string (like \"./\") to save out "
- "the pre-blurred volumes computed for the stack");
- hestOptAdd(&hopt, "ssp", "SS pos", airTypeDouble, 1, 1, &posSS, "0",
- "position at which to sample in scale-space");
- hestOptAdd(&hopt, "kssblur", "kernel", airTypeOther, 1, 1, &kSSblur, "dgauss:1,5",
- "blurring kernel, to sample scale space", NULL, NULL, nrrdHestKernelSpec);
- hestOptAdd(&hopt, "kss", "kernel", airTypeOther, 1, 1, &kSS, "tent",
- "kernel for reconstructing from scale space samples", NULL, NULL,
- nrrdHestKernelSpec);
- hestOptAdd(&hopt, "ssnd", "ssnd", airTypeInt, 1, 1, &SSnormd, "0",
- "enable derivative normalization based on scale space");
- hestOptAdd(&hopt, "ssu", NULL, airTypeInt, 0, 0, &SSuniform, NULL,
- "do uniform samples along sigma, and not (by default) "
- "samples according to the logarithm of diffusion time");
+ hestOptAdd_1_UInt(&hopt, "ssn", "SS #", &numSS, "0",
+ "how many scale-space samples to evaluate, or, "
+ "0 to turn-off all scale-space behavior");
+ hestOptAdd_2_Double(&hopt, "ssr", "scale range", rangeSS, "nan nan",
+ "range of scales in scale-space");
+ hestOptAdd_1_String(&hopt, "sss", "scale save path", &stackSavePath, "",
+ "give a non-empty path string (like \"./\") to save out "
+ "the pre-blurred volumes computed for the stack");
+ hestOptAdd_1_Doubl...
[truncated message content] |