read_segment_definitions: Read Segment Definitions from Excel File

View source: R/read_segment_definitions.R

read_segment_definitionsR Documentation

Read Segment Definitions from Excel File

Description

Reads an Excel file defining the markers in each segment and creates a list suitable for use with plot_chest_3d and calculate_segment_volumes functions.

Usage

read_segment_definitions(filepath)

Arguments

filepath

A string specifying the path to the Excel file containing segment definitions.

Details

The Excel file should have a specific format:

  • Each row represents a segment.

  • The first column contains the segment names.

  • Subsequent columns contain the marker names belonging to each segment.

Missing marker entries can be left blank or filled with NA.

Value

A named list where each element is a character vector of marker names defining a segment.

Examples

# 'segment_def.xlsx' is the Excel file with segment definitions
path <- system.file("extdata", "segment_def.xlsx", package="ChestVolume")
segments <- read_segment_definitions(path)
head(segments)

ChestVolume documentation built on April 3, 2025, 9:31 p.m.