visualize_CrossSections
Plot cross sectional contours and their CSG properties for a given sample.
visualize_CrossSections
reads the respective $geometry-$$.csv
,
$inertia-$$.csv
, $polyline2D-$$.csv
, and
$polyline3D-$$.csv
files available in the working directory, where
$$
is the bone_id char string for the required bone and
$
denotes the mode of bone analysis, and plots the 2D cross
sectional polygons from proximal (top) to distal (bottom) along with certain
information regarding cross sectional area, perimeter, and second moments of
area.
When called with a single input argument, visualize_CrossSections
reads the files produced with the longbone_Analysis
function, i.e. it
reads the Dgeometry-bone_id.csv
, Dinertia-bone_id.csv
,
Dpolyline2D-bone_id.csv
, and Dpolyline3D-bone_id.csv
files
associated with bone_id. Optionally, if called with a second argument,
mode, then the function reads the files generated by the respective
function as shown below.
mode | Function | CSV Files |
---|---|---|
"default" | longbone_Geometry | Dgeometry-bone_id.csv |
Dinertia-bone_id.csv | ||
Dpolyline2D-bone_id.csv | ||
"custom" | longbone_CustomGeometry | Cgeometry-bone_id.csv |
Cinertia-bone_id.csv | ||
Cpolyline2D-bone_id.csv | ||
"fragment" | longbone_FragmentGeometry | Fgeometry-bone_id.csv |
Finertia-bone_id.csv | ||
Fpolyline2D-bone_id.csv |
In default mode, visualize_CrossSections
produces 5 plots with the
cross sections at 20%, 35%, 50%, 65%, and 80% of the longbone’s max distance,
whereas in "custom"
and "fragment"
modes, it produces an
arbitrary number of plots according to the cross sections contained in the
associated files. All four CSV files corresponding to bone_id must be
present in the working directory.
The centroid of each cross section is centered at origin and the x-axis of the plots represents the frontal axis of the bone from left to right side, whereas the y-axis is aligned to the sagital axis with the top pointing towards the front side (anterior). Both axes retain equal size so that the actual shape of the cross sectional area is preserved. However, each figure has a different scaling factor. Consequently, size may not be visually proportional among different figures, but the axes in each figure preserve the values of the actual size for the displayed cross section.
If output arguments are defined, then visualize_CrossSections
returns
up to three structures with the following fields, containing the data
retrieved from the CSV files. The number of elements of each structure
correspond to the number of cross sections generated by the respective
longbone_
function.
Structure | Field | Data |
---|---|---|
CS_Geometry | CS | The ratio of the cross section’s distance from the proximal end to the bone’s maximum length or the ordered index of the sectioning point for bone fragments. |
Area | The cross sectional aera measured in . | |
Perimeter | The perimeter of the cross section measured in . | |
Centroid | The x, y, z coordinates of the cross sectional centroid. | |
Section_n | The x, y, z coordinates of the cross sectional plane’s normal. | |
Coronal_n | The x, y, z coordinates of the normal of the bone’s Coronal plane. | |
SMoA | Ix | The 2nd moment of area with respect to the x axis, which is collinear with the intersection of the coronal plane and the sectioning plane, measured in . |
Iy | The 2nd moment of area with respect to y axis, which is collinear with the intersection of the sagital plane and the sectioning plane, measured in . | |
Ixy | The product of the 2nd moment of area measured in . | |
Imin | The minimum 2nd moment of area measured in . | |
Imax | The maximum 2nd moment of area measured in . | |
theta | The angle of rotation of the principal axis of 2nd moment of area with respect to x axis, measured in degrees. | |
polyline | poly2D | An matrix with the x, y coordinates of the cross section, ordered counter-clockwise, on the 2D local axes of the sectioning plane. |
poly3D | An matrix with the x, y, z coordinates of the cross section, ordered counter-clockwise, in the original 3D space of the bone’s 3D model. |
If mode is defined as "fragment"
, then Coronal_n
field
is not available in CS_Geometry and the fields Ixy
, Iy
,
theta
are missing from SMoA.
See also: inspect_CSG, longbone_Analysis, longbone_CustomGeometry, longbone_FragmentGeometry
Source Code: visualize_CrossSections