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.


Put a string together with delimiter if has more than one value

write_ATvalue(fp, elem)

Write a data_element tag to a file.

write_DA(fp, elem)

write_dataset(fp, dataset[, parent_encoding])

Write a Dataset dictionary to the file.

write_data_element(fp, elem[, encodings])

Write the data_element to file fp according to dicom media storage rules.

write_DT(fp, elem)

write_file_meta_info(fp, file_meta[, ...])

Write the File Meta Information elements in file_meta to fp.

write_numbers(fp, elem, struct_format)

Write a "value" of type struct_format from the dicom file.

write_number_string(fp, elem)

Handle IS or DS VR - write a number stored as a string of digits.

write_OBvalue(fp, elem)

Write a data_element with VR of 'other byte' (OB).

write_OWvalue(fp, elem)

Write a data_element with VR of 'other word' (OW).

write_PN(fp, elem[, encodings])

write_sequence(fp, elem, 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, elem[, padding])

Write a single or multivalued ASCII string.

write_text(fp, elem[, encodings])

Write a single or multivalued text string.

write_TM(fp, elem)

write_UI(fp, elem)

Write a data_element with VR of 'unique identifier' (UI).

write_UN(fp, elem)

Write a byte string for an DataElement of value 'UN' (unknown).