dcm_subtract_date: DICOM Anonymization

View source: R/dcm_subtract_date.R

dcm_subtract_dateR Documentation

DICOM Anonymization

Description

Anonymizes DICOM images

Usage

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

## Not run: 
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)

## End(Not run)

muschellij2/dcmtk documentation built on March 6, 2025, 12:07 a.m.