dicom.set.tag.value | R Documentation |
The dicom.set.tag.value
function changes, in the DICOM
raw data, the values of the TAG whose VR is a string of characters.
dicom.set.tag.value(
dicom.raw.data,
tag,
tag.value,
tag.dictionary = dicom.tag.dictionary(),
...
)
dicom.raw.data |
Raw vector, representing the binary extraction of the DICOM file. |
tag |
String vector, representing the list of tags whose value is to be changed. See note 1. |
tag.value |
String vector,representing the list of new tag values. |
tag.dictionary |
Dataframe, by default equal to dicom.tag.dictionary, whose structure it must keep. This dataframe is used to parse DICOM files. |
... |
Additional arguments |
Returns a raw vector, with new tag values.
1- The list of tags included in the DICOM file are given by the first columns of the dataframe provided by the functions dicom.browser and dicom.parser.
2- The dicom.set.tag.value
function may take some processing time.
To minimize this time, it is recommended to prepare in advance all the tags to
be modified, and use the dicom.set.tag.value
function only once, as shown in
the example.
# change the value of tags "(0010,0010)" and "(0010,0020)" in the
# dummy raw data toy.dicom.raw ()
new.raw.data <- dicom.set.tag.value (toy.dicom.raw (),
tag = c ("(0010,0010)", "(0010,0020)"),
tag.value = c ("unknown", "000001"))
# change control
data <- dicom.parser (new.raw.data)
data[data$TAG %in% c ("(0010,0010)", "(0010,0020)"), ]
# save data in a the new file
#############################
# new.file.name <- "new.dcm"
# zz <- file (new.file.name, "wb")
# writeBin (new.raw.data , zz, size = 1)
# close (zz)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.