Project Class

Documentation of the Project class.

class qmenta.client.Project(account: <module 'qmenta.client.Account' from '/home/deploy/jenkins/workspace/mintapi_master/src/qmenta/client/Account.py'>, project_id, max_upload_retries=5)

This class is used to work with QMENTA projects. The class is instantiated passing as argument a Connection object and the id

Parameters
  • account (qmenta.client.Account) – A QMENTA Account instance

  • project_id (Int or string) – The ID (or name) of the project you want to work with

calculate_qc_statistics()

Calculate comprehensive statistics from multiple QC results across subjects from a project in the QMENTA platform.

This function aggregates and analyzes QC results from multiple subjects/containers, providing statistical insights about rule pass/fail rates, file statistics, and condition failure patterns.

Returns

A dictionary containing comprehensive QC statistics including:
  • passed_rules: Total count of passed rules across all subjects

  • failed_rules: Total count of failed rules across all subjects

  • subjects_passed: Count of subjects with no failed rules

  • subjects_with_failed: Count of subjects with at least one failed rule

  • num_passed_files_distribution: Distribution of how many rules have N passed files

  • file_stats: File-level statistics (total, passed, failed, pass percentage)

  • condition_failure_rates: Frequency and percentage of each failed condition

  • rule_success_rates: Success rates for each rule type

Return type

dict

The statistics help identify:
  • Overall QC pass rates

  • Most common failure conditions

  • Rule-specific success rates

  • Distribution of passed files per rule

  • Subject-level pass rates

Example

>>> project.calculate_qc_statistics()
{
    "passed_rules": 42,
    "failed_rules": 8,
    "subjects_passed": 15,
    "subjects_with_failed": 5,
    "num_passed_files_distribution": {
        "1": 30,
        "2": 12
    },
    "file_stats": {
        "total": 50,
        "passed": 45,
        "failed": 5,
        "pass_percentage": 90.0
    },
    "condition_failure_rates": {
        "SliceThickness": {
            "count": 5,
            "percentage": 62.5
        }
    },
    "rule_success_rates": {
        "T1": {
            "passed": 20,
            "failed": 2,
            "success_rate": 90.91
        }
    }
}
change_file_metadata(container_id, filename, modality, tags)

Change modality and tags of filename in container_id

Parameters
  • container_id (int) – Container identifier.

  • filename (str) – Name of the file to be edited.

  • modality (str or None) – Modality identifier, or None if the file shouldn’t have any modality

  • tags (list[str] or None) – List of tags, or None if the filename shouldn’t have any tags

change_subject_metadata(patient_id, subject_name, ssid, tags, age_at_scan, metadata)

Change the Subject ID, Session ID, Tags, Age at Scan and Metadata of the session with Patient ID

Parameters
  • patient_id (Integer) – Patient ID representing the session to modify.

  • subject_name (String) – Represents the new Subject ID.

  • ssid (String) – Represents the new Session ID.

  • tags (list of strings in lowercase) – Represents the new tags of the session.

  • age_at_scan (Integer) – Represents the new Age at Scan of the Session.

  • metadata (Dictionary) –

    Each pair key/value representing the new metadata values.

    The keys must either all start with “md_” or none start with “md_”.

    The key represents the ID of the metadata field.

Returns

True if correctly modified, False otherwise

Return type

bool

check_subject_name(subject_name)

Check if a given subject name (Subject ID) exists in the selected project.

Parameters

subject_name (str) – Subject ID of the subject to check

Returns

True if subject name exists in project, False otherwise

Return type

bool

copy_container_to_project(container_id, project_id)

Copy a container to another project.

Parameters
  • container_id (int) – ID of the container to copy.

  • project_id (int or str) – ID of the project to retrieve, either the numeric ID or the name

Returns

True on success, False on fail

Return type

bool

delete_analysis(analysis_id)

Delete an analysis

Parameters

analysis_id (Int) – id of the analysis to be deleted

delete_session(subject_name, session_id)

Delete a session from a subject within a project providing the Subject ID and Session ID.

Parameters
  • subject_name (str) – Subject ID of the subject

  • session_id (int) – The Session ID of the session that will be deleted

Returns

True if correctly deleted, False otherwise.

Return type

bool

delete_session_by_patientid(patient_id)

Delete a session from a subject within a project providing the Patient ID.

Parameters

patient_id (str) – Patient ID of the Session ID/Subject ID

Returns

True if correctly deleted, False otherwise.

Return type

bool

delete_subject(subject_name)

Delete a subject from the project. It deletes all its available sessions only providing the Subject ID.

Parameters

subject_name (str) – Subject ID of the subject to be deleted.

Returns

True if correctly deleted, False otherwise.

Return type

bool

download_file(container_id, file_name, local_filename=False, overwrite=False)

Download a single file from a specific container.

Parameters
  • container_id (str) – ID of the container inside which the file is.

  • file_name (str) – Name of the file in the container.

  • local_filename (str) – Name of the file to be created. By default, the same as file_name.

  • overwrite (bool) – Whether to overwrite the file if existing.

download_files(container_id, filenames, zip_name='files.zip', overwrite=False)

Download a set of files from a given container.

Parameters
  • container_id (int) – ID of the container inside which the file is.

  • filenames (list[str]) – List of files to download.

  • overwrite (bool) – Whether to overwrite the file if existing.

  • zip_name (str) – Name of the zip where the downloaded files are stored.

get_analysis(analysis_name_or_id)

Returns the analysis corresponding with the analysis id or analysis name

Parameters

analysis_name_or_id (int, str) – analysis_id or analysis name to search for

Returns

analysis – A dictionary containing the analysis information

Return type

dict

get_analysis_log(analysis_id, file_name=None)

Get the log of an analysis and save it in the provided file. The logs of analysis can only be obtained for the tools you created.

Note workflows do not have a log so the printed message will only be ERROR. You can only download the anlaysis log of the tools that you own.

Note this method is very time consuming.

Parameters
  • analysis_id (int) – ID of the script to be run.

  • file_name (str) – Path to the file where to export the log. If None the file will be: f’logs_{analysis_id}.txt’

Returns

File name of the exported file if the export is possible. False otherwise.

Return type

str or bool

get_file_metadata(container_id, filename)

Retrieve the metadata from a particular file in a particular container.

Parameters
  • container_id (str) – Container identifier.

  • filename (str) – Name of the file.

Returns

Dictionary with the metadata. False otherwise.

Return type

dict

get_project_pa_rules(rules_file_path)

Retrive the active project’s protocol adherence rules

Parameters

rules_file_path (str) – The file path to the JSON file to store the protocol adherence rules.

Returns

guidance_text – Description of the protocol adherence rules, False if extraction of the protocol adhernece rules is not possible.

Return type

str

get_qc_status_analysis(analysis_id)

Gets the QC status of an anlaysis provided its Analysis ID.

Parameters

analysis_id (int) – Analysis ID number

Returns

  • status (QCStatus or False) – QCStatus.PASS, QCStatus.FAIL or QCStatus.UNDETERMINED False if the status cannot be extracted.

  • comments (str or False) – Comments defined in the QC Status. False if the comments cannot be extracted.

get_qc_status_subject(patient_id=None, subject_name=None, ssid=None)

Gets the session QC status via the patient ID or the Subject ID and the Session ID.

Parameters
  • patient_id (int) – Patient ID number of the session

  • subject_name (string) – Subject ID of the session

  • ssid (string) – Session ID

Returns

  • status (QCStatus or False) – QCStatus.PASS, QCStatus.FAIL or QCStatus.UNDETERMINED False if the status cannot be extracted.

  • comments (str or False) – Comments defined in the QC Status. False if the comments cannot be extracted.

get_subject_container_id(subject_name, ssid)

Given a Subject ID and Session ID, return its Container ID.

Parameters
  • subject_name (str) – Subject ID of the subject in the project.

  • ssid (str) – Session ID of the subject in the project.

Returns

The Container ID of the subject in the project, or False if the subject is not found.

Return type

int or bool

get_subject_id(subject_name, ssid)

Given a Subject ID and Session ID, return its Patient ID in the project.

Parameters
  • subject_name (str) – Subject ID of the subject in the project.

  • ssid (str) – Session ID of the subject in the project.

Returns

The ID of the subject in the project, or False if the subject is not found.

Return type

int or bool

get_subjects_files_metadata(search_criteria={}, items=(0, 9999))
List all Subject ID/Session ID from the selected project that meet the

defined search criteria at a file level.

Note, albeit the search criteria is similar to the one defined in

method ‘get_subjects_metadata()’ (see differences below), the output is different as this method provides the sessions which have a file that satisfy all the conditions of the search criteria. This method is slow.

Parameters
  • search_criteria (dict) – Each element is a string and is built using the formatting “type;value”, or “type;operation|value”

  • Explanation (Complete search_criteria Dictionary) –

  • { (search_criteria =) – “pars_patient_secret_name”: “string;SUBJECTID”, “pars_ssid”: “integer;OPERATOR|SSID”, “pars_modalities”: “string;MODALITY”, “pars_tags”: “tags;TAGS”, “pars_age_at_scan”: “integer;OPERATOR|AGE_AT_SCAN”, “pars_[dicom]_KEY”: “KEYTYPE;KEYVALUE”, “pars_PROJECTMETADATA”: “METADATATYPE;METADATAVALUE”, }

  • Where

  • "pars_patient_secret_name" (Applies the search to the 'Subject ID'.) –

  • strings. (SUBJECTID is a comma separated list of) –

  • "pars_ssid" (Applies the search to the 'Session ID'.) –

  • integer. (AGE_AT_SCAN is an) –

  • of (METADATATYPE is the type of the metadata field. One) –

    • Equal: eq

    • Different Than: ne

    • Greater Than: gt

    • Greater/Equal To: gte

    • Lower Than: lt

    • Lower/Equal To: lte

  • "pars_modalities" (Applies the search to the file 'Modalities') – available within each Subject ID.

  • string. (MODALITY is a) –

  • "pars_tags" (Applies only the search to the file 'Tags' available) – within each Subject ID.

  • in (TAGS is a comma separated list of strings. All tags must be present) – the same file.

  • "pars_age_at_scan" (Applies the search to the 'age_at_scan' metadata) – field.

  • integer.

  • "pars_[dicom]_KEY" (Applies the search to the metadata fields) – available within each file. KEY must be one of the

  • given (metadata keys of the files. The full list of KEYS for a) – file is shown in the QMENTA Platform within the File Information of such File.

  • of

    • integer

    • decimal

    • string

    • list

    if ‘integer’ or ‘decimal’ you must also include an OPERATOR

    (i.e., “integer;OPERATOR|KEYVALUE”).

    if ‘list’ the KEYVALUE should be a semicolon separated list of

    values. (i.e., “list;KEYVALUE1;KEYVALUE2;KEYVALUE3) KEYVALUEs must be strings.

  • KEY. (KEYVALUE is the expected value of the) –

  • "pars_[dicom]_PROJECTMETADATA" (Applies to the metadata defined) – within the ‘Metadata Manager’ of the project.

  • field. (PROJECTMETADATA is the ID of the metadata) –

  • of

    • string

    • integer

    • list

    • decimal

    • single_option

    • multiple_option

    if ‘integer’ or ‘decimal’ you must also include an OPERATOR

    (i.e., “integer;OPERATOR|METADATAVALUE”).

  • metadata. (KEYVALUE is the expected value of the) –

  • Example (2)) –

  • { – “pars_patient_secret_name”: “string;abide”, “pars_ssid”: “integer;eq|2”

  • }

  • Example

  • { – “pars_patient_secret_name”: “string;001” “pars_modalities”: “string;T2”, “pars_tags”: “tags;flair”, “pars_[dicom]_Manufacturer”: “string;ge”, “pars_[dicom]_FlipAngle”: “integer;gt|5”, “pars_[dicom]_ImageType”: “list;PRIMARY;SECONDARY”,

  • }

  • metadata (Note the search criteria might apply to both the files) – information available within a session and the metadata of the session. And the method provides a session only if all the file related conditions are satisfied within the same file. In example 2) above, it means that the output will contain any session whose Subject ID contains ‘001’, and there is a file with modality ‘T2’, tag ‘flair’, FlipAngle greater than 5º, and ImageType with both values PRIMARY and SECONDARY. Further, the acquisition had to be performed in a Manufacturer containing ‘ge’.

Returns

A list of dictionary of {“metadata_name”: “metadata_value”}

Return type

dict

get_subjects_metadata(search_criteria={}, items=(0, 9999))
List all Subject ID/Session ID from the selected project that meet the

defined search criteria at a session level.

Parameters
  • search_criteria (dict) – Each element is a string and is built using the formatting “type;value”, or “type;operation|value”

  • Explanation (Complete search_criteria Dictionary) –

  • { (search_criteria =) – “pars_patient_secret_name”: “string;SUBJECTID”, “pars_ssid”: “integer;OPERATOR|SSID”, “pars_modalities”: “string;MODALITY”, “pars_tags”: “tags;TAGS”, “pars_age_at_scan”: “integer;OPERATOR|AGE_AT_SCAN”, “pars_[dicom]_KEY”: “KEYTYPE;KEYVALUE”, “pars_PROJECTMETADATA”: “METADATATYPE;METADATAVALUE”, }

  • Where

  • "pars_patient_secret_name" (Applies the search to the 'Subject ID'.) –

  • strings. (SUBJECTID is a comma separated list of) –

  • "pars_ssid" (Applies the search to the 'Session ID'.) –

  • integer. (AGE_AT_SCAN is an) –

  • of (METADATATYPE is the type of the metadata field. One) –

    • Equal: eq

    • Different Than: ne

    • Greater Than: gt

    • Greater/Equal To: gte

    • Lower Than: lt

    • Lower/Equal To: lte

  • "pars_modalities" (Applies the search to the file 'Modalities') – available within each Subject ID.

  • as (TAGS is a comma separated list of strings. A session is provided) – long as one MODALITY is available.

  • "pars_tags" (Applies the search to the file 'Tags' available within) – each Subject ID and to the subject-level ‘Tags’.

  • as – long as one tag is available.

  • "pars_age_at_scan" (Applies the search to the 'age_at_scan' metadata) – field.

  • integer.

  • "pars_[dicom]_KEY" (Applies the search to the metadata fields) – available within each file. KEY must be one of the metadata keys of the files. The full list of KEYS for a given file is shown in the QMENTA Platform within the File Information of such File.

  • of

    • integer

    • decimal

    • string

    • list

    if ‘integer’ or ‘decimal’ you must also include an OPERATOR

    (i.e., “integer;OPERATOR|KEYVALUE”).

    if ‘list’ the KEYVALUE should be a semicolon separated list of

    values. (i.e., “list;KEYVALUE1;KEYVALUE2;KEYVALUE3) KEYVALUEs must be strings.

  • KEY. (KEYVALUE is the expected value of the) –

  • "pars_[dicom]_PROJECTMETADATA" (Applies to the metadata defined) – within the ‘Metadata Manager’ of the project.

  • field. (PROJECTMETADATA is the ID of the metadata) –

  • of

    • string

    • integer

    • list

    • decimal

    • single_option

    • multiple_option

    if ‘integer’ or ‘decimal’ you must also include an OPERATOR

    (i.e., “integer;OPERATOR|METADATAVALUE”).

  • metadata. (KEYVALUE is the expected value of the) –

  • Example (2)) –

  • { – “pars_patient_secret_name”: “string;abide”, “pars_ssid”: “integer;eq|2”

  • }

  • Example

  • { – “pars_modalities”: “string;T1”, “pars_tags”: “tags;flair”, “pars_[dicom]_Manufacturer”: “string;ge”, “pars_[dicom]_FlipAngle”: “integer;gt|5”, “pars_[dicom]_ImageType”: “list;PRIMARY;SECONDARY”,

  • }

  • a (Note the search criteria applies to all the files included within) – session. Hence, it does not imply that all the criteria conditions are applied to the same files. In example 2) above, it means that any Subject ID/Session ID that has a file classified with a ‘T1’ modality, a file with a ‘flair’ tag, a file whose Manufacturer contains ‘ge’, a file whose FlipAngle is greater than ‘5º’, and a file with ImageType with any of the values: PRIMARY or SECONDARY will be selected.

Returns

A list of dictionary of {“metadata_name”: “metadata_value”}

Return type

dict

list_analysis(search_condition={}, items=(0, 9999))

List the analysis available to the user.

Examples

>>> search_condition = {
    "secret_name":"014_S_6920",
    "from_d": "06.02.2025",
    "with_child_analysis": 1,
    "state": "completed"
}
    list_analysis(search_condition=search_condition)
Note the keys not needed for the search do not have to be included in

the search condition.

Parameters
  • search_condition (dict) –

    • p_n: str or None Analysis name

    • type: str or None Type (analysis_code:analysis_version).

    • analysis_code: str or None Type

    • from_d: str or None dd.mm.yyyy Date from

    • to_d: str or None dd.mm.yyyy Date to

    • qa_status: str or None pass/fail/nd QC status

    • secret_name: str or None Subject ID

    • tags: str or None

    • with_child_analysis: 1 or None if 1, child analysis of workflows will appear

    • id: int or None ID

    • state: running, completed, pending, exception or None

    • username: str or None

  • items (List[int]) – list containing two elements [min, max] that correspond to the mininum and maximum range of analysis listed

Returns

List of analysis, each a dictionary

Return type

dict

list_container_files(container_id)

List the name of the files available inside a given container. :param container_id: Container identifier. :type container_id: str or int

Returns

List of file names (strings)

Return type

list[str]

list_container_files_metadata(container_id)

List all the metadata of the files available inside a given container.

Parameters

container_id (str) – Container identifier.

Returns

Dictionary of {“metadata_name”: “metadata_value”}

Return type

dict

list_container_filter_files(container_id, modality='', metadata_info={}, tags=[])

List the name of the files available inside a given container. search condition example: “metadata”: {“SliceThickness”:1}, } :param container_id: Container identifier. :type container_id: str or int :param modality: String containing the modality of the files being filtered :type modality: str :param metadata_info: Dictionary containing the file metadata of the files being filtered :type metadata_info: dict :param tags: List of strings containing the tags of the files being filtered :type tags: list[str]

Returns

selected_files – List of file names (strings)

Return type

list[str]

list_input_containers(search_criteria={}, items=(0, 9999))

Retrieve the list of input containers available to the user under a certain search criteria.

Parameters
  • search_criteria (dict) – Each element is a string and is built using the formatting

  • "type;value".

  • keys (List of possible) –

  • d_n (container_name # TODO: WHAT IS THIS???) –

  • s_n (subject_id) – Subject ID of the subject in the platform.

  • ssid (session_id) – Session ID of the subejct in the platform.

  • from_d (from date) – Starting date in which perform the search. Format: DD.MM.YYYY

  • to_d (to date) – End date in which perform the search. Format: DD.MM.YYYY

  • sets (data sets (modalities) # TODO: WHAT IS THIS???) –

  • items (Tuple(int, int)) – Starting and ending element of the search.

Returns

  • dict

  • List of containers, each a dictionary containing the following

  • information – {“container_name”, “container_id”, “patient_secret_name”, “ssid”}

list_result_containers(search_condition={}, items=(0, 9999))

List the result containers available to the user. .. rubric:: Examples

>>> search_condition = {
    "secret_name":"014_S_6920",
    "from_d": "06.02.2025",
    "with_child_analysis": 1,
    "state": "completed"
}
    list_result_containers(search_condition=search_condition)
Note the keys not needed for the search do not have to be included in

the search condition.

Parameters
  • search_condition (dict) –

    • p_n: str or None Analysis name

    • type: str or None Type (analysis_code:analysis_version).

    • analysis_code: str or None Type

    • from_d: str or None dd.mm.yyyy Date from

    • to_d: str or None dd.mm.yyyy Date to

    • qa_status: str or None pass/fail/nd QC status

    • secret_name: str or None Subject ID

    • tags: str or None

    • with_child_analysis: 1 or None if 1, child analysis of workflows will appear

    • id: str or None ID

    • state: running, completed, pending, exception or None

    • username: str or None

  • items (List[int]) – list containing two elements [min, max] that correspond to the mininum and maximum range of analysis listed

Returns

List of containers, each a dictionary {“name”: “container-name”, “id”: “container_id”} if “id”: None, that analysis did not had an output container, probably it is a workflow

Return type

dict

property metadata_parameters

List all the parameters in the subject-level metadata.

Each project has a set of parameters that define the subjects-level metadata. This function returns all these parameters and its properties. New subject-level metadata parameters can be creted in the QMENTA Platform via the Metadata Manager. The API only allow modification of these subject-level metadata parameters via the ‘change_subject_metadata()’ method.

Returns

dictionary {“param_name”:

{ “order”: Int, “tags”: [tag1, tag2, …, ], “title: “Title”, “type”: “integer|string|date|list|decimal”, “visible”: 0|1 }}

Return type

dict[str] -> dict[str] -> x

parse_qc_text(patient_id=None, subject_name=None, ssid=None)

Parse QC (Quality Control) text output into a structured dictionary format.

This function takes raw QC text output (typically from medical imaging quality checks) and parses it into a structured format that separates passed and failed rules, along with their associated files and conditions.

Parameters
  • patient_id (str, optional) – Patient identifier. Defaults to None.

  • subject_name (str, optional) – Subject/patient name. Defaults to None. Mandatory if no patient_id is provided.

  • ssid (str, optional) – Session ID. Defaults to None. Mandatory if subject_name is provided.

Returns

A structured dictionary containing a list of dictionaries with passed rules and their details and failed rules and their details. Details of passed rules are: per each rule: Files that have passed the rule. Per each file name of the file and number of conditions of the rule. Details of failed rules are: - Per each rule failed conditions: Number of times it failed. Each condition status.

Return type

dict

Example

>>> parse_qc_text(subject_name="patient_123", ssid=1)
{
    "passed": [
        {
            "rule": "T2",
            "sub_rule": "rule_15T",
            "files": [
                {
                    "file": "path/to/file1",
                    "passed_conditions": 4
                }
            ]
        }
    ],
    "failed": [
        {
            "rule": "T1",
            "files": [
                {
                    "file": "path/to/file2",
                    "conditions": [
                        {
                            "status": "failed",
                            "condition": "SliceThickness between..."
                        }
                    ]
                }
            ],
            "failed_conditions": {
                "SliceThickness between...": 1
            }
        }
    ]
}
restart_analysis(analysis_id)

Restart an analysis. Only worklows can be restarted, the finished tools within the workflow will be kept and the missing ones (which probably previously failed) will start. This process maintains the flow of the workflow.

Tools can not be restarted given that they are considered as single processing units. You can start execution of another analysis instead.

For the workflow to restart, all its failed child must be removed first. You can only restart your own analysis.

Parameters

analysis_id (Int) – id of the analysis to be restarted

set_project_pa_rules(rules_file_path, guidance_text='')

Updates the active project’s protocol adherence rules using the provided rules file.

Parameters
  • rules_file_path (str) –

    The file path to the JSON file containing the protocol

    adherence rules.

  • guidance_text (str) – Description of the protocol adherence rules.

Returns

  • bool (True if the protocol adherence rules were set successfully,)

  • False otherwise.

set_qc_status_analysis(analysis_id, status=QCStatus.UNDERTERMINED, comments='')

Changes the analysis QC status.

Parameters
  • analysis_id (int) – Analysis ID number

  • status (QCStatus) – QCStatus.PASS, QCStatus.FAIL or QCStatus.UNDETERMINED

  • comments (str, optional) – Additional comments explaining why the reasoning of setting the QC status to such state.

Returns

True if the QC status was correctly changed, False otherwise.

Return type

bool

set_qc_status_subject(patient_id, status=QCStatus.UNDERTERMINED, comments='')

Changes the QC status of a Patient ID (equivalent to a Subject ID/Session ID).

Parameters
  • patient_id (int) – Patient ID number of the session.

  • status (QCStatus) – QCStatus.PASS, QCStatus.FAIL or QCStatus.UNDETERMINED

  • comments (str, optional) – Additional comments explaining why the reasoning of setting the QC status to such state.

Returns

True if the QC status was correctly changed, False otherwise.

Return type

bool

start_analysis(script_name, version, in_container_id=None, analysis_name=None, analysis_description=None, ignore_warnings=False, settings=None, tags=None, preferred_destination=None, ignore_file_selection=True)

Starts an analysis on a subject.

Parameters
  • script_name (str) – ID of the script to be run.

  • version (str) – Version of the script to be run, examples: 1.0, 5.3.4

  • in_container_id (int or dict) – The ID of the container to get the data from, or a dictionary with one or more container names as keys, and IDs as values. Input container names are generally prefixed with “input_”. If not, the prefix will be automatically added.

  • analysis_name (str) – Name of the analysis (optional)

  • analysis_description (str) – Description of the analysis (optional)

  • ignore_warnings (bool) – If False, warnings by server cause failure.

  • settings (dict) – The input settings used to run the analysis. Use either settings or in_container_id. Input specification in the settings dict can be done by using the key “input”.

  • tags (list[str]) – The tags of the analysis.

  • preferred_destination (str) – The machine on which to run the analysis

  • ignore_file_selection (Bool) – When the file filter of the analysis is satified by multiple files. False if you want to select manually the file to input to the analysis. True otherwise and the analysis will cancelled.

Returns

The analysis ID if correctly started, None otherwise.

Return type

int

property subjects

Return the list of subject names (Subject ID) from the selected project.

Returns

a list of subject names

Return type

List(Strings)

property subjects_metadata

List all subject data from the selected project.

Returns

A list of dictionary of {“metadata_name”: “metadata_value”}

Return type

dict

upload_file(file_path, subject_name, ssid='', date_of_scan='', description='', result=False, name='', input_data_type='qmenta_medical_image_data:3.10', add_to_container_id=0, chunk_size=512, split_data=False)

Upload a ZIP file to the platform.

Parameters
  • file_path (str) – Path to the ZIP file to upload.

  • subject_name (str) – Subject ID of the data to upload in the project in QMENTA Platform.

  • ssid (str) – Session ID of the Subject ID (i.e., ID of the timepoint).

  • date_of_scan (str) – Date of scan/creation of the file

  • description (str) – Description of the file

  • result (bool) – If result=True then the upload will be taken as an offline analysis

  • name (str) – Name of the file in the platform

  • input_data_type (str) – qmenta_medical_image_data:3.11

  • add_to_container_id (int) – ID of the container to which this file should be added (if id > 0)

  • chunk_size (int) – Size in kB of each chunk. Should be expressed as a power of 2: 2**x. Default value of x is 9 (chunk_size = 512 kB)

  • split_data (bool) – If True, the platform will try to split the uploaded file into different sessions. It will be ignored when the ssid is given.

Returns

True if correctly uploaded, False otherwise.

Return type

bool

upload_gametection(file_path, subject_name)

Upload new Gametection data to the subject.

Parameters
  • file_path (str) – Path to the file to upload

  • subject_name (str) –

Returns

True if upload was correctly done, False otherwise.

Return type

bool

upload_mri(file_path, subject_name)

Upload new MRI data to the subject.

Parameters
  • file_path (str) – Path to the file to upload

  • subject_name (str) –

Returns

True if upload was correctly done, False otherwise.

Return type

bool

upload_result(file_path, subject_name)

Upload new result data to the subject.

Parameters
  • file_path (str) – Path to the file to upload

  • subject_name (str) –

Returns

True if upload was correctly done, False otherwise.

Return type

bool