Header to include: imodel.h
(includes ilist.h and mcrfiles.h)
Allocates a new model structure and returns a pointer to it, or NULL if there is an error. Initializes the model with imodDefault
Initializes model structure pointed to by model to default values and allocates an initial view (which will leak if this is called twice). Returns 0 (there are no errors)
Deletes a model; frees all memory used in objects, views, and object views and frees the model itself.
Returns the current object, contour, and point indexes of the model in object, contour, and point
Sets the current object, contour, and point indexes of the model with the values in object, contour, and point. Indexes are checked for legality and if one is out of bounds it is set to -1. If an index is -1, any index at a lower level is set to -1 also (e.g., point if contour is -1).
Returns the maximum coordinates of the model imod in pnt, or -1,-1,-1 if there are no points
Returns the minimum coordinates of the model imod in pnt, or -1,-1,-1 if there are no points
Returns the minimum and maximum coordinates of the model imod in min and max, or -1,-1,-1 if there are no points
Transforms all contour points in model imod with the 3D transform in mat. Returns -1 if error.
Transforms all contour points in model with Z values that round to slice. The 2D transformation in mat is applied to X and Y coordinates. Returns 0.
Cleans model mod by removing empty contours, removing empty objects if keepEmptyObjs is 0, constraining points within the model xmax, ymax, and zmax values, and making all points have the same Z value as the first point for non-wild closed contours. Returns 0.
Returns a string (e.g., "nm") for the pixel size units of model mod.
Returns the maximum time (type) value of any contour in model imod.
Computes a checksum from the coordinates and most other features of model mod and returns the value.
Fixes the surface size information for all objects in model imod by determining the maximum surface number for the contours in each object.
Flip the model imod by exchanging Y and Z in contours and meshes.
Sets the IrefImage structure refImage in imod with the image coordinate information in the MRC header hdata. Returns 1 for memory error allocating the structure.
Transforms the model in imod according to the old and current shift, scale, and rotation in the IrefImage structure iref, with the additional scaling required for binning in each dimension specified in binScale. Returns 1 for memory errors.
Transforms the model in imod given three matrices: mat for transforming points, matNorm for transforming the mesh normals, and matClip for transforming clip plane normals.
Get the number of objects in model imod (not the maximum object index).
Get the Z scale in model imod
Get the pixel size in model imod
Get a pointer to the filename of model imod
Returns non-zero if model imod is flipped
Adds new object to end of object array in model mod. Color is automatically assigned from the collection of 35 stock colors. Returns 1 if error.
Removes the object at the given index from the model mod. All contour data is deleted and object views are deleted. The object array is packed down and reallocated or freed if there are no more objects. Returns -1 if there is an error.
Moves an object from index obOld to index obNew in the model imod. Returns 1 if memory error.
Advances from the current object to the next object in the model imod, adjusting the index of the current contour and point to stay within bounds or setting them to -1 if appropriate. Returns new object index or -1 if there is no model or objects.
Moves from the current object to the previous object in the model mod, adjusting the index of the current contour and point to stay within bounds or setting them to -1 if appropriate. Returns new object index or -1 if there is no model or objects.
Returns a pointer to the current object in model imod, or NULL if no legal object is selected.
Sets first object in model imod as current object and returns pointer to it, or NULL if error.
Advances the current object index by one in model imod and returns pointer to new current object, or NULL if error or if the existing current object is the last one in the model.
Adds a new contour to the current object of the model mod. It will inherit surface and open/closed properties from the current contour and become the new current contour. Returns -1 if error.
Deletes the current contour of the model imod.
Deletes the contour at index in the current object of the model mod, freeing all point, size, and label data and reducing the size of the contour array. Sets the current contour and point index to -1 and returns the size of the current object or -1 if error.
Moves the current contour index back by one in model mod. If there is no current contour it selects the last one in the object. Returns the current contour index or -1 for error.
Advances the current contour index forward by one in model mod. If there is no current contour it selects the first one in the object. Returns the current contour index or -1 for error.
Returns a pointer to the current contour in model imod, or NULL if there is no current contour or the contour index is not legal.
Sets the current contour index to 0 in the current object in model imod and returns pointer to first contour, or NULL if there is no contour.
Advances to the next contour in the current object of model imod and returns pointer to the contour, or NULL if there is none (error or end of object).
Adds point to the end of the current contour in model imod. Returns new number of points in contour, or 0 for an error.
Inserts point at position index into the current contour in model imod. Returns new number of points in contour, or 0 for an error.
Deletes the current point in model imod, or the current contour if it is empty. Returns size of current contour or -1 for error.
Moves the current point index back by one in model mod. Returns the new current point index or -1 if no object or contour is selected.
Advances the current point index forward by one in model mod. Returns the new current point index or -1 if no object or contour is selected.
Returns a pointer to the current point in model imod, or NULL if there is no current contour or current point.
Sets the current point index to 0 in the current contour in model imod and returns pointer to first point, or NULL if there is no current contour or point.
Advances to the next point in the current contour of model imod and returns pointer to the point , or NULL if there is none (error or end of contour).