mia_processes.bricks.tools package

General bricks needed to build pipelines or to operate other bricks (input data manipulations, etc.).

Submodules

mia_processes.bricks.tools.tools module

The toolbox library of the mia_processes package.

Basically, this module is dedicated to the low-level processes needed to run other higher-level bricks.

Contains:
Class:
  • Concat_to_list

  • Concat_to_list_of_list

  • Deconv_from_aif

  • Delete_data

  • Files_To_List

  • Filter_Files_List

  • Find_In_List

  • Get_Conditions_From_BIDS_tsv

  • Get_Conditions_From_csv

  • Get_Eprime_Info_GE2REC

  • Get_Patient_Name

  • Get_Regressors_From_csv

  • Import_Data

  • Input_Filter

  • List_Duplicate

  • List_Of_List_To_List

  • List_To_File

  • Make_AIF

  • Make_A_List

  • Make_CVR_reg_physio

class mia_processes.bricks.tools.tools.Concat_to_list[source]

Bases: ProcessMIA

Make an output list corresponding to the concatenation of list1 and list2

Ex. [‘a’, ‘b’, ‘c’] and [‘d’, ‘e’] gives

[‘a’, ‘b’, ‘c’, ‘d’, ‘e’]

Please, see the complete documentation for the Concat_to_list brick in the mia_processes website

Note

  • Type ‘Concat_to_list.help()’ for a full description of this process parameters.

  • Type ‘<Concat_to_list>.get_input_spec()’ for a full description of this process input trait types.

  • Type ‘<Concat_to_list>.get_output_spec()’ for a full description of this process output trait types.

__init__()[source]

Dedicated to the attributes initialisation/instantiation.

The input and output plugs are defined here. The special ‘self.requirement’ attribute (optional) is used to define the third-party products necessary for the running of the brick.

list_outputs(is_plugged=None, iteration=False)[source]

Dedicated to the initialisation step of the brick.

The main objective of this method is to produce the outputs of the bricks (self.outputs) and the associated tags (self.inheritance_dic), if defined here. In order not to include an output in the database, this output must be a value of the optional key ‘notInDb’ of the self.outputs dictionary. To work properly this method must return self.make_initResult() object.

Parameters:
  • is_plugged – the state, linked or not, of the plugs.

  • iteration – the state, iterative or not, of the process.

Returns:

a dictionary with requirement, outputs and inheritance_dict.

run_process_mia()[source]

Dedicated to the process launch step of the brick.

class mia_processes.bricks.tools.tools.Concat_to_list_of_list[source]

Bases: ProcessMIA

Iteration of input list1 with each element of input list2

Ex. [‘a’, ‘b’, ‘c’] and [‘1’, ‘2’] gives
[[‘a’, ‘1’], [‘a’, ‘2’],

[‘b’, ‘1’], [‘b’, ‘2’], [‘c’, ‘1’], [‘c’, ‘2’]

Please, see the complete documentation for the Concat_to_list_of_list brick in the mia_processes website

Note

  • Type ‘Concat_to_list_of_list.help()’ for a full description of this process parameters.

  • Type ‘<Concat_to_list_of_list>.get_input_spec()’ for a full description of this process input trait types.

  • Type ‘<Concat_to_list_of_list>.get_output_spec()’ for a full description of this process output trait types.

__init__()[source]

Dedicated to the attributes initialisation/instantiation.

The input and output plugs are defined here. The special ‘self.requirement’ attribute (optional) is used to define the third-party products necessary for the running of the brick.

list_outputs(is_plugged=None, iteration=False)[source]

Dedicated to the initialisation step of the brick.

The main objective of this method is to produce the outputs of the bricks (self.outputs) and the associated tags (self.inheritance_dic), if defined here. In order not to include an output in the database, this output must be a value of the optional key ‘notInDb’ of the self.outputs dictionary. To work properly this method must return self.make_initResult() object.

Parameters:
  • is_plugged – the state, linked or not, of the plugs.

  • iteration – the state, iterative or not, of the process.

Returns:

a dictionary with requirement, outputs and inheritance_dict.

run_process_mia()[source]

Dedicated to the process launch step of the brick.

class mia_processes.bricks.tools.tools.Deconv_from_aif[source]

Bases: ProcessMIA

Deconvolution using Arterial Input Function (AIF) data and functional MRI images

Please, see the complete documentation for the Deconv_from_aif in the mia_processes website

Note

  • Type ‘Deconv_from_aif.help()’ for a full description of this process parameters.

  • Type ‘<Deconv_from_aif>.get_input_spec()’ for a full description of this process input trait types.

  • Type ‘<Deconv_from_aif>.get_output_spec()’ for a full description of this process output trait types.

__init__()[source]

Dedicated to the attributes initialisation / instantiation.

The input and output plugs are defined here. The special ‘self.requirement’ attribute (optional) is used to define the third-party products necessary for the running of the brick.

bol_ar_time(vol_4d, mask)[source]

Compute Bolus Arrival Time (t0) and t0_mask.

Parameters:
  • vol_4d – 4D numpy array of shape (nb_row, nb_col, nb_sli, nb_dyn) Brain data over time.

  • mask – 3D numpy array of shape (nb_row, nb_col, nb_sli) Mask for the brain regions to be considered.

Returns:

  • t0 (3D numpy array of shape (nb_row, nb_col, nb_sli))

    – Bolus arrival time indices.

  • t0_mask (4D numpy array of shape (nb_row, nb_col, nb_sli, nb_dyn)) – Mask for valid t0 values.

deconv_osvd(u, s, v, c_func_pad, nb_dyn, data_mask)[source]

Deconvolution using OSVD (Oscillatory Singular Value Decomposition).

OSVD is used in deconvolution to filter out noise and reduce artifacts by selectively truncating the singular values that contribute to oscillations or instability in the inverse problem’s solution.

Parameters:
  • u – ndarray U matrix from SVD of the c_aif_toeplitz matrix.

  • s – ndarray Singular values from SVD of the c_aif_toeplitz matrix.

  • v – ndarray V matrix from SVD of the c_aif_toeplitz matrix.

  • c_func_pad – ndarray Zero-padded concentration voxels (4D array).

  • nb_dyn – int Number of dynamics (without zero-padding).

  • data_mask – ndarray Mask of the volume.

Returns:

  • residu_f (ndarray) – Residu function from the

    deconvolution process.

delta_r2star(vol_4d, te, mask)[source]

Compute DELTAR2* (ΔR2*).

ΔR2* corresponds to a change in the transverse relaxation rate (R2*), used in MRI to assess changes in the magnetic properties of tissues, particularly in the presence of paramagnetic contrast agents like Gadolinium (Gd).

Parameters:
  • vol_4d – 4D numpy array of shape (nb_row, nb_col, nb_sli, nb_dyn) Brain data over time.

  • te – float Echo time.

  • mask – 3D numpy array of shape (nb_row, nb_col, nb_sli) Mask for the volume to be considered.

Returns:

  • t0 (3D numpy array of shape (nb_row, nb_col, nb_sli))

    – Bolus arrival time (index in vol_4d corresponding to the 4th dimension).

  • c_vol_4d (4D numpy array of shape (nb_row, nb_col, nb_sli, nb_dyn)) – Concentration of Gadolinium for each voxel over time.

list_outputs(is_plugged=None, iteration=False)[source]

Dedicated to the initialisation step of the brick.

The main objective of this method is to produce the outputs of the bricks (self.outputs) and the associated tags (self.inheritance_dic), if defined here. In order not to include an output in the database, this output must be a value of the optional key ‘notInDb’ of the self.outputs dictionary. To work properly this method must return self.make_initResult() object.

Parameters:
  • is_plugged – the state, linked or not, of the plugs.

  • iteration – the state, iterative or not, of the process.

Returns:

a dictionary with requirement, outputs and inheritance_dict.

round_half_up(n)[source]

Rounds a number to the nearest integer using the “round half up” rule.

Python’s default rounding behavior follows the “round half to even” rule. This function instead rounds .5 up to the nearest integer.

Examples:
  • round_half_up(0.5) returns 1

  • round_half_up(1.5) returns 2

  • round(0.5) returns 0

  • round(1.5) returns 2

Parameters:

n – float The number to be rounded.

Returns:

  • int – The rounded integer value.

run_process_mia()[source]

Dedicated to the process launch step of the brick.

class mia_processes.bricks.tools.tools.Delete_data[source]

Bases: ProcessMIA

Delete from database data

Please, see the complete documentation for the Delete_data brick in the mia_processes website

Note

  • Type ‘Delete_data.help()’ for a full description of this process parameters.

  • Type ‘<Delete_data>.get_input_spec()’ for a full description of this process input trait types.

  • Type ‘<Delete_data>.get_output_spec()’ for a full description of this process output trait types.

__init__()[source]

Dedicated to the attributes initialisation / instantiation.

The input and output plugs are defined here. The special ‘self.requirement’ attribute (optional) is used to define the third-party products necessary for the running of the brick.

list_outputs(is_plugged=None, iteration=False)[source]

Dedicated to the initialisation step of the brick. The main objective of this method is to produce the outputs of the bricks (self.outputs) and the associated tags (self.inheritance_dic), if defined here. In order not to include an output in the database, this output must be a value of the optional key ‘notInDb’ of the self.outputs dictionary. To work properly this method must return self.make_initResult() object. :param is_plugged: the state, linked or not, of the plugs. :param iteration: the state, iterative or not, of the process. :returns: a dictionary with requirement, outputs and inheritance_dict.

run_process_mia()[source]

Dedicated to the process launch step of the brick.

class mia_processes.bricks.tools.tools.Files_To_List[source]

Bases: ProcessMIA

From 3 file names, generating a list containing all these file names

Please, see the complete documentation for the Files_To_List brick in the mia_processes website

Note

  • Type ‘Files_To_List.help()’ for a full description of this process parameters.

  • Type ‘<Files_To_List>.get_input_spec()’ for a full description of this process input trait types.

  • Type ‘<Files_To_List>.get_output_spec()’ for a full description of this process output trait types.

__init__()[source]

Dedicated to the attributes initialisation/instantiation.

The input and output plugs are defined here. The special ‘self.requirement’ attribute (optional) is used to define the third-party products necessary for the running of the brick.

list_outputs(is_plugged=None, iteration=False)[source]

Dedicated to the initialisation step of the brick.

The main objective of this method is to produce the outputs of the bricks (self.outputs) and the associated tags (self.inheritance_dic), if defined here. In order not to include an output in the database, this output must be a value of the optional key ‘notInDb’ of the self.outputs dictionary. To work properly this method must return self.make_initResult() object.

Parameters:
  • is_plugged – the state, linked or not, of the plugs.

  • iteration – the state, iterative or not, of the process.

Returns:

a dictionary with requirement, outputs and inheritance_dict.

run_process_mia()[source]

Dedicated to the process launch step of the brick.

class mia_processes.bricks.tools.tools.Filter_Files_List[source]

Bases: ProcessMIA

Selects one or more (slicing) element(s) from a list

Please, see the complete documentation for the Filter_Files_List brick in the mia_processes website

Note

  • Type ‘Filter_Files_List.help()’ for a full description of this process parameters.

  • Type ‘<Filter_Files_List>.get_input_spec()’ for a full description of this process input trait types.

  • Type ‘<Filter_Files_List>.get_output_spec()’ for a full description of this process output trait types.

__init__()[source]

Dedicated to the attributes initialisation/instantiation.

The input and output plugs are defined here. The special ‘self.requirement’ attribute (optional) is used to define the third-party products necessary for the running of the brick.

list_outputs(is_plugged=None, iteration=False)[source]

Dedicated to the initialisation step of the brick.

The main objective of this method is to produce the outputs of the bricks (self.outputs) and the associated tags (self.inheritance_dic), if defined here. In order not to include an output in the database, this output must be a value of the optional key ‘notInDb’ of the self.outputs dictionary. To work properly this method must return self.make_initResult() object.

Parameters:
  • is_plugged – the state, linked or not, of the plugs.

  • iteration – the state, iterative or not, of the process.

Returns:

a dictionary with requirement, outputs and inheritance_dict.

run_process_mia()[source]

Dedicated to the process launch step of the brick.

class mia_processes.bricks.tools.tools.Find_In_List[source]

Bases: ProcessMIA

From a list of files, select the 1rst element that contains a pattern

Please, see the complete documentation for the Find_In_List brick in the mia_processes website

Note

  • Type ‘Find_In_List.help()’ for a full description of this process parameters.

  • Type ‘<Find_In_List>.get_input_spec()’ for a full description of this process input trait types.

  • Type ‘<Find_In_List>.get_output_spec()’ for a full description of this process output trait types.

__init__()[source]

Dedicated to the attributes initialisation/instantiation.

The input and output plugs are defined here. The special ‘self.requirement’ attribute (optional) is used to define the third-party products necessary for the running of the brick.

list_outputs(is_plugged=None, iteration=False)[source]

Dedicated to the initialisation step of the brick.

The main objective of this method is to produce the outputs of the bricks (self.outputs) and the associated tags (self.inheritance_dic), if defined here. In order not to include an output in the database, this output must be a value of the optional key ‘notInDb’ of the self.outputs dictionary. To work properly this method must return self.make_initResult() object.

Parameters:
  • is_plugged – the state, linked or not, of the plugs.

  • iteration – the state, iterative or not, of the process.

Returns:

a dictionary with requirement, outputs and inheritance_dict.

run_process_mia()[source]

Dedicated to the process launch step of the brick.

class mia_processes.bricks.tools.tools.Get_Conditions_From_BIDS_tsv[source]

Bases: ProcessMIA

Get conditions information (conditions names, onsets and durations) for Level1Design brick using BIDS-compatible tsv files

Please, see the complete documentation for the Get_Conditions_From_BIDS_tsv brick in the mia_processes website

Note

  • Type ‘Get_Conditions_From_BIDS_tsv.help()’ for a full description of this process parameters.

  • Type ‘<Get_Conditions_From_BIDS_tsv>.get_input_spec()’ for a full description of this process input trait types.

  • Type ‘<Get_Conditions_From_BIDS_tsv>.get_output_spec()’ for a full description of this process output trait types.

__init__()[source]

Dedicated to the attributes initialisation/instantiation.

The input and output plugs are defined here. The special ‘self.requirement’ attribute (optional) is used to define the third-party products necessary for the running of the brick.

list_outputs(is_plugged=None, iteration=False)[source]

Dedicated to the initialisation step of the brick.

The main objective of this method is to produce the outputs of the bricks (self.outputs) and the associated tags (self.inheritance_dic), if defined here. In order not to include an output in the database, this output must be a value of the optional key ‘notInDb’ of the self.outputs dictionary. To work properly this method must return self.make_initResult() object.

Parameters:
  • is_plugged – the state, linked or not, of the plugs.

  • iteration – the state, iterative or not, of the process.

Returns:

a dictionary with requirement, outputs and inheritance_dict.

run_process_mia()[source]

Dedicated to the process launch step of the brick.

class mia_processes.bricks.tools.tools.Get_Conditions_From_csv[source]

Bases: ProcessMIA

Get conditions information (conditions names, onsets and durations) for Level1Design brick using csv files

Please, see the complete documentation for the Get_Conditions_From_csv brick in the mia_processes website

Note

  • Type ‘Get_Conditions_From_csv.help()’ for a full description of this process parameters.

  • Type ‘<Get_Conditions_From_csv>.get_input_spec()’ for a full description of this process input trait types.

  • Type ‘<Get_Conditions_From_csv>.get_output_spec()’ for a full description of this process output trait types.

__init__()[source]

Dedicated to the attributes initialisation/instantiation.

The input and output plugs are defined here. The special ‘self.requirement’ attribute (optional) is used to define the third-party products necessary for the running of the brick.

list_outputs(is_plugged=None, iteration=False)[source]

Dedicated to the initialisation step of the brick.

The main objective of this method is to produce the outputs of the bricks (self.outputs) and the associated tags (self.inheritance_dic), if defined here. In order not to include an output in the database, this output must be a value of the optional key ‘notInDb’ of the self.outputs dictionary. To work properly this method must return self.make_initResult() object.

Parameters:
  • is_plugged – the state, linked or not, of the plugs.

  • iteration – the state, iterative or not, of the process.

Returns:

a dictionary with requirement, outputs and inheritance_dict.

run_process_mia()[source]

Dedicated to the process launch step of the brick.

class mia_processes.bricks.tools.tools.Get_Eprime_Info_GE2REC[source]

Bases: ProcessMIA

Get info from an E-Prime file for GE2REC protocol

Please, see the complete documentation for the Get_Eprime_Info_GE2REC brick in the mia_processes website

Note

  • Type ‘Get_Eprime_Info_GE2REC.help()’ for a full description of this process parameters.

  • Type ‘<Get_Eprime_Info_GE2REC>.get_input_spec()’ for a full description of this process input trait types.

  • Type ‘<Get_Eprime_Info_GE2REC>.get_output_spec()’ for a full description of this process output trait types.

__init__()[source]

Dedicated to the attributes initialisation/instantiation.

The input and output plugs are defined here. The special ‘self.requirement’ attribute (optional) is used to define the third-party products necessary for the running of the brick.

list_outputs(is_plugged=None, iteration=False)[source]

Dedicated to the initialisation step of the brick.

The main objective of this method is to produce the outputs of the bricks (self.outputs) and the associated tags (self.inheritance_dic), if defined here. In order not to include an output in the database, this output must be a value of the optional key ‘notInDb’ of the self.outputs dictionary. To work properly this method must return self.make_initResult() object.

Parameters:
  • is_plugged – the state, linked or not, of the plugs.

  • iteration – the state, iterative or not, of the process.

Returns:

a dictionary with requirement, outputs and inheritance_dict.

run_process_mia()[source]

Dedicated to the process launch step of the brick.

class mia_processes.bricks.tools.tools.Get_Patient_Name[source]

Bases: ProcessMIA

Get patient name from a file

Please, see the complete documentation for the Get_Patient_Name brick in the mia_processes website

Note

  • Type ‘Get_Patient_Name.help()’ for a full description of this process parameters.

  • Type ‘<Get_Patient_Name>.get_input_spec()’ for a full description of this process input trait types.

  • Type ‘<Get_Patient_Name>.get_output_spec()’ for a full description of this process output trait types.

__init__()[source]

Dedicated to the attributes initialisation/instantiation.

The input and output plugs are defined here. The special ‘self.requirement’ attribute (optional) is used to define the third-party products necessary for the running of the brick.

list_outputs(is_plugged=None, iteration=False)[source]

Dedicated to the initialisation step of the brick.

The main objective of this method is to produce the outputs of the bricks (self.outputs) and the associated tags (self.inheritance_dic), if defined here. In order not to include an output in the database, this output must be a value of the optional key ‘notInDb’ of the self.outputs dictionary. To work properly this method must return self.make_initResult() object.

Parameters:
  • is_plugged – the state, linked or not, of the plugs.

  • iteration – the state, iterative or not, of the process.

Returns:

a dictionary with requirement, outputs and inheritance_dict.

run_process_mia()[source]

Dedicated to the process launch step of the brick.

class mia_processes.bricks.tools.tools.Get_Regressors_From_csv[source]

Bases: ProcessMIA

Get regressors information (regressors names, values and session) for Level1Design brick using csv files

Please, see the complete documentation for the Get_Regressors_From_csv brick in the mia_processes website

Note

  • Type ‘Get_Regressors_From_csv.help()’ for a full description of this process parameters.

  • Type ‘<Get_Regressors_From_csv>.get_input_spec()’ for a full description of this process input trait types.

  • Type ‘<Get_Regressors_From_csv>.get_output_spec()’ for a full description of this process output trait types.

__init__()[source]

Dedicated to the attributes initialisation/instantiation.

The input and output plugs are defined here. The special ‘self.requirement’ attribute (optional) is used to define the third-party products necessary for the running of the brick.

list_outputs(is_plugged=None, iteration=False)[source]

Dedicated to the initialisation step of the brick.

The main objective of this method is to produce the outputs of the bricks (self.outputs) and the associated tags (self.inheritance_dic), if defined here. In order not to include an output in the database, this output must be a value of the optional key ‘notInDb’ of the self.outputs dictionary. To work properly this method must return self.make_initResult() object.

Parameters:
  • is_plugged – the state, linked or not, of the plugs.

  • iteration – the state, iterative or not, of the process.

Returns:

a dictionary with requirement, outputs and inheritance_dict.

run_process_mia()[source]

Dedicated to the process launch step of the brick.

class mia_processes.bricks.tools.tools.Import_Data[source]

Bases: ProcessMIA

Import reference data into the current pipeline

  • This brick was originally written to select regions of interest. The rois_list parameter is used to filter the data to be imported from a library defined by lib_dir. If roi_list is a list, each element of it will be a filename filter applied for retrieval. If roi_list is a list of lists, the filters will result from concatenating the elements of each internal list (e.g. [[“foo”, “1”], [“faa”, “2”]] gives two filters, “foo_1” and “faa_2”.

  • If lib_dir is not set, use the miaresources/ROIs/ file.

  • The file_in_db file is used only to retrieve the value of the associated PatientName tag.

  • The reference data is imported into the output_directory/PatientName_data/ROI_data/raw_data directory.

Note

  • Type ‘Import_Data.help()’ for a full description of this process parameters.

  • Type ‘<Import_Data>.get_input_spec()’ for a full description of this process input trait types.

  • Type ‘<Import_Data>.get_output_spec()’ for a full description of this process output trait types.

__init__()[source]

Dedicated to the attributes initialisation/instantiation.

The input and output plugs are defined here. The special ‘self.requirement’ attribute (optional) is used to define the third-party products necessary for the running of the brick.

list_outputs(is_plugged=None, iteration=False)[source]

Dedicated to the initialisation step of the brick.

The main objective of this method is to produce the outputs of the bricks (self.outputs) and the associated tags (self.inheritance_dic), if defined here. In order not to include an output in the database, this output must be a value of the optional key ‘notInDb’ of the self.outputs dictionary. To work properly this method must return self.make_initResult() object.

Parameters:
  • is_plugged – the state, linked or not, of the plugs.

  • iteration – the state, iterative or not, of the process.

Returns:

a dictionary with requirement, outputs and inheritance_dict.

run_process_mia()[source]

Dedicated to the process launch step of the brick.

class mia_processes.bricks.tools.tools.Input_Filter[source]

Bases: ProcessMIA

To filter the Data Browser tab or the output data of another brick

Please, see the complete documentation for the Input_Filter in the mia_processes website

Note

  • Type ‘Input_Filter.help()’ for a full description of this process parameters.

  • Type ‘<Input_Filter>.get_input_spec()’ for a full description of this process input trait types.

  • Type ‘<Input_Filter>.get_output_spec()’ for a full description of this process output trait types.

__init__()[source]

Dedicated to the attributes initialisation/instantiation.

The input and output plugs are defined here. The special ‘self.requirement’ attribute (optional) is used to define the third-party products necessary for the running of the brick.

list_outputs(is_plugged=None, iteration=False)[source]

Dedicated to the initialisation step of the brick.

The main objective of this method is to produce the outputs of the bricks (self.outputs) and the associated tags (self.inheritance_dic), if defined here. In order not to include an output in the database, this output must be a value of the optional key ‘notInDb’ of the self.outputs dictionary. To work properly this method must return self.make_initResult() object.

Parameters:
  • is_plugged – the state, linked or not, of the plugs.

  • iteration – the state, iterative or not, of the process.

Returns:

a dictionary with requirement, outputs and inheritance_dict.

run_process_mia()[source]

Dedicated to the process launch step of the brick.

class mia_processes.bricks.tools.tools.List_Duplicate[source]

Bases: ProcessMIA

From a file name, generate a list containing that file name and the file name itself

Please, see the complete documentation for the List_Duplicate in the mia_processes website

Note

  • Type ‘List_Duplicate.help()’ for a full description of this process parameters.

  • Type ‘<List_Duplicate>.get_input_spec()’ for a full description of this process input trait types.

  • Type ‘<List_Duplicate>.get_output_spec()’ for a full description of this process output trait types.

__init__()[source]

Dedicated to the attributes initialisation / instantiation.

The input and output plugs are defined here. The special ‘self.requirement’ attribute (optional) is used to define the third-party products necessary for the running of the brick.

list_outputs(is_plugged=None, iteration=False)[source]

Dedicated to the initialisation step of the brick.

The main objective of this method is to produce the outputs of the bricks (self.outputs) and the associated tags (self.inheritance_dic), if defined here. In order not to include an output in the database, this output must be a value of the optional key ‘notInDb’ of the self.outputs dictionary. To work properly this method must return self.make_initResult() object.

Parameters:
  • is_plugged – the state, linked or not, of the plugs.

  • iteration – the state, iterative or not, of the process.

Returns:

a dictionary with requirement, outputs and inheritance_dict.

run_process_mia()[source]

Dedicated to the process launch step of the brick.

class mia_processes.bricks.tools.tools.List_Of_List_To_List[source]

Bases: ProcessMIA

Select and generate a list from a list of list

Please, see the complete documentation for the List_Of_List_To_List in the mia_processes website

Note

  • Type ‘List_Of_List_To_List.help()’ for a full description of this process parameters.

  • Type ‘<List_Of_List_To_List>.get_input_spec()’ for a full description of this process input trait types.

  • Type ‘<List_Of_List_To_List>.get_output_spec()’ for a full description of this process output trait types.

__init__()[source]

Dedicated to the attributes initialisation / instantiation.

The input and output plugs are defined here. The special ‘self.requirement’ attribute (optional) is used to define the third-party products necessary for the running of the brick.

list_outputs(is_plugged=None, iteration=False)[source]

Dedicated to the initialisation step of the brick.

The main objective of this method is to produce the outputs of the bricks (self.outputs) and the associated tags (self.inheritance_dic), if defined here. In order not to include an output in the database, this output must be a value of the optional key ‘notInDb’ of the self.outputs dictionary. To work properly this method must return self.make_initResult() object.

Parameters:
  • is_plugged – the state, linked or not, of the plugs.

  • iteration – the state, iterative or not, of the process.

Returns:

a dictionary with requirement, outputs and inheritance_dict.

run_process_mia()[source]

Dedicated to the process launch step of the brick.

class mia_processes.bricks.tools.tools.List_To_File[source]

Bases: ProcessMIA

From several filenames, selects and generates a file

Please, see the complete documentation for the List_To_File in the mia_processes website

Note

  • Type ‘List_To_File.help()’ for a full description of this process parameters.

  • Type ‘<List_To_File>.get_input_spec()’ for a full description of this process input trait types.

  • Type ‘<List_To_File>.get_output_spec()’ for a full description of this process output trait types.

__init__()[source]

Dedicated to the attributes initialisation / instantiation.

The input and output plugs are defined here. The special ‘self.requirement’ attribute (optional) is used to define the third-party products necessary for the running of the brick.

list_outputs(is_plugged=None, iteration=False)[source]

Dedicated to the initialisation step of the brick.

The main objective of this method is to produce the outputs of the bricks (self.outputs) and the associated tags (self.inheritance_dic), if defined here. In order not to include an output in the database, this output must be a value of the optional key ‘notInDb’ of the self.outputs dictionary. To work properly this method must return self.make_initResult() object.

Parameters:
  • is_plugged – the state, linked or not, of the plugs.

  • iteration – the state, iterative or not, of the process.

Returns:

a dictionary with requirement, outputs and inheritance_dict.

run_process_mia()[source]

Dedicated to the process launch step of the brick.

class mia_processes.bricks.tools.tools.Make_AIF[source]

Bases: ProcessMIA

Creating an Arterial Input Function (AIF) for Dynamic Susceptibility Contrast (DSC) Magnetic Resonance Imaging (MRI)

Please, see the complete documentation for the Make_AIF in the mia_processes website

Note

  • Type ‘Make_AIF.help()’ for a full description of this process parameters.

  • Type ‘<Make_AIF>.get_input_spec()’ for a full description of this process input trait types.

  • Type ‘<Make_AIF>.get_output_spec()’ for a full description of this process output trait types.

__init__()[source]

Dedicated to the attributes initialisation / instantiation.

The input and output plugs are defined here. The special ‘self.requirement’ attribute (optional) is used to define the third-party products necessary for the running of the brick.

bol_ar_time(data)[source]

Compute bolus arrival time

Parameters:

data – Value of voxels selected during dynamics

Returns:

the bolus arrival time

convert_to_native_types(data)[source]

Convert data to list of native Python types

Useful, for example, for serializing with json.

Parameters:

data – The data to be converted to a native Python type

list_outputs(is_plugged=None, iteration=False)[source]

Dedicated to the initialisation step of the brick.

The main objective of this method is to produce the outputs of the bricks (self.outputs) and the associated tags (self.inheritance_dic), if defined here. In order not to include an output in the database, this output must be a value of the optional key ‘notInDb’ of the self.outputs dictionary. To work properly this method must return self.make_initResult() object.

Parameters:
  • is_plugged – the state, linked or not, of the plugs.

  • iteration – the state, iterative or not, of the process.

Returns:

a dictionary with requirement, outputs and inheritance_dict.

run_process_mia()[source]

Dedicated to the process launch step of the brick.

class mia_processes.bricks.tools.tools.Make_A_List[source]

Bases: ProcessMIA

From 2 objects, generating a list containing all these objects

Please, see the complete documentation for the Make_A_List in the mia_processes website

Note

  • Type ‘Make_A_List.help()’ for a full description of this process parameters.

  • Type ‘<Make_A_List>.get_input_spec()’ for a full description of this process input trait types.

  • Type ‘<Make_A_List>.get_output_spec()’ for a full description of this process output trait types.

__init__()[source]

Dedicated to the attributes initialisation / instantiation.

The input and output plugs are defined here. The special ‘self.requirement’ attribute (optional) is used to define the third-party products necessary for the running of the brick.

list_outputs(is_plugged=None, iteration=False)[source]

Dedicated to the initialisation step of the brick. The main objective of this method is to produce the outputs of the bricks (self.outputs) and the associated tags (self.inheritance_dic), if defined here. In order not to include an output in the database, this output must be a value of the optional key ‘notInDb’ of the self.outputs dictionary. To work properly this method must return self.make_initResult() object. :param is_plugged: the state, linked or not, of the plugs. :param iteration: the state, iterative or not, of the process. :returns: a dictionary with requirement, outputs and inheritance_dict.

run_process_mia()[source]

Dedicated to the process launch step of the brick.

class mia_processes.bricks.tools.tools.Make_CVR_reg_physio[source]

Bases: ProcessMIA

Generate the physiological regressor for CVR

Please, see the complete documentation for the Make_CVR_reg_physio in the mia_processes website

Note

  • Type ‘Make_CVR_reg_physio.help()’ for a full description of this process parameters.

  • Type ‘<Make_CVR_reg_physio>.get_input_spec()’ for a full description of this process input trait types.

  • Type ‘<Make_CVR_reg_physio>.get_output_spec()’ for a full description of this process output trait types.

__init__()[source]

Dedicated to the attributes initialisation / instantiation.

The input and output plugs are defined here. The special ‘self.requirement’ attribute (optional) is used to define the third-party products necessary for the running of the brick.

gaussfir(bt, nt=3, of=2)[source]

Generate a Gaussian FIR filter.

with a specified bandwidth-time product (bt), number of taps (nt), and oversampling factor (of)

gfb_conv(a, b, shape='full')[source]

Return a subsection of the convolution, as specified by the shape parameter.

Parameters:
  • a – a vector (a ndarray numpy object)

  • b – a vector (a ndarray numpy object)

  • shape – sub-section of the convolution (a string in [‘full’, ‘same’, ‘valid’])

list_outputs(is_plugged=None, iteration=False)[source]

Dedicated to the initialisation step of the brick. The main objective of this method is to produce the outputs of the bricks (self.outputs) and the associated tags (self.inheritance_dic), if defined here. In order not to include an output in the database, this output must be a value of the optional key ‘notInDb’ of the self.outputs dictionary. To work properly this method must return self.make_initResult() object. :param is_plugged: the state, linked or not, of the plugs. :param iteration: the state, iterative or not, of the process. :returns: a dictionary with requirement, outputs and inheritance_dict.

run_process_mia()[source]

Dedicated to the process launch step of the brick.

spm_hrf(rt, p=[6, 16, 1, 1, 6, 0, 32], t=16)[source]

Hemodynamic response function.

Parameters: - rt: scan repeat time - p: parameters of the response function (two Gamma functions) (Default: [6, 16, 1, 1, 6, 0, 32]) - t: microtime resolution (Default: 16)

Returns: - hrf: hemodynamic response function - p: parameters of the response function

Note: Adapted from SPM12 matlab code (spm_hrf.m)