cmtklib.bids.utils module

This module provides CMTK Utility functions to handle BIDS datasets.

CreateBIDSStandardParcellationLabelIndexMappingFile

Link to code

Bases: nipype.interfaces.base.core.BaseInterface

Creates the BIDS standard generic label-index mapping file that describes parcellation nodes.

roi_colorluta pathlike object or string representing an existing file

Path to FreesurferColorLUT.txt file that describes the RGB color of the graph nodes for a given parcellation.

roi_graphmla pathlike object or string representing an existing file

Path to graphml file that describes graph nodes for a given parcellation.

verbosea boolean

Verbose mode.

roi_bids_tsva pathlike object or string representing a file

Output BIDS standard generic label-index mapping file that describes parcellation nodes.

CreateCMPParcellationNodeDescriptionFilesFromBIDSFile

Link to code

Bases: nipype.interfaces.base.core.BaseInterface

Creates CMP graphml and FreeSurfer colorLUT files that describe parcellation nodes from the BIDS TSV file

roi_bids_tsva pathlike object or string representing an existing file

Output BIDS standard generic label-index mapping file that describes parcellation nodes.

roi_colorluta pathlike object or string representing a file

Path to FreesurferColorLUT.txt file that describes the RGB color of the graph nodes for a given parcellation.

roi_graphmla pathlike object or string representing a file

Path to graphml file that describes graph nodes for a given parcellation.

CreateMultipleCMPParcellationNodeDescriptionFilesFromBIDSFile

Link to code

Bases: nipype.interfaces.base.core.BaseInterface

Creates CMP graphml and FreeSurfer colorLUT files describing parcellation nodes from a list of BIDS TSV files

roi_bids_tsvs : a list of items which are a pathlike object or string representing an existing file

roi_colorluts : a list of items which are a pathlike object or string representing a file roi_graphmls : a list of items which are a pathlike object or string representing a file

cmtklib.bids.utils.get_native_space_files(filepathlist)[source]

Return a list of files without _space-<label>_ in the filename.

cmtklib.bids.utils.get_native_space_no_desc_files(filepathlist)[source]

Return a list of files without _space-<label>_ and _desc-<label>_ in the filename.

cmtklib.bids.utils.get_native_space_tsv_sidecar_files(filepathlist)[source]

Return path to tsv sidecar file of a list of niftis (nii.gz) without _space-<label>_ in their filename.

cmtklib.bids.utils.write_derivative_description(bids_dir, deriv_dir, pipeline_name)[source]

Write a dataset_description.json in each type of CMP derivatives.

Parameters
  • bids_dir (string) – BIDS root directory

  • deriv_dir (string) – Output/derivatives directory

  • pipeline_name (string) – Type of derivatives (['cmp-<version>', 'freesurfer-<version>', 'nipype-<version>'])