|
From: <kin...@us...> - 2003-10-30 21:35:27
|
Update of /cvsroot/teem/teem/src/bane
In directory sc8-pr-cvs1:/tmp/cvs-serv26362/bane
Modified Files:
gkmsOpac.c
Log Message:
API CHANGE: nrrd:
nrrdCheapMedian now takes a new argument, "pad", which tells it to
pad the input by the radius of the filter, prior to filtering, and then
crops the output. Without this, the samples along the boundary are left
unprocessed. Note: this functionality has migrated from "unu cmedian"
down into nrrd.
"unu cmedian", on the other hand, has a new command-line flag, "-c",
which tells it to slice along axis 0, run filtering on all slices, and
then join the results together. I was too chicken to add this the nrrd
API directly, but it may migrate there.
Index: gkmsOpac.c
===================================================================
RCS file: /cvsroot/teem/teem/src/bane/gkmsOpac.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** gkmsOpac.c 23 Jul 2003 01:20:26 -0000 1.8
--- gkmsOpac.c 30 Oct 2003 21:35:24 -0000 1.9
***************
*** 31,35 ****
hestOpt *opt = NULL;
char *outS, *perr, err[AIR_STRLEN_MED], *befS;
! Nrrd *ninfo, *nbef, *nout, *nmax, *npos, *nopac, *npadopac, *nmedpadopac;
airArray *mop;
int pret, radius, idim;
--- 31,35 ----
hestOpt *opt = NULL;
char *outS, *perr, err[AIR_STRLEN_MED], *befS;
! Nrrd *ninfo, *nbef, *nout, *nmax, *npos, *nopac;
airArray *mop;
int pret, radius, idim;
***************
*** 83,88 ****
airMopAdd(mop, npos=nrrdNew(), (airMopper)nrrdNuke, airMopAlways);
airMopAdd(mop, nopac=nrrdNew(), (airMopper)nrrdNuke, airMopAlways);
- airMopAdd(mop, npadopac=nrrdNew(), (airMopper)nrrdNuke, airMopAlways);
- airMopAdd(mop, nmedpadopac=nrrdNew(), (airMopper)nrrdNuke, airMopAlways);
airMopAdd(mop, nout=nrrdNew(), (airMopper)nrrdNuke, airMopAlways);
--- 83,86 ----
***************
*** 126,133 ****
}
if (radius) {
! if (nrrdSimplePad(npadopac, nopac, radius, nrrdBoundaryBleed)
! || nrrdCheapMedian(nmedpadopac, npadopac, AIR_FALSE, radius, 1.0, 2048)
! || nrrdSimpleCrop(nout, nmedpadopac, radius)) {
! sprintf(err, "%s: error in padding, median filtering, or cropping", me);
biffMove(BANE, err, NRRD); airMopError(mop); return 1;
}
--- 124,129 ----
}
if (radius) {
! if (nrrdCheapMedian(nout, nopac, AIR_TRUE, AIR_FALSE, radius, 1.0, 2048)) {
! sprintf(err, "%s: error in median filtering", me);
biffMove(BANE, err, NRRD); airMopError(mop); return 1;
}
|