data: A data frame containing adjusted marker coordinates, with columns 'Timeframe', 'Marker', 'X', 'Y', 'Z'. Coordinates should be in consistent units (e.g., centimeters).
segments: A named list where each element is a character vector of marker names defining a segment.
selected_segment: A character string specifying the name of the segment to highlight.
timeframe: A numeric value indicating the timeframe to plot. If NULL, the first timeframe is used.
point_size: Numeric value specifying the size of the markers in the plot (default is 5).
highlight_color: Color to use for the highlighted segment markers and mesh (default is 'red').
marker_color: Color to use for the non-highlighted markers (default is 'blue').
Returns
A plotly object representing the 3D plot.
Details
The function plots all markers at the specified timeframe, highlighting the markers in the selected segment and overlaying the convex hull mesh of the selected segment. The plot is interactive, allowing for rotation and zooming.
Examples
# Example input data (replace with your actual data)data(sample_data)df<-reformat_marker_data(head(sample_data))df_a <- adj_position(df)# Define segmentssegments <- list( UL = c("M01","M02","M03","M04"))# Plot the 'UL' segment at timeframe 1plot <- plot_chest_3d(df_a, segments, selected_segment ="UL", timeframe =1)# Display the plotplot