Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /trunk/src/dnorm/dnorm.c
ViewVC logotype

Diff of /trunk/src/dnorm/dnorm.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 124, Mon Jun 28 20:40:26 2010 UTC revision 125, Tue Jun 29 15:13:36 2010 UTC
# Line 42  Line 42 
42    char *err;    char *err;
43    Nrrd *nin, *nout;    Nrrd *nin, *nout;
44    NrrdIoState *nio;    NrrdIoState *nio;
45    int kindIn, kindOut;    int kindIn, kindOut, headerOnly;
46    unsigned int kindAxis, axi, si, sj;    unsigned int kindAxis, axi, si, sj;
47    
48    me = argv[0];    me = argv[0];
# Line 50  Line 50 
50    hparm = hestParmNew();    hparm = hestParmNew();
51    hopt = NULL;    hopt = NULL;
52    airMopAdd(mop, hparm, (airMopper)hestParmFree, airMopAlways);    airMopAdd(mop, hparm, (airMopper)hestParmFree, airMopAlways);
53      hestOptAdd(&hopt, "h,header", NULL, airTypeInt, 0, 0, &headerOnly, NULL,
54                 "output header of nrrd file only, not the data itself");
55    hestOptAdd(&hopt, "i", "nin", airTypeOther, 1, 1, &nin, NULL,    hestOptAdd(&hopt, "i", "nin", airTypeOther, 1, 1, &nin, NULL,
56               "input image", NULL, NULL, nrrdHestNrrd);               "input image", NULL, NULL, nrrdHestNrrd);
57    hestOptAdd(&hopt, "o", "nout", airTypeString, 1, 1, &outS, "-",    hestOptAdd(&hopt, "o", "nout", airTypeString, 1, 1, &outS, "-",
# Line 132  Line 134 
134    nio = nrrdIoStateNew();    nio = nrrdIoStateNew();
135    airMopAdd(mop, nio, (airMopper)nrrdIoStateNix, airMopAlways);    airMopAdd(mop, nio, (airMopper)nrrdIoStateNix, airMopAlways);
136    nio->skipFormatURL = AIR_TRUE;    nio->skipFormatURL = AIR_TRUE;
137      if (headerOnly) {
138        nio->skipData = AIR_TRUE;
139      }
140    nrrdCommentClear(nout);    nrrdCommentClear(nout);
141    
142    /* no measurement frame */    /* no measurement frame */
# Line 201  Line 206 
206      for (axi=0; axi<nout->dim; axi++) {      for (axi=0; axi<nout->dim; axi++) {
207        if (nrrdKindUnknown == kindOut || kindAxis != axi) {        if (nrrdKindUnknown == kindOut || kindAxis != axi) {
208          nrrdSpaceVecSetZero(nout->axis[axi].spaceDirection);          nrrdSpaceVecSetZero(nout->axis[axi].spaceDirection);
209          nout->axis[axi].spaceDirection[saxi] = 1.0;          nout->axis[axi].spaceDirection[saxi]
210              = (AIR_EXISTS(nin->axis[axi].spacing)
211                 ? nin->axis[axi].spacing
212                 : 1.0);
213          saxi++;          saxi++;
214        } else {        } else {
215          nrrdSpaceVecSetNaN(nout->axis[axi].spaceDirection);          nrrdSpaceVecSetNaN(nout->axis[axi].spaceDirection);

Legend:
Removed from v.124  
changed lines
  Added in v.125

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0