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

SCM Repository

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

Diff of /branches/lamont/src/dnorm/dnorm.c

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

revision 1738, Tue Mar 20 18:14:18 2012 UTC revision 1739, Tue Mar 20 19:19:37 2012 UTC
# Line 43  Line 43 
43    char *err;    char *err;
44    Nrrd *nin, *nout;    Nrrd *nin, *nout;
45    NrrdIoState *nio;    NrrdIoState *nio;
46    int kindIn, kindOut, headerOnly, haveMM;    int kindIn, kindOut, headerOnly, haveMM, trivialOrient;
47    unsigned int kindAxis, axi, si, sj;    unsigned int kindAxis, axi, si, sj;
48    
49    me = argv[0];    me = argv[0];
# Line 53  Line 53 
53    airMopAdd(mop, hparm, (airMopper)hestParmFree, airMopAlways);    airMopAdd(mop, hparm, (airMopper)hestParmFree, airMopAlways);
54    hestOptAdd(&hopt, "h,header", NULL, airTypeInt, 0, 0, &headerOnly, NULL,    hestOptAdd(&hopt, "h,header", NULL, airTypeInt, 0, 0, &headerOnly, NULL,
55               "output header of nrrd file only, not the data itself");               "output header of nrrd file only, not the data itself");
56      hestOptAdd(&hopt, "to", NULL, airTypeInt, 0, 0, &trivialOrient, NULL,
57                 "(*t*rivial *o*rientation) "
58                 "even if the input nrrd comes with full orientation or "
59                 "per-axis min-max info, ignore it and instead assert the "
60                 "most trivial mapping between index and world space");
61    hestOptAdd(&hopt, "i", "nin", airTypeOther, 1, 1, &nin, NULL,    hestOptAdd(&hopt, "i", "nin", airTypeOther, 1, 1, &nin, NULL,
62               "input image", NULL, NULL, nrrdHestNrrd);               "input image", NULL, NULL, nrrdHestNrrd);
63    hestOptAdd(&hopt, "o", "nout", airTypeString, 1, 1, &outS, "-",    hestOptAdd(&hopt, "o", "nout", airTypeString, 1, 1, &outS, "-",
# Line 187  Line 192 
192       but we have to accept a greater variety of kinds and dimensions       but we have to accept a greater variety of kinds and dimensions
193       than gage ever has to process.       than gage ever has to process.
194    */    */
195    if (nout->spaceDim) {    if (nout->spaceDim && !trivialOrient) {
196      int saxi = 0;      int saxi = 0;
197      /* we use only the space dimension, not any named space */      /* we use only the space dimension, not any named space */
198      nout->space = nrrdSpaceUnknown;      nout->space = nrrdSpaceUnknown;
# Line 206  Line 211 
211          nrrdSpaceVecSetNaN(nout->axis[axi].spaceDirection);          nrrdSpaceVecSetNaN(nout->axis[axi].spaceDirection);
212        }        }
213      }      }
214    } else if (haveMM) {    } else if (haveMM && !trivialOrient) {
215      int saxi = 0;      int saxi = 0;
216      for (axi=0; axi<nout->dim; axi++) {      for (axi=0; axi<nout->dim; axi++) {
217        if (nrrdKindUnknown == kindOut || kindAxis != axi) {        if (nrrdKindUnknown == kindOut || kindAxis != axi) {

Legend:
Removed from v.1738  
changed lines
  Added in v.1739

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