dbdicom.Record.series#
- Record.series(sort=True, sortby=['PatientName', 'StudyDescription', 'SeriesNumber'], **kwargs) list [source]#
Return a list of series under the record.
If the record is a study, this returns the record’s children. If it is a patient, this returns a list the record’s grand children.
- 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’, ‘SeriesNumber’].
kwargs (keyword arguments, optional) – Set any number of valid DICOM (tag, value) pairs as keywords to filer the list. The result will only contain series with the appropriate values
- Returns:
A list of dbdicom Series objects.
- Return type:
Example
Find all series in a database, and print their labels:
>>> database = db.database_hollywood() >>> series_list = database.series() >>> print([s.label() for s in series_list]) ['Series 001 [Localizer]', 'Series 002 [T2w]', 'Series 001 [Chest]', 'Series 002 [Head]', 'Series 001 [Localizer]', 'Series 002 [T2w]', 'Series 001 [Chest]', 'Series 002 [Head]']
Find all series with a given SeriesDescription:
>>> series_list = database.series(SeriesDescription='Chest') >>> print([s.label() for s in series_list]) ['Series 001 [Chest]', 'Series 001 [Chest]']
Find all series with a given SeriesDescription of a given Patient:
>>> series_list = database.series(SeriesDescription='Chest', PatientName='James Bond') >>> print([s.label() for s in series_list]) ['Series 001 [Chest]']