Function Reference: inspect_CSG

csg-toolkit: inspect_CSG
csg-toolkit: inspect_CSG ("default")
csg-toolkit: inspect_CSG ("custom")
csg-toolkit: inspect_CSG ("fragment")
csg-toolkit: inspect_CSG (…, filename)
csg-toolkit: inspect_CSG (filename)

Batch inspect the CSG properties of previously analyzed long bones.

inspect_CSG reads all available $geometry-$$.csv files in the working folder, utilizes visualize_CrossSections to retrieve the data in the corresponding CSV files for each associated 3D model and plot the cross sectional contours, and upon user confirmation, it aggregates the CSG properties in a tabular format and save it under filename. If filename is not provided, "CSG Data.csv" is used by default.

The rationale behind the visual inspection of the cross sectional contours is to avoid any erroneous values due to badly shaped long bone models that might be processed succesfully by the respective Geometry function. For any given sample, if the contours of are shown as a simple polygon, then the computed CSG properties can be safely assumed as accurate and the user can confirm by pressing the "yes" button in order to append the CSG properties into tabular form. If not, press "no" to ignore the particular sample and proceed the inspection to the next available sample. If the user cancels, the process is terminated and the already appended values are saved in the CSV file.

Prior to batch processing, the user is prompted for the folder containing the 3D models of the associated bones and, if available, inspect_CSG measures their maximum length (max Distance) and includes it in the aggregated results, otherwise it adds NaN, as a missing value in the stored CSV file.

By default, inspect_CSG processes the available Dgeometry-, Dinertia-, Dpolyline2D-, and Dpolyline3D- CSV files generated with the longbone_Geometry function. This is identical to calling inspect_CSG with the optional argument "default". In this batch prossecing mode, 5 plots are rendered, one for each cross section at 20%, 35%, 50%, 65%, and 80%, respectively.

inspect_CSG ("custom") will process all available Cgeometry-, Cinertia-, Cpolyline2D-, and Cpolyline3D- CSV files generated with the longbone_CustomGeometry function. In this batch prossecing mode, an arbitrary number of plots is rendered, one for each associated cross section according to the contents of the respective CSV files. Note that all files included in the same batch MUST contain the same number of cross sections. However, it is not mandatory that they conform to the same points along the diaphysis. This is especially important for 3D modes analyzed with custom PP point files, where the ratio used for indexing each cross section might vary between samples. The ratio IDs used in the resulting "CSG Data.csv" are taken from the ultimate processed sample. Also note that the first and last plots always refer to the cross sections at 20% and 80%, respectively.

inspect_CSG ("fragment") will process all available Fgeometry-, Finertia-, Fpolyline2D-, and Fpolyline3D- CSV files generated with the longbone_FragmentGeometry function. In this batch prossecing mode, an arbitrary number of plots is rendered, one for each associated cross section according to the contents of the respective CSV files. Note that all files included in the same batch MUST contain the same number of cross sections. However, it is not mandatory that they conform to the same points along the diaphysis.

See also: visualize_CrossSections, longbone_Analysis

Source Code: inspect_CSG