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

SCM Repository

[diderot] Diff of /branches/pure-cfg/src/lib/common/image.c
ViewVC logotype

Diff of /branches/pure-cfg/src/lib/common/image.c

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

revision 1356, Tue Jun 21 03:52:02 2011 UTC revision 1357, Tue Jun 21 03:55:10 2011 UTC
# Line 331  Line 331 
331    // compute the offset to the first space axis    // compute the offset to the first space axis
332      int base = nin->dim - nin->spaceDim;      int base = nin->dim - nin->spaceDim;
333    
334  // FIXME: we should also be checking the size of the axes, the shape of the voxels,  // FIXME: we should also be checking the shape of the voxels and the type of the samples.
 // and the type of the samples.  
335    // check that the image format is what we expect    // check that the image format is what we expect
336      if (nin->spaceDim != 1) {      if (nin->spaceDim != 1) {
337          fprintf(stderr, "nrrd file \"%s\" has unexpected dimension %d, expected 1\n",          fprintf(stderr, "nrrd file \"%s\" has unexpected dimension %d, expected 1\n",
# Line 350  Line 349 
349      img->dim = 1;      img->dim = 1;
350      img->size[0] = nin->axis[base+0].size;      img->size[0] = nin->axis[base+0].size;
351      img->data = nin->data;      img->data = nin->data;
352    // FIXME: this code probably only works for scalar images
353        img->dataSzb =  nrrdElementSize(nin) * nrrdElementNumber(nin) * img->size[0];
354    
355  //printf("LoadImage \"%s\": space dim = 1, axes = <%d>\n",  //printf("LoadImage \"%s\": space dim = 1, axes = <%d>\n",
356  //name, img->size[base+0]);  //name, img->size[base+0]);
# Line 392  Line 393 
393      img->size[0] = nin->axis[base+0].size;      img->size[0] = nin->axis[base+0].size;
394      img->size[1] = nin->axis[base+1].size;      img->size[1] = nin->axis[base+1].size;
395      img->data = nin->data;      img->data = nin->data;
396    // FIXME: this code probably only works for scalar images
397        img->dataSzb = nrrdElementSize(nin) * nrrdElementNumber(nin) * img->size[0] * img->size[1];
398    
399  //printf("LoadImage \"%s\": space dim = 2, axes = <%d, %d>\n",  //printf("LoadImage \"%s\": space dim = 2, axes = <%d, %d>\n",
400  //name, img->size[0], img->size[1]);  //name, img->size[0], img->size[1]);
# Line 454  Line 457 
457      img->size[1] = nin->axis[base+1].size;      img->size[1] = nin->axis[base+1].size;
458      img->size[2] = nin->axis[base+2].size;      img->size[2] = nin->axis[base+2].size;
459      img->data = nin->data;      img->data = nin->data;
460    // FIXME: this code probably only works for scalar images
461        img->dataSzb = nrrdElementSize(nin) * nrrdElementNumber(nin) * img->size[0] * img->size[1] * img->size[2];
462    
463  //printf("LoadImage \"%s\": space dim = 3, axes = <%d, %d, %d>\n",  //printf("LoadImage \"%s\": space dim = 3, axes = <%d, %d, %d>\n",
464  //name, img->size[0], img->size[1], img->size[2]);  //name, img->size[0], img->size[1], img->size[2]);

Legend:
Removed from v.1356  
changed lines
  Added in v.1357

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