Plist Module

This module contains functions for reading a piece list from a text file, creating a fake piece list, and analyzing the piece coordinates. Note the function for reading piece coordinates from an extended MRC header is not in here but in iimrc.c, and is accessed via iiLoadPCoord in iimage.c.

Header to include: iimage.h


int mrc_plist_li(IloadInfo *li, MrcHeader *hdata, const char *fname)
int mrc_plist_load(IloadInfo *li, MrcHeader *hdata, FILE *fin)
int mrc_plist_proc(IloadInfo *li, int nx, int ny, int nz)
int mrc_plist_create(IloadInfo *li, int nx, int ny, int nz, int nfx, int nfy, int ovx, int ovy)
int iiPlistLoad(const char *filename, IloadInfo *li, int nx, int ny, int nz)
int iiPlistLoadF(FILE *fin, IloadInfo *li, int nx, int ny, int nz)
int iiPlistFromMetadata(const char *filename, int addMdoc, IloadInfo *li, int nx, int ny, int nz)
int iiPlistFromAutodoc(int adocIndex, int clearOnDone, IloadInfo *li, int nx, int ny, int nz, int montage, int numSect, int sectType)

int mrc_plist_li(IloadInfo *li, MrcHeader *hdata, const char *fname)

Reads a list of piece coordinates from a text file whose name is in fname, places it in the IloadInfo structure li, and processes it with mrc_plist_proc given the image dimensions in hdata. Returns 1 or -1 for errors.

int mrc_plist_load(IloadInfo *li, MrcHeader *hdata, FILE *fin)

Reads a list of piece coordinates from a text file fin, places it in the IloadInfo structure li, and processes it with mrc_plist_proc given the image dimensions in hdata. Returns 1 for errors.

int mrc_plist_proc(IloadInfo *li, int nx, int ny, int nz)

Analyzes the piece coordinates in the pcoord array in the IloadInfo structure li based on the image dimensions in nx, ny, and nz.  It fills in the px, py, pz, opx, opy, and opz elements in li, shifts coordinates to start at zero, and determines number of Z sections with data (pdz).  Returns 1 for memory error.

int mrc_plist_create(IloadInfo *li, int nx, int ny, int nz, int nfx, int nfy, int ovx, int ovy)

Creates a piece list in li for nz sections of size nx by ny, with the number of frames in X and Y given by nfx and nfy, and overlap in X and Y given by ovx and ovy.  Processes the list with mrc_plist_proc. Returns 1 for memory error.

int iiPlistLoad(const char *filename, IloadInfo *li, int nx, int ny, int nz)

Reads a list of piece coordinates from a text file whose name is in filename, places it in the IloadInfo structure li, and processes it with mrc_plist_proc given the image dimensions in nx, ny, and nz.  Returns 1 for all kinds of errors.

int iiPlistLoadF(FILE *fin, IloadInfo *li, int nx, int ny, int nz)

Reads a list of piece coordinates from the text file fin places it in the IloadInfo structure li, and processes it with mrc_plist_proc given the image dimensions in nx, ny, and nz. Returns 1 for all kinds of errors.

int iiPlistFromMetadata(const char *filename, int addMdoc, IloadInfo *li, int nx, int ny, int nz)

Reads a list of piece coordinates from an image metadata file if one exists. It looks for the file with the name in filename, or with the extension .mdoc added if addMdoc is non-zero.  If it finds the file, the file describes a montage, and there are nz sections, it places the coordinates in the IloadInfo structure li, and processes it with mrc_plist_proc given the image dimensions in nx, ny, and nz. Returns -4 for bad arguments, -5 for a memory error, 1 if it is not a montage or the number of sections does not match, 2 if there are not piece coordinates for every sections, or -3, -2, or -1 for an error in AdocOpenImageMetadata.

int iiPlistFromAutodoc(int adocIndex, int clearOnDone, IloadInfo *li, int nx, int ny, int nz, int montage, int numSect, int sectType)

Reads a list of piece coordinates from the autodoc with index adocIndex.  Provided that the montage is non-zero and that numSect equals nz sections, it places the coordinates in the IloadInfo structure li, and processes it with mrc_plist_proc given the image dimensions in nx, ny, and nz.  The montage, numSect, and sectType arguments should be the values returned by AdocOpenImageMetadata or AdocGetImageMetaInfo. Set clearOnDone non-zero to have the autodoc cleared out upon completion. Returns -4 for bad arguments, -5 for a memory error, 1 if it is not a montage or the number of sections does not match, or 2 if there are not piece coordinates for every section.