dbdicom.Record.move_to#

Record.move_to(parent)[source]#

Move the record to another parent.

Parameters:

parent – parent where the record will be moved to.

Example

Create a database with two studies and a single series in one:

>>> demo = db.series(SeriesDescription='!!WATCH ME MOVE!!')
>>> test = demo.new_pibling(StudyDescription='Test')
>>> series.patient().print()
---------- PATIENT -------------
Patient New Patient
    Study New Study [None]
        Series 001 [!!WATCH ME MOVE!!]
            Nr of instances: 0
Study Test [None]
--------------------------------

Now move the series to the other study:

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