Add_ROILabelCodeVars: Add user-defined ROI Label Code Variables to SizeExractR...

Description Usage Arguments Value Examples

View source: R/Add_ROILabelCodeVars.R

Description

Add user-defined ROI Label Code Variables to SizeExractR Database, based on ROI Label Code Translator Matrix

Usage

1
Add_ROILabelCodeVars(data, label.translator)

Arguments

data

An object of class dataframe as output directly from SizeExtractR::Build_Uncalibrated_Dataset()

label.translator

An object of class data.frame as output directly from SizeExtractR::CheckSet_ROILabelCodeVars. See documentation for that function for more information.

Value

Adds to the SizeExtractR database (and returns this dataframe object) by deconstructing the ROI.LabelCode variable and forming it into new columns showing TRUE or FALSE (i.e. yes or no) for each of the different ROI Label Code variables.

Note that the user-defined ROI Label Code variables are for ROIs of interest, not the calibration ROIs (ROI.Type = "Cali_Pts" or "M" denoting calibration points and measurement length respectively).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# load in the output of Build_Uncalibrated_Dataset and CheckSet_ROILabelCodeVars
data(Database)
data(Label.Translator)


# Run the function
Database.ROIlabelcode = Add_ROILabelCodeVars(Database, Label.Translator)

# Dataframe withour ROI codes
head(Database[(ncol(Database)-5):ncol(Database)])

# DataframeWith ROI codes
head(Database.ROIlabelcode[(ncol(Database.ROIlabelcode)-5):ncol(Database.ROIlabelcode)])

liamlachs/SizeExtractR documentation built on Feb. 13, 2022, 9:46 p.m.