calculate_volumes {ChestVolume}R Documentation

Calculate Segment Volumes Over Time

Description

Calculates the volumes of specified segments over time using convex hulls.

Usage

calculate_volumes(data, segments)

Arguments

data

A data frame containing adjusted marker coordinates in centimeters, with columns 'Timeframe', 'Marker', 'X', 'Y', 'Z'.

segments

A list of character vectors, each containing marker names defining a segment.

Details

Coordinates should be in centimeters to ensure correct volume units (cm³).

Value

A data frame with columns 'Timeframe', 'Segment', 'Volume'.

Examples

# Define segments (e.g., quadrants of the chest)
segments <- list(
  UL = c("M01", "M02", "M03", "M04"),
  UR = c("M05", "M06", "M07", "M08")
)

# Assume 'adjusted_data' is the data frame with adjusted marker positions in cm
data('sample_data')
reformat_data <- reformat_marker_data(head(sample_data))
adjusted_data <- adj_position(reformat_data)
volumes_df <- calculate_volumes(adjusted_data, segments)
head(volumes_df)


[Package ChestVolume version 1.0.1 Index]