9. Database Search¶
9.1. Quick Search¶
By typing a search string in the quick search field in the main menu bar, you can search for Projects, Patients, Studies, Series, Datasets, Tags, and Tasks. Searches can be performed in the current project only or in all projects. Quick search will not find data in projects you are not member of. The results are displayed on a separate result page.
Quick search will search in the names and descriptions of the individual objects. Additionally you can search for file extensions and dataset types:
test
Will find all objects with the word “test” in name/description
Philips Raw
Will find all Philips raw datasets
.rec
Will find all files which have the “.rec” extension (Philips par/rec datasets)
brain .raw
Will find all raw datasets with the word brain in the name/description
GYRO30
Will find studies measured on the scanner GYRO30
9.2. Database Queries¶
The Database Queries view gives access to the Agora Query Language (AQL) — a structured query language for searching studies, series, datasets, and their parameters with precise conditions. Navigate to the Search and Queries view to open the query editor.
9.2.1. Basic Syntax¶
A query consists of one or more conditions combined with logical operators:
field OPERATOR value
condition AND condition
condition OR condition
NOT condition
(condition OR condition) AND condition
Conditions can be grouped with parentheses. NOT has higher precedence than AND and OR.
9.2.2. Fields¶
Fields are written as object.attribute. The following objects are available:
Object |
Example fields |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
9.2.3. Comparison Operators¶
Operator |
Meaning |
|---|---|
|
Case-insensitive equality (strings); exact match (numbers and dates) |
|
Case-sensitive exact equality |
|
Case-insensitive substring match (contains) |
|
Regular expression match |
|
Greater than / greater than or equal |
|
Less than / less than or equal |
9.2.4. Values¶
Strings — enclosed in double quotes:
"brain"Numbers — integer or decimal:
128,3.14Dates — in
dd/mm/yyyyformat:15/03/2025Booleans —
trueorfalseDataset type constants — e.g.
DATASET_PHILIPS_PARREC,DATASET_DICOM,DATASET_NIFTI1
9.2.5. Date Fields¶
Date and time fields support sub-field extraction using dot notation:
exam.start_time.year = 2024
exam.start_time.month = 3
exam.start_time.day = 15
9.2.6. Count Queries¶
You can filter by the number of child objects using _count:
exam.series_count >= 3
series.dataset_count = 10
patient.exam_count > 5
9.2.7. Parameter Queries¶
Parameters are scalar values attached to datasets (e.g. MR acquisition parameters). Search them using the parameter. prefix:
parameter.ParameterName OPERATOR value
If the parameter name contains dots, enclose it in double quotes:
parameter."Param.With.Dots" = 42
Use the ? operator to check whether a parameter exists on a dataset:
parameter.FlipAngle ? true -- dataset has a FlipAngle parameter
parameter.FlipAngle ? false -- dataset does NOT have a FlipAngle parameter
9.2.8. Examples¶
Find studies by name:
exam.name = "brain"
Find studies on a specific scanner:
exam.scanner_name = "GYRO3T"
Find studies acquired in a specific year:
exam.start_time.year = 2024
Find studies acquired after a date:
exam.start_time > 01/01/2024
Find datasets of a specific type:
dataset.type = DATASET_DICOM
Find datasets whose filename matches a pattern:
datafile.original_filename ~~ "sub-[0-9]+_T1w"
Find datasets with a parameter value in a range:
parameter.FlipAngle >= 5 AND parameter.FlipAngle <= 15
Find studies with a specific patient name and at least two series:
patient.name = "Doe" AND exam.series_count >= 2
Combine OR and AND with grouping:
(exam.name ~ "brain" OR exam.name ~ "head") AND exam.start_time.year = 2024
Check parameter existence:
parameter.FlipAngle ? true AND parameter.RepetitionTime > 1000
9.2.9. Saved Queries¶
Queries can be saved and reused. Click Save in the query editor to store the current query under a name. Saved queries appear in the Queries list and can be attached to a folder in the project — any time you open that folder the query runs automatically and shows matching results alongside the folder contents.