R/subtyper.R
assign_qc_ratings_NM2DMT.Rd
This function assigns quality control ratings to a dataset based on several criteria related to measurements of a specific anatomical structure, such as the substantia nigra. The ratings are determined by whether the measurements fall within certain thresholds.
assign_qc_ratings_NM2DMT(
df,
z_coord_col = "NM2DMT_NM_substantianigra_z_coordinate",
volume_col = "NM2DMT_NM_volume_substantianigra",
avg_col = "NM2DMT_NM_avg_substantianigra",
sd_col = "NM2DMT_NM_sd",
max_col = "NM2DMT_NM_max",
lohi = c(0.3, 0.7),
volume_threshold = 500,
avg_threshold = 2500,
sd_threshold = 50,
max_threshold = 5500,
verbose = FALSE
)
A data frame containing the dataset to be rated. No default value, must be provided by the user.
Name of the column for the Z-coordinate measurement. Default is "NM2DMT_NM_substantianigra_z_coordinate".
Name of the column for the volume measurement. Default is "NM2DMT_NM_volume_substantianigra".
Name of the column for the average measurement. Default is "NM2DMT_NM_avg_substantianigra".
Name of the column for the standard deviation measurement. Default is "NM2DMT_NM_sd".
Name of the column for the maximum value measurement. Default is "NM2DMT_NM_max".
A numeric vector of length 2 specifying the lower and upper thresholds for the Z-coordinate. Defaults to c(0.3, 0.7).
A numeric value specifying the threshold for the volume measurement. Default is 500.
A numeric value specifying the threshold for the average measurement. Default is 2500.
A numeric value specifying the threshold for the standard deviation measurement. Default is 50.
A numeric value specifying the threshold for the maximum value measurement. Default is 5500.
boolean
The original data frame with additional columns containing the quality control ratings. 1=pass; 0=fail.
# Example usage:
# df_rated <- assign_qc_ratings(df)
# View(df_rated)