dbdicom.Record.copy_to#

Record.copy_to(parent, **kwargs)[source]#

Return a copy of the record under another parent.

Parameters:
  • parent – parent where the copy will be placed.

  • kwargs (optional) – Any valid DICOM (tag, value) pair can be assigned up front as properties of the copy.

Returns:

copy of the same type.

Return type:

Record

Example

Create a database with a single patient/study/series:

>>> series = db.series(SeriesDescription='Demo')
>>> series.patient().print()
---------- PATIENT -------------
Patient New Patient
    Study New Study [None]
        Series 001 [Demo]
            Nr of instances: 0
--------------------------------

Create a new study Copies under the same patient, and copy the the Demo series into it:

>>> study = series.new_pibling(StudyDescription='Copies')
>>> copy = series.copy_to(study, SeriesDescription='Copy of Demo')

The same patient now has two studies, each with a single series:

>>> series.patient().print()
---------- PATIENT -------------
Patient New Patient
    Study Copies [None]
        Series 001 [Copy of Demo]
            Nr of instances: 0
    Study New Study [None]
        Series 001 [Demo]
            Nr of instances: 0
--------------------------------