This module has functions for loading, manipulating, and saving an IMOD model from Fortran.
void imodarraylimits(int *maxpt, int *maxob)
void imodpartialmode(int *mode)
int getimod(int ibase[], int npt[], float coord[][3], int color[][2],
int *npoint, int *nobject, char *fname, fortStrLen_t fsize)
int getopenedimod(int ibase[], int npt[], float coord[][3], int color[][2],
int *npoint, int *nobject)
int openimoddata(char *fname, fortStrLen_t fsize)
void imodopenerror(char *error, fortStrLen_t errlen)
int imodcountcontspoints(int *numContsTotal, int *maxNumConts, int *numPtsTotal,
int *maxNumPts)
int getimodobjlist(int objList[], int *ninList, int ibase[], int npt[],
float coord[][3], int color[][2], int *npoint, int *nobject)
int getimodobjrange(int *objStart, int *objEnd, int ibase[], int npt[],
float coord[][3], int color[][2], int *npoint, int *nobject)
int getimodmesh(int *objnum, float *verts, int *index, int *limverts,
int *limindex)
int getimodverts(int *objnum, float *verts, int *index, int *limverts,
int *limindex, int *nverts, int *nindex)
int getimodsizes(int *ob, float *sizes, int *limsizes, int *nsizes)
int getcontpointsizes(int *ob, int *co, float *sizes, int *limsizes,
int *nsizes)
int putcontpointsizes(int *ob, int *co, float *sizes, int *nsizes)
int getimodtimes(int *times)
int getimodobjtimes(int *ob, int *times)
int getimodsurfaces(int *surfs)
int getobjsurfaces(int *ob, int *sortSurfs, int *surfs)
int getcontvalue(int *ob, int *co, float *value)
int getpointvalue(int *ob, int *co, int *pt, float *value)
int putcontvalue(int *ob, int *co, float *value)
int putpointvalue(int *ob, int *co, int *pt, float *value)
int clearimodobjstore(int *ob)
int deleteimodmeshes(int *ob)
int deleteimodcont(int *ob, int *co)
int deletelistofconts(int *ob, int *contours, int *numCont)
int deleteimodpoint(int *ob, int *co, int *pt)
int addimodpoint(int *ob, int *co, float *ptOrZ, int *ifByZ, float *x, float *y, float *z)
int getobjvaluethresh(int *ob, float *thresh)
int getobjskiplowvalues(int *ob)
int findaddminmax1value(int *ob)
int putimod(int ibase[], int npt[], float coord[][3], int cindex[],
int color[][2], int *npoint, int *nobject)
int writeimod(char *fname, fortStrLen_t fsize)
int imodwriteaswimp(char *fname, fortStrLen_t fsize)
int putimodscat(int *ob, float *verts)
int putimodmesh(float *verts)
int newimod(void)
int deleteimod(void)
int deleteiobj(void)
int getimodobjsize()
int getimodheado(float *um, float *zscale)
int getimodmaxes(int *xmax, int *ymax, int *zmax)
int getzfromminuspt5()
int getimodhead(float *um, float *zscale,
float *xoffset, float *yoffset, float *zoffset,
int *ifflip)
int getimodscales(float *ximscale, float *yimscale, float *zimscale)
int putimageref(float *delta, float *origin, float *tilt)
int imodhasimageref()
int getimodflags(int *flags, int *limflags)
int getmodelname(char *fname, fortStrLen_t fsize)
int getimodobjname(int *ob, char *fname, fortStrLen_t fsize)
int getimodclip(int *objnum, float *clip)
int putimodmaxes(int *xmax, int *ymax, int *zmax)
void putimodflag(int *objnum, int *flag)
void putimodzscale(float *zscale)
void putimodrotation(float *xrot, float *yrot, float *zrot)
int getscatsize(int *objnum, int *size)
void putscatsize(int *objnum, int *size)
void putsymtype(int *objnum, int *type)
void putsymflags(int *objnum, int *flags)
void putlinewidth(int *objnum, int *width)
int getobjcolor(int *objnum, int *red, int *green, int *blue)
void putobjcolor(int *objnum, int *red, int *green, int *blue)
void putsymsize(int *objnum, int *size)
void putvalblackwhite(int *objnum, int *black, int *white)
int putmodelname(char *fname, fortStrLen_t fsize)
void putimodobjname(int *objnum, char *fname, fortStrLen_t fsize)
int getimodnesting(int *ob, int *inOnly, int *level, int *inIndex,
int *inCont, int *outIndex, int *outCont, int *arraySize)
Sets limit on number of points and objects in calling arrays
Turns on mode for returning only part of model if mode is non-zero.
Reads IMOD model from the file given by fname and transforms coordinates,
leaves it in a static model structure for further actions.
Returns all contour data into the given arrays unless in partial mode.
ibase = starting index of contours in coord array, numbered from 0
npt = number of points in contour
coord = X, Y, Z coordinates of points
color = On/Off flag and "color" = 256 - IMOD object number
npoint = Total number of points returned, or 0 in partial mode
nobject = Total number of contours returned, or 0 in partial mode
fsize is omitted from fortran call.
Returns all contour data from an already opened model into the given arrays unless
in partial mode.
ibase = starting index of contours in coord array, numbered from 0
npt = number of points in contour
coord = X, Y, Z coordinates of points
color = On/Off flag and "color" = 256 - IMOD object number
npoint = Total number of points returned, or 0 in partial mode
nobject = Total number of contours returned, or 0 in partial mode
Reads in an IMOD model from a file with name fname, places it into a static model structure and transforms coordinates. Called from fortran as openimoddata(fname)
Returns an error string from the last error opening a model into errlen
Returns the total number of contours in the model in numContsTotal, the maximum in any one object in maxNumConts, the total points in numPtsTotal, and the maximum in any one object in maxNumPts
Returns contours from the given list of objects into the model arrays
objList = List of IMOD objects to retrieve, numbered from 1
ninList = Number of objects in list
ibase = starting index of contours in coord array, numbered from 0
npt = number of points in contour
coord = X, Y, Z coordinates of points
color = On/Off flag and "color" = 256 - IMOD object number
npoint = Total number of points returned
nobject = Total number of contours returned
Returns contours from the given range of objects into the model arrays
objStart, objEnd = Starting and ending IMOD objects to retrieve,
numbered from 1
ninList = Number of objects in list
ibase = starting index of contours in coord array, numbered from 0
npt = number of points in contour
coord = X, Y, Z coordinates of points
color = On/Off flag and "color" = 256 - IMOD object number
npoint = Total number of points returned
nobject = Total number of contours returned
Returns mesh data for the given object objnum. The vertex/normal data are returned in the array verts, whose maximum size is specified by limverts, and the index data are returned in the array index, whose maximum size is specified by limindex. If limverts and limindex are 0, the function sets them with the needed limits and returns without error. The vertex coordinates are shifted to correspond to image index coordinate coordinates of the full volume.
Returns mesh data with normals omitted for the given object objnum. The vertex data are returned in the array verts, whose maximum size is specified by limverts, and the index data are returned in the array index, whose maximum size is specified by limindex. nverts and nindex are returned with the number of vertices and indexes. The vertex coordinates are shifted to correspond to image index coordinates of the full volume. Returns 1 if there are no meshes in the object, or negative values for other errors.
Returns point sizes for the given object ob in array sizes; limsizes specifies the size of the array and the number of points is returned in nsizes.
Returns the values in the point size array for contour co of object ob into array sizes; limsizes specifies the size of the array and the number of points is returned in nsizes. The array contains a -1 for points with the default size. Returns no points if there is no point size array.
Fills the point size array for contour co of object ob with the values in the array sizes; nsizes specifies the number of values in the array.
Returns time values for all contours in all objects into array times
Returns time values for contours in object ob into array times
Returns surface numbers for all contours in all objects into array surfs
Returns surface numbers for all contours in object ob into the array surfs. If sortSurfs > 0, it analyzes a mesh to sort contours into surfaces using imodObjectSortSurf.
Returns the general value for contour co of object ob into value. The return value is -8 if there is no value.
Returns the general value for point pt in contour co of object ob into value. If pt <= 0, has the same effect as getcontvalue. The return value is -8 if there is no value.
Stores a general value value for contour co of object ob.
Stores a general value value for point pt in contour co of object ob. If pt is <= 0 then the effect is the same as calling putcontvalue.
Deletes the store structure for the given object ob, if any.
Deletes the meshes stored for the given object ob, if any.
Deletes contour co in object ob using imodDeleteContour, which will adjust contour numbers in an object store, if any.
Deletes the list of numCont contours in contours in object ob using imodDeleteListOfConts, which will adjust contour numbers in an object store, if any. Contours are numbered from 1 as usual.
Deletes point pt in contour co of object ob using imodPointDelete, which will adjust sizes, labels, and general storage items in the contour, if any.
Adds a point with coordinates x, y, z to contour co of object ob at either an index or a Z value given in ptOrZ. If ifByZ is 0, then ptOrZ should have the floating point value of the index at which to add the point (numbered from 1). If ifByZ is non-zero, the point will be added before the first existing point with a Z value greater than or equal to ptOrZ. The point must be in the same scaled coordinates as in the model returned by this module. The point is added using imodPointAdd, which will adjust sizes, labels, and general storage items in the contour, if any.
Returns the threshold value for object ob in thresh. This value is based on the min and max contour values in the object as the value of the byte valblack as stored by imodfindbeads and findbeads3d or adjusted in beadfixer. The return value is -8 if there is no min/max stored.
Returns 1 if flags are set to display values and skip ones below threshold for object ob, 0 if not, or a negative number for error.
Updates the min and max values for VALUE1 for contours and points of object ob, using istoreFindAddMinMax1.
Puts model contours from arrays back into IMOD model structure. If partial
mode is off, all existing contour data in all objects are deleted, and replaced by
the points in the contours being stored. If partial
mode is on, existing contour data will be deleted only from objects included
in these data (as specified by the color values); other objects will be
retained.
ibase = starting index of contours in cindex array, numbered from 0
npt = number of points in contour
coord = X, Y, Z coordinates of points
cindex = index to points in coord array, numbered from 1
color = On/Off flag and "color" = 256 - IMOD object number
npoint = Total number of points
nobject = Total number of contours
Writes the current model structure to the file given by fname after transforming back to index coordinates. Called from fortran as writeimod(fname).
Writes the current model as an ascii WIMP model file with the same library function used by 3dmod
Puts scattered points back into object ob from array verts. The number of points must be the same as the number in the original object.
Puts vertex/normal data back into the current model object from array verts and sets the flag that normals are magnitudes.
Deletes current model and allocates a new, default model structure
Deletes current model and frees all memory
Removes all objects from model.
Returns number of IMOD objects in the model, or -1 for error.
Returns pixel size in microns in um and Z-scale in zscale, -1 if there is no model or -13 if there is no pixel size in the model
Returns maximum X, Y, Z coordinates of image that model was loaded on
Returns 1 if the model flag is set that Z coordinates start at -0.5, or negative if there is no open model.
Returns header values: pixel size in microns in um, Z-scale in zscale, offsets to get from model coordinates to full volume index coordinates in xoffset, yoffset, zoffset, and ifflip nonzero if Y/Z are flipped.
Returns the image file scale values used to get from model to index coords
Sets the image reference information of the model with the delta, origin, and current tilt angle values from an MRC file header.
Returns 1 if a model has image reference information, 0 if it does not, or -5 for no model.
Return a flag for each object in array flags; limflags specifies the maximum size of the array. The flag is the sum of 0, 1 or 2 for closed, open or scattered point object, plus 4 if the object has a mesh.
Returns model name in fname; fsize is omitted in the call from fortran.
Returns name of object ob in fname; fsize is omitted in the call from fortran.
Returns the clipping planes for the object objnum in the array clip. Each clipping plane is specified by 4 numbers: the normal and the dot product of normal and point, scaled by the pixel size. The return value is the number of clipping planes or negative for an error.
Sets the maximum X, Y, Z coordinates for the model
Specifies a flag or value for object objnum; in external calls flag should be 0 for closed contour, 1 for open contour, 2 for scattered points, 7 to set IMOD_OBJFLAG_USE_VALUE in flags and MATFLAGS2_CONSTANT and MATFLAGS2_SKIP_LOW in matflags2, 9 to set IMOD_OBJFLAG_PNT_ON_SEC, and 10 to set IMOD_OBJFLAG_THICK_CONT.
Sets the Z-scale of the model to zscale
Sets the display rotation angles of the model to xrot, yrot, zrot
Returns the 3D point size for objnum into size
Sets the 3D point size for objnum to size
Sets the symbol type of object objnum to type
Sets the symbol flags of object objnum to flags, the sumof 1 for filled symbols and 2 for marked ends.
Sets the 2D line width for objnum to width
Returns the color for object objnum into red, green, blue, where values range from 0 to 255.
Sets the color for object objnum to red, green, blue, where values range from 0 to 255.
Sets the symbol size of object objnum to size
Sets the valblack and valwhite members of object objnum to black and white.
Sets the model name to the string in fname
Sets the name for object objnum to the string in fname
Returns information about nested contours for object ob.
Only inside information is returned if inOnly is nonzero.
level is filled with nesting level or 0 if no inside/outside contours
inCont and outCont are filled with the inside and outside contours
numbers from the nesting analysis, numered from 1
inIndex and outIndex are filled with indices into these arrays for each
contour, numbered from 1
arraySize specifies limiting size of ALL arrays, but if inOnly is
nonzero then outCont and outIndex are ignored and do not need to be
arrays