
ChestVolume is an R package designed for analyzingchest expansion using 3D marker coordinate data collected from motioncapture systems. The package allows users to process marker data, adjustmarker positions, calculate convex hull volumes of chest segments, andvisualize chest movements in both 2D and 3D.
This tool is particularly useful for respiratory health research,enabling detailed assessments of chest expansion and identifyingpotential asymmetries in breathing patterns.
Install the released version of remotes from CRAN:
install.packages("ChestVolume")To installChestVolume from GitHub, use thefollowing commands:
if (!requireNamespace("devtools",quietly =TRUE)) {install.packages("devtools")}devtools::install_github("PKwong86/ChestVolume")Here is a quick example demonstrating how to use ChestVolume toprocess 3D marker data, adjust marker positions, and calculate chestsegment volumes.
# Load the packagelibrary(ChestVolume)# Example sample input datadata(sample_data)# Step 1: Process the marker data and convert from mm to cmprocessed_data<-process_marker_data(sample_data,convert_to_cm =TRUE)# Step 2: Adjust the marker positions by moving them 1 cm toward the chest centeradjusted_data<-adj_position(processed_data,distance =1)# Step 3: Define the chest segments (example with one segment)segments<-list(left =c("M01","M02","M03","M04","M05","M06","M07","M08","M09","M10","M11","M12","M13","M14","M15","M16","M17","M18"))# Step 4: Calculate the chest segment volumesvolumes<-calculate_volumes(adjusted_data, segments)head(volumes)# Step 5: Visualize the chest expansion in 3Dplot_chest_3d(adjusted_data, segments,selected_segment ='left')# Step 6: Plot the chest volume changes over timeplot_2d_volume(volumes,'Segment')For users who prefer a graphical interface, the ChestVolume Shiny appallows you to interact with the data without programming knowledge.
Access the Shiny app online:https://waihangkwong.shinyapps.io/Lung_volumn/ Source Code: The sourcecode for the Shiny app is available athttps://github.com/PKwong86/Chestvolume_shiny
This package is released under the MIT License. Feel free to use,modify, and distribute it.