Dataset Writing (pydicom.filewriter)

Functions for writing DICOM datasets to file-likes.

correct_ambiguous_vr(ds, is_little_endian) Iterate through ds correcting ambiguous VR elements (if possible).
correct_ambiguous_vr_element(elem, ds, …) Attempt to correct the ambiguous VR element elem.
dcmwrite(filename, dataset[, …]) Write dataset to the filename specified.
multi_string(val) Put a string together with delimiter if has more than one value
write_ATvalue(fp, data_element) Write a data_element tag to a file.
write_DA(fp, data_element)
write_dataset(fp, dataset[, parent_encoding]) Write a Dataset dictionary to the file.
write_data_element(fp, data_element[, encodings]) Write the data_element to file fp according to dicom media storage rules.
write_DT(fp, data_element)
write_file_meta_info(fp, file_meta[, …]) Write the File Meta Information elements in file_meta to fp.
write_numbers(fp, data_element, struct_format) Write a “value” of type struct_format from the dicom file.
write_number_string(fp, data_element) Handle IS or DS VR - write a number stored as a string of digits.
write_OBvalue(fp, data_element) Write a data_element with VR of ‘other byte’ (OB).
write_OWvalue(fp, data_element) Write a data_element with VR of ‘other word’ (OW).
write_PN(fp, data_element[, encodings])
write_sequence(fp, data_element, encodings) Write a sequence contained in data_element to the file-like fp.
write_sequence_item(fp, dataset, encodings) Write a dataset in a sequence to the file-like fp.
write_string(fp, data_element[, padding]) Write a single or multivalued ASCII string.
write_text(fp, data_element[, encodings]) Write a single or multivalued text string.
write_TM(fp, data_element)
write_UI(fp, data_element) Write a data_element with VR of ‘unique identifier’ (UI).
write_UN(fp, data_element) Write a byte string for an DataElement of value ‘UN’ (unknown).