populse_mia.data_manager

Module to handle the projects and their database.

Module Attributes

FIELD_TYPE_STRING

Field type for string values (maps to Python str).

FIELD_TYPE_INTEGER

Field type for integer values (maps to Python int).

FIELD_TYPE_FLOAT

Field type for floating-point values (maps to Python float).

FIELD_TYPE_BOOLEAN

Field type for boolean values (maps to Python bool).

FIELD_TYPE_DATE

Field type for date values (maps to datetime.date).

FIELD_TYPE_DATETIME

Field type for datetime values (maps to datetime.datetime).

FIELD_TYPE_TIME

Field type for time values (maps to datetime.time).

FIELD_TYPE_JSON

Field type for JSON objects (maps to Python dict).

FIELD_TYPE_LIST_STRING

Field type for lists of string values (maps to list of str).

FIELD_TYPE_LIST_INTEGER

Field type for lists of integer values (maps to list of int).

FIELD_TYPE_LIST_FLOAT

Field type for lists of floating-point values (maps to list of float).

FIELD_TYPE_LIST_BOOLEAN

Field type for lists of boolean values (maps to list of bool).

FIELD_TYPE_LIST_DATE

Field type for lists of date values (maps to list of datetime.date).

FIELD_TYPE_LIST_DATETIME

Field type for lists of datetime values (maps to list of datetime.datetime).

FIELD_TYPE_LIST_TIME

Field type for lists of time values (maps to list of datetime.time).

FIELD_TYPE_LIST_JSON

Field type for lists of JSON objects (maps to list of dict).

ALL_TYPES

Set of all supported field types (both scalar and list variants).

FIELD_TYPE_MAPPING

Mapping from V2 string field type names to their corresponding V3 Python types.

TAG_UNIT_MS

Tag unit for milliseconds.

TAG_UNIT_MM

Tag unit for millimetres.

TAG_UNIT_DEGREE

Tag unit for degrees.

TAG_UNIT_HZPIXEL

Tag unit for Hz per pixel.

TAG_UNIT_MHZ

Tag unit for megahertz.

ALL_UNITS

List of all supported tag units.

COLLECTION_CURRENT

Name of the collection storing the current state of the database.

COLLECTION_INITIAL

Name of the collection storing the initial state of the database at import time.

COLLECTION_BRICK

Name of the collection storing brick (pipeline process) records.

COLLECTION_HISTORY

Name of the collection storing the full pipeline execution history.

FIELD_ATTRIBUTES_COLLECTION

Name of the internal collection storing field metadata and attributes.

TAG_ORIGIN_BUILTIN

Tag origin indicating the tag is a built-in MIA tag.

TAG_ORIGIN_USER

Tag origin indicating the tag was created by the user.

TAG_CHECKSUM

Tag name for the file checksum, used to detect file modifications.

TAG_TYPE

Tag name for the document type (e.g. Scan, Matrix, Text).

TAG_EXP_TYPE

Tag name for the experimental type of the document.

TAG_FILENAME

Tag name for the file name of the document.

TAG_BRICKS

Tag name for the list of brick IDs that produced the document.

TAG_HISTORY

Tag name for the full pipeline execution history associated with the document.

CLINICAL_TAGS

Dictionary of clinical tag names and their descriptions.

BRICK_ID

Brick field name for the unique identifier of a brick.

BRICK_NAME

Brick field name for the name of the brick (pipeline process).

BRICK_INPUTS

Brick field name for the list of input parameters of the brick.

BRICK_OUTPUTS

Brick field name for the list of output parameters of the brick.

BRICK_INIT

Brick field name for the initialisation status of the brick.

BRICK_EXEC

Brick field name for the execution status of the brick.

BRICK_INIT_TIME

Brick field name for the timestamp of the brick initialisation.

BRICK_EXEC_TIME

Brick field name for the timestamp of the brick execution.

HISTORY_ID

History field name for the unique identifier of a history record.

HISTORY_PIPELINE

History field name for the XML serialisation of the pipeline.

HISTORY_BRICKS

History field name for the list of brick UUIDs in the history record.

TYPE_BVEC

Document type for b-vector files used in diffusion MRI.

TYPE_BVAL

Document type for b-value files used in diffusion MRI.

TYPE_BVEC_BVAL

Document type for combined b-vector/b-value files in MRtrix format.

TYPE_NII

Document type for NIfTI scan files.

TYPE_MAT

Document type for matrix files.

TYPE_TXT

Document type for plain text files.

TYPE_UNKNOWN

Document type for files with an unrecognised or unsupported format.

NOT_DEFINED_VALUE

Placeholder string displayed when a tag has no value defined for a document.

populse_mia.data_manager.FIELD_TYPE_STRING

Field type for string values (maps to Python str).

populse_mia.data_manager.FIELD_TYPE_INTEGER

Field type for integer values (maps to Python int).

populse_mia.data_manager.FIELD_TYPE_FLOAT

Field type for floating-point values (maps to Python float).

populse_mia.data_manager.FIELD_TYPE_BOOLEAN

Field type for boolean values (maps to Python bool).

populse_mia.data_manager.FIELD_TYPE_DATE

Field type for date values (maps to datetime.date).

populse_mia.data_manager.FIELD_TYPE_DATETIME

Field type for datetime values (maps to datetime.datetime).

populse_mia.data_manager.FIELD_TYPE_TIME

Field type for time values (maps to datetime.time).

populse_mia.data_manager.FIELD_TYPE_JSON

Field type for JSON objects (maps to Python dict).

populse_mia.data_manager.FIELD_TYPE_LIST_STRING

Field type for lists of string values (maps to list of str).

alias of list[str]

populse_mia.data_manager.FIELD_TYPE_LIST_INTEGER

Field type for lists of integer values (maps to list of int).

alias of list[int]

populse_mia.data_manager.FIELD_TYPE_LIST_FLOAT

Field type for lists of floating-point values (maps to list of float).

alias of list[float]

populse_mia.data_manager.FIELD_TYPE_LIST_BOOLEAN

Field type for lists of boolean values (maps to list of bool).

alias of list[bool]

populse_mia.data_manager.FIELD_TYPE_LIST_DATE

Field type for lists of date values (maps to list of datetime.date).

alias of list[date]

populse_mia.data_manager.FIELD_TYPE_LIST_DATETIME

Field type for lists of datetime values (maps to list of datetime.datetime).

alias of list[datetime]

populse_mia.data_manager.FIELD_TYPE_LIST_TIME

Field type for lists of time values (maps to list of datetime.time).

alias of list[time]

populse_mia.data_manager.FIELD_TYPE_LIST_JSON

Field type for lists of JSON objects (maps to list of dict).

alias of list[dict]

populse_mia.data_manager.ALL_TYPES = {<class 'bool'>, <class 'datetime.date'>, <class 'datetime.datetime'>, <class 'datetime.time'>, <class 'dict'>, <class 'float'>, <class 'int'>, <class 'str'>, list[bool], list[datetime.date], list[datetime.datetime], list[datetime.time], list[dict], list[float], list[int], list[str]}

Set of all supported field types (both scalar and list variants).

populse_mia.data_manager.FIELD_TYPE_MAPPING = {'boolean': <class 'bool'>, 'date': <class 'datetime.date'>, 'datetime': <class 'datetime.datetime'>, 'float': <class 'float'>, 'int': <class 'int'>, 'json': <class 'dict'>, 'list_boolean': list[bool], 'list_date': list[datetime.date], 'list_datetime': list[datetime.datetime], 'list_float': list[float], 'list_int': list[int], 'list_json': list[dict], 'list_string': list[str], 'list_time': list[datetime.time], 'string': <class 'str'>, 'time': <class 'datetime.time'>}

Mapping from V2 string field type names to their corresponding V3 Python types. Used for backwards compatibility when reading older database formats.

populse_mia.data_manager.TAG_UNIT_MS = 'ms'

Tag unit for milliseconds.

populse_mia.data_manager.TAG_UNIT_MM = 'mm'

Tag unit for millimetres.

populse_mia.data_manager.TAG_UNIT_DEGREE = 'degree'

Tag unit for degrees.

populse_mia.data_manager.TAG_UNIT_HZPIXEL = 'Hz/pixel'

Tag unit for Hz per pixel.

populse_mia.data_manager.TAG_UNIT_MHZ = 'MHz'

Tag unit for megahertz.

populse_mia.data_manager.ALL_UNITS = ['ms', 'mm', 'degree', 'Hz/pixel', 'MHz']

List of all supported tag units.

populse_mia.data_manager.COLLECTION_CURRENT = 'current'

Name of the collection storing the current state of the database.

populse_mia.data_manager.COLLECTION_INITIAL = 'initial'

Name of the collection storing the initial state of the database at import time.

populse_mia.data_manager.COLLECTION_BRICK = 'brick'

Name of the collection storing brick (pipeline process) records.

populse_mia.data_manager.COLLECTION_HISTORY = 'history'

Name of the collection storing the full pipeline execution history.

populse_mia.data_manager.FIELD_ATTRIBUTES_COLLECTION = 'mia_field_attributes'

Name of the internal collection storing field metadata and attributes.

populse_mia.data_manager.TAG_ORIGIN_BUILTIN = 'builtin'

Tag origin indicating the tag is a built-in MIA tag.

populse_mia.data_manager.TAG_ORIGIN_USER = 'user'

Tag origin indicating the tag was created by the user.

populse_mia.data_manager.TAG_CHECKSUM = 'Checksum'

Tag name for the file checksum, used to detect file modifications.

populse_mia.data_manager.TAG_TYPE = 'Type'

Tag name for the document type (e.g. Scan, Matrix, Text).

populse_mia.data_manager.TAG_EXP_TYPE = 'Exp Type'

Tag name for the experimental type of the document.

populse_mia.data_manager.TAG_FILENAME = 'FileName'

Tag name for the file name of the document.

populse_mia.data_manager.TAG_BRICKS = 'History'

Tag name for the list of brick IDs that produced the document.

populse_mia.data_manager.TAG_HISTORY = 'Full history'

Tag name for the full pipeline execution history associated with the document.

populse_mia.data_manager.CLINICAL_TAGS = {'Age': "patient's age", 'Institution': 'site where the NMR spectrometer is installed', 'MagneticFieldStrength': 'nominal field strength of MR magnet in Tesla', 'Manufacturer': 'manufacturer of the MRI spectrometer', "Manufacturer's Model": "manufacturer's model name of the MRI spectrometer", 'Message': 'brief message about the patient', 'Pathology': "patient's pathology", 'PatientRef': "patient's anonymous reference", 'Sex': "patient's gender", 'SoftwareVersions': 'version of the software used to acquire the data'}

Dictionary of clinical tag names and their descriptions. These tags store patient and acquisition metadata.

populse_mia.data_manager.BRICK_ID = 'ID'

Brick field name for the unique identifier of a brick.

populse_mia.data_manager.BRICK_NAME = 'Name'

Brick field name for the name of the brick (pipeline process).

populse_mia.data_manager.BRICK_INPUTS = 'Input(s)'

Brick field name for the list of input parameters of the brick.

populse_mia.data_manager.BRICK_OUTPUTS = 'Output(s)'

Brick field name for the list of output parameters of the brick.

populse_mia.data_manager.BRICK_INIT = 'Init'

Brick field name for the initialisation status of the brick.

populse_mia.data_manager.BRICK_EXEC = 'Exec'

Brick field name for the execution status of the brick.

populse_mia.data_manager.BRICK_INIT_TIME = 'Init Time'

Brick field name for the timestamp of the brick initialisation.

populse_mia.data_manager.BRICK_EXEC_TIME = 'Exec Time'

Brick field name for the timestamp of the brick execution.

populse_mia.data_manager.HISTORY_ID = 'ID'

History field name for the unique identifier of a history record.

populse_mia.data_manager.HISTORY_PIPELINE = 'Pipeline xml'

History field name for the XML serialisation of the pipeline.

populse_mia.data_manager.HISTORY_BRICKS = 'Bricks uuid'

History field name for the list of brick UUIDs in the history record.

populse_mia.data_manager.TYPE_BVEC = 'Bvec'

Document type for b-vector files used in diffusion MRI.

populse_mia.data_manager.TYPE_BVAL = 'Bval'

Document type for b-value files used in diffusion MRI.

populse_mia.data_manager.TYPE_BVEC_BVAL = 'Bvec_bval_MRTRIX'

Document type for combined b-vector/b-value files in MRtrix format.

populse_mia.data_manager.TYPE_NII = 'Scan'

Document type for NIfTI scan files.

populse_mia.data_manager.TYPE_MAT = 'Matrix'

Document type for matrix files.

populse_mia.data_manager.TYPE_TXT = 'Text'

Document type for plain text files.

populse_mia.data_manager.TYPE_UNKNOWN = 'Unknown'

Document type for files with an unrecognised or unsupported format.

populse_mia.data_manager.NOT_DEFINED_VALUE = '*Not Defined*'

Placeholder string displayed when a tag has no value defined for a document.

Modules

populse_mia.data_manager.data_history_inspect

This module provides utilities for tracking, retrieving, and reconstructing the processing history of data files within the Mia framework.

populse_mia.data_manager.data_loader

Module for importing MRI scan data from MRIFileManager into a Mia project.

populse_mia.data_manager.database_mia

Mia Database Interaction Module

populse_mia.data_manager.filter

Mia Filter Module

populse_mia.data_manager.project

Mia Project Module

populse_mia.data_manager.project_properties

Mia Saved Projects Module