Connectomics Lab Toolkit Documentation
A comprehensive Python toolkit for neuroimaging data processing and analysis, specifically designed for working with brain connectivity data, BIDS datasets, and various neuroimaging formats.
Installation
Install from PyPI:
conda env create -f environment.yaml
conda activate clabtoolkit-env
pip install clabtoolkit
For development installation:
git clone https://github.com/connectomicslab/clabtoolkit.git
cd clabtoolkit
pip install -e .[dev]
Quick Start
Surface Visualization
import clabtoolkit.surfacetools as cltsurf
# Reading a surface file
surf_lh = cltsurf.Surface("/opt/freesurfer/subjects/fsaverage/surf/lh.pial")
# Loading scalar maps
surf_lh.load_scalar_maps("/opt/freesurfer/subjects/fsaverage/surf/lh.thickness", maps_names="Thickness")
surf_lh.plot(overlay_name="Thickness",
views="4_views",
cmap= "jet",
colorbar_position="right")
API Reference
- bidstools module
str2entity()entity2str()delete_entity()replace_entity_value()replace_entity_key()insert_entity()recursively_replace_entity_value()recursively_replace_entity_key()recursively_delete_entity()recursively_insert_entity()get_all_entities()entities4table()entities_to_table()get_subjects()copy_bids_folder()get_bids_database_table()get_derivatives_folders()is_bids_filename()get_individual_files_and_folders()generate_bids_tree()generate_bids_tree_with_stats()validate_bids_structure()load_bids_json()- Key Features
- Common Usage Examples
- connectivitytools module
- dicomtools module
- dwitools module
- freesurfertools module
AnnotParcellationFreeSurferSubjectcreate_individual_freesurfer_table()process_subject()create_freesurfer_table()create_fsaverage_links()remove_fsaverage_links()region_to_vertexwise()create_vertex_colors()colors2colortable()resolve_colortable_duplicates()find_unique_color()verify_packed_rgb_values()detect_hemi()parse_freesurfer_lta()get_cras_coordinates()load_lobes_json()get_version()- Key Features
- Main Classes
- Common Usage Examples
- imagetools module
MorphologicalOperationsquick_morphology()get_voxel_size()get_voxel_volume()get_center()get_rotation_matrix()get_vox_neighbors()crop_image_from_mask()cropped_to_native()apply_multi_transf()vox2mm()mm2vox()merge_to_4d()create_spams()spams2maxprob()simulate_image()delete_volumes_from_4D_images()extract_mesh_from_volume()extract_centroid_from_volume()create_spams_from_volume()spams2maxprob_from_volume()compute_statistics_at_nonzero_voxels()interpolate()region_growing()simulate_array()delete_volumes_from_4D_array()dilate_mm()- Key Features
- Main Classes
- Common Usage Examples
- misctools module
- morphometrytools module
compute_reg_val_fromannot()compute_reg_area_fromsurf()compute_reg_nvertices_fromsurf()compute_euler_fromsurf()area_from_mesh()euler_from_mesh()compute_reg_val_fromparcellation()compute_reg_volume_fromparcellation()parse_freesurfer_global_fromaseg()parse_freesurfer_stats_fromaseg()parse_freesurfer_cortex_stats()get_stats_dictionary()network_metrics_to_table()stats_from_vector()get_units()- Key Features
- Main Functions
- Common Usage Examples
- networktools module
- parcellationtools module
- pipelinetools module
get_ids2process()create_processing_status_table()process_file()process_freesurfer_subject()scan_derivatives()build_inventory()build_derivatives_inventory()get_processing_status_details_json()get_processing_status_details_sqlite3()query_processing_status_db()export_db_to_json()- Key Features
- Main Functions
- Common Usage Examples
- plottools module
- qcqatools module
- segmentationtools module
- surfacetools module
- visualizationtools module