|
From: Wei L. <wei...@gm...> - 2017-04-25 15:02:01
|
Hi Teem users,
Instead of using the trv.c example, I copy-pasted Schultz’s code in [1]
below and it compiles OK. Then I generated the Mobius image as suggested,
and run the code as:
> find_creases mobius-noisy.nrrd
But then I got a segfault, and trace looks like:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff78012ca in airArrayLenSet () from /home/weiliu/packages/teem-1.
11.0-src/build/bin/libteem.so.1
(gdb) where
#0 0x00007ffff78012ca in airArrayLenSet () from
/home/weiliu/packages/teem-1.11.0-src/build/bin/libteem.so.1
#1 0x00007ffff780139c in airArrayLenIncr () from
/home/weiliu/packages/teem-1.11.0-src/build/bin/libteem.so.1
#2 0x00007ffff7807e57 in airMopAdd () from /home/weiliu/packages/teem-1.
11.0-src/build/bin/libteem.so.1
#3 0x000000000040159b in main (argc=2, argv=0x7fffffffe2f8) at
/home/weiliu/projects/seismic/code/C/creases.c:21
I appreciate any insights of this issue.
p.s the code is exactly same as in [1], but here is relevant part:
int main(int argc, char * argv[])
{
airArray *mop = airMopNew();
airMopError(mop);
const char *filename = argv[1];
Nrrd *nin = nrrdNew();
if (nrrdLoad(nin, filename, NULL)) {
char *err;
airMopAdd(mop, err = biffGetDone(NRRD), airFree,
airMopAlways);
fprintf(stderr, "ERROR: Could not open input file \"%s\"\n"
"Reason: %s\n", filename, err);
airMopError(mop); return 1;
}
airMopAdd(mop, nin, (airMopper)nrrdNuke, airMopAlways);
gageContext *gctx = gageContextNew();
airMopAdd(mop, gctx, (airMopper)gageContextNix, airMopAlways);
double kparm[3]={1, 1.0, 0.0}; /* parameters of the cubic kernel */
gagePerVolume *pvl;
if (!(pvl = gagePerVolumeNew(gctx, nin, gageKindScl))
|| gagePerVolumeAttach(gctx, pvl)
|| gageKernelSet(gctx, gageKernel00, nrrdKernelBCCubic,
kparm)
|| gageKernelSet(gctx, gageKernel11, nrrdKernelBCCubicD,
kparm)
|| gageKernelSet(gctx, gageKernel22, nrrdKernelBCCubicDD,
kparm)
|| gageQueryItemOn(gctx, pvl, gageSclNormal)
|| gageQueryItemOn(gctx, pvl, gageSclHessEval)
|| gageQueryItemOn(gctx, pvl, gageSclHessEvec)
|| gageQueryItemOn(gctx, pvl, gageSclHessEval2) /* ridge
strength */
|| gageUpdate(gctx)) {
char *err;
airMopAdd(mop, err = biffGetDone(GAGE), airFree,
airMopAlways);
fprintf(stderr, "ERROR while setting up Gage:\n%s\n", err);
airMopError(mop); return 1;
}
On Mon, Apr 24, 2017 at 11:41 AM, Wei Liu <wei...@gm...> wrote:
> Hi Teem users,
>
>
>
> I’m trying to use the ridge extraction code as descripted in [1], and I’m
> running into issue similar to a previous post [2]. Here are what I did: I
> build trv.c and run it as
>
>
>
> trv -i ./mobius-noisy.nrrd -k scalar -s 150 -gi 'gageSclNormal'
>
>
>
> And I got errors:
>
>
>
> [gage] gageQueryItemOn: 0 not a valid gageScl value
>
>
>
> I understand that my ‘gi’ parameter is not in the correct format, but I
> have no idea where to find the correct way to set it. I’m reading the
> official ‘gage’ document now.
>
>
>
> Thanks for your input.
>
>
>
> [1] http://web.ci.uchicago.edu/~schultz/sphinx/creases.html
>
> [2] https://sourceforge.net/p/teem/mailman/message/25609154/
>
|