Function Reference: longbone_CustomGeometry

csg-toolkit: longbone_CustomGeometry (filename, points)
csg-toolkit: longbone_CustomGeometry (filename, bones, points)
csg-toolkit: longbone_CustomGeometry (folder, filename, points)
csg-toolkit: longbone_CustomGeometry (folder, filename, bones, points)

This function analyzes the cross-sectional geometry of an intact humerus, ulna, femur, or tibia bone along its longitudinal axis at custom intervals.

longbone_CustomGeometry (filename, points) will analyze the 3D model in filename, which must be a char string, at custom intervals defined inpoints. points can be either a char string or a numerical vector. The string must specify a Meshlab PickedPoints file containing an arbitrary number of points on the bone’s surface, each one of which specify a cross-sectional plane along the bones longitudinal axis. Alternatively, the numerical vector specifies an arbitrary number of cross-sectional planes as the ratios of the sectioning points’ distance from the proximal end to the bone’s maximum length in the range [0.1, 0.9]. Values beyond this range are ignored.

folder, which must be a char string, defines the relative or absolute path to the directory containing the 3D model in filename. When omitted, the current working directory is assumed.

bones must be cell array of strings specifying one or more long bones that should be analyzed. longbone_CustomGeometry will automatically determine what bone is represented in the 3D model, but it will analyze it only if it matches one of the bones named in bones. Valid options are:

  • "Humerus"
  • "Ulna"
  • "Femur"
  • "Tibia"
  • "All"

longbone_CustomGeometry does not return any output arguments, but it saves all geometric properties in CSV files as described in the following section. 3D models must be pure triangular meshes and their coordinate units are assumed to be in mm. Each OBJ file must explicitly contain a single 3D model of any long bone fragment.

Assuming a 3D model named "bone_ID.obj", the following files are generated:

FilenameDescription
Cgeometry-bone_ID.csvIt contains the properties of area (measured in mm^2), perimeter (measured in mm), centroid (returned as [x,y,z] coordinates in mm units), as well as the sectioning and orientation normals (returned as an [x,y,z] vectors). Each row of the CSV file corresponds to a different cross section. The first and last rows contain the default cross sections at 20% and 80% respectively. The intermediate rows follow the order of the sectioning points in the Meshlab PickedPoints file or in the numerical vector parsed in points. The aforementioned properties for each cross section are stored as a row vector with the respective order in columns [[2],[3],[4:6],[7:9],[10:12]]. The first column contains the ratios of the sectioning points’ distance from the proximal end to the bone’s maximum length.
Cinertia-bone_ID.csvIt contains the properties of Ix, Iy Ixy, Imin, and Imax, all measured in mm^4, as well as theta, measured in degrees. Accordingly, they are saved as row vectors [2:7] with the first column containing the ratios of the sectioning points’ distance from the proximal end to the bone’s maximum length.
Cpolyline2D-bone_ID.csvIt contains the 2D coordinates (on an arbitrary x,y local axis) for each cross section as an N×2 matrix, where N is the number of points for each cross-sectional polygon. These polygons are ordered as column duplets, i.e. [[1:2],...,[end-1:end]]. The first and the last column duplets contain the default cross sections at 20% and 80%, respectively. The intermediate column duplets follow the order of the sectioning points in the Meshlab PickedPoints file or in the numerical vector parsed in points. Polygon coordinates start from the second row ([2:end],:), while the first row contains the relevant ratios at columns (1, [1,3,...,end-1]).
Cpolyline3D-bone_ID.csvIt contains the 3D model coordinates for each cross section as an N×3 matrix, where N is the number of points for each cross-sectional polygon. These polygons are ordered as column triplets, i.e. [[1:3],...,[end-2:end]]. The first and the last column triplets contain the default cross sections at 20% and 80%, respectively. The intermediate column triplets follow the order of the sectioning points in the Meshlab PickedPoints file or in the numerical vector parsed in points. Polygon coordinates start from the second row ([2:end],:), while the first row contains the relevant ratios at columns (1, [1,3,...,end-1]).

For any analyzed 3D model, the initial alignment points are either read from the corresponding Meshlab PickedPoints file (e.g. ’bone_ID.pp’), if present in the same folder with the OBJ, or they are automatically registered with the longbone_Registration function. The optimized alignment points are appended in the existing MPP file or saved in newly created, accordingly.

See also: longbone_Geometry, longbone_FragmentGeometry, visualize_CrossSections

Source Code: longbone_CustomGeometry