|
From: <kin...@us...> - 2003-11-13 11:25:54
|
Update of /cvsroot/teem/teem/src/unrrdu
In directory sc8-pr-cvs1:/tmp/cvs-serv23821
Modified Files:
join.c
Log Message:
unu join now allows you to set label, spacing, and min/max along the join axis
Index: join.c
===================================================================
RCS file: /cvsroot/teem/teem/src/unrrdu/join.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** join.c 16 Sep 2003 00:34:50 -0000 1.20
--- join.c 13 Nov 2003 11:25:51 -0000 1.21
***************
*** 26,40 ****
". Can stich images into volumes, or tile images side "
"by side, or attach images onto volumes. If there are many many "
! "files to name in the \"-i\" option, consider putting the list of "
"filenames into a seperate text file (e.g. \"slices.txt\"), and then "
! "name this file as a response file (e.g. \"-i @slices.txt\").");
int
unrrdu_joinMain(int argc, char **argv, char *me, hestParm *hparm) {
hestOpt *opt = NULL;
! char *out, *err;
Nrrd **nin;
Nrrd *nout;
int ninLen, axis, incrDim, pret;
airArray *mop;
--- 26,45 ----
". Can stich images into volumes, or tile images side "
"by side, or attach images onto volumes. If there are many many "
! "files to name in the \"-i\" option, and using wildcards won't work, "
! "consider putting the list of "
"filenames into a seperate text file (e.g. \"slices.txt\"), and then "
! "name this file as a response file (e.g. \"-i @slices.txt\"). "
! "This command now allows you to set the same pieces of information that "
! "previously had to be set with \"unu axinfo\": label, spacing, and min/max. "
! "These can be use whether the join axis is new (because of \"-incr\") or not.");
int
unrrdu_joinMain(int argc, char **argv, char *me, hestParm *hparm) {
hestOpt *opt = NULL;
! char *out, *err, *label;
Nrrd **nin;
Nrrd *nout;
int ninLen, axis, incrDim, pret;
+ double mm[2], spc;
airArray *mop;
***************
*** 46,54 ****
OPT_ADD_AXIS(axis, "axis to join along");
hestOptAdd(&opt, "incr", NULL, airTypeInt, 0, 0, &incrDim, NULL,
! "in situations where the join axis is among the axes of "
! "the input nrrds, then this flag signifies that the join "
"axis should be *inserted*, and the output dimension should "
"be one greater than input dimension. Without this flag, the "
"nrrds are joined side-by-side, along an existing axis.");
OPT_ADD_NOUT(out, "output nrrd");
--- 51,65 ----
OPT_ADD_AXIS(axis, "axis to join along");
hestOptAdd(&opt, "incr", NULL, airTypeInt, 0, 0, &incrDim, NULL,
! "in situations where the join axis is *not* among the existing "
! "axes of the input nrrds, then this flag signifies that the join "
"axis should be *inserted*, and the output dimension should "
"be one greater than input dimension. Without this flag, the "
"nrrds are joined side-by-side, along an existing axis.");
+ hestOptAdd(&opt, "l", "label", airTypeString, 1, 1, &label, "",
+ "label to associate with join axis");
+ hestOptAdd(&opt, "mm", "min max", airTypeDouble, 2, 2, mm, "nan nan",
+ "min and max values along join axis");
+ hestOptAdd(&opt, "sp", "spacing", airTypeDouble, 1, 1, &spc, "nan",
+ "spacing between samples along join axis");
OPT_ADD_NOUT(out, "output nrrd");
***************
*** 68,71 ****
--- 79,95 ----
airMopError(mop);
return 1;
+ }
+ if (strlen(label)) {
+ AIR_FREE(nout->axis[axis].label);
+ nout->axis[axis].label = airStrdup(label);
+ }
+ if (AIR_EXISTS(mm[0])) {
+ nout->axis[axis].min = mm[0];
+ }
+ if (AIR_EXISTS(mm[1])) {
+ nout->axis[axis].max = mm[1];
+ }
+ if (AIR_EXISTS(spc)) {
+ nout->axis[axis].spacing = spc;
}
|