Filtering
pyorthanc.find(orthanc, patient_filter=None, study_filter=None, series_filter=None, instance_filter=None)
Find desired patients/Study/Series/Instance in an Orthanc server
This function builds a series of tree structure. Each tree correspond to a patient. The layers in the tree correspond to:
Patient -> Studies -> Series -> Instances
Parameters:
Name | Type | Description | Default |
---|---|---|---|
orthanc |
Union[Orthanc, AsyncOrthanc]
|
Orthanc object. |
required |
patient_filter |
Optional[Callable]
|
Patient filter (e.g. lambda patient: patient.id_ == '03HDQ99*') |
None
|
study_filter |
Optional[Callable]
|
Study filter (e.g. lambda study: study.study_id == 'pros') |
None
|
series_filter |
Optional[Callable]
|
Series filter (e.g. lambda series: series.modality == 'SR') |
None
|
instance_filter |
Optional[Callable]
|
Instance filter (e.g. lambda instance: instance.SOPInstance == '...') |
None
|
Returns:
Type | Description |
---|---|
List[Patient]
|
List of patients that respect . |
Source code in pyorthanc/_filtering.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
|
pyorthanc.trim_patients(patients)
Trim Patient forest (list of patients)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
patients |
List[Patient]
|
Patient forest. |
required |
Returns:
Type | Description |
---|---|
List[Patient]
|
Pruned patient forest. |
Source code in pyorthanc/_filtering.py
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 |
|