dcm_subtract_date: DICOM Anonymization

Description Usage Arguments Value Note Examples

View source: R/dcm_subtract_date.R

Description

Anonymizes DICOM images

Usage

1
2
3
4
5
6
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## 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 17, 2021, 9:11 p.m.