Anonymizes DICOM images
dcm_subtract_date(file, base_date, origin = as.Date("19000101", format =
"%Y%m%d"), date_tags = dcmtk::date_tags$tag)
file | DICOM Image |
---|---|
base_date | baseline date to subtract dates from.
The new date is
|
origin | origin to add back in. The new date is
|
date_tags | tags to modify |
Output filename
If no tags are changed, then a warning will be printed.
if (FALSE) {
file = "~/Desktop/000000.dcm"
base_date = lubridate::ymd("2004-06-10")
origin = as.Date("19000101", format = "%Y%m%d")
tfile = tempfile()
file.copy(file, tfile)
anon = dcm_subtract_date(tfile, base_date = base_date)
hdr = read_dicom_header(anon)
}