NIPY logo

Table Of Contents

Previous topic

nipype.interfaces.camino2trackvis.convert

Next topic

nipype.interfaces.cmtk.convert

This Page

nipype.interfaces.cmtk.cmtk

CreateMatrix

Performs connectivity mapping and outputs the result as a NetworkX graph and a Matlab matrix

Example

>>> import nipype.interfaces.cmtk.cmtk as ck
>>> conmap = ck.CreateMatrix()
>>> conmap.roi_file = 'fsLUT_aparc+aseg.nii'
>>> conmap.dict_file = 'fsLUT_aparc+aseg.pck'
>>> conmap.tract_file = 'fibers.trk'
>>> conmap.run()                 

Inputs:

[Mandatory]
dict_file : (an existing file name)
        Pickle file containing the label dictionary (see ROIGen)
resolution_network_file : (an existing file name)
        Parcellation files from Connectome Mapping Toolkit
roi_file : (an existing file name)
        Freesurfer aparc+aseg file
tract_file : (an existing file name)
        Trackvis tract file

[Optional]
out_endpoint_array_name : (a file name)
        Name for the generated endpoint arrays
out_matrix_file : (a file name)
        NetworkX graph describing the connectivity
out_matrix_mat_file : (a file name)
        Matlab matrix describing the connectivity

Outputs:

endpoint_file : (a file name)
        Saved Numpy array with the endpoints of each fiber
endpoint_file_mm : (a file name)
        Saved Numpy array with the endpoints of each fiber (in millimeters)
fiber_label_file : (a file name)
        Saved Numpy array with the labels for each fiber
fiber_length_file : (a file name)
        Saved Numpy array with the lengths of each fiber
matrix_file : (a file name)
        NetworkX graph describing the connectivity
matrix_mat_file : (a file name)
        Matlab matrix describing the connectivity

ROIGen

Generates a ROI file for connectivity mapping and a dictionary file containing relevant node information

Example

>>> import nipype.interfaces.cmtk.cmtk as ck
>>> rg = ck.ROIGen()
>>> rg.inputs.aparc_aseg_file = 'aparc+aseg.nii'
>>> rg.inputs.use_freesurfer_LUT = True
>>> rg.inputs.freesurfer_dir = '/usr/local/freesurfer'
>>> rg.run() 

The label dictionary is written to disk using Pickle. Resulting data can be loaded using:

>>> file = open("FreeSurferColorLUT_adapted_aparc+aseg_out.pck", "r")
>>> file = open("fsLUT_aparc+aseg.pck", "r")
>>> labelDict = pickle.load(file) 
>>> print labelDict                     

Inputs:

[Mandatory]
aparc_aseg_file : (an existing file name)
        Freesurfer aparc+aseg file

[Optional]
LUT_file : (an existing file name)
        Custom lookup table (cf. FreeSurferColorLUT.txt)
        exclusive: use_freesurfer_LUT
freesurfer_dir : (a directory name)
        Freesurfer main directory
        requires: use_freesurfer_LUT
ignore_exception : (a boolean)
        Print an error message instead of throwing an exception in case the interface fails to run
out_dict_file : (a file name)
        Label dictionary saved in Pickle format
out_roi_file : (a file name)
        Region of Interest file for connectivity mapping
use_freesurfer_LUT : (a boolean)
        Boolean value; Set to True to use default Freesurfer LUT, False for custom LUT
        exclusive: LUT_file

Outputs:

dict_file : (a file name)
        Label dictionary saved in Pickle format
roi_file : (a file name)
        Region of Interest file for connectivity mapping