dbdicom.Record.studies#
- Record.studies(sort=True, sortby=['PatientName', 'StudyDescription'], **kwargs) list [source]#
Return a list of studies under the record.
If the record is a patient, this returns the record’s children. If it is a series, this returns the parent study.
- Parameters:
sort (bool, optional) – Set to False to return an unsorted list (faster). Defaults to True.
sortby (list, optional) – list of DICOM keywords to sort the result. This argument is ignored if sort=False. Defaults to [‘PatientName’, ‘StudyDescription’].
kwargs (keyword arguments, optional) – Set any number of valid DICOM (tag, value) pairs as keywords to filer the list. The result will only contain studies with the appropriate values.
- Returns:
A list of dbdicom Study objects.
- Return type:
See also
parent()
children()
siblings()
series()
patients()
database()
Example
Find all studies in a database:
>>> database = db.database_hollywood() >>> studies_list = database.studies() >>> print([s.label() for s in studies_list]) ['Study MRI [19821201]', 'Study Xray [19821205]', 'Study MRI [19850105]', 'Study Xray [19850106]']
Find all studies of a given Patient:
>>> studies_list = database.studies(PatientName='James Bond') >>> print([s.label() for s in studies_list]) ['Study MRI [19821201]', 'Study Xray [19821205]']