Scrubs a named structured header without parsing or rewriting a binary file. The DICOM-adjacent mode implements a documented conservative subset, not a DICOM PS3.15 conformance statement. DICOM private attributes, pixels, overlays, and burned-in annotations always remain manual-review items.
Arguments
- header
A named plain list, data frame, or
DataFrame.- format
Explicit format, or
"auto"when the object carries exactly one explicit supported format marker.- subject_token
Optional safe replacement token.
- date_key
Caller-owned raw date-shifting key.
- subject_id
Subject identifier used only to derive a date offset.
- free_text
Refuse or drop detected free-text fields.
Examples
header <- list(
patient_id = "source-patient",
recording_id = "source-recording",
start_date = as.Date("2024-02-29"),
comments = "free text note",
signal_headers = list(label = c("ECG", "EMG"), unit = c("mV", "mV"))
)
# Scrubs a parsed header only; it does not read or rewrite the binary file.
result <- headerScrub(header, "edf", subject_token = "psn_safe",
free_text = "drop")
result$header$patient_id
#> [1] "psn_safe"
result
#> <header_scrub> format=edf; actions=4; manual-review=2