Anonymizes DICOM images

dcm_subtract_date(file, base_date, origin = as.Date("19000101", format =
  "%Y%m%d"), date_tags = dcmtk::date_tags$tag)

Arguments

file

DICOM Image

base_date

baseline date to subtract dates from. The new date is date - base_date + origin.

origin

origin to add back in. The new date is date - base_date + origin.

date_tags

tags to modify

Value

Output filename

Note

If no tags are changed, then a warning will be printed.

Examples

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)
}