Working with Exams and Series
In Agora the typical data hierarchy is:
Patient → Exam (Study) → Series → Dataset → Datafile
Exams
Get an exam by ID
exam = agora.get_exam(12)
Get all exams
exams = agora.get_exam_list()
Get an exam by UID (DICOM Study Instance UID)
exam = agora.get_exam_by_uid(project=2, uid='1.2.840.10008.5.1.4.1.1.4')
Link an exam to a folder
Creates a link — the exam remains in its original location and is also visible in the target folder:
folder = agora.get_folder(10)
exam_item = exam.link_to_folder(folder.id)
Remove the link (does not delete the exam):
exam_item.delete()
Lock and unlock an exam
Locking prevents any further modifications to the exam:
exam.lock()
exam.unlock()
Get relations
relations = exam.relations()
Get all patients
patients = agora.get_patients()
for p in patients:
print(p.name)
Get a patient by ID
patient = agora.get_patient(15)
Series
Get all series of an exam
series_list = exam.get_series()
for s in series_list:
print(f'Series: {s.name}')
Get a series by ID
series = agora.get_series(76)
Get a series by UID
series = agora.get_series_by_uid(project=2, uid='1.2.840.10008.5.1.4.1.1.4.1')
Get all datasets of a series
datasets = series.get_datasets()
Get relations of a series
relations = series.relations()
Get all datasets of an exam (shortcut)
datasets = exam.get_datasets()
Search
Search for series by a free-text string:
results = agora.search_series('knee')
for s in results:
print(s.name)