Beispiel #1
0
int iiMRCreadSection(ImodImageFile *inFile, char *buf, int inSection)
{
  struct LoadInfo li;
  MrcHeader *h = (MrcHeader *)inFile->header;

  li.xmin = inFile->llx;
  li.ymin = inFile->lly;
  li.zmin = inFile->llz;

  /* DNM 2/26/03: replace upper right only if negative */
  if (inFile->urx < 0)
    li.xmax = inFile->nx-1;
  else
    li.xmax = inFile->urx;
  if (inFile->ury < 0)
    li.ymax = inFile->ny-1;
  else
    li.ymax = inFile->ury;
  if (inFile->urz < 0)
    li.zmax = inFile->nz-1;
  else
    li.zmax = inFile->urz;
  li.slope = inFile->slope;
  li.offset = inFile->offset;
  li.outmin = inFile->smin;
  li.outmax = inFile->smax;
  li.black = 0;
  li.white = 255;
  li.axis = inFile->axis;
  li.mirrorFFT = 0;
  h->fp = inFile->fp;
  return (mrcReadSection(h, &li, (unsigned char *)buf, inSection));
}
Beispiel #2
0
static int readSectionUnscaled(ImodImageFile *inFile, char *buf, int inSection, 
                               int asFloat)
{
  int err;
  IloadInfo li;
  MrcHeader *h = (MrcHeader *)inFile->header;

  iiMRCsetLoadInfo(inFile, &li);
  li.outmin = inFile->smin;
  li.outmax = inFile->smax;
  li.black = 0;
  li.white = 255;
  li.mirrorFFT = 0;
  h->fp = inFile->fp;
  iiChangeCallCount(1);
  if (asFloat)
    err = mrcReadSectionFloat(h, &li, (b3dFloat *)buf, inSection);
  else
    err = mrcReadSection(h, &li, (unsigned char *)buf, inSection);
  iiChangeCallCount(-1);
  return err;
}