|
From: <ik...@us...> - 2004-02-26 21:07:58
|
Update of /cvsroot/teem/teem/src/unrrdu In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26791/unrrdu Modified Files: GNUmakefile unrrdu.h Added Files: subst.c Log Message: added nrrdApply1DSubstitution and unu subst ... waiting for TEAT approval --- NEW FILE: subst.c --- /* teem: Gordon Kindlmann's research software Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998 University of Utah This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "unrrdu.h" #include "privateUnrrdu.h" #define INFO "Map nrrd through univariate substitution table" char *_unrrdu_substInfoL = (INFO " (itself represented as a nrrd). The substitution table " "has to be a 2 by N table containing a list of pairs aka. " "substitution rules."); int unrrdu_substMain(int argc, char **argv, char *me, hestParm *hparm) { hestOpt *opt = NULL; char *out, *err; int pret; Nrrd *nin, *nsubst, *nout; airArray *mop; hestOptAdd(&opt, "s", "subst", airTypeOther, 1, 1, &nsubst, NULL, "substition table to map input nrrd through", NULL, NULL, nrrdHestNrrd); OPT_ADD_NIN(nin, "input nrrd"); OPT_ADD_NOUT(out, "output nrrd"); mop = airMopNew(); airMopAdd(mop, opt, (airMopper)hestOptFree, airMopAlways); USAGE(_unrrdu_substInfoL); PARSE(); airMopAdd(mop, opt, (airMopper)hestParseFree, airMopAlways); nout = nrrdNew(); airMopAdd(mop, nout, (airMopper)nrrdNuke, airMopAlways); if (nrrdApply1DSubstitution(nout, nin, nsubst)) { airMopAdd(mop, err = biffGetDone(NRRD), airFree, airMopAlways); fprintf(stderr, "%s: trouble applying SUBST:\n%s", me, err); airMopError(mop); return 1; } SAVE(out, nout, NULL); airMopOkay(mop); return 0; } UNRRDU_CMD(subst, INFO); Index: GNUmakefile =================================================================== RCS file: /cvsroot/teem/teem/src/unrrdu/GNUmakefile,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** GNUmakefile 7 Jan 2004 15:34:31 -0000 1.20 --- GNUmakefile 26 Feb 2004 20:59:45 -0000 1.21 *************** *** 56,60 **** unquantize.o block.o unblock.o project.o swap.o join.o dhisto.o \ jhisto.o dice.o heq.o histax.o gamma.o make.o 1op.o 2op.o 3op.o \ ! lut.o rmap.o imap.o save.o head.o data.o splice.o inset.o \ axinsert.o axdelete.o axinfo.o ccfind.o ccadj.o ccmerge.o \ ccsettle.o about.o axsplit.o axmerge.o --- 56,60 ---- unquantize.o block.o unblock.o project.o swap.o join.o dhisto.o \ jhisto.o dice.o heq.o histax.o gamma.o make.o 1op.o 2op.o 3op.o \ ! lut.o subst.o rmap.o imap.o save.o head.o data.o splice.o inset.o \ axinsert.o axdelete.o axinfo.o ccfind.o ccadj.o ccmerge.o \ ccsettle.o about.o axsplit.o axmerge.o Index: unrrdu.h =================================================================== RCS file: /cvsroot/teem/teem/src/unrrdu/unrrdu.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** unrrdu.h 19 Feb 2004 03:44:06 -0000 1.25 --- unrrdu.h 26 Feb 2004 20:59:45 -0000 1.26 *************** *** 129,132 **** --- 129,133 ---- F(3op) \ F(lut) \ + F(subst) \ F(rmap) \ F(imap) \ |