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
)

Arguments

df

A data frame containing the dataset to be rated. No default value, must be provided by the user.

z_coord_col

Name of the column for the Z-coordinate measurement. Default is "NM2DMT_NM_substantianigra_z_coordinate".

volume_col

Name of the column for the volume measurement. Default is "NM2DMT_NM_volume_substantianigra".

avg_col

Name of the column for the average measurement. Default is "NM2DMT_NM_avg_substantianigra".

sd_col

Name of the column for the standard deviation measurement. Default is "NM2DMT_NM_sd".

max_col

Name of the column for the maximum value measurement. Default is "NM2DMT_NM_max".

lohi

A numeric vector of length 2 specifying the lower and upper thresholds for the Z-coordinate. Defaults to c(0.3, 0.7).

volume_threshold

A numeric value specifying the threshold for the volume measurement. Default is 500.

avg_threshold

A numeric value specifying the threshold for the average measurement. Default is 2500.

sd_threshold

A numeric value specifying the threshold for the standard deviation measurement. Default is 50.

max_threshold

A numeric value specifying the threshold for the maximum value measurement. Default is 5500.

verbose

boolean

Value

The original data frame with additional columns containing the quality control ratings. 1=pass; 0=fail.

Examples

# Example usage:
# df_rated <- assign_qc_ratings(df)
# View(df_rated)