nipype.interfaces.mrtrix3.connectivity module

BuildConnectome

Link to code

Bases: MRTrix3Base

Wrapped executable: tck2connectome.

Generate a connectome matrix from a streamlines file and a node parcellation image

Example

>>> import nipype.interfaces.mrtrix3 as mrt
>>> mat = mrt.BuildConnectome()
>>> mat.inputs.in_file = 'tracks.tck'
>>> mat.inputs.in_parc = 'aparc+aseg.nii'
>>> mat.cmdline                               
'tck2connectome tracks.tck aparc+aseg.nii connectome.csv'
>>> mat.run()                                 
Mandatory Inputs:
  • in_file (a pathlike object or string representing an existing file) – Input tractography. Maps to a command-line argument: %s (position: -3).

  • out_file (a pathlike object or string representing a file) – Output file after processing. Maps to a command-line argument: %s (position: -1). (Nipype default value: connectome.csv)

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • in_parc (a pathlike object or string representing an existing file) – Parcellation file. Maps to a command-line argument: %s (position: -2).

  • in_scalar (a pathlike object or string representing an existing file) – Provide the associated image for the mean_scalar metric. Maps to a command-line argument: -image %s.

  • in_weights (a pathlike object or string representing an existing file) – Specify a text scalar file containing the streamline weights. Maps to a command-line argument: -tck_weights_in %s.

  • keep_unassigned (a boolean) – By default, the program discards the information regarding those streamlines that are not successfully assigned to a node pair. Set this option to keep these values (will be the first row/column in the output matrix). Maps to a command-line argument: -keep_unassigned.

  • metric (‘count’ or ‘meanlength’ or ‘invlength’ or ‘invnodevolume’ or ‘mean_scalar’ or ‘invlength_invnodevolume’) – Specify the edge weight metric. Maps to a command-line argument: -metric %s.

  • nthreads (an integer) – Number of threads. if zero, the number of available cpus will be used. Maps to a command-line argument: -nthreads %d.

  • search_forward (a float) – Project the streamline forwards from the endpoint in search of aparcellation node voxel. Argument is the maximum traversal length in mm. Maps to a command-line argument: -assignment_forward_search %f.

  • search_radius (a float) – Perform a radial search from each streamline endpoint to locate the nearest node. Argument is the maximum radius in mm; if no node is found within this radius, the streamline endpoint is not assigned to any node. Maps to a command-line argument: -assignment_radial_search %f.

  • search_reverse (a float) – Traverse from each streamline endpoint inwards along the streamline, in search of the last node traversed by the streamline. Argument is the maximum traversal length in mm (set to 0 to allow search to continue to the streamline midpoint). Maps to a command-line argument: -assignment_reverse_search %f.

  • vox_lookup (a boolean) – Use a simple voxel lookup value at each streamline endpoint. Maps to a command-line argument: -assignment_voxel_lookup.

  • zero_diagonal (a boolean) – Set all diagonal entries in the matrix to zero (these represent streamlines that connect to the same node at both ends). Maps to a command-line argument: -zero_diagonal.

Outputs:

out_file (a pathlike object or string representing an existing file) – The output response file.

LabelConfig

Link to code

Bases: MRTrix3Base

Wrapped executable: labelconfig.

Re-configure parcellation to be incrementally defined.

Example

>>> import nipype.interfaces.mrtrix3 as mrt
>>> labels = mrt.LabelConfig()
>>> labels.inputs.in_file = 'aparc+aseg.nii'
>>> labels.inputs.in_config = 'mrtrix3_labelconfig.txt'
>>> labels.cmdline                               
'labelconfig aparc+aseg.nii mrtrix3_labelconfig.txt parcellation.mif'
>>> labels.run()                                 
Mandatory Inputs:
  • in_file (a pathlike object or string representing an existing file) – Input anatomical image. Maps to a command-line argument: %s (position: -3).

  • out_file (a pathlike object or string representing a file) – Output file after processing. Maps to a command-line argument: %s (position: -1). (Nipype default value: parcellation.mif)

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • in_config (a pathlike object or string representing an existing file) – Connectome configuration file. Maps to a command-line argument: %s (position: -2).

  • lut_aal (a pathlike object or string representing a file) – Get information from the AAL lookup table (typically “ROI_MNI_V4.txt”). Maps to a command-line argument: -lut_aal %s.

  • lut_basic (a pathlike object or string representing a file) – Get information from a basic lookup table consisting of index / name pairs. Maps to a command-line argument: -lut_basic %s.

  • lut_fs (a pathlike object or string representing a file) – Get information from a FreeSurfer lookup table(typically “FreeSurferColorLUT.txt”). Maps to a command-line argument: -lut_freesurfer %s.

  • lut_itksnap (a pathlike object or string representing a file) – Get information from an ITK - SNAP lookup table(this includes the IIT atlas file “LUT_GM.txt”). Maps to a command-line argument: -lut_itksnap %s.

  • nthreads (an integer) – Number of threads. if zero, the number of available cpus will be used. Maps to a command-line argument: -nthreads %d.

  • spine (a pathlike object or string representing a file) – Provide a manually-defined segmentation of the base of the spine where the streamlines terminate, so that this can become a node in the connection matrix. Maps to a command-line argument: -spine %s.

Outputs:

out_file (a pathlike object or string representing an existing file) – The output response file.

LabelConvert

Link to code

Bases: MRTrix3Base

Wrapped executable: labelconvert.

Re-configure parcellation to be incrementally defined.

Example

>>> import nipype.interfaces.mrtrix3 as mrt
>>> labels = mrt.LabelConvert()
>>> labels.inputs.in_file = 'aparc+aseg.nii'
>>> labels.inputs.in_config = 'mrtrix3_labelconfig.txt'
>>> labels.inputs.in_lut = 'FreeSurferColorLUT.txt'
>>> labels.cmdline
'labelconvert aparc+aseg.nii FreeSurferColorLUT.txt mrtrix3_labelconfig.txt parcellation.mif'
>>> labels.run()                                 
Mandatory Inputs:
  • in_file (a pathlike object or string representing an existing file) – Input anatomical image. Maps to a command-line argument: %s (position: -4).

  • in_lut (a pathlike object or string representing an existing file) – Get information from a basic lookup table consisting of index / name pairs. Maps to a command-line argument: %s (position: -3).

  • out_file (a pathlike object or string representing a file) – Output file after processing. Maps to a command-line argument: %s (position: -1). (Nipype default value: parcellation.mif)

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • in_config (a pathlike object or string representing an existing file) – Connectome configuration file. Maps to a command-line argument: %s (position: -2).

  • num_threads (an integer) – Number of threads. if zero, the number of available cpus will be used. Maps to a command-line argument: -nthreads %d.

  • spine (a pathlike object or string representing a file) – Provide a manually-defined segmentation of the base of the spine where the streamlines terminate, so that this can become a node in the connection matrix. Maps to a command-line argument: -spine %s.

Outputs:

out_file (a pathlike object or string representing an existing file) – The output response file.