int iiMRCreadSectionByte(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; 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 = 0; li.outmax = 255; li.axis = inFile->axis; li.mirrorFFT = inFile->mirrorFFT; h->fp = inFile->fp; return (mrcReadSectionByte(h, &li, (unsigned char *)buf, inSection)); }
static int readSectionScaled(ImodImageFile *inFile, char *buf, int inSection, int outmax) { int err; IloadInfo li; MrcHeader *h = (MrcHeader *)inFile->header; iiMRCsetLoadInfo(inFile, &li); li.outmin = 0; li.outmax = outmax; li.mirrorFFT = inFile->mirrorFFT; h->fp = inFile->fp; iiChangeCallCount(1); if (outmax > 255) err = mrcReadSectionUShort(h, &li, (unsigned char *)buf, inSection); else err = mrcReadSectionByte(h, &li, (unsigned char *)buf, inSection); iiChangeCallCount(-1); return err; }