mia_processes.bricks.preprocess.others package

Atomic calculations that do not come from ants, fsl, spm, etc.

Submodules

mia_processes.bricks.preprocess.others.processing module

The other preprocess library of the mia_processes package.

The purpose of this module is to provide bricks generally necessary for the pre-processing steps, which are not found in nipype.

Contains:
Class:
  • ApplyBiasCorrection

  • ArtifactMask

  • Binarize

  • ConformImage

  • ConvROI

  • Enhance

  • EstimateSNR

  • ExtractROIbyLabel

  • ExtractSignalROI

  • GradientThreshold

  • Harmonize

  • IntensityClip

  • Mask

  • NonSteadyStateDetector

  • Resample1

  • Resample2

  • RotationMask

  • Sanitize

  • TSNR

  • TemplateFromTemplateFlow

  • Threshold

Function:
  • artifact_mask

  • is_outlier

  • threshold

class mia_processes.bricks.preprocess.others.processing.ApplyBiasCorrection[source]

Bases: ProcessMIA

Apply bias field correction to an input file using the bias image

Please, see the complete documentation for the ‘ApplyBiasCorrection brick in the mia_processes website <https://populse.github.io/mia_processes/html/documentation/bricks/preprocess/other/ApplyMask.html>`_

Note

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

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

  • Type ‘<ApplyBiasCorrection>.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. 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.preprocess.others.processing.ArtifactMask[source]

Bases: ProcessMIA

Computes the artifact mask

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

adapted from https://github.com/nipreps/mriqc/blob/e021008da0a2ef1c48e882baf932139a673349f9/mriqc/interfaces/anatomical.py#L301

Note

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

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

  • Type ‘<ArtifactMask>.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. 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.preprocess.others.processing.Binarize[source]

Bases: ProcessMIA

Image binarization

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

adapted from: https://github.com/nipreps/niworkflows/blob/45ab13e1bf6fdbf5e29c90cef44055b0b9cf391b/niworkflows/interfaces/nibabel.py#L92

Note

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

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

  • Type ‘<Binarize>.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. 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.preprocess.others.processing.ConformImage[source]

Bases: ProcessMIA

Conform T1w image to standard

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

adapted from: https://github.com/nipreps/mriqc/blob/e021008da0a2ef1c48e882baf932139a673349f9/mriqc/interfaces/common/conform_image.py#L75

Note

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

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

  • Type ‘<ConformImage>.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. 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.preprocess.others.processing.ConvROI[source]

Bases: ProcessMIA

Image convolution with one image

  • Resampling the images_to_convolve to the size of convolve_with.

  • Then convolve each element of resized images_to_convolve with convolve_with.

  • The output_directory/PatientName_data/ROI_data/convROI_BOLD directory is created to receive the convolved images. If this directory exists at runtime it is deleted.

  • To work correctly, the database entry for the convolve_with parameter must have the “PatientName” tag filled in.

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

Note

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

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

  • Type ‘<ConvROI>.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.preprocess.others.processing.Enhance[source]

Bases: ProcessMIA

Image enhancing

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

adapted from: https://github.com/nipreps/mriqc/blob/22.0.6/mriqc/workflows/anatomical.py#L974

Note

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

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

  • Type ‘<Enhance>.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. 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.preprocess.others.processing.EstimateSNR[source]

Bases: ProcessMIA

Estimate SNR using a segmentation file

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

adapted from: https://github.com/nipreps/mriqc/blob/22.0.6/mriqc/workflows/anatomical.py#L970

Note

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

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

  • Type ‘<EstimateSNR>.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. 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.preprocess.others.processing.ExtractROIbyLabel[source]

Bases: ProcessMIA

Extract a specific ROI from a segmentation file using a label

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

Note

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

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

  • Type ‘<ExtractROIbyLabel>.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. 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.preprocess.others.processing.ExtractSignalROI[source]

Bases: ProcessMIA

Extract signal from ROI using a segmentation file with label

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

Note

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

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

  • Type ‘<ExtractSignalROI>.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. 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.preprocess.others.processing.GradientThreshold[source]

Bases: ProcessMIA

Computes a threshold from the histogram of the magnitude gradient image

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

adapted from: https://github.com/nipreps/mriqc/blob/e021008da0a2ef1c48e882baf932139a673349f9/mriqc/workflows/anatomical.py#L1039

Note

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

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

  • Type ‘<GradientThreshold>.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. 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.preprocess.others.processing.Harmonize[source]

Bases: ProcessMIA

Harmonize input image using a white matter mask

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

adapted from: https://github.com/nipreps/mriqc/blob/e021008da0a2ef1c48e882baf932139a673349f9/mriqc/interfaces/anatomical.py#L405

Note

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

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

  • Type ‘<Harmonize>.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. 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.preprocess.others.processing.IntensityClip[source]

Bases: ProcessMIA

Clip the intensity range as prescribed by the percentiles

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

Note

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

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

  • Type ‘<IntensityClip>.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. 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.preprocess.others.processing.Mask[source]

Bases: ProcessMIA

Apply a binary mask to an image

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

adapted from: https://github.com/nipreps/niworkflows/blob/45ab13e1bf6fdbf5e29c90cef44055b0b9cf391b/niworkflows/interfaces/norm.py#L474

Note

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

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

  • Type ‘<Mask>.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. 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.preprocess.others.processing.NonSteadyStateDetector[source]

Bases: ProcessMIA

Detect non-steady-state at the beginning of a bold 4D image

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

adapted from: https://github.com/nipy/nipype/blob/f662acfce8def4717e0c3414618f3a5de5913b31/nipype/algorithms/confounds.py#L974

Note

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

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

  • Type ‘<NonSteadyStateDetector>.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. 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.preprocess.others.processing.Resample1[source]

Bases: ProcessMIA

Resamples an image to the resolution of a reference image

  • Uses nilearn.image.resample_to_img().

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

Note

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

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

  • Type ‘<Resample1>.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. 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.preprocess.others.processing.Resample2[source]

Bases: ProcessMIA

Resamples images to the resolution of a reference image

  • Uses nilearn.image.resample_to_img().

  • The output_directory/PatientName_data/ROI_data/convROI_BOLD2 directory is created to receive the resampled images. If this directory exists at runtime it is deleted.

  • To work correctly, the database entry for the reference_image parameter must have the “PatientName” tag filled in.

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

Note

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

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

  • Type ‘<Resample2>.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.preprocess.others.processing.RotationMask[source]

Bases: ProcessMIA

Compute the rotation mask image

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

adapted from: https://github.com/nipreps/mriqc/blob/e021008da0a2ef1c48e882baf932139a673349f9/mriqc/interfaces/anatomical.py#L448

Note

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

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

  • Type ‘<RotationMask>.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. 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.preprocess.others.processing.Sanitize[source]

Bases: ProcessMIA

Sanitize input bold image

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

adapted from: https://github.com/nipreps/niworkflows/blob/45ab13e1bf6fdbf5e29c90cef44055b0b9cf391b/niworkflows/interfaces/header.py#L394

Note

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

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

  • Type ‘<Sanitize>.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. 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.preprocess.others.processing.TSNR[source]

Bases: ProcessMIA

Computes the time-course SNR for a time series

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

adapted from: https://github.com/nipy/nipype/blob/f662acfce8def4717e0c3414618f3a5de5913b31/nipype/algorithms/confounds.py#L899

Note

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

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

  • Type ‘<TSNR>.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. 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.preprocess.others.processing.TemplateFromTemplateFlow[source]

Bases: ProcessMIA

Get template image from templateflow

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

Note

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

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

  • Type ‘<TemplateFromTemplateFlow>.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. 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.preprocess.others.processing.Threshold[source]

Bases: ProcessMIA

Makes a binary mask image at a given threshold

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

Note

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

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

  • Type ‘<Threshold>.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. 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.

mia_processes.bricks.preprocess.others.processing.artifact_mask(imdata, airdata, distance, zscore=10.0)[source]

Computes a mask of artifacts found in the air region

mia_processes.bricks.preprocess.others.processing.is_outlier(points, thresh=3.5)[source]

Returns a boolean array with True if points are outliers and False otherwise

Parameters:
  • points (nparray) – an numobservations by numdimensions numpy array of observations

  • thresh (float) – the modified z-score to use as a threshold. Observations with a modified z-score (based on the median absolute deviation) greater than this value will be classified as outliers.

Returns:

A boolean mask, of size numobservations-length array.

Note

Boris Iglewicz and David Hoaglin (1993), “Volume 16: How to Detect and Handle Outliers”, The ASQC Basic References in Quality Control: Statistical Techniques, Edward F. Mykytka, Ph.D., Editor.

mia_processes.bricks.preprocess.others.processing.threshold(file_name, thresh)[source]

Basic method for image thresholding

Parameters:
  • file_name – Image to be thresholded

  • thresh – Threshold value (a float between 0 and 1)

Returns:

Image after thresholding