├── .gitignore ├── COPYRIGHT ├── README.rst ├── cmp ├── __init__.py ├── binary │ ├── linux2 │ │ ├── bit32 │ │ │ ├── DTB_P0 │ │ │ ├── DTB_dtk2dir │ │ │ ├── DTB_gfa │ │ │ └── DTB_streamline │ │ └── bit64 │ │ │ ├── 181_vecs.dat │ │ │ ├── DTB_P0 │ │ │ ├── DTB_dtk2dir │ │ │ ├── DTB_gfa │ │ │ └── DTB_streamline │ └── ubuntu1104 │ │ └── bit32 │ │ ├── DTB_P0 │ │ ├── DTB_dtk2dir │ │ ├── DTB_gfa │ │ └── DTB_streamline ├── configuration.py ├── configuration.py.orig ├── connectome.py ├── data │ ├── colortable_and_gcs │ │ ├── colortable_desikan_killiany.txt │ │ ├── my_atlas_gcs │ │ │ ├── myatlasP17_28_lh.gcs │ │ │ ├── myatlasP17_28_rh.gcs │ │ │ ├── myatlasP1_16_lh.gcs │ │ │ ├── myatlasP1_16_rh.gcs │ │ │ ├── myatlasP29_36_lh.gcs │ │ │ ├── myatlasP29_36_rh.gcs │ │ │ ├── myatlas_125_lh.gcs │ │ │ ├── myatlas_125_rh.gcs │ │ │ ├── myatlas_250_lh.gcs │ │ │ ├── myatlas_250_rh.gcs │ │ │ ├── myatlas_36_lh.gcs │ │ │ ├── myatlas_36_rh.gcs │ │ │ ├── myatlas_60_lh.gcs │ │ │ └── myatlas_60_rh.gcs │ │ ├── original_color_125_L.txt │ │ ├── original_color_125_R.txt │ │ ├── original_color_250_L.txt │ │ ├── original_color_250_R.txt │ │ ├── original_color_36_L.txt │ │ ├── original_color_36_R.txt │ │ ├── original_color_60_L.txt │ │ ├── original_color_60_R.txt │ │ ├── original_color_P17_28_L.txt │ │ ├── original_color_P17_28_R.txt │ │ ├── original_color_P1_16_L.txt │ │ ├── original_color_P1_16_R.txt │ │ ├── original_color_P29_36_L.txt │ │ └── original_color_P29_36_R.txt │ ├── diffusion │ │ ├── gradient_tables │ │ │ ├── dsi_grad_514.txt │ │ │ ├── mgh_dti_006.txt │ │ │ ├── mgh_dti_018.txt │ │ │ ├── mgh_dti_030.txt │ │ │ ├── mgh_dti_042.txt │ │ │ ├── mgh_dti_060.txt │ │ │ ├── mgh_dti_072.txt │ │ │ ├── mgh_dti_090.txt │ │ │ ├── mgh_dti_120.txt │ │ │ ├── mgh_dti_144.txt │ │ │ ├── siemens_06.txt │ │ │ ├── siemens_12.txt │ │ │ ├── siemens_20.txt │ │ │ ├── siemens_256.txt │ │ │ ├── siemens_30.txt │ │ │ └── siemens_64.txt │ │ └── odf_directions │ │ │ ├── 181_vecs.dat │ │ │ └── 181_vecs.txt │ └── parcellation │ │ ├── lausanne2008 │ │ ├── ParcellationLausanne2008.xls │ │ ├── README.txt │ │ ├── resolution1015 │ │ │ └── resolution1015.graphml │ │ ├── resolution150 │ │ │ └── resolution150.graphml │ │ ├── resolution258 │ │ │ └── resolution258.graphml │ │ ├── resolution500 │ │ │ └── resolution500.graphml │ │ └── resolution83 │ │ │ └── resolution83.graphml │ │ └── nativefreesurfer │ │ ├── freesurferaparc │ │ ├── FreeSurferColorLUT_adapted.txt │ │ └── resolution83.graphml │ │ └── mapping.ods ├── gui.py ├── gui.py.orig ├── helpgui.py ├── helpgui.py.orig ├── info.py ├── logme.py ├── pipeline │ ├── __init__.py │ ├── pipeline.proto │ ├── pipeline_pb2.py │ └── pipeline_status.py ├── stages │ ├── __init__.py │ ├── connectionmatrix │ │ ├── __init__.py │ │ └── creatematrix.py │ ├── converter │ │ ├── __init__.py │ │ ├── cffconverter.py │ │ ├── dicomconverter.py │ │ └── dicomconverter.py~ │ ├── epiunwarp │ │ ├── __init__.py │ │ └── epiunwarp.py │ ├── parcellation │ │ ├── __init__.py │ │ └── maskcreation.py │ ├── postprocessing │ │ ├── __init__.py │ │ ├── fiberclustering.py │ │ └── fiberfilter.py │ ├── preprocessing │ │ ├── __init__.py │ │ └── organize.py │ ├── reconstruction │ │ ├── __init__.py │ │ ├── dtk.py │ │ └── dtk.py~ │ ├── registration │ │ ├── __init__.py │ │ ├── apply_registration.py │ │ └── registration.py │ ├── rsfmri │ │ ├── __init__.py │ │ ├── rsfmri_correlation.py │ │ ├── rsfmri_preprocessing.py │ │ └── rsfmri_registration.py │ ├── segmentation │ │ ├── __init__.py │ │ └── freesurfer.py │ ├── stats │ │ ├── __init__.py │ │ ├── fiber_statistics.py │ │ └── network_statistics.py │ ├── template_module │ │ ├── __init__.py │ │ └── modulename.py │ └── tractography │ │ ├── __init__.py │ │ └── tractography.py ├── util.py ├── util.py.orig └── utility │ ├── __init__.py │ └── scalars.py ├── doc ├── Makefile └── source │ ├── cmptemplates │ └── layout.html │ ├── conf.py │ ├── download.rst │ ├── exampleresults.rst │ ├── images │ ├── cffconverter.png │ ├── cffconverter_120.png │ ├── configuration.png │ ├── configuration_120.png │ ├── dicomconverter.png │ ├── dicomconverter_120.png │ ├── ex_cffconverter.png │ ├── ex_connectionmatrix.png │ ├── ex_parcellation.png │ ├── ex_parcellation2.png │ ├── ex_registration.png │ ├── ex_rsfMRI.png │ ├── ex_segmentation1.png │ ├── ex_segmentation2.png │ ├── ex_tractography1.png │ ├── ex_tractography2.png │ ├── fiberfiltering.png │ ├── fiberfiltering_120.png │ ├── maintab.png │ ├── maintab_120.png │ ├── metadata.png │ ├── metadata_120.png │ ├── parcellation.png │ ├── parcellation_120.png │ ├── reconstruction.png │ ├── reconstruction_120.png │ ├── registration.png │ ├── registration_120.png │ ├── rsfMRI_120.png │ ├── subject.png │ ├── subject_120.png │ ├── tractography.png │ └── tractography_120.png │ ├── index.rst │ ├── installation.rst │ └── mappingsteps.rst ├── example └── default_project │ └── map_connectome.py ├── scratch ├── compute_coords.py ├── extract_and_merge_cnetwork.py ├── ideas │ ├── WMfillHolesInLabels.m │ ├── atlas_creation_idea.py │ ├── connectomemapper_dti.py │ ├── convert.py │ ├── plotonsphere.py │ └── write_trackvis.py ├── inversecode │ ├── __init__.py │ ├── scratch.py │ └── util.py ├── map_dti_script.py ├── ordered_leftlabels_resolution1015.csv ├── ordered_leftlabels_resolution125.csv ├── ordered_leftlabels_resolution250.csv ├── ordered_leftlabels_resolution33.csv ├── ordered_leftlabels_resolution500.csv ├── ordered_leftlabels_resolution60.csv ├── ordered_rightlabels_resolution1015.csv ├── ordered_rightlabels_resolution125.csv ├── ordered_rightlabels_resolution250.csv ├── ordered_rightlabels_resolution33.csv ├── ordered_rightlabels_resolution500.csv ├── ordered_rightlabels_resolution60.csv ├── reorder_labels_parcellation1015.py ├── rsfmri │ ├── cv_rsfmri2FC.m │ ├── prep_rsFMRI.sh │ └── readme.txt └── subdivision_left_right_regions.txt ├── scripts └── connectomemapper ├── setup.py ├── setup_egg.py └── src ├── DTB ├── Applications │ ├── CMakeLists.txt │ ├── DTB_P0 │ │ ├── CMakeLists.txt │ │ └── main.cxx │ ├── DTB_dtk2dir │ │ ├── CMakeLists.txt │ │ └── main.cxx │ ├── DTB_gfa │ │ ├── CMakeLists.txt │ │ └── main.cxx │ └── DTB_streamline │ │ ├── CMakeLists.txt │ │ └── main.cxx ├── CMake │ ├── FindBLITZ.cmake │ └── FindNIFTI.cmake ├── CMakeFiles │ └── cmake.check_cache ├── CMakeLists.txt └── Common │ ├── 181_vecs.dat │ ├── NIFTI.h │ ├── TrackVis.h │ ├── streamline.h │ └── utils.h └── README.rst /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | /testdata 3 | /CMT.egg-info 4 | /build 5 | /doc/build/ 6 | /doc/build 7 | /src/cpp/build 8 | .settings/ 9 | .idea/ 10 | -------------------------------------------------------------------------------- /COPYRIGHT: -------------------------------------------------------------------------------- 1 | Copyright (C) 2009-2011, Ecole Polytechnique Fédérale de Lausanne (EPFL) and 2 | Hospital Center and University of Lausanne (UNIL-CHUV), Switzerland 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of the Ecole Polytechnique Fédérale de Lausanne (EPFL) 13 | and Hospital Center and University of Lausanne (UNIL-CHUV) nor the 14 | names of its contributors may be used to endorse or promote products 15 | derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL "Ecole Polytechnique Fédérale de Lausanne (EPFL) and 21 | Hospital Center and University of Lausanne (UNIL-CHUV)" BE LIABLE FOR ANY 22 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | THIS SOFTWARE IS FOR RESEARCH PURPOSES ONLY AND SHALL NOT BE USED FOR 30 | ANY CLINICAL USE. THIS SOFTWARE HAS NOT BEEN REVIEWED OR APPROVED BY 31 | THE FOOD AND DRUG ADMINISTRATION OR EQUIVALENT AUTHORITY, AND IS FOR 32 | NON-CLINICAL, IRB-APPROVED RESEARCH USE ONLY. IN NO EVENT SHALL DATA 33 | OR IMAGES GENERATED THROUGH THE USE OF THE SOFTWARE BE USED IN THE 34 | PROVISION OR PATIENT CARE. 35 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | ================= 2 | Connectome Mapper 3 | ================= 4 | 5 | Connectome Mapper implements a full diffusion MRI processing pipeline, 6 | from raw Diffusion/T1/T2 data to multi-resolution connection matrices. 7 | Moreover, the Connectome Mapper implements a full resting-state fMRI 8 | processing pipeline from raw fMRI data to multi-resolution functional 9 | connectivity matrices. 10 | The Connectome Mapper is part of the Connectome Mapping Toolkit. 11 | 12 | Copyright (C) 2009-2011, Ecole Polytechnique Fédérale de Lausanne (EPFL) and 13 | Hospital Center and University of Lausanne (UNIL-CHUV), Switzerland 14 | 15 | This software is distributed under the open-source license Modified BSD. 16 | 17 | ======= 18 | Credits 19 | ======= 20 | 21 | * Jean-Philippe Thiran 22 | * Reto Meuli 23 | * Patric Hagmann (pahagman) 24 | * Xavier Gigandet 25 | * Leila Cammoun 26 | * Alessandro Daducci (daducci) 27 | * Alia Lemkaddem (allem) 28 | * Stephan Gerhard (unidesigner) 29 | * Christophe Chênes (Cwis) 30 | * Alessandra Griffa (agriffa) 31 | 32 | ------------ 33 | Contributors 34 | ------------ 35 | 36 | Collaboration Children's Hospital Boston 37 | 38 | * Ellen Grant 39 | * Daniel Ginsburg (danginsburg) 40 | * Rudolph Pienaar (rudolphpienaar) 41 | -------------------------------------------------------------------------------- /cmp/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2009-2011, Ecole Polytechnique Federale de Lausanne (EPFL) and 2 | # Hospital Center and University of Lausanne (UNIL-CHUV), Switzerland 3 | # All rights reserved. 4 | # 5 | # This software is distributed under the open-source license Modified BSD. 6 | 7 | from .info import __version__ 8 | 9 | # PREPROCESSING 10 | import stages.preprocessing.organize as preprocessing 11 | 12 | # DICOM CONVERTER 13 | import stages.converter.dicomconverter as dicomconverter 14 | 15 | # EPI UNWARP 16 | import stages.epiunwarp.epiunwarp as epiunwarp 17 | # REGISTRATION 18 | import stages.registration.registration as registration 19 | 20 | # FREESURFER 21 | import stages.segmentation.freesurfer as freesurfer 22 | 23 | # MASK: ROI_HR_th.nii / fsmask_1mm.nii CREATION 24 | import stages.parcellation.maskcreation as maskcreation 25 | 26 | # DIFFUSION TOOLKIT 27 | import stages.reconstruction.dtk as dtk 28 | 29 | # REGISTRATION: Apply registration ROI/WM --> b0 30 | import stages.registration.apply_registration as apply_registration 31 | 32 | # TRACTOGRAPHY 33 | import stages.tractography.tractography as tractography 34 | 35 | # FIBER FILTERING 36 | import stages.postprocessing.fiberfilter as fiberfilter 37 | 38 | # FIBER CLUSTERING 39 | import stages.postprocessing.fiberclustering as fiberclustering 40 | 41 | # CONNECTION MATRIX 42 | import stages.connectionmatrix.creatematrix as connectionmatrix 43 | 44 | # RS-FMRI REGISTRATION 45 | import stages.rsfmri.rsfmri_registration as fmriregistration 46 | 47 | # RS-FMRI PREPROCESSING 48 | import stages.rsfmri.rsfmri_preprocessing as fmripreprocessing 49 | 50 | # RS-FMRI CONNECTOME 51 | import stages.rsfmri.rsfmri_correlation as fmriconnectionmatrix 52 | 53 | # STATISTICS 54 | import stages.stats.fiber_statistics as fiberstatistics 55 | 56 | # CFF CONVERTER 57 | import stages.converter.cffconverter as cffconverter 58 | 59 | # Pipeline Status 60 | import pipeline.pipeline_status as pipeline_status 61 | 62 | # others 63 | import configuration, connectome 64 | -------------------------------------------------------------------------------- /cmp/binary/linux2/bit32/DTB_P0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/binary/linux2/bit32/DTB_P0 -------------------------------------------------------------------------------- /cmp/binary/linux2/bit32/DTB_dtk2dir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/binary/linux2/bit32/DTB_dtk2dir -------------------------------------------------------------------------------- /cmp/binary/linux2/bit32/DTB_gfa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/binary/linux2/bit32/DTB_gfa -------------------------------------------------------------------------------- /cmp/binary/linux2/bit32/DTB_streamline: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/binary/linux2/bit32/DTB_streamline -------------------------------------------------------------------------------- /cmp/binary/linux2/bit64/181_vecs.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/binary/linux2/bit64/181_vecs.dat -------------------------------------------------------------------------------- /cmp/binary/linux2/bit64/DTB_P0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/binary/linux2/bit64/DTB_P0 -------------------------------------------------------------------------------- /cmp/binary/linux2/bit64/DTB_dtk2dir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/binary/linux2/bit64/DTB_dtk2dir -------------------------------------------------------------------------------- /cmp/binary/linux2/bit64/DTB_gfa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/binary/linux2/bit64/DTB_gfa -------------------------------------------------------------------------------- /cmp/binary/linux2/bit64/DTB_streamline: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/binary/linux2/bit64/DTB_streamline -------------------------------------------------------------------------------- /cmp/binary/ubuntu1104/bit32/DTB_P0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/binary/ubuntu1104/bit32/DTB_P0 -------------------------------------------------------------------------------- /cmp/binary/ubuntu1104/bit32/DTB_dtk2dir: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/binary/ubuntu1104/bit32/DTB_dtk2dir -------------------------------------------------------------------------------- /cmp/binary/ubuntu1104/bit32/DTB_gfa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/binary/ubuntu1104/bit32/DTB_gfa -------------------------------------------------------------------------------- /cmp/binary/ubuntu1104/bit32/DTB_streamline: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/binary/ubuntu1104/bit32/DTB_streamline -------------------------------------------------------------------------------- /cmp/connectome.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2009-2011, Ecole Polytechnique Federale de Lausanne (EPFL) and 2 | # Hospital Center and University of Lausanne (UNIL-CHUV), Switzerland 3 | # All rights reserved. 4 | # 5 | # This software is distributed under the open-source license Modified BSD. 6 | 7 | # Connectome Mapping Execution Engine 8 | 9 | import cmp 10 | from logme import * 11 | 12 | def setup_pipeline_status(cobj): 13 | cobj.init_pipeline_status() 14 | 15 | # Add all of the stages to the pipeline status file 16 | # This needs to be done before starting processing so 17 | # that the stages in the pipeline are laid out before 18 | # processing begins 19 | stages = [ (cmp.dicomconverter, cobj.active_dicomconverter), 20 | # (cmp.epiunwarp, cobj.active_epiunwarp), 21 | (cmp.freesurfer, cobj.active_segmentation), 22 | (cmp.registration, cobj.active_registration), 23 | (cmp.maskcreation, cobj.active_parcellation), 24 | (cmp.apply_registration, cobj.active_applyregistration), 25 | (cmp.dtk, cobj.active_reconstruction), 26 | (cmp.tractography, cobj.active_tractography), 27 | (cmp.fiberfilter, cobj.active_fiberfilter), 28 | (cmp.connectionmatrix, cobj.active_connectome), 29 | (cmp.fmriregistration, cobj.active_rsfmri_registration), 30 | (cmp.fmripreprocessing, cobj.active_rsfmri_preprocessing), 31 | (cmp.fmriconnectionmatrix, cobj.active_rsfmri_connectionmatrix), 32 | # (cmp.fiberstatistics, cobj.active_statistics), 33 | (cmp.cffconverter, cobj.active_cffconverter) ] 34 | 35 | for stage,stageEnabled in stages: 36 | cobj.pipeline_status.AddStage( stage.__name__, True ) 37 | if hasattr(stage,'declare_inputs'): 38 | stage.declare_inputs(cobj) 39 | if hasattr(stage,'declare_outputs'): 40 | stage.declare_outputs(cobj) 41 | 42 | # Save pipeline to disk 43 | cobj.update_pipeline_status() 44 | 45 | return stages 46 | 47 | def mapit(cobj): 48 | 49 | cobj.consistency_check() 50 | 51 | stages = setup_pipeline_status(cobj) 52 | 53 | cmp.preprocessing.run( cobj ) 54 | 55 | # Set the logger function for the PipelineStatus object 56 | cobj.pipeline_status.SetLoggerFunctions(cobj.get_logger().error, cobj.get_logger().info) 57 | 58 | # Execute the pipeline 59 | for stage, stageEnabled in stages: 60 | if stageEnabled == True: 61 | curStageObj = cobj.pipeline_status.GetStage( stage.__name__ ) 62 | 63 | # Check if the inputs exist 64 | if curStageObj != None: 65 | if cobj.pipeline_status.CanRun( curStageObj ) == False: 66 | # TODO: depending on the stage's missing file, point to required stages 67 | msg = "Required input file missing for stage: '%s'. Please run all previous stages." % (stage.__name__) 68 | cobj.get_logger().error( msg ) 69 | raise Exception( msg ) 70 | # If stage was already completed and user asked to skip completed stages, skip 71 | # this stage. 72 | elif (cobj.skip_completed_stages == True and 73 | cobj.pipeline_status.RanOK( curStageObj, 74 | checkTimestamp=True, 75 | timestampRootFile=cobj.get_pipeline_status_file() ) == True): 76 | cobj.get_logger().info( "Skipping previously completed stage: '%s'" % ( stage.__name__) ) 77 | continue 78 | 79 | # Run the stage 80 | if hasattr(stage, 'run'): 81 | stage.run( cobj ) 82 | 83 | # Check if the stage ran properly 84 | if curStageObj != None: 85 | if cobj.pipeline_status.RanOK( stage=curStageObj, 86 | storeTimestamp=True, 87 | timestampRootFile=cobj.get_pipeline_status_file() ) == False: 88 | msg = "Required output file not generated for stage: '%s'" % (stage.__name__) 89 | cobj.get_logger().error( msg ) 90 | raise Exception( msg ) 91 | 92 | -------------------------------------------------------------------------------- /cmp/data/colortable_and_gcs/colortable_desikan_killiany.txt: -------------------------------------------------------------------------------- 1 | 0 unknown 25 5 25 0 2 | 1 bankssts 25 100 40 0 3 | 2 caudalanteriorcingulate 125 100 160 0 4 | 3 caudalmiddlefrontal 100 25 0 0 5 | 4 corpuscallosum 120 70 50 0 6 | 5 cuneus 220 20 100 0 7 | 6 entorhinal 220 20 10 0 8 | 7 fusiform 180 220 140 0 9 | 8 inferiorparietal 220 60 220 0 10 | 9 inferiortemporal 180 40 120 0 11 | 10 isthmuscingulate 140 20 140 0 12 | 11 lateraloccipital 20 30 140 0 13 | 12 lateralorbitofrontal 35 75 50 0 14 | 13 lingual 225 140 140 0 15 | 14 medialorbitofrontal 200 35 75 0 16 | 15 middletemporal 160 100 50 0 17 | 16 parahippocampal 20 220 60 0 18 | 17 paracentral 60 220 60 0 19 | 18 parsopercularis 220 180 140 0 20 | 19 parsorbitalis 20 100 50 0 21 | 20 parstriangularis 220 60 20 0 22 | 21 pericalcarine 120 100 60 0 23 | 22 postcentral 220 20 20 0 24 | 23 posteriorcingulate 220 180 220 0 25 | 24 precentral 60 20 220 0 26 | 25 precuneus 160 140 180 0 27 | 26 rostralanteriorcingulate 80 20 140 0 28 | 27 rostralmiddlefrontal 75 50 125 0 29 | 28 superiorfrontal 20 220 160 0 30 | 29 superiorparietal 20 180 140 0 31 | 30 superiortemporal 140 220 220 0 32 | 31 supramarginal 80 160 20 0 33 | 32 frontalpole 100 0 100 0 34 | 33 temporalpole 70 70 70 0 35 | 34 transversetemporal 150 150 200 0 36 | -------------------------------------------------------------------------------- /cmp/data/colortable_and_gcs/my_atlas_gcs/myatlasP17_28_lh.gcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/data/colortable_and_gcs/my_atlas_gcs/myatlasP17_28_lh.gcs -------------------------------------------------------------------------------- /cmp/data/colortable_and_gcs/my_atlas_gcs/myatlasP17_28_rh.gcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/data/colortable_and_gcs/my_atlas_gcs/myatlasP17_28_rh.gcs -------------------------------------------------------------------------------- /cmp/data/colortable_and_gcs/my_atlas_gcs/myatlasP1_16_lh.gcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/data/colortable_and_gcs/my_atlas_gcs/myatlasP1_16_lh.gcs -------------------------------------------------------------------------------- /cmp/data/colortable_and_gcs/my_atlas_gcs/myatlasP1_16_rh.gcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/data/colortable_and_gcs/my_atlas_gcs/myatlasP1_16_rh.gcs -------------------------------------------------------------------------------- /cmp/data/colortable_and_gcs/my_atlas_gcs/myatlasP29_36_lh.gcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/data/colortable_and_gcs/my_atlas_gcs/myatlasP29_36_lh.gcs -------------------------------------------------------------------------------- /cmp/data/colortable_and_gcs/my_atlas_gcs/myatlasP29_36_rh.gcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/data/colortable_and_gcs/my_atlas_gcs/myatlasP29_36_rh.gcs -------------------------------------------------------------------------------- /cmp/data/colortable_and_gcs/my_atlas_gcs/myatlas_125_lh.gcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/data/colortable_and_gcs/my_atlas_gcs/myatlas_125_lh.gcs -------------------------------------------------------------------------------- /cmp/data/colortable_and_gcs/my_atlas_gcs/myatlas_125_rh.gcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/data/colortable_and_gcs/my_atlas_gcs/myatlas_125_rh.gcs -------------------------------------------------------------------------------- /cmp/data/colortable_and_gcs/my_atlas_gcs/myatlas_250_lh.gcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/data/colortable_and_gcs/my_atlas_gcs/myatlas_250_lh.gcs -------------------------------------------------------------------------------- /cmp/data/colortable_and_gcs/my_atlas_gcs/myatlas_250_rh.gcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/data/colortable_and_gcs/my_atlas_gcs/myatlas_250_rh.gcs -------------------------------------------------------------------------------- /cmp/data/colortable_and_gcs/my_atlas_gcs/myatlas_36_lh.gcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/data/colortable_and_gcs/my_atlas_gcs/myatlas_36_lh.gcs -------------------------------------------------------------------------------- /cmp/data/colortable_and_gcs/my_atlas_gcs/myatlas_36_rh.gcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/data/colortable_and_gcs/my_atlas_gcs/myatlas_36_rh.gcs -------------------------------------------------------------------------------- /cmp/data/colortable_and_gcs/my_atlas_gcs/myatlas_60_lh.gcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/data/colortable_and_gcs/my_atlas_gcs/myatlas_60_lh.gcs -------------------------------------------------------------------------------- /cmp/data/colortable_and_gcs/my_atlas_gcs/myatlas_60_rh.gcs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/data/colortable_and_gcs/my_atlas_gcs/myatlas_60_rh.gcs -------------------------------------------------------------------------------- /cmp/data/colortable_and_gcs/original_color_125_L.txt: -------------------------------------------------------------------------------- 1 | 0 unknown 25 5 25 0 2 | 1 bankssts_1 25 100 40 0 3 | 2 caudalanteriorcingulate_1 125 100 160 0 4 | 3 caudalmiddlefrontal_1 100 25 0 0 5 | 4 corpuscallosum 120 70 50 0 6 | 5 cuneus_1 220 20 100 0 7 | 6 entorhinal_1 220 20 10 0 8 | 7 fusiform_1 180 220 140 0 9 | 8 inferiorparietal_1 220 60 220 0 10 | 9 inferiortemporal_1 180 40 120 0 11 | 10 isthmuscingulate_1 140 20 140 0 12 | 11 lateraloccipital_1 20 30 140 0 13 | 12 lateralorbitofrontal_1 35 75 50 0 14 | 13 lingual_1 225 140 140 0 15 | 14 medialorbitofrontal_1 200 35 75 0 16 | 15 middletemporal_1 160 100 50 0 17 | 16 parahippocampal_1 20 220 60 0 18 | 17 paracentral_1 60 220 60 0 19 | 18 parsopercularis_1 220 180 140 0 20 | 19 parsorbitalis_1 20 100 50 0 21 | 20 parstriangularis_1 220 60 20 0 22 | 21 pericalcarine_1 120 100 60 0 23 | 22 postcentral_1 220 20 20 0 24 | 23 posteriorcingulate_1 220 180 220 0 25 | 24 precentral_1 60 20 220 0 26 | 25 precuneus_1 160 140 180 0 27 | 26 rostralanteriorcingulate_1 80 20 140 0 28 | 27 rostralmiddlefrontal_1 75 50 125 0 29 | 28 superiorfrontal_1 20 220 160 0 30 | 29 superiorparietal_1 20 180 140 0 31 | 30 superiortemporal_1 140 220 220 0 32 | 31 supramarginal_1 80 160 20 0 33 | 32 frontalpole_1 100 0 100 0 34 | 33 temporalpole_1 70 70 70 0 35 | 34 transversetemporal_1 150 150 200 0 36 | 35 insula_1 255 192 32 0 37 | 36 bankssts_2 25 77 40 0 38 | 37 caudalmiddlefrontal_2 82 25 0 0 39 | 38 caudalmiddlefrontal_3 83 25 0 0 40 | 39 fusiform_2 180 194 140 0 41 | 40 fusiform_3 180 195 140 0 42 | 41 fusiform_4 180 196 140 0 43 | 42 inferiorparietal_2 212 60 220 0 44 | 43 inferiorparietal_3 213 60 220 0 45 | 44 inferiorparietal_4 214 60 220 0 46 | 45 inferiorparietal_5 215 60 220 0 47 | 46 inferiortemporal_2 162 40 120 0 48 | 47 inferiortemporal_3 163 40 120 0 49 | 48 inferiortemporal_4 164 40 120 0 50 | 49 lateraloccipital_2 20 30 127 0 51 | 50 lateraloccipital_3 20 30 128 0 52 | 51 lateraloccipital_4 20 30 129 0 53 | 52 lateraloccipital_5 20 30 130 0 54 | 53 lateralorbitofrontal_2 35 72 50 0 55 | 54 lateralorbitofrontal_3 35 73 50 0 56 | 55 lateralorbitofrontal_4 35 74 50 0 57 | 56 lingual_2 227 140 140 0 58 | 57 lingual_3 228 140 140 0 59 | 58 lingual_4 229 140 140 0 60 | 59 medialorbitofrontal_2 182 35 75 0 61 | 60 middletemporal_2 152 100 50 0 62 | 61 middletemporal_3 153 100 50 0 63 | 62 middletemporal_4 154 100 50 0 64 | 63 paracentral_2 60 200 60 0 65 | 64 parsopercularis_2 202 180 140 0 66 | 65 postcentral_2 219 20 20 0 67 | 66 postcentral_3 221 20 20 0 68 | 67 postcentral_4 222 20 20 0 69 | 68 postcentral_5 223 20 20 0 70 | 69 postcentral_6 224 20 20 0 71 | 70 postcentral_7 220 6 20 0 72 | 71 posteriorcingulate_2 220 180 202 0 73 | 72 precentral_2 60 20 211 0 74 | 73 precentral_3 60 20 212 0 75 | 74 precentral_4 60 20 213 0 76 | 75 precentral_5 60 20 214 0 77 | 76 precentral_6 60 20 215 0 78 | 77 precentral_7 60 20 216 0 79 | 78 precentral_8 60 20 217 0 80 | 79 precuneus_2 160 140 162 0 81 | 80 precuneus_3 160 140 163 0 82 | 81 precuneus_4 160 140 164 0 83 | 82 precuneus_5 160 140 165 0 84 | 83 rostralmiddlefrontal_2 75 50 122 0 85 | 84 rostralmiddlefrontal_3 75 50 123 0 86 | 85 rostralmiddlefrontal_4 75 50 124 0 87 | 86 rostralmiddlefrontal_5 75 50 126 0 88 | 87 rostralmiddlefrontal_6 71 50 125 0 89 | 88 superiorfrontal_2 20 194 160 0 90 | 89 superiorfrontal_3 20 195 160 0 91 | 90 superiorfrontal_4 20 196 160 0 92 | 91 superiorfrontal_5 20 197 160 0 93 | 92 superiorfrontal_6 20 198 160 0 94 | 93 superiorfrontal_7 20 199 160 0 95 | 94 superiorfrontal_8 20 200 160 0 96 | 95 superiorfrontal_9 20 201 160 0 97 | 96 superiorparietal_2 20 162 140 0 98 | 97 superiorparietal_3 20 163 140 0 99 | 98 superiorparietal_4 20 164 140 0 100 | 99 superiorparietal_5 20 165 140 0 101 | 100 superiorparietal_6 20 166 140 0 102 | 101 superiorparietal_7 20 167 140 0 103 | 102 superiortemporal_2 140 220 202 0 104 | 103 superiortemporal_3 140 220 203 0 105 | 104 superiortemporal_4 140 220 204 0 106 | 105 superiortemporal_5 140 220 205 0 107 | 106 supramarginal_2 80 152 20 0 108 | 107 supramarginal_3 80 153 20 0 109 | 108 supramarginal_4 80 154 20 0 110 | 109 supramarginal_5 80 155 20 0 111 | 110 insula_2 227 192 32 0 112 | 111 insula_3 228 192 32 0 113 | 112 insula_4 229 192 32 0 114 | -------------------------------------------------------------------------------- /cmp/data/colortable_and_gcs/original_color_125_R.txt: -------------------------------------------------------------------------------- 1 | 0 unknown 25 5 25 0 2 | 1 bankssts_1 25 100 40 0 3 | 2 caudalanteriorcingulate_1 125 100 160 0 4 | 3 caudalmiddlefrontal_1 100 25 0 0 5 | 4 corpuscallosum 120 70 50 0 6 | 5 cuneus_1 220 20 100 0 7 | 6 entorhinal_1 220 20 10 0 8 | 7 fusiform_1 180 220 140 0 9 | 8 inferiorparietal_1 220 60 220 0 10 | 9 inferiortemporal_1 180 40 120 0 11 | 10 isthmuscingulate_1 140 20 140 0 12 | 11 lateraloccipital_1 20 30 140 0 13 | 12 lateralorbitofrontal_1 35 75 50 0 14 | 13 lingual_1 225 140 140 0 15 | 14 medialorbitofrontal_1 200 35 75 0 16 | 15 middletemporal_1 160 100 50 0 17 | 16 parahippocampal_1 20 220 60 0 18 | 17 paracentral_1 60 220 60 0 19 | 18 parsopercularis_1 220 180 140 0 20 | 19 parsorbitalis_1 20 100 50 0 21 | 20 parstriangularis_1 220 60 20 0 22 | 21 pericalcarine_1 120 100 60 0 23 | 22 postcentral_1 220 20 20 0 24 | 23 posteriorcingulate_1 220 180 220 0 25 | 24 precentral_1 60 20 220 0 26 | 25 precuneus_1 160 140 180 0 27 | 26 rostralanteriorcingulate_1 80 20 140 0 28 | 27 rostralmiddlefrontal_1 75 50 125 0 29 | 28 superiorfrontal_1 20 220 160 0 30 | 29 superiorparietal_1 20 180 140 0 31 | 30 superiortemporal_1 140 220 220 0 32 | 31 supramarginal_1 80 160 20 0 33 | 32 frontalpole_1 100 0 100 0 34 | 33 temporalpole_1 70 70 70 0 35 | 34 transversetemporal_1 150 150 200 0 36 | 35 insula_1 255 192 32 0 37 | 36 caudalmiddlefrontal_2 82 25 0 0 38 | 37 caudalmiddlefrontal_3 83 25 0 0 39 | 38 cuneus_2 202 20 100 0 40 | 39 fusiform_2 180 194 140 0 41 | 40 fusiform_3 180 195 140 0 42 | 41 fusiform_4 180 196 140 0 43 | 42 inferiorparietal_2 212 60 220 0 44 | 43 inferiorparietal_3 213 60 220 0 45 | 44 inferiorparietal_4 214 60 220 0 46 | 45 inferiorparietal_5 215 60 220 0 47 | 46 inferiorparietal_6 216 60 220 0 48 | 47 inferiortemporal_2 162 40 120 0 49 | 48 inferiortemporal_3 163 40 120 0 50 | 49 inferiortemporal_4 164 40 120 0 51 | 50 lateraloccipital_2 20 30 127 0 52 | 51 lateraloccipital_3 20 30 128 0 53 | 52 lateraloccipital_4 20 30 129 0 54 | 53 lateraloccipital_5 20 30 130 0 55 | 54 lateralorbitofrontal_2 35 72 50 0 56 | 55 lateralorbitofrontal_3 35 73 50 0 57 | 56 lateralorbitofrontal_4 35 74 50 0 58 | 57 lingual_2 227 140 140 0 59 | 58 lingual_3 228 140 140 0 60 | 59 medialorbitofrontal_2 182 35 75 0 61 | 60 medialorbitofrontal_3 183 35 75 0 62 | 61 middletemporal_2 152 100 50 0 63 | 62 middletemporal_3 153 100 50 0 64 | 63 middletemporal_4 154 100 50 0 65 | 64 paracentral_2 60 200 60 0 66 | 65 paracentral_3 60 201 60 0 67 | 66 parsopercularis_2 202 180 140 0 68 | 67 parstriangularis_2 211 60 20 0 69 | 68 pericalcarine_2 102 100 60 0 70 | 69 postcentral_2 219 20 20 0 71 | 70 postcentral_3 221 20 20 0 72 | 71 postcentral_4 222 20 20 0 73 | 72 postcentral_5 223 20 20 0 74 | 73 posteriorcingulate_2 220 180 202 0 75 | 74 precentral_2 60 20 211 0 76 | 75 precentral_3 60 20 212 0 77 | 76 precentral_4 60 20 213 0 78 | 77 precentral_5 60 20 214 0 79 | 78 precentral_6 60 20 215 0 80 | 79 precuneus_2 160 140 162 0 81 | 80 precuneus_3 160 140 163 0 82 | 81 precuneus_4 160 140 164 0 83 | 82 precuneus_5 160 140 165 0 84 | 83 rostralmiddlefrontal_2 75 50 122 0 85 | 84 rostralmiddlefrontal_3 75 50 123 0 86 | 85 rostralmiddlefrontal_4 75 50 124 0 87 | 86 rostralmiddlefrontal_5 75 50 126 0 88 | 87 rostralmiddlefrontal_6 71 50 125 0 89 | 88 superiorfrontal_2 20 194 160 0 90 | 89 superiorfrontal_3 20 195 160 0 91 | 90 superiorfrontal_4 20 196 160 0 92 | 91 superiorfrontal_5 20 197 160 0 93 | 92 superiorfrontal_6 20 198 160 0 94 | 93 superiorfrontal_7 20 199 160 0 95 | 94 superiorfrontal_8 20 200 160 0 96 | 95 superiorparietal_2 20 162 140 0 97 | 96 superiorparietal_3 20 163 140 0 98 | 97 superiorparietal_4 20 164 140 0 99 | 98 superiorparietal_5 20 165 140 0 100 | 99 superiorparietal_6 20 166 140 0 101 | 100 superiorparietal_7 20 167 140 0 102 | 101 superiortemporal_2 140 220 202 0 103 | 102 superiortemporal_3 140 220 203 0 104 | 103 superiortemporal_4 140 220 204 0 105 | 104 superiortemporal_5 140 220 205 0 106 | 105 supramarginal_2 80 152 20 0 107 | 106 supramarginal_3 80 153 20 0 108 | 107 supramarginal_4 80 154 20 0 109 | 108 insula_2 227 192 32 0 110 | 109 insula_3 228 192 32 0 111 | -------------------------------------------------------------------------------- /cmp/data/colortable_and_gcs/original_color_36_L.txt: -------------------------------------------------------------------------------- 1 | 0 unknown 25 5 25 0 2 | 1 bankssts 25 100 40 0 3 | 2 caudalanteriorcingulate 125 100 160 0 4 | 3 caudalmiddlefrontal 100 25 0 0 5 | 4 corpuscallosum 120 70 50 0 6 | 5 cuneus 220 20 100 0 7 | 6 entorhinal 220 20 10 0 8 | 7 fusiform 180 220 140 0 9 | 8 inferiorparietal 220 60 220 0 10 | 9 inferiortemporal 180 40 120 0 11 | 10 isthmuscingulate 140 20 140 0 12 | 11 lateraloccipital 20 30 140 0 13 | 12 lateralorbitofrontal 35 75 50 0 14 | 13 lingual 225 140 140 0 15 | 14 medialorbitofrontal 200 35 75 0 16 | 15 middletemporal 160 100 50 0 17 | 16 parahippocampal 20 220 60 0 18 | 17 paracentral 60 220 60 0 19 | 18 parsopercularis 220 180 140 0 20 | 19 parsorbitalis 20 100 50 0 21 | 20 parstriangularis 220 60 20 0 22 | 21 pericalcarine 120 100 60 0 23 | 22 postcentral 220 20 20 0 24 | 23 posteriorcingulate 220 180 220 0 25 | 24 precentral 60 20 220 0 26 | 25 precuneus 160 140 180 0 27 | 26 rostralanteriorcingulate 80 20 140 0 28 | 27 rostralmiddlefrontal 75 50 125 0 29 | 28 superiorfrontal 20 220 160 0 30 | 29 superiorparietal 20 180 140 0 31 | 30 superiortemporal 140 220 220 0 32 | 31 supramarginal 80 160 20 0 33 | 32 frontalpole 100 0 100 0 34 | 33 temporalpole 70 70 70 0 35 | 34 transversetemporal 150 150 200 0 36 | 35 insula 255 192 32 0 37 | -------------------------------------------------------------------------------- /cmp/data/colortable_and_gcs/original_color_36_R.txt: -------------------------------------------------------------------------------- 1 | 0 unknown 25 5 25 0 2 | 1 bankssts 25 100 40 0 3 | 2 caudalanteriorcingulate 125 100 160 0 4 | 3 caudalmiddlefrontal 100 25 0 0 5 | 4 corpuscallosum 120 70 50 0 6 | 5 cuneus 220 20 100 0 7 | 6 entorhinal 220 20 10 0 8 | 7 fusiform 180 220 140 0 9 | 8 inferiorparietal 220 60 220 0 10 | 9 inferiortemporal 180 40 120 0 11 | 10 isthmuscingulate 140 20 140 0 12 | 11 lateraloccipital 20 30 140 0 13 | 12 lateralorbitofrontal 35 75 50 0 14 | 13 lingual 225 140 140 0 15 | 14 medialorbitofrontal 200 35 75 0 16 | 15 middletemporal 160 100 50 0 17 | 16 parahippocampal 20 220 60 0 18 | 17 paracentral 60 220 60 0 19 | 18 parsopercularis 220 180 140 0 20 | 19 parsorbitalis 20 100 50 0 21 | 20 parstriangularis 220 60 20 0 22 | 21 pericalcarine 120 100 60 0 23 | 22 postcentral 220 20 20 0 24 | 23 posteriorcingulate 220 180 220 0 25 | 24 precentral 60 20 220 0 26 | 25 precuneus 160 140 180 0 27 | 26 rostralanteriorcingulate 80 20 140 0 28 | 27 rostralmiddlefrontal 75 50 125 0 29 | 28 superiorfrontal 20 220 160 0 30 | 29 superiorparietal 20 180 140 0 31 | 30 superiortemporal 140 220 220 0 32 | 31 supramarginal 80 160 20 0 33 | 32 frontalpole 100 0 100 0 34 | 33 temporalpole 70 70 70 0 35 | 34 transversetemporal 150 150 200 0 36 | 35 insula 255 192 32 0 37 | -------------------------------------------------------------------------------- /cmp/data/colortable_and_gcs/original_color_60_L.txt: -------------------------------------------------------------------------------- 1 | 0 unknown 25 5 25 0 2 | 1 bankssts_1 25 100 40 0 3 | 2 caudalanteriorcingulate_1 125 100 160 0 4 | 3 caudalmiddlefrontal_1 100 25 0 0 5 | 4 corpuscallosum 120 70 50 0 6 | 5 cuneus_1 220 20 100 0 7 | 6 entorhinal_1 220 20 10 0 8 | 7 fusiform_1 180 220 140 0 9 | 8 inferiorparietal_1 220 60 220 0 10 | 9 inferiortemporal_1 180 40 120 0 11 | 10 isthmuscingulate_1 140 20 140 0 12 | 11 lateraloccipital_1 20 30 140 0 13 | 12 lateralorbitofrontal_1 35 75 50 0 14 | 13 lingual_1 225 140 140 0 15 | 14 medialorbitofrontal_1 200 35 75 0 16 | 15 middletemporal_1 160 100 50 0 17 | 16 parahippocampal_1 20 220 60 0 18 | 17 paracentral_1 60 220 60 0 19 | 18 parsopercularis_1 220 180 140 0 20 | 19 parsorbitalis_1 20 100 50 0 21 | 20 parstriangularis_1 220 60 20 0 22 | 21 pericalcarine_1 120 100 60 0 23 | 22 postcentral_1 220 20 20 0 24 | 23 posteriorcingulate_1 220 180 220 0 25 | 24 precentral_1 60 20 220 0 26 | 25 precuneus_1 160 140 180 0 27 | 26 rostralanteriorcingulate_1 80 20 140 0 28 | 27 rostralmiddlefrontal_1 75 50 125 0 29 | 28 superiorfrontal_1 20 220 160 0 30 | 29 superiorparietal_1 20 180 140 0 31 | 30 superiortemporal_1 140 220 220 0 32 | 31 supramarginal_1 80 160 20 0 33 | 32 frontalpole_1 100 0 100 0 34 | 33 temporalpole_1 70 70 70 0 35 | 34 transversetemporal_1 150 150 200 0 36 | 35 insula_1 255 192 32 0 37 | 36 fusiform_2 180 194 140 0 38 | 37 inferiorparietal_2 212 60 220 0 39 | 38 inferiortemporal_2 162 40 120 0 40 | 39 lateraloccipital_2 20 30 127 0 41 | 40 lateralorbitofrontal_2 35 72 50 0 42 | 41 lingual_2 227 140 140 0 43 | 42 middletemporal_2 152 100 50 0 44 | 43 postcentral_2 219 20 20 0 45 | 44 postcentral_3 221 20 20 0 46 | 45 precentral_2 60 20 211 0 47 | 46 precentral_3 60 20 212 0 48 | 47 precentral_4 60 20 213 0 49 | 48 precuneus_2 160 140 162 0 50 | 49 rostralmiddlefrontal_2 75 50 122 0 51 | 50 rostralmiddlefrontal_3 75 50 123 0 52 | 51 superiorfrontal_2 20 194 160 0 53 | 52 superiorfrontal_3 20 195 160 0 54 | 53 superiorfrontal_4 20 196 160 0 55 | 54 superiorparietal_2 20 162 140 0 56 | 55 superiorparietal_3 20 163 140 0 57 | 56 superiortemporal_2 140 220 202 0 58 | 57 supramarginal_2 80 152 20 0 59 | 58 insula_2 227 192 32 0 60 | -------------------------------------------------------------------------------- /cmp/data/colortable_and_gcs/original_color_60_R.txt: -------------------------------------------------------------------------------- 1 | 0 unknown 25 5 25 0 2 | 1 bankssts_1 25 100 40 0 3 | 2 caudalanteriorcingulate_1 125 100 160 0 4 | 3 caudalmiddlefrontal_1 100 25 0 0 5 | 4 corpuscallosum 120 70 50 0 6 | 5 cuneus_1 220 20 100 0 7 | 6 entorhinal_1 220 20 10 0 8 | 7 fusiform_1 180 220 140 0 9 | 8 inferiorparietal_1 220 60 220 0 10 | 9 inferiortemporal_1 180 40 120 0 11 | 10 isthmuscingulate_1 140 20 140 0 12 | 11 lateraloccipital_1 20 30 140 0 13 | 12 lateralorbitofrontal_1 35 75 50 0 14 | 13 lingual_1 225 140 140 0 15 | 14 medialorbitofrontal_1 200 35 75 0 16 | 15 middletemporal_1 160 100 50 0 17 | 16 parahippocampal_1 20 220 60 0 18 | 17 paracentral_1 60 220 60 0 19 | 18 parsopercularis_1 220 180 140 0 20 | 19 parsorbitalis_1 20 100 50 0 21 | 20 parstriangularis_1 220 60 20 0 22 | 21 pericalcarine_1 120 100 60 0 23 | 22 postcentral_1 220 20 20 0 24 | 23 posteriorcingulate_1 220 180 220 0 25 | 24 precentral_1 60 20 220 0 26 | 25 precuneus_1 160 140 180 0 27 | 26 rostralanteriorcingulate_1 80 20 140 0 28 | 27 rostralmiddlefrontal_1 75 50 125 0 29 | 28 superiorfrontal_1 20 220 160 0 30 | 29 superiorparietal_1 20 180 140 0 31 | 30 superiortemporal_1 140 220 220 0 32 | 31 supramarginal_1 80 160 20 0 33 | 32 frontalpole_1 100 0 100 0 34 | 33 temporalpole_1 70 70 70 0 35 | 34 transversetemporal_1 150 150 200 0 36 | 35 insula_1 255 192 32 0 37 | 36 fusiform_2 180 194 140 0 38 | 37 inferiorparietal_2 212 60 220 0 39 | 38 inferiorparietal_3 213 60 220 0 40 | 39 inferiortemporal_2 162 40 120 0 41 | 40 lateraloccipital_2 20 30 127 0 42 | 41 lateraloccipital_3 20 30 128 0 43 | 42 lateralorbitofrontal_2 35 72 50 0 44 | 43 lingual_2 227 140 140 0 45 | 44 medialorbitofrontal_2 182 35 75 0 46 | 45 middletemporal_2 152 100 50 0 47 | 46 postcentral_2 219 20 20 0 48 | 47 precentral_2 60 20 211 0 49 | 48 precentral_3 60 20 212 0 50 | 49 precuneus_2 160 140 162 0 51 | 50 rostralmiddlefrontal_2 75 50 122 0 52 | 51 superiorfrontal_2 20 194 160 0 53 | 52 superiorfrontal_3 20 195 160 0 54 | 53 superiorfrontal_4 20 196 160 0 55 | 54 superiorparietal_2 20 162 140 0 56 | 55 superiorparietal_3 20 163 140 0 57 | 56 superiortemporal_2 140 220 202 0 58 | 57 supramarginal_2 80 152 20 0 59 | 58 insula_2 227 192 32 0 60 | -------------------------------------------------------------------------------- /cmp/data/diffusion/gradient_tables/mgh_dti_006.txt: -------------------------------------------------------------------------------- 1 | 1, 1, 0 2 | -1, 1, 0 3 | 1, 0, 1 4 | -1, 0, 1 5 | 0, 1, 1 6 | 0, -1, 1 7 | -------------------------------------------------------------------------------- /cmp/data/diffusion/gradient_tables/mgh_dti_018.txt: -------------------------------------------------------------------------------- 1 | 1.0000000000, 0.0000000000, 0.0000000000 2 | 0.6751463781, -0.7189312596, -0.1652731430 3 | 0.6751472935, -0.1652760049, 0.7189297422 4 | 0.6751479586, 0.7189301144, 0.1652716683 5 | -0.9999999999, 0.0000056818, 0.0000022998 6 | 0.2034128195, 0.8298328729, -0.5196158464 7 | -0.6751504583, -0.3914932523, -0.6252238733 8 | 0.2034137268, 0.5196128036, 0.8298345558 9 | -0.2034108733, 0.2193578471, -0.9542044600 10 | 0.2034071219, -0.5196160113, -0.8298341662 11 | -0.6751447723, 0.6252284477, -0.3914957530 12 | -0.2034132660, -0.9542037705, -0.2193586272 13 | -0.2034075826, 0.9542049795, 0.2193586383 14 | -0.2034099752, -0.2193594185, 0.9542042901 15 | -0.6751438785, 0.3914977979, 0.6252281324 16 | -0.6751495646, -0.6252235580, 0.3914952974 17 | 0.6751470434, 0.1652688066, -0.7189316319 18 | 0.2034080292, -0.8298358492, 0.5196129685 19 | -------------------------------------------------------------------------------- /cmp/data/diffusion/gradient_tables/mgh_dti_030.txt: -------------------------------------------------------------------------------- 1 | 1.0000000000, 0.0000000000, 0.0000000000 2 | 0.7703189794, -0.6334477240, 0.0731618129 3 | 0.2561448687, -0.0249786863, 0.9663156169 4 | 0.7976459349, -0.1068670680, 0.5935826751 5 | -0.4615578229, 0.8761728334, 0.1388723949 6 | -0.2292204126, 0.8533775040, -0.4681931632 7 | -0.2630794898, -0.4113047154, -0.8727070603 8 | 0.7992449025, 0.5854349684, 0.1359171940 9 | 0.5067126566, 0.5103287334, 0.6948430524 10 | 0.3054330813, -0.1364364527, -0.9423883102 11 | -0.7972741706, -0.1949622700, -0.5712649212 12 | -0.8042542270, -0.5926021950, -0.0446964971 13 | 0.1865635668, 0.9537832611, 0.2355663949 14 | -0.3881893823, 0.1079319091, 0.9152375137 15 | -0.1339272628, 0.6629447625, 0.7365919699 16 | -0.3384961835, -0.8809697404, 0.3306246365 17 | 0.7673774759, 0.3119018842, -0.5602222989 18 | 0.4065245350, -0.6656047592, 0.6258658858 19 | 0.2871876223, -0.7612264361, -0.5814271946 20 | -0.7661480348, 0.4319864923, 0.4758201964 21 | -0.1793153505, -0.5264136055, 0.8311045187 22 | -0.7673768974, -0.3119020115, 0.5602230203 23 | 0.2179780246, -0.9751760272, 0.0389524925 24 | 0.4189866219, 0.8397110024, -0.3454499142 25 | 0.1777380470, 0.4786928124, -0.8598036857 26 | -0.3397814897, -0.8554854208, -0.3907598163 27 | -0.7844890989, 0.5119797541, -0.3499336868 28 | -0.4197498720, 0.2604620840, -0.8694650929 29 | 0.7734515702, -0.3550403437, -0.5250895379 30 | -0.9984481940, 0.0477096943, 0.0287226207 31 | -------------------------------------------------------------------------------- /cmp/data/diffusion/gradient_tables/mgh_dti_042.txt: -------------------------------------------------------------------------------- 1 | 1.0000000000, 0.0000000000, 0.0000000000 2 | 0.4918315906, -0.8325036973, -0.2550279994 3 | 0.8058917831, -0.2752635069, 0.5241835896 4 | 0.4918243114, -0.7897736205, 0.3665603294 5 | -0.4381722597, 0.8967745945, -0.0616473641 6 | -0.1055049351, 0.8285041662, -0.5499541393 7 | -0.6013526883, 0.0161960973, -0.7988195233 8 | 0.4968412547, 0.8169244910, 0.2928875954 9 | 0.8231124236, 0.3169085016, 0.4712270575 10 | -0.0219780959, -0.1036177133, -0.9943743424 11 | -0.7463937677, -0.4341513326, -0.5043896945 12 | -0.5104342308, -0.8332053594, -0.2126634078 13 | 0.1229862240, 0.9900724965, -0.0680502782 14 | 0.5061009746, 0.0731944308, 0.8593627749 15 | 0.3290448239, 0.5789815212, 0.7459959128 16 | -0.5104398129, -0.7962705590, 0.3246604292 17 | 0.3290649344, 0.4714630067, -0.8181924604 18 | 0.3272552527, -0.4537055802, 0.8288879575 19 | 0.3272724444, -0.5628600725, -0.7590001883 20 | -0.6013759729, 0.1253450783, 0.7890725889 21 | -0.2934924437, -0.4113353911, 0.8629399640 22 | -0.7464102555, -0.3610536658, 0.5590277103 23 | -0.0312051920, -0.8070212103, 0.5896973818 24 | 0.4968466276, 0.7691699637, -0.4018967473 25 | -0.8479854012, 0.5287709815, -0.0363594354 26 | -0.0311912438, -0.8801242478, -0.4737176529 27 | -0.9463457555, 0.0642824417, -0.3166977720 28 | -0.2934672537, -0.5255490724, -0.7985456427 29 | 0.8058993947, -0.3444031091, -0.4815731139 30 | -0.9078186710, -0.4183766215, 0.0287447946 31 | 0.8479917549, -0.5287608963, 0.0363579184 32 | 0.5061174595, -0.0450841158, -0.8612853996 33 | 0.8381787114, 0.5441123705, -0.0373921918 34 | -0.0219996300, 0.0334181096, 0.9991993026 35 | 0.0208099796, -0.9974294561, 0.0685669371 36 | -0.9463552192, 0.1070096003, 0.3048946450 37 | -0.2091054910, 0.5191617038, 0.8287014052 38 | -0.2090807855, 0.4008899405, -0.8919486985 39 | -0.6322729339, 0.5523828896, -0.5432348299 40 | -0.1055182271, 0.8959595930, 0.4314189512 41 | -0.6322878642, 0.6215162330, 0.4625252739 42 | 0.8231182004, 0.2494544408, -0.5101459694 43 | -------------------------------------------------------------------------------- /cmp/data/diffusion/gradient_tables/mgh_dti_060.txt: -------------------------------------------------------------------------------- 1 | 1.0000000000, 0.0000000000, 0.0000000000 2 | 0.5867917880, -0.3765825401, -0.7168409782 3 | 0.8941946396, 0.0229172218, 0.4470914307 4 | 0.7292807003, -0.4109697317, 0.5470407112 5 | -0.1542514872, 0.9643685389, -0.2149413870 6 | 0.1171358937, 0.7735388946, -0.6228296405 7 | -0.4075748558, -0.4149938010, -0.8134266298 8 | 0.2113303675, 0.7537379261, 0.6222689246 9 | 0.0953754479, -0.9695170076, 0.2256995700 10 | -0.1354495929, -0.0334895243, -0.9902180869 11 | -0.1421249090, -0.7505207879, -0.6453828764 12 | -0.6370086516, 0.7461087590, -0.1937568003 13 | 0.0805627090, 0.9716688439, 0.2221920516 14 | 0.1068711102, -0.0212132049, 0.9940465612 15 | 0.2987471838, 0.3872142910, 0.8722472201 16 | -0.2074923466, -0.8034317141, 0.5580720446 17 | 0.3311253599, -0.0403370235, -0.9427242017 18 | -0.8052938703, -0.5894943816, -0.0632309772 19 | 0.3372782393, -0.7497744517, -0.5692817061 20 | 0.5923956565, -0.7613903146, 0.2633480110 21 | -0.0889786763, -0.4656499028, 0.8804845048 22 | -0.5279822841, -0.4309273477, 0.7318034768 23 | -0.3691107672, -0.9270817276, 0.0653965747 24 | 0.3119141107, 0.9263806671, -0.2110176467 25 | -0.6845107095, 0.4393361237, -0.5817463872 26 | -0.0301144372, -0.9666234693, -0.2544252134 27 | -0.3375681082, 0.7446536700, -0.5757939598 28 | -0.5748043973, 0.0248056695, -0.8179147777 29 | 0.2711345897, -0.7478336044, 0.6059958204 30 | -0.9351846353, 0.1854208474, 0.3017429489 31 | 0.8890828042, 0.3096650018, -0.3371043665 32 | -0.8843427628, 0.0335738057, -0.4656293348 33 | 0.5450453160, 0.5863166623, -0.5992982354 34 | -0.3507739501, -0.0162741008, 0.9363187436 35 | 0.4161578229, -0.9005281933, -0.1259430007 36 | -0.7326543804, 0.0032497924, 0.6805931220 37 | -0.7392091927, 0.6114227884, 0.2823684530 38 | -0.2563531817, 0.4068753637, -0.8767756182 39 | -0.9190233497, 0.3725215524, -0.1289332220 40 | -0.2572930879, 0.7654856997, 0.5897727617 41 | -0.5898325959, 0.4339526330, 0.6810158743 42 | 0.8911355730, -0.1859567819, -0.4138809802 43 | 0.6790668275, 0.1421053101, -0.7201904780 44 | -0.8798114304, -0.3095542322, 0.3607048990 45 | -0.6216091234, -0.6971946467, 0.3571018374 46 | 0.8970498267, -0.4302092257, 0.1011020795 47 | -0.1633471451, 0.4178925801, 0.8936909430 48 | -0.5071832929, -0.7783088090, -0.3701357929 49 | 0.1070146247, -0.4463982695, -0.8884123227 50 | 0.8834848752, 0.4352636229, 0.1732052363 51 | 0.5981714157, 0.0298426427, 0.8008123214 52 | 0.6961919295, 0.6981038794, -0.1672356743 53 | -0.3935564738, 0.9008076113, 0.1834637547 54 | -0.7610879393, -0.4028968520, -0.5083495602 55 | 0.2103242675, 0.3961643680, -0.8937659067 56 | 0.3760324590, -0.3789549152, 0.8455724463 57 | 0.7357633769, -0.6114614743, -0.2911479325 58 | -0.9872142951, -0.1458661333, -0.0642729085 59 | 0.5292124419, 0.8073646995, 0.2609529333 60 | 0.6629178857, 0.4726722554, 0.5806210604 61 | -------------------------------------------------------------------------------- /cmp/data/diffusion/gradient_tables/mgh_dti_072.txt: -------------------------------------------------------------------------------- 1 | 1.0000000000, 0.0000000000, 0.0000000000 2 | 0.6771415786, -0.7358412192, 0.0041210061 3 | 0.2938636735, -0.1784940274, 0.9390335583 4 | 0.9015380501, 0.0453643989, 0.4303152513 5 | 0.3001274715, 0.8230285917, 0.4822317265 6 | 0.3478340626, -0.5180863201, -0.7814077232 7 | -0.4124973783, 0.7057101084, 0.5760374604 8 | -0.4836693948, 0.8593972946, 0.1658318620 9 | 0.9015318660, -0.3574469448, 0.2438687686 10 | 0.1151753850, -0.1240303876, -0.9855714554 11 | -0.4920945213, -0.4472503797, -0.7468668422 12 | 0.3817091148, -0.5446325079, 0.7467754569 13 | 0.3081660341, 0.9492654078, 0.0626807863 14 | 0.1487220287, 0.2404126682, 0.9592098348 15 | 0.3941882332, 0.5196769381, 0.7579917656 16 | -0.7027333730, -0.5816592833, 0.4096807105 17 | 0.3340884935, 0.2860053476, -0.8981012302 18 | -0.2688196877, -0.7649698092, -0.5852838342 19 | 0.2820867599, -0.9482532797, -0.1457490219 20 | -0.2630283976, 0.3523009054, 0.8981648702 21 | -0.8223476177, -0.5689695762, -0.0042446535 22 | -0.4532195605, -0.4290849007, 0.7813310297 23 | -0.0722080652, -0.9755478826, 0.2075869073 24 | -0.1117981910, 0.8689616755, -0.4820858544 25 | -0.5392286922, 0.2410929362, -0.8069117756 26 | -0.1440188701, -0.9675140414, -0.2077862960 27 | -0.6245561883, 0.5716112559, -0.5321561235 28 | 0.7208770650, -0.3728965494, -0.5841955328 29 | 0.8881515339, -0.4219173325, -0.1821335151 30 | -0.9591774119, -0.2163658894, 0.1821112141 31 | 0.5790216096, 0.1165209179, 0.8069429046 32 | -0.3259067371, -0.1093497831, -0.9390566669 33 | 0.6607697552, 0.7320582077, -0.1657531632 34 | -0.1396863604, -0.0958670488, 0.9855441287 35 | 0.3544914378, -0.8959868728, 0.2674758763 36 | -0.7852096126, -0.2054759653, 0.5841450950 37 | -0.8970523429, 0.1613529242, 0.4114150312 38 | 0.1650857305, 0.6421783292, -0.7485677625 39 | -0.9755337676, 0.2198496051, 0.0001390752 40 | -0.0198976874, 0.6626514426, 0.7486635744 41 | 0.0940657693, -0.8054701935, 0.5851234044 42 | 0.8744225321, 0.3821965486, -0.2988495165 43 | 0.5575764203, 0.5977900483, -0.5759822859 44 | -0.5427965979, -0.7960707254, -0.2676625739 45 | -0.6405969336, 0.3640790323, 0.6760784177 46 | 0.6421537632, -0.6351836284, 0.4291623268 47 | -0.0460118050, -0.4990614825, 0.8653441804 48 | -0.4836431346, -0.8630792385, 0.1455456848 49 | -0.0647999111, -0.4968033458, -0.8654405856 50 | 0.6407879248, 0.7236204342, 0.2564455158 51 | 0.7033074678, -0.2593827949, 0.6618754954 52 | 0.7050269047, 0.2143573675, -0.6760088628 53 | -0.8695512209, 0.2424883299, -0.4302093491 54 | -0.4660321086, 0.8468059275, -0.2563860269 55 | -0.0919574474, 0.9937969814, -0.0625410869 56 | 0.7348790300, 0.4203179406, 0.5322458455 57 | 0.5577108026, -0.7218069037, -0.4098212469 58 | -0.7660883673, -0.4783700740, -0.4292676156 59 | 0.9071150643, 0.4031204703, 0.1209799425 60 | 0.9106420068, -0.0397282344, -0.4112819019 61 | -0.0920170605, 0.9271138113, 0.3633081908 62 | -0.7963019489, 0.5926990874, -0.1208759606 63 | -0.7431288245, -0.0982861897, -0.6618907577 64 | -0.5287314006, -0.0027528567, 0.8487847358 65 | -0.2703315994, 0.5937774865, -0.7578582472 66 | 0.1485821216, -0.8220410813, -0.5497015679 67 | -0.7690078810, 0.5650310804, 0.2989427322 68 | -0.0922169341, 0.2674340061, -0.9591533191 69 | 0.5151623090, -0.1187946315, -0.8488201405 70 | -0.9580665351, -0.1504637140, -0.2438630457 71 | 0.2936288213, 0.8842390512, -0.3631850982 72 | -0.3256672690, -0.7693751484, 0.5495477331 73 | -------------------------------------------------------------------------------- /cmp/data/diffusion/gradient_tables/mgh_dti_090.txt: -------------------------------------------------------------------------------- 1 | 1.0000000000, 0.0000000000, 0.0000000000 2 | 0.5500267418, -0.4765521741, 0.6858342427 3 | 0.3852421161, 0.7758149672, 0.4996995582 4 | 0.1969586181, 0.9554703753, 0.2197354423 5 | -0.4106219286, 0.8452825911, 0.3418873686 6 | -0.6695330649, -0.0511426907, 0.7410195005 7 | 0.7185783926, 0.5910287399, 0.3665107394 8 | -0.1888702410, 0.3940895565, -0.8994561987 9 | 0.7952743355, -0.4579438479, 0.3972734113 10 | -0.3942144083, -0.5978303085, -0.6979927810 11 | 0.1263624584, -0.1750323226, -0.9764201017 12 | 0.1227950189, 0.6487546533, 0.7510251547 13 | -0.9533814620, 0.1732861235, -0.2470540573 14 | -0.8099706624, 0.2841831441, 0.5130179981 15 | -0.0570573793, -0.3699084559, 0.9273145042 16 | -0.5549730612, 0.7261674893, -0.4058148330 17 | -0.5958921214, 0.5843220365, 0.5508904947 18 | 0.4907474010, -0.7562794866, 0.4326757752 19 | -0.9045382650, -0.3965535867, 0.1567028395 20 | 0.4891989964, -0.0248726526, -0.8718174654 21 | -0.9977403674, -0.0448529873, 0.0500236812 22 | -0.8160763167, 0.5517896002, -0.1718943926 23 | 0.9281220625, -0.0719241118, 0.3652620416 24 | -0.1670454376, 0.9829978824, 0.0762298159 25 | -0.2290989528, 0.0352834196, -0.9727634605 26 | 0.2277763130, 0.3305896767, 0.9158757649 27 | 0.7808773307, 0.1473593244, -0.6070550418 28 | 0.5229595065, 0.4794088030, 0.7047556697 29 | -0.9085615180, -0.0566797947, 0.4138881114 30 | 0.5425117638, -0.8069945549, -0.2333254687 31 | 0.9297536817, -0.3640672968, 0.0548916623 32 | 0.9310968694, 0.2693014425, -0.2460393315 33 | 0.3361729570, -0.2516331138, 0.9075618540 34 | -0.5305639359, 0.8465218378, -0.0436198116 35 | 0.8210388163, -0.5039884513, -0.2681247897 36 | 0.9270770547, 0.3203695855, 0.1946572967 37 | 0.8020789992, 0.5946592871, -0.0552232853 38 | -0.7530535877, -0.3804529421, 0.5368108165 39 | -0.2284129487, -0.3308857862, -0.9156102453 40 | -0.5677349770, 0.1430774746, -0.8106823249 41 | -0.1489991972, -0.6900362901, 0.7082719516 42 | -0.5080634117, -0.7754311224, -0.3749375201 43 | 0.1783584951, 0.9724632003, -0.1500119032 44 | 0.5078896068, 0.0954015524, 0.8561230583 45 | -0.4682216877, -0.8833431287, 0.0217570217 46 | 0.0387911290, -0.5730066350, -0.8186321789 47 | 0.2150521723, -0.6216927557, 0.7531604613 48 | -0.7251654298, -0.4604377774, -0.5119884299 49 | -0.2787355769, -0.8890145116, 0.3632625445 50 | -0.7694598658, -0.6233942046, -0.1389646735 51 | 0.0671467438, -0.0038653206, 0.9977356233 52 | 0.5008422152, 0.3489849707, -0.7920647483 53 | -0.4931018861, 0.5032246026, -0.7096587413 54 | -0.9296358211, -0.2697120600, -0.2510630292 55 | -0.0539234273, 0.8734814612, 0.4838619645 56 | -0.1541507768, 0.3407811882, 0.9274188480 57 | -0.8297186728, -0.0457764853, -0.5563015704 58 | 0.1199034902, -0.8781277294, 0.4631574718 59 | -0.4340547509, -0.3695265146, 0.8216122127 60 | 0.1848752648, -0.9511003349, -0.2474455279 61 | -0.2670258441, 0.6431783926, 0.7176480709 62 | -0.9364401798, 0.3193932483, 0.1451473128 63 | -0.5720318322, -0.2328078595, -0.7864986226 64 | -0.2010649207, 0.7364789401, -0.6458882785 65 | 0.3649424237, -0.9241588515, 0.1129045815 66 | 0.1257868105, 0.8588638807, -0.4965183909 67 | 0.7225396683, -0.1439331966, 0.6761801997 68 | 0.7887425996, 0.2402816994, 0.5658178296 69 | -0.7430828401, 0.6371503766, 0.2046149801 70 | 0.2734352933, -0.7705802763, -0.5757075456 71 | 0.7326429751, 0.5105870689, -0.4500390161 72 | 0.7073757163, -0.7002672218, 0.0961530754 73 | -0.7764038952, 0.3585502485, -0.5183036857 74 | 0.1643192320, 0.2064691304, -0.9645567314 75 | -0.6806437075, -0.6882706234, 0.2510133309 76 | 0.9272553302, -0.1368138639, -0.3485391213 77 | 0.4339218660, 0.6721744978, -0.5999110423 78 | -0.5167370695, 0.2950519940, 0.8036959137 79 | -0.4930972321, -0.6539864334, 0.5737219400 80 | -0.1963107508, -0.9556691888, -0.2194504282 81 | 0.5194954119, 0.8149891909, -0.2567433264 82 | 0.3888557436, -0.4129452835, -0.8235699141 83 | 0.1352663995, 0.5703909358, -0.8101587384 84 | 0.7230497514, -0.2390890428, -0.6481014477 85 | 0.5418556090, 0.8320194336, 0.1188955881 86 | -0.0169291674, -0.9934100662, 0.1133571505 87 | -0.2214384526, 0.9280535567, -0.2994688755 88 | -0.3169918014, -0.0280803534, 0.9480124954 89 | 0.5958641212, -0.5838270357, -0.5514453203 90 | -0.1140885768, -0.8218250420, -0.5582001405 91 | -------------------------------------------------------------------------------- /cmp/data/diffusion/gradient_tables/mgh_dti_120.txt: -------------------------------------------------------------------------------- 1 | 1.0000000000, 0.0000000000, 0.0000000000 2 | 0.8158672124, -0.0398383136, -0.5768653226 3 | -0.5485043271, 0.7908735630, -0.2714074617 4 | 0.2770360493, 0.9583816906, -0.0689605855 5 | 0.5937547745, -0.7881079451, -0.1622995206 6 | -0.2627236103, 0.7574523973, 0.5976973902 7 | -0.6068084180, 0.7868992094, 0.1121301828 8 | -0.5642739799, 0.6885156428, 0.4555667735 9 | 0.7931599914, -0.5969328256, 0.1206997495 10 | -0.5917768017, -0.5619309228, 0.5779566202 11 | -0.9972383290, 0.0597146952, -0.0441573358 12 | 0.6003472677, -0.4112473980, 0.6858999458 13 | 0.3143633557, 0.1571327474, 0.9362077655 14 | -0.0234247077, 0.9829917063, 0.1821499062 15 | -0.9554098274, -0.2569915302, -0.1454215081 16 | 0.6442413880, 0.2136264038, -0.7343819125 17 | 0.0630937739, -0.8050369023, 0.5898599508 18 | -0.8001171185, -0.5899629292, -0.1084266509 19 | 0.0421706979, 0.3506443050, 0.9355587654 20 | 0.5929973408, -0.1314913231, -0.7943954844 21 | -0.7914559475, 0.5528058612, 0.2607741604 22 | -0.9080226666, -0.3941448002, 0.1419320724 23 | -0.7010248753, 0.5363590201, -0.4699820481 24 | -0.0788376201, 0.7760025128, -0.6257832929 25 | -0.5611043185, 0.0694567895, -0.8248258592 26 | 0.6217775850, -0.6452185880, 0.4439432490 27 | -0.7762193739, 0.6170970188, -0.1291307587 28 | 0.3542353290, 0.7437447915, 0.5668871287 29 | 0.2866518329, -0.4245320383, 0.8588383288 30 | -0.0095931242, -0.5786148641, 0.8155444874 31 | -0.2758468323, -0.9582035245, 0.0758586228 32 | 0.8008723326, 0.5955658847, 0.0624882692 33 | 0.1911817085, -0.1419577991, 0.9712350578 34 | 0.9468321319, 0.2570772690, 0.1934429933 35 | -0.7553189958, 0.3594515323, 0.5479852282 36 | 0.0975766547, 0.5742482423, -0.8128454666 37 | 0.0316114547, 0.8748949152, 0.4832800463 38 | -0.9276238083, 0.3731055035, 0.0175029531 39 | -0.2299715634, 0.5173949235, -0.8242666880 40 | -0.2678956060, 0.2101181562, -0.9402565100 41 | 0.6060426723, 0.1923322190, 0.7718293832 42 | -0.5375959009, -0.2703446810, -0.7986891764 43 | -0.8974455425, 0.3171236471, -0.3066334790 44 | -0.8155404941, -0.3407454045, 0.4677459478 45 | -0.9260870383, 0.2190867751, 0.3071868850 46 | -0.7735416558, 0.2051138132, -0.5996345805 47 | -0.0443606958, -0.6907902722, -0.7216930985 48 | -0.4796468034, -0.8058987384, 0.3470823638 49 | -0.5963325918, -0.5305289342, -0.6024338054 50 | -0.0202326581, -0.8898740607, -0.4557573867 51 | -0.6382885464, -0.2322349598, 0.7339309605 52 | -0.2494539106, 0.8933092578, -0.3738600223 53 | 0.7359599209, 0.6206386780, -0.2705006951 54 | -0.8306847338, -0.0028135031, 0.5567359851 55 | 0.0794388133, 0.6662409870, 0.7414933729 56 | 0.3444756550, 0.4691576901, 0.8131590157 57 | 0.3046387767, -0.8958487094, -0.3234969945 58 | -0.3092070035, -0.5075232929, -0.8042456938 59 | -0.1786890887, -0.8992229080, 0.3993349111 60 | 0.8297013937, -0.3832088597, 0.4058898459 61 | 0.8277161247, 0.1940238410, 0.5265365760 62 | 0.7925320752, 0.4851439202, 0.3694973427 63 | 0.2884522755, -0.7440091556, -0.6026986486 64 | -0.3739743743, -0.4359806253, 0.8185744081 65 | 0.0291866872, -0.0244286849, -0.9992754258 66 | 0.0647975855, 0.2910348101, -0.9545155903 67 | 0.9447870861, -0.3192147076, 0.0740225119 68 | -0.3362209394, 0.2378190823, 0.9112615233 69 | -0.2073066391, 0.5289582722, 0.8229380922 70 | 0.9460797287, 0.0849624546, -0.3125932310 71 | 0.3951926475, 0.4242804344, -0.8147446743 72 | -0.2880411905, -0.1258118283, -0.9493174687 73 | -0.4227317658, 0.6875989607, -0.5903435637 74 | 0.5941262503, 0.5607015480, -0.5767389120 75 | -0.8193811516, -0.4080304269, -0.4026483565 76 | 0.3046952676, 0.9157828976, 0.2617297810 77 | 0.9243069061, 0.3584829192, -0.1309455609 78 | 0.7672838547, -0.1183817967, 0.6302866304 79 | 0.4719789269, 0.8170501626, -0.3311569479 80 | -0.0034515542, -0.9899674883, -0.1412531728 81 | 0.3089075981, 0.7252855369, -0.6152535946 82 | 0.3186011719, -0.8674284064, 0.3821796081 83 | -0.5327656657, 0.3974937084, -0.7471007275 84 | 0.9403924268, -0.0714878294, 0.3324929680 85 | 0.5850403763, 0.7423752779, 0.3265068218 86 | -0.5704515875, -0.8213306965, 0.0009344587 87 | -0.3233890475, 0.8955790573, 0.3055448836 88 | -0.3509386954, 0.9360034738, -0.0271942837 89 | -0.0755857042, 0.0495387902, 0.9959079824 90 | 0.5187298186, -0.4527610056, -0.7252081405 91 | 0.8123905083, -0.5422193695, -0.2145223000 92 | 0.5854968328, -0.6632587578, -0.4661343999 93 | -0.0432329950, 0.9896096334, -0.1371265163 94 | 0.3641159294, 0.1112258622, -0.9246882704 95 | 0.0595630738, -0.9773678816, 0.2029883349 96 | 0.5581462788, -0.8128589333, 0.1665325372 97 | 0.1386361013, 0.9066298312, -0.3985001637 98 | 0.2165846327, -0.5179252036, -0.8275533700 99 | -0.5112598268, 0.4788201944, 0.7136838311 100 | 0.3562678679, -0.6644174412, 0.6569799616 101 | 0.6006708051, 0.5009937119, 0.6230568869 102 | -0.9280119983, -0.0160612954, -0.3722039303 103 | 0.7664730840, -0.3682316918, -0.5262360996 104 | -0.6195045485, 0.1284612945, 0.7744106211 105 | -0.3870864563, -0.1008568139, 0.9165107628 106 | 0.8128160406, 0.3387637070, -0.4738873651 107 | -0.0999634124, -0.2982088957, 0.9492516898 108 | -0.7300557332, -0.6338496420, 0.2554471719 109 | 0.2981419779, -0.2168490046, -0.9295632685 110 | 0.3118663978, -0.9501251572, -0.0012390959 111 | 0.9338519807, -0.2422242823, -0.2631499099 112 | 0.5103678785, -0.1298496065, 0.8500962935 113 | 0.5683016331, 0.8228172259, -0.0022508539 114 | -0.3226325986, -0.9114424590, -0.2553054054 115 | -0.2869217361, -0.7038115651, 0.6498655230 116 | -0.6022140736, -0.7258684115, -0.3323450896 117 | -0.9638455703, -0.0988908745, 0.2474314275 118 | -0.0470343539, -0.3564415737, -0.9331329884 119 | -0.3361809066, -0.7599746195, -0.5562562139 120 | -0.7718185129, -0.1529063718, -0.6171837850 121 | -------------------------------------------------------------------------------- /cmp/data/diffusion/gradient_tables/siemens_06.txt: -------------------------------------------------------------------------------- 1 | 1, 0, 1 2 | -1, 0, 1 3 | 0, 1, 1 4 | 0, 1, -1 5 | 1, 1, 0 6 | -1, 1, 0 7 | -------------------------------------------------------------------------------- /cmp/data/diffusion/gradient_tables/siemens_12.txt: -------------------------------------------------------------------------------- 1 | 1.000000, 0.414250, -0.414250 2 | 1.000000, -0.414250, -0.414250 3 | 1.000000, -0.414250, 0.414250 4 | 1.000000, 0.414250, 0.414250 5 | 0.414250, 0.414250, 1.000000 6 | 0.414250, 1.000000, 0.414250 7 | 0.414250, 1.000000, -0.414250 8 | 0.414250, 0.414250, -1.000000 9 | 0.414250, -0.414250, -1.000000 10 | 0.414250, -1.000000, -0.414250 11 | 0.414250, -1.000000, 0.414250 12 | 0.414250, -0.414250, 1.000000 13 | -------------------------------------------------------------------------------- /cmp/data/diffusion/gradient_tables/siemens_20.txt: -------------------------------------------------------------------------------- 1 | 1.000000, 0.000000, 0.000000 2 | 0.000000, 1.000000, 0.000000 3 | -0.031984, 0.799591, 0.599693 4 | 0.856706, 0.493831, -0.148949 5 | 0.834429, 0.309159, 0.456234 6 | 0.834429, -0.309159, 0.456234 7 | 0.856706, -0.493831, -0.148949 8 | 0.822228, 0.000000, -0.569158 9 | 0.550834, 0.425872, -0.717784 10 | 0.468173, 0.834308, -0.291108 11 | 0.515933, 0.808894, 0.281963 12 | 0.391890, 0.515855, 0.761785 13 | 0.478151, 0.000000, 0.878278 14 | 0.391890, -0.515855, 0.761785 15 | 0.515933, -0.808894, 0.281963 16 | 0.468173, -0.834308, -0.291108 17 | 0.550834, -0.425872, -0.717784 18 | 0.111012, -0.264029, -0.958105 19 | 0.111012, 0.264029, -0.958105 20 | 0.031984, 0.799591, -0.599693 21 | -------------------------------------------------------------------------------- /cmp/data/diffusion/gradient_tables/siemens_30.txt: -------------------------------------------------------------------------------- 1 | -0.208098, 0.525514, 0.850005 2 | 0.202387, 0.526131, 0.851002 3 | 0.409956, 0.175267, 0.918257 4 | -0.412630, 0.742620, 0.565889 5 | -0.207127, 0.959492, 0.280092 6 | -0.872713, 0.525505, 0.064764 7 | -0.746815, 0.526129, 0.455449 8 | -0.415238, 0.175473, 0.915841 9 | -0.746636, 0.175268, 0.673642 10 | -0.665701, 0.742619, -0.217574 11 | -0.330391, 0.959489, -0.110458 12 | -0.331275, 0.525513, -0.809983 13 | -0.663936, 0.526130, -0.569521 14 | -0.999332, 0.175474, -0.111904 15 | -0.871398, 0.175267, -0.501922 16 | 0.001214, 0.742616, -0.700356 17 | 0.002949, 0.959483, -0.348370 18 | 0.667975, 0.525509, -0.565356 19 | 0.336490, 0.526126, -0.807431 20 | 0.202383, -0.175470, 0.985002 21 | 0.208094, 0.175265, -0.983848 22 | 0.666452, 0.742619, -0.215262 23 | 0.332212, 0.959489, -0.104850 24 | 0.205064, 0.958364, 0.285421 25 | 0.412630, 0.742620, 0.565889 26 | 0.746093, 0.175315, 0.674232 27 | 0.744110, 0.525505, 0.460568 28 | 0.871894, 0.526125, 0.070507 29 | 0.874264, 0.175471, -0.496841 30 | 1.000000, 0.175267, -0.106112 31 | -------------------------------------------------------------------------------- /cmp/data/diffusion/gradient_tables/siemens_64.txt: -------------------------------------------------------------------------------- 1 | 1.000000, 0.000000, 0.000000 2 | 0.000000, 1.000000, 0.000000 3 | -0.026007, 0.649170, 0.760199 4 | 0.591136, -0.766176, 0.252058 5 | -0.236071, -0.524158, 0.818247 6 | -0.893021, -0.259006, 0.368008 7 | 0.796184, 0.129030, 0.591137 8 | 0.233964, 0.929855, 0.283956 9 | 0.935686, 0.139953, 0.323891 10 | 0.505827, -0.844710, -0.174940 11 | 0.346220, -0.847539, -0.402256 12 | 0.456968, -0.630956, -0.626956 13 | -0.486997, -0.388997, 0.781995 14 | -0.617845, 0.672831, 0.406898 15 | -0.576984, -0.104997, -0.809978 16 | -0.826695, -0.520808, 0.212921 17 | 0.893712, -0.039987, -0.446856 18 | 0.290101, -0.541189, -0.789276 19 | 0.115951, -0.962591, -0.244896 20 | -0.800182, 0.403092, -0.444101 21 | 0.513981, 0.839970, 0.173994 22 | -0.788548, 0.152912, -0.595659 23 | 0.949280, -0.233069, 0.211062 24 | 0.232964, 0.782880, 0.576911 25 | -0.020999, -0.187990, -0.981946 26 | 0.216932, -0.955701, 0.198938 27 | 0.774003, -0.604002, 0.190001 28 | -0.160928, 0.355840, 0.920587 29 | -0.147035, 0.731173, -0.666158 30 | 0.888141, 0.417066, 0.193031 31 | -0.561971, 0.231988, -0.793959 32 | -0.380809, 0.142928, 0.913541 33 | -0.306000, -0.199000, -0.931001 34 | -0.332086, -0.130034, 0.934243 35 | -0.963226, -0.265062, 0.044010 36 | -0.959501, 0.205107, 0.193101 37 | 0.452965, -0.888932, 0.067995 38 | -0.773133, 0.628108, 0.088015 39 | 0.709082, 0.408047, 0.575066 40 | -0.692769, 0.023992, 0.720760 41 | 0.681659, 0.528735, -0.505747 42 | -0.141995, -0.724976, 0.673978 43 | -0.740168, 0.388088, 0.549125 44 | -0.103006, 0.822044, 0.560030 45 | 0.584037, -0.596038, 0.551035 46 | -0.088008, -0.335031, 0.938088 47 | -0.552263, -0.792377, 0.259123 48 | 0.838158, -0.458086, -0.296056 49 | 0.362995, -0.560993, 0.743990 50 | -0.184062, 0.392133, -0.901306 51 | -0.720938, -0.692941, 0.008999 52 | 0.433101, 0.682159, -0.589137 53 | 0.502114, 0.690157, 0.521119 54 | -0.170944, -0.508833, -0.843722 55 | 0.462968, 0.422971, 0.778946 56 | 0.385030, -0.809064, 0.444035 57 | -0.713102, -0.247035, 0.656094 58 | 0.259923, 0.884737, -0.386885 59 | 0.001000, 0.077002, -0.997030 60 | 0.037002, -0.902057, 0.430027 61 | 0.570320, -0.303170, -0.763428 62 | -0.282105, 0.145054, -0.948354 63 | 0.721098, 0.608082, 0.332045 64 | 0.266985, 0.959945, -0.084995 65 | -------------------------------------------------------------------------------- /cmp/data/diffusion/odf_directions/181_vecs.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/data/diffusion/odf_directions/181_vecs.dat -------------------------------------------------------------------------------- /cmp/data/diffusion/odf_directions/181_vecs.txt: -------------------------------------------------------------------------------- 1 | 0.000000, 0.000000, 1.000000 2 | 0.000000, 1.000000, 0.000000 3 | 0.021000, -0.936000, 0.350000 4 | 0.021000, 0.936000, 0.350000 5 | 0.022000, -0.630000, 0.776000 6 | 0.022000, 0.630000, 0.776000 7 | 0.035000, -0.456000, -0.889000 8 | 0.035000, 0.456000, -0.889000 9 | 0.050000, -0.154000, 0.987000 10 | 0.050000, 0.154000, 0.987000 11 | 0.066000, -0.855000, -0.515000 12 | 0.066000, 0.855000, -0.515000 13 | 0.075000, -0.770000, 0.634000 14 | 0.075000, 0.770000, 0.634000 15 | 0.088000, -0.270000, -0.959000 16 | 0.088000, 0.270000, -0.959000 17 | 0.092000, -0.979000, -0.183000 18 | 0.092000, 0.979000, -0.183000 19 | 0.106000, -0.979000, 0.172000 20 | 0.106000, -0.326000, 0.939000 21 | 0.106000, 0.326000, 0.939000 22 | 0.106000, 0.979000, 0.172000 23 | 0.119000, -0.866000, 0.486000 24 | 0.119000, 0.866000, 0.486000 25 | 0.127000, -0.738000, -0.663000 26 | 0.127000, 0.738000, -0.663000 27 | 0.131000, -0.095000, -0.987000 28 | 0.131000, 0.095000, -0.987000 29 | 0.162000, -0.500000, 0.851000 30 | 0.162000, 0.000000, 0.987000 31 | 0.162000, 0.500000, 0.851000 32 | 0.183000, -0.912000, -0.366000 33 | 0.183000, 0.912000, -0.366000 34 | 0.188000, -0.577000, -0.795000 35 | 0.188000, 0.577000, -0.795000 36 | 0.200000, -0.925000, 0.324000 37 | 0.200000, 0.925000, 0.324000 38 | 0.205000, -0.979000, 0.000000 39 | 0.205000, 0.979000, 0.000000 40 | 0.212000, -0.653000, 0.727000 41 | 0.212000, 0.653000, 0.727000 42 | 0.229000, -0.167000, 0.959000 43 | 0.229000, 0.167000, 0.959000 44 | 0.240000, -0.390000, -0.889000 45 | 0.240000, 0.390000, -0.889000 46 | 0.250000, -0.770000, 0.586000 47 | 0.250000, 0.770000, 0.586000 48 | 0.263000, -0.809000, -0.526000 49 | 0.263000, 0.809000, -0.526000 50 | 0.276000, -0.851000, 0.447000 51 | 0.276000, 0.851000, 0.447000 52 | 0.278000, -0.202000, -0.939000 53 | 0.278000, 0.202000, -0.939000 54 | 0.284000, 0.000000, -0.959000 55 | 0.296000, -0.348000, 0.889000 56 | 0.296000, 0.348000, 0.889000 57 | 0.304000, -0.936000, 0.175000 58 | 0.304000, -0.934000, -0.188000 59 | 0.304000, 0.934000, -0.188000 60 | 0.304000, 0.936000, 0.175000 61 | 0.331000, -0.671000, -0.663000 62 | 0.331000, 0.671000, -0.663000 63 | 0.343000, 0.000000, 0.939000 64 | 0.353000, -0.523000, 0.776000 65 | 0.353000, 0.523000, 0.776000 66 | 0.381000, -0.866000, 0.324000 67 | 0.381000, 0.866000, 0.324000 68 | 0.388000, -0.846000, -0.366000 69 | 0.388000, -0.497000, -0.776000 70 | 0.388000, 0.497000, -0.776000 71 | 0.388000, 0.846000, -0.366000 72 | 0.392000, -0.667000, 0.634000 73 | 0.392000, 0.667000, 0.634000 74 | 0.410000, -0.912000, 0.000000 75 | 0.410000, 0.912000, 0.000000 76 | 0.412000, -0.770000, 0.486000 77 | 0.412000, 0.770000, 0.486000 78 | 0.423000, -0.174000, 0.889000 79 | 0.423000, 0.174000, 0.889000 80 | 0.425000, -0.309000, -0.851000 81 | 0.425000, 0.309000, -0.851000 82 | 0.445000, -0.108000, -0.889000 83 | 0.445000, 0.108000, -0.889000 84 | 0.449000, -0.730000, -0.515000 85 | 0.449000, 0.730000, -0.515000 86 | 0.490000, -0.855000, 0.172000 87 | 0.490000, 0.855000, 0.172000 88 | 0.491000, -0.357000, 0.795000 89 | 0.491000, 0.357000, 0.795000 90 | 0.501000, -0.846000, -0.183000 91 | 0.501000, 0.846000, -0.183000 92 | 0.513000, -0.579000, -0.634000 93 | 0.513000, 0.579000, -0.634000 94 | 0.526000, 0.000000, 0.851000 95 | 0.534000, -0.770000, 0.350000 96 | 0.534000, 0.770000, 0.350000 97 | 0.536000, -0.523000, 0.663000 98 | 0.536000, 0.523000, 0.663000 99 | 0.555000, -0.653000, 0.515000 100 | 0.555000, -0.404000, -0.727000 101 | 0.555000, 0.404000, -0.727000 102 | 0.555000, 0.653000, 0.515000 103 | 0.567000, -0.745000, -0.350000 104 | 0.567000, 0.745000, -0.350000 105 | 0.588000, -0.809000, 0.000000 106 | 0.588000, 0.809000, 0.000000 107 | 0.593000, -0.215000, -0.776000 108 | 0.593000, 0.215000, -0.776000 109 | 0.605000, -0.630000, -0.486000 110 | 0.605000, 0.630000, -0.486000 111 | 0.606000, -0.174000, 0.776000 112 | 0.606000, 0.174000, 0.776000 113 | 0.607000, 0.000000, -0.795000 114 | 0.649000, -0.738000, 0.183000 115 | 0.649000, 0.738000, 0.183000 116 | 0.655000, -0.476000, -0.586000 117 | 0.655000, 0.476000, -0.586000 118 | 0.662000, -0.730000, -0.172000 119 | 0.662000, 0.730000, -0.172000 120 | 0.663000, -0.348000, 0.663000 121 | 0.663000, 0.348000, 0.663000 122 | 0.684000, -0.630000, 0.366000 123 | 0.684000, 0.630000, 0.366000 124 | 0.687000, 0.000000, 0.727000 125 | 0.688000, -0.500000, 0.526000 126 | 0.688000, 0.500000, 0.526000 127 | 0.705000, -0.630000, -0.324000 128 | 0.705000, 0.630000, -0.324000 129 | 0.709000, -0.309000, -0.634000 130 | 0.709000, 0.309000, -0.634000 131 | 0.724000, -0.526000, -0.447000 132 | 0.724000, 0.526000, -0.447000 133 | 0.741000, -0.671000, 0.000000 134 | 0.741000, -0.108000, -0.663000 135 | 0.741000, 0.108000, -0.663000 136 | 0.741000, 0.671000, 0.000000 137 | 0.755000, -0.167000, 0.634000 138 | 0.755000, 0.167000, 0.634000 139 | 0.787000, -0.381000, -0.486000 140 | 0.787000, 0.381000, -0.486000 141 | 0.793000, -0.326000, 0.515000 142 | 0.793000, 0.326000, 0.515000 143 | 0.795000, -0.577000, 0.188000 144 | 0.795000, 0.577000, 0.188000 145 | 0.796000, -0.579000, -0.175000 146 | 0.796000, 0.579000, -0.175000 147 | 0.810000, 0.000000, 0.586000 148 | 0.811000, -0.456000, 0.366000 149 | 0.811000, 0.456000, 0.366000 150 | 0.817000, -0.476000, -0.324000 151 | 0.817000, 0.476000, -0.324000 152 | 0.833000, -0.202000, -0.515000 153 | 0.833000, 0.202000, -0.515000 154 | 0.851000, 0.000000, -0.526000 155 | 0.860000, -0.154000, 0.486000 156 | 0.860000, 0.154000, 0.486000 157 | 0.868000, -0.497000, 0.000000 158 | 0.868000, 0.497000, 0.000000 159 | 0.884000, -0.309000, -0.350000 160 | 0.884000, 0.309000, -0.350000 161 | 0.894000, 0.000000, 0.447000 162 | 0.897000, -0.270000, 0.350000 163 | 0.897000, 0.270000, 0.350000 164 | 0.899000, -0.404000, -0.172000 165 | 0.899000, 0.404000, -0.172000 166 | 0.903000, -0.390000, 0.183000 167 | 0.903000, 0.390000, 0.183000 168 | 0.924000, -0.108000, -0.366000 169 | 0.924000, 0.108000, -0.366000 170 | 0.941000, -0.095000, 0.324000 171 | 0.941000, 0.095000, 0.324000 172 | 0.951000, -0.309000, 0.000000 173 | 0.951000, 0.309000, 0.000000 174 | 0.959000, -0.215000, -0.183000 175 | 0.959000, 0.215000, -0.183000 176 | 0.964000, -0.202000, 0.172000 177 | 0.964000, 0.202000, 0.172000 178 | 0.982000, 0.000000, -0.188000 179 | 0.985000, 0.000000, 0.175000 180 | 0.994000, -0.108000, 0.000000 181 | 0.994000, 0.108000, 0.000000 182 | -------------------------------------------------------------------------------- /cmp/data/parcellation/lausanne2008/ParcellationLausanne2008.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/data/parcellation/lausanne2008/ParcellationLausanne2008.xls -------------------------------------------------------------------------------- /cmp/data/parcellation/lausanne2008/README.txt: -------------------------------------------------------------------------------- 1 | This multi-resolution parcellation was first used in: 2 | 3 | Hagmann P, Cammoun L, Gigandet X, Meuli R, Honey CJ, et al. 2008 Mapping the Structural Core of Human Cerebral Cortex. PLoS Biol 6(7): e159. doi:10.1371/journal.pbio.0060159 4 | http://www.plosbiology.org/article/info:doi/10.1371/journal.pbio.0060159 5 | 6 | With the release of Freesurfer 5.0, the parcellation was recreated, and includes the insula. 7 | 8 | Please address questions about this parcellation to 9 | Leila Cammoun 10 | -------------------------------------------------------------------------------- /cmp/data/parcellation/nativefreesurfer/freesurferaparc/FreeSurferColorLUT_adapted.txt: -------------------------------------------------------------------------------- 1 | #$Id: FreeSurferColorLUT.txt,v 1.67 15/02/06 04:27:06 nicks Exp $ 2 | 3 | #No. Label Name: R G B A 4 | 5 | 0 Unknown 0 0 0 0 6 | 7 | 76 Left-Thalamus-Proper 0 118 14 0 8 | 77 Left-Caudate 122 186 220 0 9 | 78 Left-Putamen 236 13 176 0 10 | 79 Left-Pallidum 12 48 255 0 11 | 80 Left-Accumbens-area 255 165 0 0 12 | 81 Left-Hippocampus 220 216 20 0 13 | 82 Left-Amygdala 103 255 255 0 14 | 83 Brain-Stem 119 159 176 0 15 | 16 | 35 Right-Thalamus-Proper 0 118 14 0 17 | 36 Right-Caudate 122 186 220 0 18 | 37 Right-Putamen 236 13 176 0 19 | 38 Right-Pallidum 13 48 255 0 20 | 39 Right-Accumbens-area 255 165 0 0 21 | 40 Right-Hippocampus 220 216 20 0 22 | 41 Right-Amygdala 103 255 255 0 23 | 24 | #No. Label Name: R G B A 25 | 72 ctx-lh-bankssts 25 100 40 0 26 | 54 ctx-lh-caudalanteriorcingulate 125 100 160 0 27 | 50 ctx-lh-caudalmiddlefrontal 100 25 0 0 28 | 62 ctx-lh-cuneus 220 20 100 0 29 | 68 ctx-lh-entorhinal 220 20 10 0 30 | 66 ctx-lh-fusiform 180 220 140 0 31 | 60 ctx-lh-inferiorparietal 220 60 220 0 32 | 70 ctx-lh-inferiortemporal 180 40 120 0 33 | 56 ctx-lh-isthmuscingulate 140 20 140 0 34 | 64 ctx-lh-lateraloccipital 20 30 140 0 35 | 42 ctx-lh-lateralorbitofrontal 35 75 50 0 36 | 65 ctx-lh-lingual 225 140 140 0 37 | 45 ctx-lh-medialorbitofrontal 200 35 75 0 38 | 71 ctx-lh-middletemporal 160 100 50 0 39 | 67 ctx-lh-parahippocampal 20 220 60 0 40 | 52 ctx-lh-paracentral 60 220 60 0 41 | 47 ctx-lh-parsopercularis 220 180 140 0 42 | 43 ctx-lh-parsorbitalis 20 100 50 0 43 | 46 ctx-lh-parstriangularis 220 60 20 0 44 | 63 ctx-lh-pericalcarine 120 100 60 0 45 | 57 ctx-lh-postcentral 220 20 20 0 46 | 55 ctx-lh-posteriorcingulate 220 180 220 0 47 | 51 ctx-lh-precentral 60 20 220 0 48 | 61 ctx-lh-precuneus 160 140 180 0 49 | 53 ctx-lh-rostralanteriorcingulate 80 20 140 0 50 | 48 ctx-lh-rostralmiddlefrontal 75 50 125 0 51 | 49 ctx-lh-superiorfrontal 20 220 160 0 52 | 59 ctx-lh-superiorparietal 20 180 140 0 53 | 73 ctx-lh-superiortemporal 140 220 220 0 54 | 58 ctx-lh-supramarginal 80 160 20 0 55 | 44 ctx-lh-frontalpole 100 0 100 0 56 | 69 ctx-lh-temporalpole 70 70 70 0 57 | 74 ctx-lh-transversetemporal 150 150 200 0 58 | 75 ctx-lh-insula 255 192 32 0 59 | 60 | 31 ctx-rh-bankssts 25 100 40 0 61 | 13 ctx-rh-caudalanteriorcingulate 125 100 160 0 62 | 9 ctx-rh-caudalmiddlefrontal 100 25 0 0 63 | 21 ctx-rh-cuneus 220 20 100 0 64 | 27 ctx-rh-entorhinal 220 20 10 0 65 | 25 ctx-rh-fusiform 180 220 140 0 66 | 19 ctx-rh-inferiorparietal 220 60 220 0 67 | 29 ctx-rh-inferiortemporal 180 40 120 0 68 | 15 ctx-rh-isthmuscingulate 140 20 140 0 69 | 23 ctx-rh-lateraloccipital 20 30 140 0 70 | 1 ctx-rh-lateralorbitofrontal 35 75 50 0 71 | 24 ctx-rh-lingual 225 140 140 0 72 | 4 ctx-rh-medialorbitofrontal 200 35 75 0 73 | 30 ctx-rh-middletemporal 160 100 50 0 74 | 26 ctx-rh-parahippocampal 20 220 60 0 75 | 11 ctx-rh-paracentral 60 220 60 0 76 | 6 ctx-rh-parsopercularis 220 180 140 0 77 | 2 ctx-rh-parsorbitalis 20 100 50 0 78 | 5 ctx-rh-parstriangularis 220 60 20 0 79 | 22 ctx-rh-pericalcarine 120 100 60 0 80 | 16 ctx-rh-postcentral 220 20 20 0 81 | 14 ctx-rh-posteriorcingulate 220 180 220 0 82 | 10 ctx-rh-precentral 60 20 220 0 83 | 20 ctx-rh-precuneus 160 140 180 0 84 | 12 ctx-rh-rostralanteriorcingulate 80 20 140 0 85 | 7 ctx-rh-rostralmiddlefrontal 75 50 125 0 86 | 8 ctx-rh-superiorfrontal 20 220 160 0 87 | 18 ctx-rh-superiorparietal 20 180 140 0 88 | 32 ctx-rh-superiortemporal 140 220 220 0 89 | 17 ctx-rh-supramarginal 80 160 20 0 90 | 3 ctx-rh-frontalpole 100 0 100 0 91 | 28 ctx-rh-temporalpole 70 70 70 0 92 | 33 ctx-rh-transversetemporal 150 150 200 0 93 | 34 ctx-rh-insula 255 192 32 0 94 | 95 | -------------------------------------------------------------------------------- /cmp/data/parcellation/nativefreesurfer/mapping.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/data/parcellation/nativefreesurfer/mapping.ods -------------------------------------------------------------------------------- /cmp/helpgui.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2009-2011, Ecole Polytechnique Federale de Lausanne (EPFL) and 2 | # Hospital Center and University of Lausanne (UNIL-CHUV), Switzerland 3 | # All rights reserved. 4 | # 5 | # This software is distributed under the open-source license Modified BSD. 6 | 7 | try: 8 | from traits.api import HasTraits, Int, Str, Directory, List,\ 9 | Bool, File, Button, Enum 10 | 11 | from traitsui.api import View, Item, HGroup, Handler, \ 12 | message, spring, Group, VGroup, TableEditor 13 | except ImportError: 14 | from enthought.traits.api import HasTraits, Int, Str, Directory, List,\ 15 | Bool, File, Button, Enum 16 | 17 | from enthought.traits.ui.api import View, Item, HGroup, Handler, \ 18 | message, spring, Group, VGroup, TableEditor 19 | 20 | from cmp import __version__ 21 | 22 | desc = { 23 | 'About' : """ 24 | Connectome Mapper 25 | Version """ + __version__ + """ 26 | 27 | Copyright (C) 2011, Ecole Polytechnique Federale de Lausanne (EPFL) and 28 | Hospital Center and University of Lausanne (UNIL-CHUV), Switzerland 29 | 30 | The code is released under the Modified BSD license. 31 | 32 | Contact 33 | ------- 34 | info@connectomics.org 35 | http://www.connectomics.org/ 36 | 37 | Contributors 38 | ------------ 39 | * Jean-Philippe Thiran 40 | * Reto Meuli 41 | * Alessandro Daducci 42 | * Leila Cammoun 43 | * Patric Hagmann 44 | * Alia Lemkaddem 45 | * Elda Fischi 46 | * Christophe Chenes 47 | * Xavier Gigandet 48 | * Stephan Gerhard 49 | 50 | External Contributors 51 | --------------------- 52 | 53 | Children's Hospital Boston: 54 | * Ellen Grant 55 | * Daniel Ginsburg 56 | * Rudolph Pienaar 57 | 58 | """, 59 | 'Help' : """ 60 | For a short description of the processing stages, please refer to the online documentation: 61 | http://connectomics.org/connectomemapper/ 62 | 63 | If you have any questions or feedback, please use the mailinglist for the Connectome Mapping Toolkit: 64 | http://groups.google.com/group/cmtk-users 65 | 66 | """ 67 | } 68 | 69 | 70 | class HelpDialog ( HasTraits ): 71 | 72 | sections = Enum('About', desc.keys()) 73 | stagedescription = Str(desc['About']) 74 | 75 | view = View( 76 | Item( name = 'sections', show_label = False ), 77 | VGroup( 78 | 79 | Item( name = 'stagedescription', style = 'readonly', show_label = False ), 80 | show_border = True 81 | ), 82 | title = 'Connectome Mapper Help', 83 | buttons = [ 'OK' ], 84 | resizable = True, 85 | width = 0.4, 86 | height = 0.6 87 | ) 88 | 89 | def _sections_changed(self, value): 90 | 91 | self.stagedescription = desc[value] 92 | -------------------------------------------------------------------------------- /cmp/helpgui.py.orig: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2009-2011, Ecole Polytechnique Federale de Lausanne (EPFL) and 2 | # Hospital Center and University of Lausanne (UNIL-CHUV), Switzerland 3 | # All rights reserved. 4 | # 5 | # This software is distributed under the open-source license Modified BSD. 6 | 7 | <<<<<<< HEAD 8 | from traits.api import HasTraits, Int, Str, Directory, List,\ 9 | Bool, File, Button, Enum 10 | 11 | from enthought.traits.ui.api import View, Item, HGroup, Handler, \ 12 | message, spring, Group, VGroup, TableEditor 13 | ======= 14 | try: 15 | from traits.api import HasTraits, Int, Str, Directory, List,\ 16 | Bool, File, Button, Enum 17 | 18 | from traitsui.api import View, Item, HGroup, Handler, \ 19 | message, spring, Group, VGroup, TableEditor 20 | except ImportError: 21 | from enthought.traits.api import HasTraits, Int, Str, Directory, List,\ 22 | Bool, File, Button, Enum 23 | 24 | from enthought.traits.ui.api import View, Item, HGroup, Handler, \ 25 | message, spring, Group, VGroup, TableEditor 26 | >>>>>>> beta 27 | 28 | from cmp import __version__ 29 | 30 | desc = { 31 | 'About' : """ 32 | Connectome Mapper 33 | Version """ + __version__ + """ 34 | 35 | Copyright (C) 2011, Ecole Polytechnique Federale de Lausanne (EPFL) and 36 | Hospital Center and University of Lausanne (UNIL-CHUV), Switzerland 37 | 38 | The code is released under the Modified BSD license. 39 | 40 | Contact 41 | ------- 42 | info@connectomics.org 43 | http://www.connectomics.org/ 44 | 45 | Contributors 46 | ------------ 47 | * Jean-Philippe Thiran 48 | * Reto Meuli 49 | * Alessandro Daducci 50 | * Leila Cammoun 51 | * Patric Hagmann 52 | * Alia Lemkaddem 53 | * Elda Fischi 54 | * Christophe Chenes 55 | * Xavier Gigandet 56 | * Stephan Gerhard 57 | 58 | External Contributors 59 | --------------------- 60 | 61 | Children's Hospital Boston: 62 | * Ellen Grant 63 | * Daniel Ginsburg 64 | * Rudolph Pienaar 65 | 66 | """, 67 | 'Help' : """ 68 | For a short description of the processing stages, please refer to the online documentation: 69 | http://connectomics.org/connectomemapper/ 70 | 71 | If you have any questions or feedback, please use the mailinglist for the Connectome Mapping Toolkit: 72 | http://groups.google.com/group/cmtk-users 73 | 74 | """ 75 | } 76 | 77 | 78 | class HelpDialog ( HasTraits ): 79 | 80 | sections = Enum('About', desc.keys()) 81 | stagedescription = Str(desc['About']) 82 | 83 | view = View( 84 | Item( name = 'sections', show_label = False ), 85 | VGroup( 86 | 87 | Item( name = 'stagedescription', style = 'readonly', show_label = False ), 88 | show_border = True 89 | ), 90 | title = 'Connectome Mapper Help', 91 | buttons = [ 'OK' ], 92 | resizable = True, 93 | width = 0.4, 94 | height = 0.6 95 | ) 96 | 97 | def _sections_changed(self, value): 98 | 99 | self.stagedescription = desc[value] 100 | 101 | -------------------------------------------------------------------------------- /cmp/info.py: -------------------------------------------------------------------------------- 1 | """ This file contains cmp package information """ 2 | 3 | _version_major = 1 4 | _version_minor = 3 5 | _version_micro = 0 6 | _version_extra = '' 7 | 8 | __version__ = "%s.%s.%s%s" % (_version_major, 9 | _version_minor, 10 | _version_micro, 11 | _version_extra) 12 | -------------------------------------------------------------------------------- /cmp/logme.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2009-2011, Ecole Polytechnique Federale de Lausanne (EPFL) and 2 | # Hospital Center and University of Lausanne (UNIL-CHUV), Switzerland 3 | # All rights reserved. 4 | # 5 | # This software is distributed under the open-source license Modified BSD. 6 | 7 | # Code from 8 | # from http://devlishgenius.blogspot.com/2008/10/logging-in-real-time-in-python.html 9 | 10 | import sys, os, os.path as op 11 | import logging, subprocess 12 | 13 | def getLog(fpath): 14 | logFormat = "%(levelname)-8s : %(asctime)s : %(name)-10s : %(message)s" 15 | logFormatter = logging.Formatter( logFormat ) 16 | 17 | consolehandler = logging.StreamHandler() 18 | consolehandler.setLevel( logging.DEBUG ) 19 | consolehandler.setFormatter( logFormatter ) 20 | 21 | if not op.exists(fpath): 22 | try: 23 | os.makedirs(op.dirname(fpath)) 24 | except: 25 | pass 26 | 27 | errfpath = fpath + '.error' 28 | if not op.exists(errfpath): 29 | try: 30 | os.makedirs(op.dirname(errfpath)) 31 | except: 32 | pass 33 | 34 | logFile = fpath 35 | logFileErr = errfpath 36 | 37 | filehandler = logging.FileHandler( logFile ) 38 | filehandler.setLevel( logging.DEBUG ) 39 | filehandler.setFormatter( logFormatter ) 40 | 41 | filehandler2 = logging.FileHandler( logFileErr ) 42 | filehandler2.setLevel( logging.ERROR ) 43 | filehandler2.setFormatter( logFormatter ) 44 | 45 | logging.getLogger( '' ).addHandler( consolehandler ) 46 | logging.getLogger( '' ).addHandler( filehandler ) 47 | logging.getLogger( '' ).addHandler( filehandler2 ) 48 | 49 | mainlog = logging.getLogger( "main" ) 50 | mainlog.setLevel( logging.DEBUG ) 51 | 52 | return mainlog 53 | 54 | def mkLocalLog( f ): 55 | # Could set _localLog as an attribute on the function: 56 | # f._localLog = ..., but user would have to access it 57 | # as an attribute: <func>._localLog( "<msg>" ). 58 | # Instead we add it to the function's globals dict. 59 | # If someone knows how to add it to the function's locals 60 | # that would be great! 61 | 62 | ll = logging.getLogger( f.__name__ ) 63 | ll.setLevel( logging.DEBUG ) 64 | 65 | f.__globals__[ "_localLog" ] = ll 66 | return f 67 | 68 | 69 | @mkLocalLog 70 | def runCmd( cmd, log, sleep_interval=0.5 ): 71 | 72 | # timestamp for name 73 | import random 74 | t = random.randint(1, 10000000) 75 | # create in temporary file 76 | import tempfile 77 | fname = op.join(tempfile.gettempdir(), "out_fifo_%s" % str(t)) 78 | # import time module 79 | import time 80 | 81 | try: 82 | os.unlink( fname ) 83 | except: pass 84 | 85 | os.mkfifo( fname ) 86 | 87 | try: 88 | 89 | fifo = os.fdopen( os.open( fname, 90 | os.O_RDONLY | os.O_NONBLOCK ) ) 91 | 92 | newcmd = "( %s ) 1>%s 2>&1"%( cmd, fname ) 93 | 94 | process = subprocess.Popen( newcmd, shell = True, 95 | stdout = subprocess.PIPE, 96 | stderr = subprocess.STDOUT ) 97 | 98 | _localLog.debug( "Running: %s"%( cmd, ) ) 99 | 100 | while process.returncode == None: 101 | # None means process is still running 102 | 103 | # pause for a while 104 | time.sleep(sleep_interval) 105 | 106 | # need to poll the process once so the returncode 107 | # gets set (see docs) 108 | process.poll() 109 | 110 | try: 111 | line = fifo.readline().strip() 112 | except: 113 | continue 114 | 115 | if line: 116 | log.info( line ) 117 | 118 | remaining = fifo.read() 119 | 120 | if remaining: 121 | for line in [ line 122 | for line in remaining.split( "\n" ) 123 | if line.strip() ]: 124 | log.info( line.strip() ) 125 | 126 | if process.returncode: 127 | _localLog.critical( "Return Value: %s"%( process.returncode, ) ) 128 | else: 129 | _localLog.debug( "Return Value: %s"%( process.returncode, ) ) 130 | 131 | finally: 132 | try: 133 | os.unlink( fname ) 134 | except: 135 | _localLog.warning( "Failed to unlink '%s'." % fname) 136 | 137 | def GetInHMS(seconds): 138 | hours = seconds / 3600 139 | seconds -= 3600*hours 140 | minutes = seconds / 60 141 | seconds -= 60*minutes 142 | return "%02d:%02d:%02d" % (hours, minutes, seconds) 143 | 144 | def send_email_notification(message, gconf, log, host = 'localhost'): 145 | 146 | import smtplib 147 | from email.mime.text import MIMEText 148 | 149 | # add subject information 150 | text = "Module:%s\nTime: %s\nProject Directory: %s\nSubject: %s\nTimepoint: %s\nWorkingdir: %s" % (message[0], \ 151 | GetInHMS(message[1]), gconf.project_dir, gconf.subject_name, gconf.subject_timepoint, gconf.subject_workingdir) 152 | fromaddr = 'Connectome Mapper ' 153 | 154 | msg = MIMEText(text) 155 | msg['Subject'] = "CMP - %s - Finished" % message[0] 156 | msg['From'] = fromaddr 157 | msg['To'] = ", ".join(gconf.emailnotify) 158 | 159 | try: 160 | smtpObj = smtplib.SMTP(host) 161 | smtpObj.sendmail(fromaddr, gconf.emailnotify, msg.as_string()) 162 | log.info("Successfully sent email") 163 | except smtplib.SMTPException: 164 | log.info("Error: Unable to send email") 165 | finally: 166 | smtpObj.quit() 167 | 168 | -------------------------------------------------------------------------------- /cmp/pipeline/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/pipeline/__init__.py -------------------------------------------------------------------------------- /cmp/pipeline/pipeline.proto: -------------------------------------------------------------------------------- 1 | message StageInputOutput 2 | { 3 | // Exact name of file from root directory, or wildcard 4 | required string filePath = 1; 5 | 6 | // Name of input or output 7 | required string name = 2; 8 | 9 | // Root directory of input or output 10 | required string rootDir = 3; 11 | 12 | // Type tag - should refer to one of the types declared. If 13 | // not specified, file is assumed to be of unknown type. 14 | optional string typeTag = 4; 15 | } 16 | 17 | message Stage 18 | { 19 | // Stage number, should be a unique integer. Filled in automatically 20 | // by PipelineStatus python class 21 | required int32 num = 1; 22 | 23 | // Name of stage 24 | required string name = 2; 25 | 26 | // List of inputs to stage 27 | repeated StageInputOutput inputs = 3; 28 | 29 | // List of outputs to stage 30 | repeated StageInputOutput outputs = 4; 31 | } 32 | 33 | message Type 34 | { 35 | // Tag by which type is referred to, for example "nii", "dcm", "surf" 36 | required string tag = 1; 37 | 38 | // Description of type 39 | required string desc = 2; 40 | } 41 | 42 | message Pipeline 43 | { 44 | // Name of Pipeline 45 | required string name = 1; 46 | 47 | // List of stages in pipeline 48 | repeated Stage stages = 2; 49 | 50 | // List of file types generated/read by pipeline 51 | repeated Type types = 3; 52 | } -------------------------------------------------------------------------------- /cmp/stages/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/stages/__init__.py -------------------------------------------------------------------------------- /cmp/stages/connectionmatrix/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/stages/connectionmatrix/__init__.py -------------------------------------------------------------------------------- /cmp/stages/converter/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/stages/converter/__init__.py -------------------------------------------------------------------------------- /cmp/stages/epiunwarp/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/stages/epiunwarp/__init__.py -------------------------------------------------------------------------------- /cmp/stages/parcellation/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/stages/parcellation/__init__.py -------------------------------------------------------------------------------- /cmp/stages/postprocessing/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/cmp/stages/postprocessing/__init__.py -------------------------------------------------------------------------------- /cmp/stages/postprocessing/fiberclustering.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2009-2011, Ecole Polytechnique Federale de Lausanne (EPFL) and 2 | # Hospital Center and University of Lausanne (UNIL-CHUV), Switzerland 3 | # All rights reserved. 4 | # 5 | # This software is distributed under the open-source license Modified BSD. 6 | 7 | import os, os.path as op 8 | from time import time 9 | from ...logme import * 10 | 11 | # input: trackfile and grey matter mask 12 | 13 | def find_clusters(): 14 | try: 15 | import dipy.core 16 | except ImportError: 17 | log.info("Cannot import DiPy") 18 | 19 | log.info("DiPy clustering not included in the current release.") 20 | 21 | 22 | def create_connectionbased_parcellation(): 23 | pass 24 | # idea: 25 | # each bundle defines 2 ROIs 26 | # number of connection of fibers /ROIs 27 | # segment ROIs (according to number of connection fibers) 28 | # could find anatomical labeling using a standardized atlas 29 | 30 | def run(conf): 31 | """ Run the fiber clustering 32 | 33 | Parameters 34 | ---------- 35 | conf : PipelineConfiguration object 36 | 37 | """ 38 | # setting the global configuration variable 39 | globals()['gconf'] = conf 40 | globals()['log'] = gconf.get_logger() 41 | start = time() 42 | 43 | find_clusters() 44 | 45 | log.info("Module took %s seconds to process." % (time()-start)) 46 | 47 | if not len(gconf.emailnotify) == 0: 48 | msg = ["Fiber clustering", int(time()-start)] 49 | send_email_notification(msg, gconf, log) 50 | -------------------------------------------------------------------------------- /cmp/stages/postprocessing/fiberfilter.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2009-2011, Ecole Polytechnique Federale de Lausanne (EPFL) and 2 | # Hospital Center and University of Lausanne (UNIL-CHUV), Switzerland 3 | # All rights reserved. 4 | # 5 | # This software is distributed under the open-source license Modified BSD. 6 | 7 | import os, os.path as op 8 | from time import time 9 | from ...logme import * 10 | import cmp.util as util 11 | import numpy as np 12 | import nibabel.trackvis as tv 13 | 14 | def spline_filtering(): 15 | log.info("Spline filtering the fibers") 16 | log.info("===========================") 17 | 18 | src = op.join(gconf.get_cmp_fibers(), 'streamline.trk') 19 | ren = op.join(gconf.get_cmp_fibers(), 'streamline_splinefiltered.trk') 20 | 21 | sp_cmd = 'spline_filter %s 1 %s' % (src, ren) 22 | runCmd( sp_cmd, log ) 23 | 24 | le = compute_length_array(ren) 25 | 26 | # os.rename(op.join(gconf.get_cmp_fibers(), "tmp.trk"), op.join(gconf.get_cmp_fibers(), "streamline.trk")) 27 | 28 | log.info("[ DONE ]") 29 | 30 | 31 | def compute_length_array(trkfile=None, streams=None, savefname = 'lengths.npy'): 32 | if streams is None and not trkfile is None: 33 | log.info("Compute length array for fibers in %s" % trkfile) 34 | streams, hdr = tv.read(trkfile, as_generator = True) 35 | n_fibers = hdr['n_count'] 36 | if n_fibers == 0: 37 | msg = "Header field n_count of trackfile %s is set to 0. No track seem to exist in this file." % trkfile 38 | log.error(msg) 39 | raise Exception(msg) 40 | else: 41 | n_fibers = len(streams) 42 | 43 | leng = np.zeros(n_fibers, dtype = np.float) 44 | for i,fib in enumerate(streams): 45 | leng[i] = util.length(fib[0]) 46 | 47 | # store length array 48 | lefname = op.join(gconf.get_cmp_fibers(), savefname) 49 | np.save(lefname, leng) 50 | log.info("Store lengths array to: %s" % lefname) 51 | 52 | return leng 53 | 54 | 55 | def filter_fibers(applied_spline=False): 56 | 57 | log.info("Cut Fiber Filtering") 58 | log.info("===================") 59 | log.info("Was spline filtering applied? %s" % applied_spline) 60 | 61 | if applied_spline: 62 | intrk = op.join(gconf.get_cmp_fibers(), 'streamline_splinefiltered.trk') 63 | else: 64 | intrk = op.join(gconf.get_cmp_fibers(), 'streamline.trk') 65 | 66 | log.info("Input file for fiber cutting is: %s" % intrk) 67 | 68 | outtrk = op.join(gconf.get_cmp_fibers(), 'streamline_cutfiltered.trk') 69 | 70 | # compute length array 71 | le = compute_length_array(intrk, savefname = 'lengths_beforecutfiltered.npy') 72 | 73 | # cut the fibers smaller than value 74 | reducedidx = np.where((le>gconf.fiber_cutoff_lower) & (le' where is one of" 19 | @echo " html to make standalone HTML files" 20 | @echo " dirhtml to make HTML files named index.html in directories" 21 | @echo " pickle to make pickle files" 22 | @echo " json to make JSON files" 23 | @echo " htmlhelp to make HTML files and a HTML help project" 24 | @echo " qthelp to make HTML files and a qthelp project" 25 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 26 | @echo " changes to make an overview of all changed/added/deprecated items" 27 | @echo " linkcheck to check all external links for integrity" 28 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 29 | 30 | clean: 31 | -rm -rf $(BUILDDIR)/* 32 | 33 | html: 34 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 35 | @echo 36 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 37 | 38 | dirhtml: 39 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 40 | @echo 41 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 42 | 43 | pickle: 44 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 45 | @echo 46 | @echo "Build finished; now you can process the pickle files." 47 | 48 | json: 49 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 50 | @echo 51 | @echo "Build finished; now you can process the JSON files." 52 | 53 | htmlhelp: 54 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 55 | @echo 56 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 57 | ".hhp project file in $(BUILDDIR)/htmlhelp." 58 | 59 | qthelp: 60 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 61 | @echo 62 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 63 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 64 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/ConnectomeMappingToolkit.qhcp" 65 | @echo "To view the help file:" 66 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/ConnectomeMappingToolkit.qhc" 67 | 68 | latex: 69 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 70 | @echo 71 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 72 | @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ 73 | "run these through (pdf)latex." 74 | 75 | changes: 76 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 77 | @echo 78 | @echo "The overview file is in $(BUILDDIR)/changes." 79 | 80 | linkcheck: 81 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 82 | @echo 83 | @echo "Link check complete; look for any errors in the above output " \ 84 | "or in $(BUILDDIR)/linkcheck/output.txt." 85 | 86 | doctest: 87 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 88 | @echo "Testing of doctests in the sources finished, look at the " \ 89 | "results in $(BUILDDIR)/doctest/output.txt." 90 | -------------------------------------------------------------------------------- /doc/source/cmptemplates/layout.html: -------------------------------------------------------------------------------- 1 | {% extends "!layout.html" %} 2 | 3 | {% block rootrellink %} 4 |
  • Connectome Mapping Toolkit
  • 5 | {% endblock %} 6 | 7 | {% block sidebarlogo %} 8 | {{ super() }} 9 | Latest Release:
    10 | Version: {{ release }}

    11 | 12 |

    Upcoming relase
      (beta-testing)

    13 |
    14 |

    15 |

      16 |
    •  •Probabilistic tractography: Camino, MRtrix, FSL probtrackx
    • 17 |
    •  •Global tractography: Gibbs-tracker
    • 18 |
    •  •Additional atlases
    • 19 |
    •  •Additional reconstuction schemes
    • 20 |
    •  •Functional connectomes
    • 21 |

    22 | 23 | {% endblock %} 24 | 25 | {%- block extrahead %} 26 | {{ super() }} 27 | 66 | {% endblock %} 67 | 68 | {% block footer %} 69 | {{ super() }} 70 | 81 | {% endblock %} 82 | 83 | 84 | -------------------------------------------------------------------------------- /doc/source/download.rst: -------------------------------------------------------------------------------- 1 | ==================== 2 | Download Instruction 3 | ==================== 4 | 5 | By downloading Connectome Mapper, you agree to the terms and conditions of the Modified BSD license. 6 | 7 | .. note:: Copyright (C) 2009-2011, Ecole Polytechnique Fédérale de Lausanne (EPFL) and Hospital Center and University of Lausanne (UNIL-CHUV), Switzerland. All rights reserved. 8 | 9 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | * Neither the name of the Ecole Polytechnique Fédérale de Lausanne (EPFL) 16 | and Hospital Center and University of Lausanne (UNIL-CHUV) nor the 17 | names of its contributors may be used to endorse or promote products 18 | derived from this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL "Ecole Polytechnique Fédérale de Lausanne (EPFL) and 24 | Hospital Center and University of Lausanne (UNIL-CHUV)" BE LIABLE FOR ANY 25 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | THIS SOFTWARE IS FOR RESEARCH PURPOSES ONLY AND SHALL NOT BE USED FOR 33 | ANY CLINICAL USE. THIS SOFTWARE HAS NOT BEEN REVIEWED OR APPROVED BY 34 | THE FOOD AND DRUG ADMINISTRATION OR EQUIVALENT AUTHORITY, AND IS FOR 35 | NON-CLINICAL, IRB-APPROVED RESEARCH USE ONLY. IN NO EVENT SHALL DATA 36 | OR IMAGES GENERATED THROUGH THE USE OF THE SOFTWARE BE USED IN THE 37 | PROVISION OR PATIENT CARE. 38 | 39 | .. note:: Please `REGISTER `_ before you start to use Connectome Mapper or the Connectome Mapping Toolkit. This will help us improving the software. 40 | 41 | .. raw:: html 42 | 43 | I agree on the terms and conditions of the connectome mapper license and want to download the source code, current release 1.2.0

    44 | I agree on the terms and conditions of the connectome mapper license and want to download the source code, previous release 1.1.0 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /doc/source/exampleresults.rst: -------------------------------------------------------------------------------- 1 | =============== 2 | Example Results 3 | =============== 4 | 5 | Registration 6 | ------------ 7 | 8 | Registration of T1 to Diffusion space (b0). T1 in copper overlayed to the b0 image. 9 | 10 | .. image:: images/ex_registration.png 11 | 12 | Segmentation 13 | ------------ 14 | 15 | Surfaces are extracted using Freesurfer. 16 | 17 | .. image:: images/ex_segmentation1.png 18 | 19 | T1 is segmented using Freesurfer. 20 | 21 | .. image:: images/ex_segmentation2.png 22 | 23 | Parcellation 24 | ------------ 25 | 26 | Cortical and subcortical parcellation are shown with Freeview. 27 | 28 | .. image:: images/ex_parcellation2.png 29 | 30 | Tractography 31 | ------------ 32 | 33 | DSI Tractography results are displayed with TrackVis. 34 | 35 | .. image:: images/ex_tractography1.png 36 | 37 | .. image:: images/ex_tractography2.png 38 | 39 | Connection Matrix Creation 40 | -------------------------- 41 | 42 | Generated connection matrix are displayed with Chaco. 43 | 44 | .. image:: images/ex_connectionmatrix.png 45 | 46 | Rs-fMRI Average Time-Courses 47 | ---------------------------- 48 | 49 | Average time-courses are displayed with Matplotlib. 50 | 51 | .. image:: images/ex_rsfMRI.png 52 | 53 | Connectome File Format Converter 54 | -------------------------------- 55 | 56 | Multi-modal datasets converted to a connectome file. The Connectome File is displayed in the Connectome Viewer Tree. 57 | 58 | .. image:: images/ex_cffconverter.png 59 | -------------------------------------------------------------------------------- /doc/source/images/cffconverter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/cffconverter.png -------------------------------------------------------------------------------- /doc/source/images/cffconverter_120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/cffconverter_120.png -------------------------------------------------------------------------------- /doc/source/images/configuration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/configuration.png -------------------------------------------------------------------------------- /doc/source/images/configuration_120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/configuration_120.png -------------------------------------------------------------------------------- /doc/source/images/dicomconverter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/dicomconverter.png -------------------------------------------------------------------------------- /doc/source/images/dicomconverter_120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/dicomconverter_120.png -------------------------------------------------------------------------------- /doc/source/images/ex_cffconverter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/ex_cffconverter.png -------------------------------------------------------------------------------- /doc/source/images/ex_connectionmatrix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/ex_connectionmatrix.png -------------------------------------------------------------------------------- /doc/source/images/ex_parcellation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/ex_parcellation.png -------------------------------------------------------------------------------- /doc/source/images/ex_parcellation2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/ex_parcellation2.png -------------------------------------------------------------------------------- /doc/source/images/ex_registration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/ex_registration.png -------------------------------------------------------------------------------- /doc/source/images/ex_rsfMRI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/ex_rsfMRI.png -------------------------------------------------------------------------------- /doc/source/images/ex_segmentation1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/ex_segmentation1.png -------------------------------------------------------------------------------- /doc/source/images/ex_segmentation2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/ex_segmentation2.png -------------------------------------------------------------------------------- /doc/source/images/ex_tractography1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/ex_tractography1.png -------------------------------------------------------------------------------- /doc/source/images/ex_tractography2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/ex_tractography2.png -------------------------------------------------------------------------------- /doc/source/images/fiberfiltering.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/fiberfiltering.png -------------------------------------------------------------------------------- /doc/source/images/fiberfiltering_120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/fiberfiltering_120.png -------------------------------------------------------------------------------- /doc/source/images/maintab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/maintab.png -------------------------------------------------------------------------------- /doc/source/images/maintab_120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/maintab_120.png -------------------------------------------------------------------------------- /doc/source/images/metadata.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/metadata.png -------------------------------------------------------------------------------- /doc/source/images/metadata_120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/metadata_120.png -------------------------------------------------------------------------------- /doc/source/images/parcellation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/parcellation.png -------------------------------------------------------------------------------- /doc/source/images/parcellation_120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/parcellation_120.png -------------------------------------------------------------------------------- /doc/source/images/reconstruction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/reconstruction.png -------------------------------------------------------------------------------- /doc/source/images/reconstruction_120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/reconstruction_120.png -------------------------------------------------------------------------------- /doc/source/images/registration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/registration.png -------------------------------------------------------------------------------- /doc/source/images/registration_120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/registration_120.png -------------------------------------------------------------------------------- /doc/source/images/rsfMRI_120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/rsfMRI_120.png -------------------------------------------------------------------------------- /doc/source/images/subject.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/subject.png -------------------------------------------------------------------------------- /doc/source/images/subject_120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/subject_120.png -------------------------------------------------------------------------------- /doc/source/images/tractography.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/tractography.png -------------------------------------------------------------------------------- /doc/source/images/tractography_120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/doc/source/images/tractography_120.png -------------------------------------------------------------------------------- /doc/source/index.rst: -------------------------------------------------------------------------------- 1 | Connectome Mapper 2 | ================= 3 | 4 | Connectome Mapper implements a full diffusion MRI processing pipeline, 5 | from raw Diffusion/T1/T2 data to multi-resolution connection matrices. 6 | The Connectome Mapper also offer support for resting-state fMRI data processing. 7 | The Connectome Mapper is part of the Connectome Mapping Toolkit. 8 | 9 | Copyright (C) 2009-2011, Ecole Polytechnique Fédérale de Lausanne (EPFL) and 10 | Hospital Center and University of Lausanne (UNIL-CHUV), Switzerland 11 | 12 | This software is distributed under the open-source license Modified BSD. 13 | 14 | Contents: 15 | 16 | .. toctree:: 17 | :maxdepth: 2 18 | 19 | installation 20 | download 21 | mappingsteps 22 | exampleresults 23 | -------------------------------------------------------------------------------- /example/default_project/map_connectome.py: -------------------------------------------------------------------------------- 1 | from cmp.gui import CMPGUI 2 | import cmp.connectome 3 | cmpgui = CMPGUI() 4 | 5 | cmpgui.project_name = 'a' 6 | cmpgui.project_dir = 'a' 7 | cmpgui.subject_name = 'a' 8 | cmpgui.subject_timepoint = 'a' 9 | cmpgui.subject_workingdir = 'a' 10 | 11 | #cmpgui.show() 12 | cmp.connectome.mapit(cmpgui) 13 | -------------------------------------------------------------------------------- /scratch/compute_coords.py: -------------------------------------------------------------------------------- 1 | """ This helper script computes the center-of-gravity for each region 2 | given on the cortex, using the Freesurfer surface meshes and the networks 3 | produced by the Connectome Mapper 4 | 5 | Author: Stephan Gerhard 6 | """ 7 | 8 | import networkx as nx 9 | import numpy as np 10 | import nibabel.gifti as gi 11 | import json 12 | 13 | # load the left hemisphere surface 14 | surfs_lh = '.../FREESURFER/surf/lh.pial.gii' 15 | surfs_rh = '.../FREESURFER/surf/rh.pial.gii' 16 | 17 | # load the left hemisphere parcellation 18 | # originally converted by mris_convert --annot ... 19 | hemilabels_lh = '.../FREESURFER/label/lh.aparc.annot.gii' 20 | hemilabels_rh = '.../FREESURFER/label/rh.aparc.annot.gii' 21 | 22 | # load the network description file 23 | netwdesc = '.../CNetwork/connectome_freesurferaparc.gpickle' 24 | 25 | # loop over all cortical, left hemisphere nodes 26 | g = nx.read_gpickle(netwdesc) 27 | 28 | surf_lh = gi.read(surfs_lh) 29 | vert_lh = surf_lh.darrays[0].data 30 | face_lh = surf_lh.darrays[1].data 31 | hemilab_lh = gi.read(hemilabels_lh) 32 | hemilabdi_lh = hemilab_lh.labeltable.get_labels_as_dict() 33 | 34 | surf_rh = gi.read(surfs_rh) 35 | vert_rh = surf_rh.darrays[0].data 36 | face_rh = surf_rh.darrays[1].data 37 | hemilab_rh = gi.read(hemilabels_rh) 38 | hemilabdi_rh = hemilab_rh.labeltable.get_labels_as_dict() 39 | 40 | # compute dummy node for all subcortical regions 41 | centercoord = np.vstack( (vert_lh.mean(axis=0), vert_rh.mean(axis=0) ) ).mean(axis=0) 42 | 43 | newg = nx.Graph() 44 | 45 | # check if the network description node label is contained in the label array 46 | for nid, d in g.nodes_iter(data=True): 47 | if d['dn_region'] == 'subcortical': 48 | newg.add_node(nid, dn_fsname = d['dn_fsname'], dn_region = d['dn_region'], dn_hemisphere = d['dn_hemisphere']) 49 | newg.node[nid]['pial_x'] = str(centercoord[0]) 50 | newg.node[nid]['pial_y'] = str(centercoord[1]) 51 | newg.node[nid]['pial_z'] = str(centercoord[2]) 52 | print "Region ...", d['dn_fsname'] 53 | la = d['dn_fsname'] 54 | if d['dn_region'] == 'cortical' and d['dn_hemisphere'] == 'left': 55 | print "left" 56 | hemi = hemilabdi_lh 57 | labels = hemilab_lh.darrays[0].data 58 | vert = vert_lh 59 | face = face_lh 60 | else: 61 | print "right" 62 | hemi = hemilabdi_rh 63 | labels = hemilab_rh.darrays[0].data 64 | vert = vert_rh 65 | face = face_rh 66 | for k,v in hemi.items(): 67 | if v in la: 68 | # get the labelid 69 | print "Found label", v, "with key", k 70 | # use the labelid to compute on the given surface the center of gravity 71 | # store this information in the new network description 72 | dar = vert[np.where(k == labels)[0]] 73 | dar = dar.mean(axis=0) 74 | newg.add_node(nid, dn_fsname = d['dn_fsname'], dn_region = d['dn_region'], dn_hemisphere = d['dn_hemisphere']) 75 | newg.node[nid]['pial_x'] = str(dar[0]) 76 | newg.node[nid]['pial_y'] = str(dar[1]) 77 | newg.node[nid]['pial_z'] = str(dar[2]) 78 | 79 | # add edges 80 | for u,v,d in g.edges_iter(data=True): 81 | newg.add_edge(u,v,d) 82 | 83 | # write out as JSON 84 | f = open('nodes.json', 'w') 85 | json.dump(newg.node, f) 86 | f.close() 87 | 88 | f = open('edges.json', 'w') 89 | json.dump(newg.edge, f) 90 | f.close() 91 | -------------------------------------------------------------------------------- /scratch/extract_and_merge_cnetwork.py: -------------------------------------------------------------------------------- 1 | # This script takes a set of compressed connectome files .cff 2 | # and produces a new connectome file containing only the requested 3 | # connectome object types. The new connectome object names are composed 4 | # of the originial connectome file title and the original connectome 5 | # object name 6 | 7 | import cfflib as cf 8 | 9 | original_connectomes = ['myconnectome1.cff', 'myconnectome2.cff'] 10 | 11 | extracted_networks = [] 12 | 13 | for i, con in enumerate(original_connectomes): 14 | mycon = cf.load(con) 15 | nets = mycon.get_connectome_network() 16 | for ne in nets: 17 | # here, you might want to skip networks with a given 18 | # metadata information 19 | ne.load() 20 | contitle = mycon.get_connectome_meta().get_title() 21 | ne.set_name( str(i) + ': ' + contitle + ' - ' + ne.get_name() ) 22 | extracted_networks.append(ne) 23 | 24 | # add networks to new connectome 25 | newcon = cf.connectome(title = 'All CNetworks', connectome_network = extracted_networks ) 26 | # Setting additional metadata 27 | metadata = newcon.get_connectome_meta() 28 | metadata.set_creator('My Name') 29 | metadata.set_email('My Email') 30 | cf.save_to_cff(newcon, 'merged_cnetworks.cff') 31 | -------------------------------------------------------------------------------- /scratch/ideas/WMfillHolesInLabels.m: -------------------------------------------------------------------------------- 1 | function fillHolesInLabels( INPUT_path, gfa_GM_lb, gfa_WM_lb ) 2 | 3 | fprintf('\n-> Basepath for labels to be fixed: ''%s''\n', INPUT_path) 4 | 5 | 6 | 7 | %% load GFA and WM datasets (GFA must be provided in 1x1x1 mm^3 resolution) 8 | fprintf('\n-> Loading ''GFA_1x1x1.nii'' mask...\n') 9 | niiGFA = load_untouch_nii( fullfile(INPUT_path,'GFA_1x1x1.nii') ); 10 | fprintf(' [ OK ]\n') 11 | 12 | 13 | fprintf('\n-> Loading ''WM.nii'' mask...\n') 14 | niiWM = load_untouch_nii( fullfile(INPUT_path,'WM.nii') ); 15 | niiWM.img = abs(niiWM.img); 16 | fprintf(' [ OK ]\n') 17 | 18 | 19 | %% fill holes in WM based on GFA information 20 | fprintf('\n-> Working on''WM.nii'' dataset...\n') 21 | 22 | % fill gaps 23 | fprintf(' * INCLUDING voxels with GFA >= %.2f and REMOVING voxels with GFA < %.2f...',gfa_WM_lb,gfa_GM_lb) 24 | 25 | [X Y Z] = ind2sub( niiWM.hdr.dime.dim(2:4), find(imdilate(niiWM.img,ones(3,3,3)) - imerode(niiWM.img,ones(3,3,3))) ); 26 | for i = 1:length(X) 27 | if ( niiGFA.img( X(i),Y(i),Z(i) ) >= gfa_WM_lb ) 28 | niiWM.img( X(i), Y(i), Z(i) ) = 1; 29 | end 30 | if ( niiGFA.img( X(i),Y(i),Z(i) ) < gfa_GM_lb ) 31 | niiWM.img( X(i), Y(i), Z(i) ) = 0; 32 | end 33 | end 34 | clear X Y Z se 35 | 36 | fprintf(' [ OK ]\n') 37 | 38 | 39 | % save filled dataset 40 | fprintf(' * Saving dataset as ''WM__DILATED.nii''...') 41 | 42 | save_untouch_nii(niiWM,fullfile(INPUT_path,'WM__DILATED.nii')); 43 | 44 | fprintf(' [ OK ]\n') 45 | fprintf(' [ OK ]\n') 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /scratch/ideas/atlas_creation_idea.py: -------------------------------------------------------------------------------- 1 | """ 2 | Cortical parcellation idea 3 | Stephan Gerhard 4 | 5 | Using PyMetis: http://mathema.tician.de/software/pymetis 6 | 7 | Ubuntu: 8 | required packages: python, boost, dev packages. 9 | adapt pymetis setup.py with: Libraries("BOOST_PYTHON", ["boost_python-mt-py26"]), 10 | 11 | """ 12 | import numpy as np 13 | import networkx as nx 14 | from pymetis import part_graph 15 | # import pymatlab 16 | 17 | import nibabel.gifti as gi 18 | 19 | a=gi.read('rh.inflated.gii') 20 | vert = a.darrays[0].data 21 | face = a.darrays[1].data 22 | 23 | #import pymatlab 24 | #from pymatlab import Session 25 | #m=Session() 26 | # http://surfer.nmr.mgh.harvard.edu/fswiki/CorticalParcellation 27 | 28 | #m.run("[v,l,c] = read_annotation('/home/stephan/Dev/PyWorkspace/cmp/scratch/atlas_creation/cmp/rh.myaparc_33.annot');") 29 | 30 | # data init 31 | verts = np.array( [ [0,1,1], [2,3,2], [2,1,2], [2,5,4], [5,4,3] ] ) 32 | faces = np.array( [ [0,1,2], [2,1,4], [3,4,2] ] ).tolist() 33 | # select one region, and extract it as subgraph 34 | labels = np.array( [ 0,2,2,1,1] ) 35 | 36 | # create a graph from the mesh 37 | h=nx.Graph() 38 | for f in faces: 39 | # add three edges for each triangle 40 | a,b,c = f 41 | h.add_edges_from([(a,b),(b,c),(c,a)]) 42 | 43 | # print h.adjacency_list() 44 | 45 | # partition the graph 46 | cuts, part_vert = part_graph(2, h.adjacency_list()) 47 | 48 | print "number of cuts", cuts 49 | print "partition", part_vert 50 | 51 | # visualize partition to control using partition as scaler value 52 | 53 | -------------------------------------------------------------------------------- /scratch/ideas/connectomemapper_dti.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # 4 | # NAME 5 | # 6 | # connectome_web.py 7 | # 8 | # DESCRIPTION 9 | # 10 | # This is a wrapper for the Connectome Mapping Toolkit such that 11 | # it can be executed from the CHB web front-end. 12 | # 13 | # AUTHORS 14 | # 15 | # Daniel Ginsburg 16 | # Rudolph Pienaar 17 | # Children's Hospital Boston, 2010 18 | # 19 | 20 | import cmp,cmp.connectome,cmp.configuration,cmp.pipeline,cmp.logme 21 | import sys 22 | import os 23 | import shutil, glob 24 | from optparse import OptionParser 25 | 26 | def parseCommandLine(conf): 27 | """Setup and parse command-line options""" 28 | 29 | parser = OptionParser(usage="%prog [options]") 30 | parser.add_option("-p", "--projectName", 31 | dest="projectName", 32 | help="Project name") 33 | parser.add_option("-v", "--verbose", 34 | action="store_true", dest="verbose") 35 | parser.add_option("-d","--workingDir", 36 | dest="workingDir", 37 | help="Subject Working Directory") 38 | parser.add_option("--b0", 39 | dest="b0", 40 | type="int", 41 | help="Number of B0 volumes") 42 | parser.add_option("--bValue", 43 | dest="bValue", 44 | type="int", 45 | help="B Value") 46 | parser.add_option("--gm", 47 | dest="gradientMatrix", 48 | help="Gradient file") 49 | parser.add_option("--dtiDir", 50 | dest="dtiDir", 51 | help="DTI DICOM Input directory") 52 | parser.add_option("--t1Dir", 53 | dest="t1Dir", 54 | help="T1 DICOM Input directory") 55 | (options, args) = parser.parse_args() 56 | if len(args) != 0: 57 | parser.error("Wrong number of arguments") 58 | 59 | # Parse command-line options 60 | if options.workingDir == None: 61 | parser.error('You must specify --workingDir') 62 | else: 63 | conf.subject_workingdir = options.workingDir 64 | conf.subject_name = os.path.basename(conf.subject_workingdir) 65 | 66 | if options.projectName: 67 | conf.project_name = options.projectName 68 | 69 | if options.gradientMatrix: 70 | conf.gradient_table_file = options.gradientMatrix 71 | conf.gradient_table = 'custom' 72 | 73 | if options.b0: 74 | conf.nr_of_b0 = options.b0 75 | 76 | if options.bValue: 77 | conf.max_b0_val = options.bValue 78 | 79 | return options 80 | 81 | def prepForExecution(conf, options): 82 | """Prepare the files for execution of the cmp pipeline""" 83 | 84 | # Must specify the T1 and DTI input directories 85 | if options.t1Dir == None: 86 | sys.exit('You must specify --t1Dir') 87 | 88 | if options.dtiDir == None: 89 | sys.exit('You must specify --dtiDir') 90 | 91 | # First, setup the pipeline status so we can determine the inputs 92 | cmp.connectome.setup_pipeline_status(conf) 93 | 94 | # Get the first stage by number 95 | stage = conf.pipeline_status.GetStage(num=1) 96 | 97 | # Get the DTI and T1 DICOM input folders 98 | dtiInput = conf.pipeline_status.GetStageInput(stage, 'dti-dcm') 99 | t1Input = conf.pipeline_status.GetStageInput(stage, 't1-dcm') 100 | 101 | # Create the input folders 102 | if not os.path.exists(dtiInput.rootDir): 103 | os.makedirs(dtiInput.rootDir) 104 | 105 | if not os.path.exists(t1Input.rootDir): 106 | os.makedirs(t1Input.rootDir) 107 | 108 | # Copy the DICOM's 109 | for file in glob.glob(os.path.join(options.dtiDir, dtiInput.filePath)): 110 | shutil.copy(file, dtiInput.rootDir) 111 | 112 | for file in glob.glob(os.path.join(options.t1Dir, t1Input.filePath)): 113 | shutil.copy(file, t1Input.rootDir) 114 | 115 | 116 | def main(): 117 | """Main entrypoint for program""" 118 | 119 | # Create configuration object 120 | conf = cmp.configuration.PipelineConfiguration() 121 | 122 | # Default Options 123 | conf.freesurfer_home = os.environ['FREESURFER_HOME'] 124 | conf.fsl_home = os.environ['FSL_DIR'] 125 | conf.dtk_matrices = os.environ['DSI_PATH'] 126 | conf.dtk_home = os.path.dirname(conf.dtk_matrices) # DTK home is one up from the matrices 127 | conf.subject_raw_glob_diffusion = '*.dcm' 128 | conf.subject_raw_glob_T1 = '*.dcm' 129 | conf.subject_raw_glob_T2 = '*.dcm' 130 | 131 | conf.diffusion_imaging_model = "DTI" 132 | conf.streamline_param = '' 133 | 134 | # XXX: These are hardcoded for now until I figure out how they 135 | # should be set 136 | conf.project_dir = '/chb/arch/python/cmp' 137 | 138 | # Setup and parse command-line options 139 | options = parseCommandLine(conf) 140 | 141 | # Prepare the directory structure for execution 142 | prepForExecution(conf, options) 143 | 144 | # Before running, reset the pipeline status because it will 145 | # get created in mapit() 146 | conf.pipeline_status = cmp.pipeline_status.PipelineStatus() 147 | 148 | # Execute the 'cmp' pipeline! 149 | cmp.connectome.mapit(conf) 150 | 151 | if __name__ == '__main__': 152 | main() 153 | 154 | 155 | 156 | 157 | 158 | -------------------------------------------------------------------------------- /scratch/ideas/convert.py: -------------------------------------------------------------------------------- 1 | import networkx as nx 2 | from glob import glob 3 | import os.path as op 4 | 5 | smallest = False 6 | 7 | if False: 8 | smallest = False 9 | h=nx.read_graphml('/home/sgerhard/dev/cmp/cmp/data/parcellation/lausanne2008/resolution83/resolution83.graphml') 10 | a_lh=glob('/home/sgerhard/data/project01_dsi/ale01/tp1/FREESURFER/label/regenerated_lh_36/lh.*.label') 11 | a_rh=glob('/home/sgerhard/data/project01_dsi/ale01/tp1/FREESURFER/label/regenerated_rh_36/rh.*.label') 12 | outname = '/home/sgerhard/dev/cmp/cmp/data/parcellation/lausanne2008/resolution83/resolution83_NEW.graphml' 13 | 14 | if True: 15 | h=nx.read_graphml('/home/sgerhard/dev/cmp/cmp/data/parcellation/lausanne2008/resolution150/resolution150.graphml') 16 | a_lh=glob('/home/sgerhard/data/project01_dsi/ale01/tp2/FREESURFER/label/regenerated_lh_60/lh.*.label') 17 | a_rh=glob('/home/sgerhard/data/project01_dsi/ale01/tp2/FREESURFER/label/regenerated_rh_60/rh.*.label') 18 | outname = '/home/sgerhard/dev/cmp/cmp/data/parcellation/lausanne2008/resolution150/resolution150_NEW.graphml' 19 | 20 | if False: 21 | h=nx.read_graphml('/home/sgerhard/dev/cmp/cmp/data/parcellation/lausanne2008/resolution258/resolution258.graphml') 22 | a_lh=glob('/home/sgerhard/data/project01_dsi/ale01/tp2/FREESURFER/label/regenerated_lh_125/lh.*.label') 23 | a_rh=glob('/home/sgerhard/data/project01_dsi/ale01/tp2/FREESURFER/label/regenerated_rh_125/rh.*.label') 24 | outname = '/home/sgerhard/dev/cmp/cmp/data/parcellation/lausanne2008/resolution258/resolution258_NEW.graphml' 25 | 26 | if False: 27 | h=nx.read_graphml('/home/sgerhard/dev/cmp/cmp/data/parcellation/lausanne2008/resolution500/resolution500.graphml') 28 | a_lh=glob('/home/sgerhard/data/project01_dsi/ale01/tp2/FREESURFER/label/regenerated_lh_250/lh.*.label') 29 | a_rh=glob('/home/sgerhard/data/project01_dsi/ale01/tp2/FREESURFER/label/regenerated_rh_250/rh.*.label') 30 | outname = '/home/sgerhard/dev/cmp/cmp/data/parcellation/lausanne2008/resolution500/resolution500_NEW.graphml' 31 | 32 | if False: 33 | # highest resolution has a problem 34 | h=nx.read_graphml('/home/sgerhard/dev/cmp/cmp/data/parcellation/lausanne2008/resolution1015/resolution1015.graphml') 35 | a_lh=glob('/home/sgerhard/data/project01_dsi/ale01/tp2newparc/FREESURFER/label/regenerated_lh_500/lh.*.label') 36 | a_rh=glob('/home/sgerhard/data/project01_dsi/ale01/tp2newparc/FREESURFER/label/regenerated_rh_500/rh.*.label') 37 | outname = 'resolution1015_NEW.graphml' 38 | 39 | di = [str(i) for i in range(10)] 40 | 41 | #len([b for b in a_lh if str(b.split('.')[1][-1]) in di]) 42 | #len([b for b in a_rh if str(b.split('.')[1][-1]) in di]) 43 | 44 | # only store fs names 45 | b_rh=[b.split('.')[1] for b in a_rh if str(b.split('.')[1][-1]) in di] 46 | # when no numbers, e.g. for rh_36 47 | 48 | if smallest: 49 | b_rh = [] 50 | for b in a_rh: 51 | name = str(b.split('.')[1]) 52 | if 'unknown' in name or 'corpuscallosum' in name: 53 | continue 54 | b_rh.append(name) 55 | 56 | b_rh.sort() 57 | print "Right", b_rh 58 | 59 | # subcortical left 60 | b_lh=[b.split('.')[1] for b in a_lh if str(b.split('.')[1][-1]) in di] 61 | 62 | # when no numbers, e.g. for lh_36 63 | if smallest: 64 | b_lh = [] 65 | for b in a_lh: 66 | name = str(b.split('.')[1]) 67 | if 'unknown' in name or 'corpuscallosum' in name: 68 | continue 69 | b_lh.append(name) 70 | 71 | ### subcortical right 72 | b_lh.sort() 73 | 74 | print "Left", b_lh 75 | 76 | # create network 77 | # dn_hemisphere 78 | # dn_region 79 | # dn_freesurfer_structname 80 | 81 | new = nx.Graph() 82 | 83 | e=nx.read_graphml('/home/sgerhard/dev/cmp/cmp/data/parcellation/nativefreesurfer/freesurferaparc/resolution83.graphml') 84 | subcort = nx.Graph() 85 | for i,d in e.nodes_iter(data=True): 86 | if d['dn_region'] == 'subcortical': 87 | subcort.add_node(i,d) 88 | 89 | rhsub=['35','36','37','38','39','40','41'] 90 | rhasg=['49','50','51','52','58','53','54'] 91 | 92 | 93 | lhsub=['76','77','78','79','80','81','82','83'] 94 | lhasg=['10','11','12','13','26','17','18','16'] 95 | 96 | # build up bigraph 97 | i = 1 98 | for reg in b_rh: 99 | print "Add node", i 100 | new.add_node(str(i), {'dn_hemisphere' : 'right', 'dn_region' : 'cortical', 'dn_fsname' : reg, 'dn_correspondence_id': str(i), 'dn_name' : 'rh.' + reg } ) 101 | i += 1 102 | 103 | # subcortical 104 | for idx, j in enumerate(rhsub): 105 | print "Add node", i 106 | new.add_node(str(i), {'dn_hemisphere' : 'right', 'dn_region' : 'subcortical', 'dn_fsname' : subcort.node[j]['dn_fsname'], 107 | 'dn_correspondence_id': str(i), 'dn_fs_aseg_val' : rhasg[idx], 'dn_name' : subcort.node[j]['dn_fsname'] } ) 108 | i += 1 109 | 110 | for reg in b_lh: 111 | print "Add node", i 112 | new.add_node(str(i), {'dn_hemisphere' : 'left', 'dn_region' : 'cortical', 'dn_fsname' : reg, 'dn_correspondence_id': str(i), 'dn_name' : 'lh.' + reg} ) 113 | i += 1 114 | 115 | # subcortical left 116 | for idx, j in enumerate(lhsub): 117 | print "Add node", i 118 | new.add_node(str(i), {'dn_hemisphere' : 'left', 'dn_region' : 'subcortical', 'dn_fsname' : subcort.node[j]['dn_fsname'], 119 | 'dn_correspondence_id': str(i), 'dn_fs_aseg_val' : lhasg[idx], 'dn_name' : subcort.node[j]['dn_fsname']} ) 120 | i += 1 121 | 122 | print "Final network has number of nodes", len(new.nodes()) 123 | nx.write_graphml(new, outname) 124 | -------------------------------------------------------------------------------- /scratch/ideas/plotonsphere.py: -------------------------------------------------------------------------------- 1 | # start ipython with: 2 | # ipython -wthread 3 | 4 | # there is SPHEREPACK 3.2 with is wrapped for python 5 | # this might ease your life a lot 6 | # http://code.google.com/p/pyspharm/ 7 | 8 | # there is also a spherical harmonics explorer 9 | # http://root42.blogspot.com/2010/09/spherical-harmonics-explorer.html 10 | # but i do not know if you can download it 11 | 12 | # there is also another python package for reconstruction 13 | # http://code.google.com/p/diffusion-mri/ 14 | # the code is here: http://github.com/matthew-brett/diffusion_mri 15 | 16 | # for the visualization 17 | # we need numpy and mayavi 18 | import numpy as np 19 | 20 | try: 21 | from mayavi.mlab import * 22 | except ImportError: 23 | from enthought.mayavi.mlab import * 24 | 25 | pi = np.pi 26 | cos = np.cos 27 | sin = np.sin 28 | 29 | # modified from example 30 | # http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/auto/mlab_helper_functions.html#mesh 31 | dphi, dtheta = pi/250.0, pi/250.0 32 | [phi,theta] = np.mgrid[0:pi+dphi*1.5:dphi, 0:2*pi+dtheta*1.5:dtheta] 33 | 34 | #m0 = 4; m1 = 3; m2 = 2; m3 = 3; m4 = 6; m5 = 2; m6 = 6; m7 = 4; 35 | #r = sin(m0*phi)**m1 + cos(m2*phi)**m3 + sin(m4*theta)**m5 + cos(m6*theta)**m7 36 | 37 | r = 4*sin(phi)**4 + cos(2 * phi) 38 | x = r*sin(phi)*cos(theta) 39 | y = r*cos(phi) 40 | z = r*sin(phi)*sin(theta); 41 | 42 | # if you want, you can put color 43 | col = np.random.random ( x.shape ) 44 | 45 | # without color 46 | # me = mesh(x, y, z, colormap="bone") 47 | 48 | # with (random) color 49 | me = mesh(x, y, z, scalars = col, colormap="Spectral") 50 | 51 | # you can use these colormaps: 52 | # http://www.scipy.org/Cookbook/Matplotlib/Show_colormaps 53 | 54 | -------------------------------------------------------------------------------- /scratch/ideas/write_trackvis.py: -------------------------------------------------------------------------------- 1 | import nibabel as ni 2 | from pylab import * 3 | import numpy as np 4 | 5 | a=ni.load('ROI_HR_th.nii') 6 | d=a.get_data() 7 | 8 | hdr = ni.trackvis.empty_header() 9 | 10 | hdr['voxel_size'] = np.array([1,1,1]) 11 | hdr['dim'] = np.array(d.shape) 12 | 13 | # fibers 14 | 15 | #fi = np.array([[90.1, 100.2, 8.2], [90.1, 100.2, 87.2]]) 16 | # 90,100, 8 : 83 17 | # -> 90,100,87: 8 18 | 19 | fi = np.array([[90.1, 104.2, 0.0], [90.1, 100.2, 87.2]]) 20 | # 90,100, 8 : 83 21 | # -> 90,100,87: 8 22 | 23 | fib = [(fi,None,None)] 24 | 25 | ni.trackvis.write('test.trk', fib, hdr) 26 | 27 | # fib, hdr = ni.trackvis.read('stream.trk') 28 | 29 | 30 | 31 | # imshow(d[:,:,0], interpolation='nearest') 32 | # show() -------------------------------------------------------------------------------- /scratch/inversecode/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/scratch/inversecode/__init__.py -------------------------------------------------------------------------------- /scratch/inversecode/scratch.py: -------------------------------------------------------------------------------- 1 | # Jennifer Andreotti 2 | 3 | import nibabel as ni 4 | import numpy as np 5 | import os.path as op 6 | from util import length 7 | 8 | datafolder = '/home/sgerhard/data/project01_dsi/ale01/tp1/CMP/cff/original_tp1.cff_FILES' 9 | ctrack = op.join(datafolder, 'CTrack') 10 | cvolume = op.join(datafolder, 'CVolume') 11 | cdata = op.join(datafolder, 'CData') 12 | 13 | # load data 14 | print "load volume..." 15 | myvolume = ni.load(op.join(cvolume, 'gfa_scalar_map.nii.gz')) 16 | myvolumedata = myvolume.get_data() 17 | 18 | print "load label array..." 19 | mylabelarray = np.load(op.join(cdata, 'fiber_labels_(freesurferaparc).npy')) 20 | 21 | print "load fibers..." 22 | mytracks, mytracksheaders = ni.trackvis.read(op.join(ctrack, 'filtered_tractography.trk')) 23 | fibers = [fiber[0] for fiber in mytracks] # list comprehension 24 | 25 | # first fiber 26 | # fibers[0] 27 | # first fiber, start point, x,y,z 28 | # fibers[0][0,:] 29 | # first fiber, last point, x,y,z 30 | # fibers[0][-1,:] 31 | 32 | def test(a): 33 | print "me", a 34 | #test("test") 35 | 36 | print "number of fibers", len(fibers) 37 | 38 | # Translate from mm to index 39 | # endpoints[i,0,0] = int( endpoints[i,0,0] / float(voxelSize[0])) 40 | 41 | # convert the first fiber to a sequence of voxel indices i,j,k 42 | # idx = (fibers[0] / np.array([1,1,1]) ).astype(np.int32) 43 | 44 | # scalar values along first fiber 45 | # myvolumedata[idx[:,0],idx[:,1],idx[:,2]] 46 | 47 | # compute length of first fiber 48 | length(fibers[0]) 49 | 50 | # return indices of all the fibers from 64 to 78 51 | idx = np.where(mylabelarray == 64.78)[0] 52 | 53 | for i in idx: 54 | myfiber = fiber[i] 55 | # happy computing 56 | 57 | # matrix F: voxels x fibers 58 | -------------------------------------------------------------------------------- /scratch/inversecode/util.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | # The function length is kindly contributed from the Diffusion in Python Project 4 | # http://www.nipy.org/dipy 5 | # 2010, Eleftherios Garyfallidis 6 | 7 | def length(xyz, along=False): 8 | ''' Euclidean length of track line 9 | 10 | Parameters 11 | ---------- 12 | xyz : array-like shape (N,3) 13 | array representing x,y,z of N points in a track 14 | along : bool, optional 15 | If True, return array giving cumulative length along track, 16 | otherwise (default) return scalar giving total length. 17 | 18 | Returns 19 | ------- 20 | L : scalar or array shape (N-1,) 21 | scalar in case of `along` == False, giving total length, array if 22 | `along` == True, giving cumulative lengths. 23 | 24 | Examples 25 | -------- 26 | >>> xyz = np.array([[1,1,1],[2,3,4],[0,0,0]]) 27 | >>> expected_lens = np.sqrt([1+2**2+3**2, 2**2+3**2+4**2]) 28 | >>> length(xyz) == expected_lens.sum() 29 | True 30 | >>> len_along = length(xyz, along=True) 31 | >>> np.allclose(len_along, expected_lens.cumsum()) 32 | True 33 | >>> length([]) 34 | 0 35 | >>> length([[1, 2, 3]]) 36 | 0 37 | >>> length([], along=True) 38 | array([0]) 39 | ''' 40 | xyz = np.asarray(xyz) 41 | if xyz.shape[0] < 2: 42 | if along: 43 | return np.array([0]) 44 | return 0 45 | dists = np.sqrt((np.diff(xyz, axis=0)**2).sum(axis=1)) 46 | print dists 47 | if along: 48 | return np.cumsum(dists) 49 | return np.sum(dists) 50 | -------------------------------------------------------------------------------- /scratch/map_dti_script.py: -------------------------------------------------------------------------------- 1 | # Example script to setup the pipeline configuration 2 | # Use cmpgui.print_traits() to show all the available attributes 3 | # from within IPython 4 | 5 | import cmp 6 | from cmp.gui import CMPGUI 7 | cmpgui = CMPGUI() 8 | 9 | cmpgui.project_dir = u'/home/sgerhard/data/project01_dsi' 10 | cmpgui.subject_workingdir = u'/home/sgerhard/data/project01_dsi/ale01/tp1' 11 | cmpgui.subject_timepoint = u'tp1' 12 | cmpgui.subject_name = u'ale01' 13 | cmpgui.subject_raw_glob_T1 = '*.*' 14 | cmpgui.subject_raw_glob_T2 = '*.*' 15 | cmpgui.subject_raw_glob_diffusion = '*.*' 16 | 17 | cmpgui.active_applyregistration = True 18 | cmpgui.active_cffconverter = True 19 | cmpgui.active_connectome = True 20 | cmpgui.active_createfolder = True 21 | cmpgui.active_dicomconverter = True 22 | cmpgui.active_fiberfilter = True 23 | cmpgui.active_parcellation = True 24 | cmpgui.active_reconstruction = True 25 | cmpgui.active_registration = True 26 | cmpgui.active_segmentation = True 27 | cmpgui.active_statistics = False 28 | cmpgui.active_tractography = True 29 | cmpgui.apply_fiberlength = True 30 | cmpgui.apply_splinefilter = True 31 | 32 | cmpgui.cff_cmatpickle = True 33 | cmpgui.cff_fiberarr = True 34 | cmpgui.cff_filteredfibers = True 35 | cmpgui.cff_finalfiberlabels = True 36 | cmpgui.cff_fullnetworkpickle = True 37 | cmpgui.cff_originalfibers = True 38 | cmpgui.cff_rawT1 = True 39 | cmpgui.cff_rawT2 = True 40 | cmpgui.cff_rawdiffusion = True 41 | cmpgui.cff_roisegmentation = True 42 | cmpgui.cff_scalars = True 43 | cmpgui.cff_surfacelabels = True 44 | cmpgui.cff_surfaces = True 45 | cmpgui.compute_curvature = True 46 | 47 | cmpgui.diffusion_imaging_model = 'DTI' 48 | cmpgui.do_convert_T1 = True 49 | cmpgui.do_convert_T2 = True 50 | cmpgui.do_convert_diffusion = True 51 | cmpgui.dtb_dtk2dir_param = u'' 52 | cmpgui.dti_recon_param = u'' 53 | cmpgui.dtk_home = '/home/sgerhard/soft/dtk/' 54 | cmpgui.dtk_matrices = '/home/sgerhard/soft/dtk/matrices' 55 | 56 | cmpgui.extract_diffusion_metadata = False 57 | cmpgui.fiber_cutoff_lower = 20.0 58 | cmpgui.fiber_cutoff_upper = 500.0 59 | cmpgui.freesurfer_home = '/home/sgerhard/soft/freesurfer50/' 60 | cmpgui.fsl_home = '/usr/share/fsl/4.1' 61 | cmpgui.fsloutputtype = 'NIFTI' 62 | cmpgui.gradient_table = 'custom' 63 | cmpgui.gradient_table_file = u'/home/sgerhard/dev/cmp/cmp/data/diffusion/gradient_tables/siemens_64.txt' 64 | cmpgui.hardi_recon_param = '-b0 1 -p 3 -sn 1' 65 | 66 | 67 | 68 | cmpgui.lin_reg_param = '-usesqform -nosearch -dof 6 -cost mutualinfo' 69 | cmpgui.max_b0_val = '1000' 70 | cmpgui.modified = None 71 | cmpgui.nlin_reg_bet_T2_param = '-f 0.35 -g 0.15' 72 | cmpgui.nlin_reg_bet_b0_param = '-f 0.2 -g 0.2' 73 | cmpgui.nlin_reg_fnirt_param = '--subsamp=8,4,2,2 --mit... --applyrefmask=0,0,1,1' 74 | cmpgui.nr_of_b0 = '1' 75 | 76 | cmpgui.parcellation = {'freesurferaparc' : 77 | {'node_information_graphml' : '/home/sgerhard/dev/packages/cmp/data/parcellation/nativefreesurfer/freesurferaparc/resolution83.graphml', 78 | 'number_of_regions' : 84, 79 | 'surface_parcellation' : None, 80 | 'volume_parcellation' : None}} 81 | cmpgui.parcellation_scheme = 'NativeFreesurfer' 82 | cmpgui.pipeline_status_file = 'cmp.status' 83 | 84 | cmpgui.created = None 85 | cmpgui.creator = u'sg' 86 | cmpgui.description = '' 87 | cmpgui.email = u'sg' 88 | cmpgui.emailnotify = [] 89 | cmpgui.license = '' 90 | cmpgui.project_metadata = {} 91 | cmpgui.species = 'Homo sapiens' 92 | cmpgui.publisher = u'sg' 93 | 94 | cmpgui.recon_all_param = '-all -no-isrunning' 95 | cmpgui.reference = '' 96 | cmpgui.registration_mode = 'Linear' 97 | cmpgui.skip_completed_stages = False 98 | cmpgui.streamline_param = '--angle 60 --seeds 32' 99 | 100 | cmp.connectome.mapit(cmpgui) 101 | -------------------------------------------------------------------------------- /scratch/ordered_leftlabels_resolution125.csv: -------------------------------------------------------------------------------- 1 | "lateralorbitofrontal_1" 2 | "lateralorbitofrontal_2" 3 | "lateralorbitofrontal_3" 4 | "lateralorbitofrontal_4" 5 | "parsorbitalis_1" 6 | "frontalpole_1" 7 | "medialorbitofrontal_1" 8 | "medialorbitofrontal_2" 9 | "parstriangularis_1" 10 | "parsopercularis_1" 11 | "parsopercularis_2" 12 | "rostralmiddlefrontal_1" 13 | "rostralmiddlefrontal_2" 14 | "rostralmiddlefrontal_3" 15 | "rostralmiddlefrontal_4 " 16 | "rostralmiddlefrontal_5 " 17 | "rostralmiddlefrontal_6" 18 | "superiorfrontal_1" 19 | "superiorfrontal_2" 20 | "superiorfrontal_3" 21 | "superiorfrontal_4" 22 | "superiorfrontal_5" 23 | "superiorfrontal_6" 24 | "superiorfrontal_7" 25 | "superiorfrontal_8" 26 | "superiorfrontal_9" 27 | "caudalmiddlefrontal_1" 28 | "caudalmiddlefrontal_2" 29 | "caudalmiddlefrontal_3" 30 | "precentral_1" 31 | "precentral_2" 32 | "precentral_3" 33 | "precentral_4" 34 | "precentral_5" 35 | "precentral_6" 36 | "precentral_7" 37 | "precentral_8" 38 | "paracentral_1" 39 | "paracentral_2" 40 | "rostralanteriorcingulate_1" 41 | "caudalanteriorcingulate_1" 42 | "posteriorcingulate_1" 43 | "posteriorcingulate_2" 44 | "isthmuscingulate_1" 45 | "postcentral_1" 46 | "postcentral_2" 47 | "postcentral_3" 48 | "postcentral_4" 49 | "postcentral_5" 50 | "postcentral_6" 51 | "postcentral_7" 52 | "supramarginal_1" 53 | "supramarginal_2" 54 | "supramarginal_3" 55 | "supramarginal_4" 56 | "supramarginal_5" 57 | "superiorparietal_1" 58 | "superiorparietal_2" 59 | "superiorparietal_3" 60 | "superiorparietal_4" 61 | "superiorparietal_5" 62 | "superiorparietal_6" 63 | "superiorparietal_7" 64 | "inferiorparietal_1" 65 | "inferiorparietal_2" 66 | "inferiorparietal_3" 67 | "inferiorparietal_4" 68 | "inferiorparietal_5" 69 | "precuneus_1" 70 | "precuneus_2" 71 | "precuneus_3" 72 | "precuneus_4" 73 | "precuneus_5" 74 | "cuneus_1" 75 | "pericalcarine_1" 76 | "lateraloccipital_1" 77 | "lateraloccipital_2" 78 | "lateraloccipital_3" 79 | "lateraloccipital_4" 80 | "lateraloccipital_5" 81 | "lingual_1" 82 | "lingual_2" 83 | "lingual_3" 84 | "lingual_4" 85 | "fusiform_1" 86 | "fusiform_2" 87 | "fusiform_3" 88 | "fusiform_4" 89 | "parahippocampal_1" 90 | "entorhinal_1" 91 | "temporalpole_1" 92 | "inferiortemporal_1" 93 | "inferiortemporal_2" 94 | "inferiortemporal_3" 95 | "inferiortemporal_4" 96 | "middletemporal_1" 97 | "middletemporal_2" 98 | "middletemporal_3" 99 | "middletemporal_4" 100 | "bankssts_1" 101 | "bankssts_2" 102 | "superiortemporal_1" 103 | "superiortemporal_2" 104 | "superiortemporal_3" 105 | "superiortemporal_4" 106 | "superiortemporal_5" 107 | "transversetemporal_1" 108 | "insula_1" 109 | "insula_2" 110 | "insula_3" 111 | "insula_4" 112 | -------------------------------------------------------------------------------- /scratch/ordered_leftlabels_resolution250.csv: -------------------------------------------------------------------------------- 1 | "lateralorbitofrontal_1" 2 | "lateralorbitofrontal_2" 3 | "lateralorbitofrontal_3" 4 | "lateralorbitofrontal_4" 5 | "lateralorbitofrontal_5" 6 | "lateralorbitofrontal_6" 7 | "lateralorbitofrontal_7" 8 | "parsorbitalis_1" 9 | "parsorbitalis_2" 10 | "frontalpole_1" 11 | "medialorbitofrontal_1" 12 | "medialorbitofrontal_2" 13 | "medialorbitofrontal_3" 14 | "medialorbitofrontal_4" 15 | "medialorbitofrontal_5" 16 | "parstriangularis_1" 17 | "parstriangularis_2" 18 | "parstriangularis_3" 19 | "parsopercularis_1" 20 | "parsopercularis_2" 21 | "parsopercularis_3" 22 | "parsopercularis_4" 23 | "rostralmiddlefrontal_1" 24 | "rostralmiddlefrontal_2" 25 | "rostralmiddlefrontal_3" 26 | "rostralmiddlefrontal_4" 27 | "rostralmiddlefrontal_5" 28 | "rostralmiddlefrontal_6" 29 | "rostralmiddlefrontal_7" 30 | "rostralmiddlefrontal_8" 31 | "rostralmiddlefrontal_9" 32 | "rostralmiddlefrontal_10" 33 | "rostralmiddlefrontal_11" 34 | "rostralmiddlefrontal_12" 35 | "superiorfrontal_1" 36 | "superiorfrontal_2" 37 | "superiorfrontal_3" 38 | "superiorfrontal_4" 39 | "superiorfrontal_5" 40 | "superiorfrontal_6" 41 | "superiorfrontal_7" 42 | "superiorfrontal_8" 43 | "superiorfrontal_9" 44 | "superiorfrontal_10" 45 | "superiorfrontal_11" 46 | "superiorfrontal_12" 47 | "superiorfrontal_13" 48 | "superiorfrontal_14" 49 | "superiorfrontal_15" 50 | "superiorfrontal_16" 51 | "superiorfrontal_17" 52 | "superiorfrontal_18" 53 | "caudalmiddlefrontal_1" 54 | "caudalmiddlefrontal_2" 55 | "caudalmiddlefrontal_3" 56 | "caudalmiddlefrontal_4" 57 | "caudalmiddlefrontal_5" 58 | "caudalmiddlefrontal_6" 59 | "precentral_1" 60 | "precentral_2" 61 | "precentral_3" 62 | "precentral_4" 63 | "precentral_5" 64 | "precentral_6" 65 | "precentral_7" 66 | "precentral_8" 67 | "precentral_9" 68 | "precentral_10" 69 | "precentral_11" 70 | "precentral_12" 71 | "precentral_13" 72 | "precentral_14" 73 | "precentral_15" 74 | "precentral_16" 75 | "paracentral_1" 76 | "paracentral_2" 77 | "paracentral_3" 78 | "paracentral_4" 79 | "paracentral_5" 80 | "rostralanteriorcingulate_1" 81 | "rostralanteriorcingulate_2" 82 | "caudalanteriorcingulate_1" 83 | "caudalanteriorcingulate_2" 84 | "posteriorcingulate_1" 85 | "posteriorcingulate_2" 86 | "posteriorcingulate_3" 87 | "posteriorcingulate_4" 88 | "isthmuscingulate_1" 89 | "isthmuscingulate_2" 90 | "isthmuscingulate_3" 91 | "postcentral_1" 92 | "postcentral_2" 93 | "postcentral_3" 94 | "postcentral_4" 95 | "postcentral_5" 96 | "postcentral_6" 97 | "postcentral_7" 98 | "postcentral_8" 99 | "postcentral_9" 100 | "postcentral_10" 101 | "postcentral_11" 102 | "postcentral_12" 103 | "postcentral_13" 104 | "postcentral_14" 105 | "supramarginal_1" 106 | "supramarginal_2" 107 | "supramarginal_3" 108 | "supramarginal_4" 109 | "supramarginal_5" 110 | "supramarginal_6" 111 | "supramarginal_7" 112 | "supramarginal_8" 113 | "supramarginal_9" 114 | "supramarginal_10" 115 | "superiorparietal_1" 116 | "superiorparietal_2" 117 | "superiorparietal_3" 118 | "superiorparietal_4" 119 | "superiorparietal_5" 120 | "superiorparietal_6" 121 | "superiorparietal_7" 122 | "superiorparietal_8" 123 | "superiorparietal_9" 124 | "superiorparietal_10" 125 | "superiorparietal_11" 126 | "superiorparietal_12" 127 | "superiorparietal_13" 128 | "superiorparietal_14" 129 | "inferiorparietal_1" 130 | "inferiorparietal_2" 131 | "inferiorparietal_3" 132 | "inferiorparietal_4" 133 | "inferiorparietal_5" 134 | "inferiorparietal_6" 135 | "inferiorparietal_7" 136 | "inferiorparietal_8" 137 | "inferiorparietal_9" 138 | "inferiorparietal_10" 139 | "precuneus_1" 140 | "precuneus_2" 141 | "precuneus_3" 142 | "precuneus_4" 143 | "precuneus_5" 144 | "precuneus_6" 145 | "precuneus_7" 146 | "precuneus_8" 147 | "precuneus_9" 148 | "precuneus_10" 149 | "precuneus_11" 150 | "cuneus_1" 151 | "cuneus_2" 152 | "cuneus_3" 153 | "pericalcarine_1" 154 | "pericalcarine_2" 155 | "pericalcarine_3" 156 | "lateraloccipital_1" 157 | "lateraloccipital_2" 158 | "lateraloccipital_3" 159 | "lateraloccipital_4" 160 | "lateraloccipital_5" 161 | "lateraloccipital_6" 162 | "lateraloccipital_7" 163 | "lateraloccipital_8" 164 | "lateraloccipital_9" 165 | "lateraloccipital_10" 166 | "lateraloccipital_11" 167 | "lingual_1" 168 | "lingual_2" 169 | "lingual_3" 170 | "lingual_4" 171 | "lingual_5" 172 | "lingual_6" 173 | "lingual_7" 174 | "lingual_8" 175 | "fusiform_1" 176 | "fusiform_2" 177 | "fusiform_3" 178 | "fusiform_4" 179 | "fusiform_5" 180 | "fusiform_6" 181 | "fusiform_7" 182 | "fusiform_8" 183 | "parahippocampal_1" 184 | "parahippocampal_2" 185 | "parahippocampal_3" 186 | "entorhinal_1" 187 | "temporalpole_1" 188 | "inferiortemporal_1" 189 | "inferiortemporal_2" 190 | "inferiortemporal_3" 191 | "inferiortemporal_4" 192 | "inferiortemporal_5" 193 | "inferiortemporal_6" 194 | "inferiortemporal_7" 195 | "inferiortemporal_8" 196 | "middletemporal_1" 197 | "middletemporal_2" 198 | "middletemporal_3" 199 | "middletemporal_4" 200 | "middletemporal_5" 201 | "middletemporal_6" 202 | "middletemporal_7" 203 | "bankssts_1" 204 | "bankssts_2" 205 | "bankssts_3" 206 | "superiortemporal_1" 207 | "superiortemporal_2" 208 | "superiortemporal_3" 209 | "superiortemporal_4" 210 | "superiortemporal_5" 211 | "superiortemporal_6" 212 | "superiortemporal_7" 213 | "superiortemporal_8" 214 | "superiortemporal_9" 215 | "superiortemporal_10" 216 | "superiortemporal_11" 217 | "transversetemporal_1" 218 | "transversetemporal_2" 219 | "insula_1" 220 | "insula_2" 221 | "insula_3" 222 | "insula_4" 223 | "insula_5" 224 | "insula_6" 225 | "insula_7" 226 | -------------------------------------------------------------------------------- /scratch/ordered_leftlabels_resolution33.csv: -------------------------------------------------------------------------------- 1 | "lateralorbitofrontal" 2 | "parsorbitalis" 3 | "frontalpole" 4 | "medialorbitofrontal" 5 | "parstriangularis" 6 | "parsopercularis" 7 | "rostralmiddlefrontal" 8 | "superiorfrontal" 9 | "caudalmiddlefrontal" 10 | "precentral" 11 | "paracentral" 12 | "rostralanteriorcingulate" 13 | "caudalanteriorcingulate" 14 | "posteriorcingulate" 15 | "isthmuscingulate" 16 | "postcentral" 17 | "supramarginal" 18 | "superiorparietal" 19 | "inferiorparietal" 20 | "precuneus" 21 | "cuneus" 22 | "pericalcarine" 23 | "lateraloccipital" 24 | "lingual" 25 | "fusiform" 26 | "parahippocampal" 27 | "entorhinal" 28 | "temporalpole" 29 | "inferiortemporal" 30 | "middletemporal" 31 | "bankssts" 32 | "superiortemporal" 33 | "transversetemporal" 34 | "insula" 35 | -------------------------------------------------------------------------------- /scratch/ordered_leftlabels_resolution500.csv: -------------------------------------------------------------------------------- 1 | "lateralorbitofrontal_1" 2 | "lateralorbitofrontal_2" 3 | "lateralorbitofrontal_3" 4 | "lateralorbitofrontal_4" 5 | "lateralorbitofrontal_5" 6 | "lateralorbitofrontal_6" 7 | "lateralorbitofrontal_7" 8 | "parsorbitalis_1" 9 | "parsorbitalis_2" 10 | "frontalpole_1" 11 | "medialorbitofrontal_1" 12 | "medialorbitofrontal_2" 13 | "medialorbitofrontal_3" 14 | "medialorbitofrontal_4" 15 | "medialorbitofrontal_5" 16 | "parstriangularis_1" 17 | "parstriangularis_2" 18 | "parstriangularis_3" 19 | "parsopercularis_1" 20 | "parsopercularis_2" 21 | "parsopercularis_3" 22 | "parsopercularis_4" 23 | "rostralmiddlefrontal_1" 24 | "rostralmiddlefrontal_2" 25 | "rostralmiddlefrontal_3" 26 | "rostralmiddlefrontal_4" 27 | "rostralmiddlefrontal_5" 28 | "rostralmiddlefrontal_6" 29 | "rostralmiddlefrontal_7" 30 | "rostralmiddlefrontal_8" 31 | "rostralmiddlefrontal_9" 32 | "rostralmiddlefrontal_10" 33 | "rostralmiddlefrontal_11" 34 | "rostralmiddlefrontal_12" 35 | "superiorfrontal_1" 36 | "superiorfrontal_2" 37 | "superiorfrontal_3" 38 | "superiorfrontal_4" 39 | "superiorfrontal_5" 40 | "superiorfrontal_6" 41 | "superiorfrontal_7" 42 | "superiorfrontal_8" 43 | "superiorfrontal_9" 44 | "superiorfrontal_10" 45 | "superiorfrontal_11" 46 | "superiorfrontal_12" 47 | "superiorfrontal_13" 48 | "superiorfrontal_14" 49 | "superiorfrontal_15" 50 | "superiorfrontal_16" 51 | "superiorfrontal_17" 52 | "superiorfrontal_18" 53 | "caudalmiddlefrontal_1" 54 | "caudalmiddlefrontal_2" 55 | "caudalmiddlefrontal_3" 56 | "caudalmiddlefrontal_4" 57 | "caudalmiddlefrontal_5" 58 | "caudalmiddlefrontal_6" 59 | "precentral_1" 60 | "precentral_2" 61 | "precentral_3" 62 | "precentral_4" 63 | "precentral_5" 64 | "precentral_6" 65 | "precentral_7" 66 | "precentral_8" 67 | "precentral_9" 68 | "precentral_10" 69 | "precentral_11" 70 | "precentral_12" 71 | "precentral_13" 72 | "precentral_14" 73 | "precentral_15" 74 | "precentral_16" 75 | "paracentral_1" 76 | "paracentral_2" 77 | "paracentral_3" 78 | "paracentral_4" 79 | "paracentral_5" 80 | "rostralanteriorcingulate_1" 81 | "rostralanteriorcingulate_2" 82 | "caudalanteriorcingulate_1" 83 | "caudalanteriorcingulate_2" 84 | "posteriorcingulate_1" 85 | "posteriorcingulate_2" 86 | "posteriorcingulate_3" 87 | "posteriorcingulate_4" 88 | "isthmuscingulate_1" 89 | "isthmuscingulate_2" 90 | "isthmuscingulate_3" 91 | "postcentral_1" 92 | "postcentral_2" 93 | "postcentral_3" 94 | "postcentral_4" 95 | "postcentral_5" 96 | "postcentral_6" 97 | "postcentral_7" 98 | "postcentral_8" 99 | "postcentral_9" 100 | "postcentral_10" 101 | "postcentral_11" 102 | "postcentral_12" 103 | "postcentral_13" 104 | "postcentral_14" 105 | "supramarginal_1" 106 | "supramarginal_2" 107 | "supramarginal_3" 108 | "supramarginal_4" 109 | "supramarginal_5" 110 | "supramarginal_6" 111 | "supramarginal_7" 112 | "supramarginal_8" 113 | "supramarginal_9" 114 | "supramarginal_10" 115 | "superiorparietal_1" 116 | "superiorparietal_2" 117 | "superiorparietal_3" 118 | "superiorparietal_4" 119 | "superiorparietal_5" 120 | "superiorparietal_6" 121 | "superiorparietal_7" 122 | "superiorparietal_8" 123 | "superiorparietal_9" 124 | "superiorparietal_10" 125 | "superiorparietal_11" 126 | "superiorparietal_12" 127 | "superiorparietal_13" 128 | "superiorparietal_14" 129 | "inferiorparietal_1" 130 | "inferiorparietal_2" 131 | "inferiorparietal_3" 132 | "inferiorparietal_4" 133 | "inferiorparietal_5" 134 | "inferiorparietal_6" 135 | "inferiorparietal_7" 136 | "inferiorparietal_8" 137 | "inferiorparietal_9" 138 | "inferiorparietal_10" 139 | "precuneus_1" 140 | "precuneus_2" 141 | "precuneus_3" 142 | "precuneus_4" 143 | "precuneus_5" 144 | "precuneus_6" 145 | "precuneus_7" 146 | "precuneus_8" 147 | "precuneus_9" 148 | "precuneus_10" 149 | "precuneus_11" 150 | "cuneus_1" 151 | "cuneus_2" 152 | "cuneus_3" 153 | "pericalcarine_1" 154 | "pericalcarine_2" 155 | "pericalcarine_3" 156 | "lateraloccipital_1" 157 | "lateraloccipital_2" 158 | "lateraloccipital_3" 159 | "lateraloccipital_4" 160 | "lateraloccipital_5" 161 | "lateraloccipital_6" 162 | "lateraloccipital_7" 163 | "lateraloccipital_8" 164 | "lateraloccipital_9" 165 | "lateraloccipital_10" 166 | "lateraloccipital_11" 167 | "lingual_1" 168 | "lingual_2" 169 | "lingual_3" 170 | "lingual_4" 171 | "lingual_5" 172 | "lingual_6" 173 | "lingual_7" 174 | "lingual_8" 175 | "fusiform_1" 176 | "fusiform_2" 177 | "fusiform_3" 178 | "fusiform_4" 179 | "fusiform_5" 180 | "fusiform_6" 181 | "fusiform_7" 182 | "fusiform_8" 183 | "parahippocampal_1" 184 | "parahippocampal_2" 185 | "parahippocampal_3" 186 | "entorhinal_1" 187 | "temporalpole_1" 188 | "inferiortemporal_1" 189 | "inferiortemporal_2" 190 | "inferiortemporal_3" 191 | "inferiortemporal_4" 192 | "inferiortemporal_5" 193 | "inferiortemporal_6" 194 | "inferiortemporal_7" 195 | "inferiortemporal_8" 196 | "middletemporal_1" 197 | "middletemporal_2" 198 | "middletemporal_3" 199 | "middletemporal_4" 200 | "middletemporal_5" 201 | "middletemporal_6" 202 | "middletemporal_7" 203 | "bankssts_1" 204 | "bankssts_2" 205 | "bankssts_3" 206 | "superiortemporal_1" 207 | "superiortemporal_2" 208 | "superiortemporal_3" 209 | "superiortemporal_4" 210 | "superiortemporal_5" 211 | "superiortemporal_6" 212 | "superiortemporal_7" 213 | "superiortemporal_8" 214 | "superiortemporal_9" 215 | "superiortemporal_10" 216 | "superiortemporal_11" 217 | "transversetemporal_1" 218 | "transversetemporal_2" 219 | "insula_1" 220 | "insula_2" 221 | "insula_3" 222 | "insula_4" 223 | "insula_5" 224 | "insula_6" 225 | "insula_7" 226 | -------------------------------------------------------------------------------- /scratch/ordered_leftlabels_resolution60.csv: -------------------------------------------------------------------------------- 1 | "lateralorbitofrontal_1" 2 | "lateralorbitofrontal_2" 3 | "parsorbitalis_1" 4 | "frontalpole_1" 5 | "medialorbitofrontal_1" 6 | "parstriangularis_1" 7 | "parsopercularis_1" 8 | "rostralmiddlefrontal_1" 9 | "rostralmiddlefrontal_2" 10 | "rostralmiddlefrontal_3" 11 | "superiorfrontal_1" 12 | "superiorfrontal_2" 13 | "superiorfrontal_3" 14 | "superiorfrontal_4" 15 | "caudalmiddlefrontal_1" 16 | "precentral_1" 17 | "precentral_2" 18 | "precentral_3" 19 | "precentral_4" 20 | "paracentral_1" 21 | "rostralanteriorcingulate_1" 22 | "caudalanteriorcingulate_1" 23 | "posteriorcingulate_1" 24 | "isthmuscingulate_1" 25 | "postcentral_1" 26 | "postcentral_2" 27 | "postcentral_3" 28 | "supramarginal_1" 29 | "supramarginal_2" 30 | "superiorparietal_1" 31 | "superiorparietal_2" 32 | "superiorparietal_3" 33 | "inferiorparietal_1" 34 | "inferiorparietal_2" 35 | "precuneus_1" 36 | "precuneus_2" 37 | "cuneus_1" 38 | "pericalcarine_1" 39 | "lateraloccipital_1" 40 | "lateraloccipital_2" 41 | "lingual_1" 42 | "lingual_2" 43 | "fusiform_1" 44 | "fusiform_2" 45 | "parahippocampal_1" 46 | "entorhinal_1" 47 | "temporalpole_1" 48 | "inferiortemporal_1" 49 | "inferiortemporal_2" 50 | "middletemporal_1" 51 | "middletemporal_2" 52 | "bankssts_1" 53 | "superiortemporal_1" 54 | "superiortemporal_2" 55 | "transversetemporal_1" 56 | "insula_1" 57 | "insula_2" 58 | -------------------------------------------------------------------------------- /scratch/ordered_rightlabels_resolution125.csv: -------------------------------------------------------------------------------- 1 | "lateralorbitofrontal_1" 2 | "lateralorbitofrontal_2" 3 | "lateralorbitofrontal_3" 4 | "lateralorbitofrontal_4" 5 | "parsorbitalis_1" 6 | "frontalpole_1" 7 | "medialorbitofrontal_1" 8 | "medialorbitofrontal_2" 9 | "medialorbitofrontal_3" 10 | "parstriangularis_1" 11 | "parstriangularis_2" 12 | "parsopercularis_1" 13 | "parsopercularis_2" 14 | "rostralmiddlefrontal_1" 15 | "rostralmiddlefrontal_2" 16 | "rostralmiddlefrontal_3" 17 | "rostralmiddlefrontal_4 " 18 | "rostralmiddlefrontal_5 " 19 | "rostralmiddlefrontal_6" 20 | "superiorfrontal_1" 21 | "superiorfrontal_2" 22 | "superiorfrontal_3" 23 | "superiorfrontal_4" 24 | "superiorfrontal_5" 25 | "superiorfrontal_6" 26 | "superiorfrontal_7" 27 | "superiorfrontal_8" 28 | "caudalmiddlefrontal_1" 29 | "caudalmiddlefrontal_2" 30 | "caudalmiddlefrontal_3" 31 | "precentral_1" 32 | "precentral_2" 33 | "precentral_3" 34 | "precentral_4" 35 | "precentral_5" 36 | "precentral_6" 37 | "paracentral_1" 38 | "paracentral_2" 39 | "paracentral_3" 40 | "rostralanteriorcingulate_1" 41 | "caudalanteriorcingulate_1" 42 | "posteriorcingulate_1" 43 | "posteriorcingulate_2" 44 | "isthmuscingulate_1" 45 | "postcentral_1" 46 | "postcentral_2" 47 | "postcentral_3" 48 | "postcentral_4" 49 | "postcentral_5" 50 | "supramarginal_1" 51 | "supramarginal_2" 52 | "supramarginal_3" 53 | "supramarginal_4" 54 | "superiorparietal_1" 55 | "superiorparietal_2" 56 | "superiorparietal_3" 57 | "superiorparietal_4" 58 | "superiorparietal_5" 59 | "superiorparietal_6" 60 | "superiorparietal_7" 61 | "inferiorparietal_1" 62 | "inferiorparietal_2" 63 | "inferiorparietal_3" 64 | "inferiorparietal_4" 65 | "inferiorparietal_5" 66 | "inferiorparietal_6" 67 | "precuneus_1" 68 | "precuneus_2" 69 | "precuneus_3" 70 | "precuneus_4" 71 | "precuneus_5" 72 | "cuneus_1" 73 | "cuneus_2" 74 | "pericalcarine_1" 75 | "pericalcarine_2" 76 | "lateraloccipital_1" 77 | "lateraloccipital_2" 78 | "lateraloccipital_3" 79 | "lateraloccipital_4" 80 | "lateraloccipital_5" 81 | "lingual_1" 82 | "lingual_2" 83 | "lingual_3" 84 | "fusiform_1" 85 | "fusiform_2" 86 | "fusiform_3" 87 | "fusiform_4" 88 | "parahippocampal_1" 89 | "entorhinal_1" 90 | "temporalpole_1" 91 | "inferiortemporal_1" 92 | "inferiortemporal_2" 93 | "inferiortemporal_3" 94 | "inferiortemporal_4" 95 | "middletemporal_1" 96 | "middletemporal_2" 97 | "middletemporal_3" 98 | "middletemporal_4" 99 | "bankssts_1" 100 | "superiortemporal_1" 101 | "superiortemporal_2" 102 | "superiortemporal_3" 103 | "superiortemporal_4" 104 | "superiortemporal_5" 105 | "transversetemporal_1" 106 | "insula_1" 107 | "insula_2" 108 | "insula_3" 109 | -------------------------------------------------------------------------------- /scratch/ordered_rightlabels_resolution250.csv: -------------------------------------------------------------------------------- 1 | "lateralorbitofrontal_1" 2 | "lateralorbitofrontal_2" 3 | "lateralorbitofrontal_3" 4 | "lateralorbitofrontal_4" 5 | "parsorbitalis_1" 6 | "frontalpole_1" 7 | "medialorbitofrontal_1" 8 | "medialorbitofrontal_2" 9 | "medialorbitofrontal_3" 10 | "parstriangularis_1" 11 | "parstriangularis_2" 12 | "parsopercularis_1" 13 | "parsopercularis_2" 14 | "rostralmiddlefrontal_1" 15 | "rostralmiddlefrontal_2" 16 | "rostralmiddlefrontal_3" 17 | "rostralmiddlefrontal_4" 18 | "rostralmiddlefrontal_5" 19 | "rostralmiddlefrontal_6" 20 | "superiorfrontal_1" 21 | "superiorfrontal_2" 22 | "superiorfrontal_3" 23 | "superiorfrontal_4" 24 | "superiorfrontal_5" 25 | "superiorfrontal_6" 26 | "superiorfrontal_7" 27 | "superiorfrontal_8" 28 | "caudalmiddlefrontal_1" 29 | "caudalmiddlefrontal_2" 30 | "caudalmiddlefrontal_3" 31 | "precentral_1" 32 | "precentral_2" 33 | "precentral_3" 34 | "precentral_4" 35 | "precentral_5" 36 | "precentral_6" 37 | "paracentral_1" 38 | "paracentral_2" 39 | "paracentral_3" 40 | "rostralanteriorcingulate_1" 41 | "caudalanteriorcingulate_1" 42 | "posteriorcingulate_1" 43 | "posteriorcingulate_2" 44 | "isthmuscingulate_1" 45 | "postcentral_1" 46 | "postcentral_2" 47 | "postcentral_3" 48 | "postcentral_4" 49 | "postcentral_5" 50 | "supramarginal_1" 51 | "supramarginal_2" 52 | "supramarginal_3" 53 | "supramarginal_4" 54 | "superiorparietal_1" 55 | "superiorparietal_2" 56 | "superiorparietal_3" 57 | "superiorparietal_4" 58 | "superiorparietal_5" 59 | "superiorparietal_6" 60 | "superiorparietal_7" 61 | "inferiorparietal_1" 62 | "inferiorparietal_2" 63 | "inferiorparietal_3" 64 | "inferiorparietal_4" 65 | "inferiorparietal_5" 66 | "inferiorparietal_6" 67 | "precuneus_1" 68 | "precuneus_2" 69 | "precuneus_3" 70 | "precuneus_4" 71 | "precuneus_5" 72 | "cuneus_1" 73 | "cuneus_2" 74 | "pericalcarine_1" 75 | "pericalcarine_2" 76 | "lateraloccipital_1" 77 | "lateraloccipital_2" 78 | "lateraloccipital_3" 79 | "lateraloccipital_4" 80 | "lateraloccipital_5" 81 | "lingual_1" 82 | "lingual_2" 83 | "lingual_3" 84 | "fusiform_1" 85 | "fusiform_2" 86 | "fusiform_3" 87 | "fusiform_4" 88 | "parahippocampal_1" 89 | "entorhinal_1" 90 | "temporalpole_1" 91 | "inferiortemporal_1" 92 | "inferiortemporal_2" 93 | "inferiortemporal_3" 94 | "inferiortemporal_4" 95 | "middletemporal_1" 96 | "middletemporal_2" 97 | "middletemporal_3" 98 | "middletemporal_4" 99 | "bankssts_1" 100 | "superiortemporal_1" 101 | "superiortemporal_2" 102 | "superiortemporal_3" 103 | "superiortemporal_4" 104 | "superiortemporal_5" 105 | "transversetemporal_1" 106 | "insula_1" 107 | "insula_2" 108 | "insula_3" 109 | -------------------------------------------------------------------------------- /scratch/ordered_rightlabels_resolution33.csv: -------------------------------------------------------------------------------- 1 | "lateralorbitofrontal" 2 | "parsorbitalis" 3 | "frontalpole" 4 | "medialorbitofrontal" 5 | "parstriangularis" 6 | "parsopercularis" 7 | "rostralmiddlefrontal" 8 | "superiorfrontal" 9 | "caudalmiddlefrontal" 10 | "precentral" 11 | "paracentral" 12 | "rostralanteriorcingulate" 13 | "caudalanteriorcingulate" 14 | "posteriorcingulate" 15 | "isthmuscingulate" 16 | "postcentral" 17 | "supramarginal" 18 | "superiorparietal" 19 | "inferiorparietal" 20 | "precuneus" 21 | "cuneus" 22 | "pericalcarine" 23 | "lateraloccipital" 24 | "lingual" 25 | "fusiform" 26 | "parahippocampal" 27 | "entorhinal" 28 | "temporalpole" 29 | "inferiortemporal" 30 | "middletemporal" 31 | "bankssts" 32 | "superiortemporal" 33 | "transversetemporal" 34 | "insula" 35 | -------------------------------------------------------------------------------- /scratch/ordered_rightlabels_resolution500.csv: -------------------------------------------------------------------------------- 1 | "lateralorbitofrontal_1" 2 | "lateralorbitofrontal_2" 3 | "lateralorbitofrontal_3" 4 | "lateralorbitofrontal_4" 5 | "lateralorbitofrontal_5" 6 | "lateralorbitofrontal_6" 7 | "lateralorbitofrontal_7" 8 | "parsorbitalis_1" 9 | "parsorbitalis_2" 10 | "frontalpole_1" 11 | "medialorbitofrontal_1" 12 | "medialorbitofrontal_2" 13 | "medialorbitofrontal_3" 14 | "medialorbitofrontal_4" 15 | "medialorbitofrontal_5" 16 | "parstriangularis_1" 17 | "parstriangularis_2" 18 | "parstriangularis_3" 19 | "parstriangularis_4" 20 | "parsopercularis_1" 21 | "parsopercularis_2" 22 | "parsopercularis_3" 23 | "parsopercularis_4" 24 | "rostralmiddlefrontal_1" 25 | "rostralmiddlefrontal_2" 26 | "rostralmiddlefrontal_3" 27 | "rostralmiddlefrontal_4" 28 | "rostralmiddlefrontal_5" 29 | "rostralmiddlefrontal_6" 30 | "rostralmiddlefrontal_7" 31 | "rostralmiddlefrontal_8" 32 | "rostralmiddlefrontal_9" 33 | "rostralmiddlefrontal_10" 34 | "rostralmiddlefrontal_11" 35 | "rostralmiddlefrontal_12" 36 | "rostralmiddlefrontal_13" 37 | "superiorfrontal_1" 38 | "superiorfrontal_2" 39 | "superiorfrontal_3" 40 | "superiorfrontal_4" 41 | "superiorfrontal_5" 42 | "superiorfrontal_6" 43 | "superiorfrontal_7" 44 | "superiorfrontal_8" 45 | "superiorfrontal_9" 46 | "superiorfrontal_10" 47 | "superiorfrontal_11" 48 | "superiorfrontal_12" 49 | "superiorfrontal_13" 50 | "superiorfrontal_14" 51 | "superiorfrontal_15" 52 | "superiorfrontal_16" 53 | "superiorfrontal_17" 54 | "caudalmiddlefrontal_1" 55 | "caudalmiddlefrontal_2" 56 | "caudalmiddlefrontal_3" 57 | "caudalmiddlefrontal_4" 58 | "caudalmiddlefrontal_5" 59 | "precentral_1" 60 | "precentral_2" 61 | "precentral_3" 62 | "precentral_4" 63 | "precentral_5" 64 | "precentral_6" 65 | "precentral_7" 66 | "precentral_8" 67 | "precentral_9" 68 | "precentral_10" 69 | "precentral_11" 70 | "precentral_12" 71 | "precentral_13" 72 | "precentral_14" 73 | "precentral_15" 74 | "precentral_16" 75 | "paracentral_1" 76 | "paracentral_2" 77 | "paracentral_3" 78 | "paracentral_4" 79 | "paracentral_5" 80 | "paracentral_6" 81 | "rostralanteriorcingulate_1" 82 | "rostralanteriorcingulate_2" 83 | "caudalanteriorcingulate_1" 84 | "caudalanteriorcingulate_2" 85 | "caudalanteriorcingulate_3" 86 | "posteriorcingulate_1" 87 | "posteriorcingulate_2" 88 | "posteriorcingulate_3" 89 | "posteriorcingulate_4" 90 | "isthmuscingulate_1" 91 | "isthmuscingulate_2" 92 | "postcentral_1" 93 | "postcentral_2" 94 | "postcentral_3" 95 | "postcentral_4" 96 | "postcentral_5" 97 | "postcentral_6" 98 | "postcentral_7" 99 | "postcentral_8" 100 | "postcentral_9" 101 | "postcentral_10" 102 | "postcentral_11" 103 | "postcentral_12" 104 | "supramarginal_1" 105 | "supramarginal_2" 106 | "supramarginal_3" 107 | "supramarginal_4" 108 | "supramarginal_5" 109 | "supramarginal_6" 110 | "supramarginal_7" 111 | "supramarginal_8" 112 | "supramarginal_9" 113 | "superiorparietal_1" 114 | "superiorparietal_2" 115 | "superiorparietal_3" 116 | "superiorparietal_4" 117 | "superiorparietal_5" 118 | "superiorparietal_6" 119 | "superiorparietal_7" 120 | "superiorparietal_8" 121 | "superiorparietal_9" 122 | "superiorparietal_10" 123 | "superiorparietal_11" 124 | "superiorparietal_12" 125 | "superiorparietal_13" 126 | "inferiorparietal_1" 127 | "inferiorparietal_2" 128 | "inferiorparietal_3" 129 | "inferiorparietal_4" 130 | "inferiorparietal_5" 131 | "inferiorparietal_6" 132 | "inferiorparietal_7" 133 | "inferiorparietal_8" 134 | "inferiorparietal_9" 135 | "inferiorparietal_10" 136 | "inferiorparietal_11" 137 | "inferiorparietal_12" 138 | "precuneus_1" 139 | "precuneus_2" 140 | "precuneus_3" 141 | "precuneus_4" 142 | "precuneus_5" 143 | "precuneus_6" 144 | "precuneus_7" 145 | "precuneus_8" 146 | "precuneus_9" 147 | "precuneus_10" 148 | "cuneus_1" 149 | "cuneus_2" 150 | "cuneus_3" 151 | "cuneus_4" 152 | "pericalcarine_1" 153 | "pericalcarine_2" 154 | "pericalcarine_3" 155 | "pericalcarine_4" 156 | "lateraloccipital_1" 157 | "lateraloccipital_2" 158 | "lateraloccipital_3" 159 | "lateraloccipital_4" 160 | "lateraloccipital_5" 161 | "lateraloccipital_6" 162 | "lateraloccipital_7" 163 | "lateraloccipital_8" 164 | "lateraloccipital_9" 165 | "lateraloccipital_10" 166 | "lingual_1" 167 | "lingual_2" 168 | "lingual_3" 169 | "lingual_4" 170 | "lingual_5" 171 | "lingual_6" 172 | "lingual_7" 173 | "fusiform_1" 174 | "fusiform_2" 175 | "fusiform_3" 176 | "fusiform_4" 177 | "fusiform_5" 178 | "fusiform_6" 179 | "fusiform_7" 180 | "fusiform_8" 181 | "parahippocampal_1" 182 | "parahippocampal_2" 183 | "parahippocampal_3" 184 | "entorhinal_1" 185 | "temporalpole_1" 186 | "inferiortemporal_1" 187 | "inferiortemporal_2" 188 | "inferiortemporal_3" 189 | "inferiortemporal_4" 190 | "inferiortemporal_5" 191 | "inferiortemporal_6" 192 | "inferiortemporal_7" 193 | "middletemporal_1" 194 | "middletemporal_2" 195 | "middletemporal_3" 196 | "middletemporal_4" 197 | "middletemporal_5" 198 | "middletemporal_6" 199 | "middletemporal_7" 200 | "middletemporal_8" 201 | "middletemporal_9" 202 | "bankssts_1" 203 | "bankssts_2" 204 | "bankssts_3" 205 | "superiortemporal_1" 206 | "superiortemporal_2" 207 | "superiortemporal_3" 208 | "superiortemporal_4" 209 | "superiortemporal_5" 210 | "superiortemporal_6" 211 | "superiortemporal_7" 212 | "superiortemporal_8" 213 | "superiortemporal_9" 214 | "superiortemporal_10" 215 | "superiortemporal_11" 216 | "transversetemporal_1" 217 | "insula_1" 218 | "insula_2" 219 | "insula_3" 220 | "insula_4" 221 | "insula_5" 222 | "insula_6" 223 | "insula_7" 224 | -------------------------------------------------------------------------------- /scratch/ordered_rightlabels_resolution60.csv: -------------------------------------------------------------------------------- 1 | "lateralorbitofrontal_1" 2 | "lateralorbitofrontal_2" 3 | "parsorbitalis_1" 4 | "frontalpole_1" 5 | "medialorbitofrontal_1" 6 | "medialorbitofrontal_2" 7 | "parstriangularis_1" 8 | "parsopercularis_1" 9 | "rostralmiddlefrontal_1" 10 | "rostralmiddlefrontal_2" 11 | "superiorfrontal_1" 12 | "superiorfrontal_2" 13 | "superiorfrontal_3" 14 | "superiorfrontal_4" 15 | "caudalmiddlefrontal_1" 16 | "precentral_1" 17 | "precentral_2" 18 | "precentral_3" 19 | "paracentral_1" 20 | "rostralanteriorcingulate_1" 21 | "caudalanteriorcingulate_1" 22 | "posteriorcingulate_1" 23 | "isthmuscingulate_1" 24 | "postcentral_1" 25 | "postcentral_2" 26 | "supramarginal_1" 27 | "supramarginal_2" 28 | "superiorparietal_1" 29 | "superiorparietal_2" 30 | "superiorparietal_3" 31 | "inferiorparietal_1" 32 | "inferiorparietal_2" 33 | "inferiorparietal_3" 34 | "precuneus_1" 35 | "precuneus_2" 36 | "cuneus_1" 37 | "pericalcarine_1" 38 | "lateraloccipital_1" 39 | "lateraloccipital_2" 40 | "lateraloccipital_3" 41 | "lingual_1" 42 | "lingual_2" 43 | "fusiform_1" 44 | "fusiform_2" 45 | "parahippocampal_1" 46 | "entorhinal_1" 47 | "temporalpole_1" 48 | "inferiortemporal_1" 49 | "inferiortemporal_2" 50 | "middletemporal_1" 51 | "middletemporal_2" 52 | "bankssts_1" 53 | "superiortemporal_1" 54 | "superiortemporal_2" 55 | "transversetemporal_1" 56 | "insula_1" 57 | "insula_2" 58 | -------------------------------------------------------------------------------- /scratch/reorder_labels_parcellation1015.py: -------------------------------------------------------------------------------- 1 | b = nx.Graph() 2 | for i,elem in enumerate(right): 3 | id = str(i+1) 4 | for idn,dictn in a.nodes(data=True): 5 | if dictn['dn_fsname'] == elem and dictn['dn_hemisphere'] == 'right' and dictn['dn_region'] == 'cortical': 6 | b.add_node(id,dictn) 7 | b.node[id]['dn_correspondence_id'] = id 8 | for i,elem in enumerate(left): 9 | id = str(i+509) # skip the subcortical region: 501 + 7 + 1 10 | for idn,dictn in a.nodes(data=True): 11 | if dictn['dn_fsname'] == elem and dictn['dn_hemisphere'] == 'left' and dictn['dn_region'] == 'cortical': 12 | b.add_node(id,dictn) 13 | b.node[id]['dn_correspondence_id'] = id 14 | for i,dictn in a.nodes(data=True): 15 | if dictn['dn_region'] == 'subcortical': 16 | b.add_node(i,dictn) 17 | 18 | 19 | -------------------------------------------------------------------------------- /scratch/rsfmri/prep_rsFMRI.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | MY_SUBJECT=$1 4 | RAW_RSFMRI=$2 5 | cd $CMT_SUBJECTS_DIR/$MY_SUBJECT/rsFMRI 6 | mkdir registered 7 | mkdir nifti 8 | 9 | # convert fmri dicom into individual nifti 10 | mri_convert $RAW_RSFMRI -ot nii ${MY_SUBJECT}_rsFMRI.nii 11 | fslsplit ${MY_SUBJECT}_rsFMRI.nii ./nifti/${MY_SUBJECT}_rsFMRI 12 | rm -f ${MY_SUBJECT}_rsFMRI.nii 13 | 14 | # if temporal interolation needed to be put here. 15 | 16 | # calculate transformation 17 | cd $CMT_SUBJECTS_DIR/$MY_SUBJECT/rsFMRI/nifti 18 | flirt -in ${MY_SUBJECT}_rsFMRI0000.nii.gz -ref $CMT_SUBJECTS_DIR/$MY_SUBJECT/raw_diffusion/${MY_SUBJECT}_b0_resampled.nii.gz -omat transformation.mat -dof 6 19 | 20 | # apply registration 21 | for f in `ls *.nii.gz` 22 | do 23 | echo $f 24 | flirt -in $f -ref $CMT_SUBJECTS_DIR/$MY_SUBJECT/raw_diffusion/${MY_SUBJECT}_b0_resampled.nii.gz -applyxfm -init transformation.mat -out ../registered/${f:0:${#f}-7}_reg.nii.gz 25 | done 26 | 27 | cd $CMT_SUBJECTS_DIR/$MY_SUBJECT/rsFMRI/registered 28 | for f in `ls *.nii.gz` 29 | do 30 | echo $f 31 | fslswapdim $f x -y z ${f:0:${#f}-7}_lpi.nii.gz 32 | fslchfiletype ANALYZE ${f:0:${#f}-7}_lpi.nii.gz 33 | done 34 | 35 | rm -f *.nii.gz 36 | rm -rf ../nifti 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /scratch/rsfmri/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | I send you the two files that entail the code for creating the resting state time series per node. 3 | Basically you should only do it for the highest resolution, the averaging over bigger regions can be done later ( 4 | -------------------------------------------------------------------------------- /scratch/subdivision_left_right_regions.txt: -------------------------------------------------------------------------------- 1 | scale500 2 | R cortical 1:501 3 | R subcortical 502:508 4 | L cortical 509:1007 5 | L subcortical 1008:1014 6 | Brain Stem 1015 7 | scale250 8 | R cortical 1:223 9 | R subcortical 224:230 10 | L cortical 231:455 11 | L subcortical 456:462 12 | Brain Stem 463 13 | scale125 14 | R cortical 1:108 15 | R subcortical 109:115 16 | L cortical 116:226 17 | L subcortical 227:233 18 | Brain Stem 234 19 | scale60 20 | R cortical 1:57 21 | R subcortical 58:64 22 | L cortical 65:121 23 | L subcortical 122:128 24 | Brain Stem 129 25 | scale33 26 | R cortical 1:34 27 | R subcortical 35:41 28 | L cortical 42:75 29 | L subcortical 76:82 30 | Brain Stem 83 31 | -------------------------------------------------------------------------------- /scripts/connectomemapper: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #-*- coding:utf-8 -*- 3 | 4 | import sys 5 | import os.path 6 | from cmp.gui import CMPGUI 7 | 8 | if __name__ == "__main__": 9 | 10 | cmpgui = CMPGUI() 11 | if len(sys.argv) >= 2 and os.path.isfile(sys.argv[1]): 12 | cmpgui.load_state(sys.argv[1]) 13 | 14 | cmpgui.show() 15 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """Connectome Mapper 4 | """ 5 | from glob import glob 6 | import os 7 | import sys 8 | if os.path.exists('MANIFEST'): os.remove('MANIFEST') 9 | 10 | packages=["cmp", 11 | "cmp.stages", 12 | "cmp.stages.connectionmatrix", 13 | "cmp.stages.converter", 14 | "cmp.stages.preprocessing", 15 | "cmp.stages.postprocessing", 16 | "cmp.stages.segmentation", 17 | "cmp.stages.reconstruction", 18 | "cmp.stages.parcellation", 19 | "cmp.stages.registration", 20 | "cmp.stages.tractography", 21 | "cmp.stages.rsfmri", 22 | "cmp.stages.stats", 23 | "cmp.stages.template_module", 24 | "cmp.pipeline"] 25 | 26 | package_data = {'cmp': 27 | ['data/colortable_and_gcs/*.txt', 28 | 'data/colortable_and_gcs/my_atlas_gcs/*.gcs', 29 | 'pipeline/pipeline.proto', 30 | 'binary/linux2/bit32/*', 31 | 'binary/linux2/bit32/*.*', 32 | 'binary/linux2/bit64/*.*', 33 | 'binary/linux2/bit64/*', 34 | 'data/diffusion/gradient_tables/*.txt', 35 | 'data/diffusion/odf_directions/*.*', 36 | 'data/parcellation/lausanne2008/*.*', 37 | 'data/parcellation/lausanne2008/resolution83/*.*', 38 | 'data/parcellation/lausanne2008/resolution150/*.*', 39 | 'data/parcellation/lausanne2008/resolution258/*.*', 40 | 'data/parcellation/lausanne2008/resolution500/*.*', 41 | 'data/parcellation/lausanne2008/resolution1015/*.*', 42 | 'data/parcellation/nativefreesurfer/freesurferaparc/*.*', 43 | ]} 44 | 45 | ################################################################################ 46 | # For some commands, use setuptools 47 | 48 | if len(set(('develop', 'bdist_egg', 'bdist_rpm', 'bdist', 'bdist_dumb', 49 | 'bdist_wininst', 'install_egg_info', 'egg_info', 'easy_install', 50 | )).intersection(sys.argv)) > 0: 51 | from setup_egg import extra_setuptools_args 52 | 53 | # extra_setuptools_args can be defined from the line above, but it can 54 | # also be defined here because setup.py has been exec'ed from 55 | # setup_egg.py. 56 | if not 'extra_setuptools_args' in globals(): 57 | extra_setuptools_args = dict() 58 | 59 | 60 | def main(**extra_args): 61 | from distutils.core import setup 62 | from cmp.info import __version__ 63 | # regenerate protoc 64 | import subprocess 65 | protofname = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'cmp', 'pipeline', 'pipeline.proto') 66 | protoout = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'cmp', 'pipeline') 67 | protopath = os.path.dirname(protofname) 68 | cmd = 'protoc %s --proto_path=%s --python_out=%s' % (protofname, protopath, protoout) 69 | print "Calling protoc to generate protobuf python file in current version:" 70 | print cmd 71 | process = subprocess.call( cmd, shell = True, 72 | stdout = subprocess.PIPE, 73 | stderr = subprocess.STDOUT ) 74 | print "protoc return code:", process 75 | 76 | setup(name='Connectome Mapper', 77 | version=__version__, 78 | description="""Connectome Mapper implements a full diffusion MRI processing pipeline, from raw Diffusion/T1/T2 """ + \ 79 | """data to multi-resolution connection matrices. It also offers support for resting state fMRI data processing and multi-resolution functional connection matrices creation. """ + \ 80 | """The Connectome Mapper is part of the Connectome Mapping Toolkit.""", 81 | author='EPFL LTS5 Diffusion Group', 82 | author_email='info@connectomics.org', 83 | url='http://www.connectomics.org/', 84 | scripts = glob('scripts/*'), 85 | packages = packages, 86 | package_data = package_data, 87 | **extra_args 88 | ) 89 | 90 | if __name__ == "__main__": 91 | main(**extra_setuptools_args) 92 | -------------------------------------------------------------------------------- /setup_egg.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- 3 | # vi: set ft=python sts=4 ts=4 sw=4 et: 4 | """Wrapper to run setup.py using setuptools.""" 5 | 6 | from setuptools import setup 7 | 8 | ################################################################################ 9 | # Call the setup.py script, injecting the setuptools-specific arguments. 10 | 11 | extra_setuptools_args = dict( 12 | zip_safe=False, 13 | ) 14 | 15 | 16 | if __name__ == '__main__': 17 | execfile('setup.py', dict(__name__='__main__', 18 | extra_setuptools_args=extra_setuptools_args)) 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/DTB/Applications/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ##################################################################################### 2 | ############################### SUBPROJECTS ####################################### 3 | ##################################################################################### 4 | ADD_SUBDIRECTORY( DTB_gfa ) 5 | ADD_SUBDIRECTORY( DTB_P0 ) 6 | ADD_SUBDIRECTORY( DTB_dtk2dir ) 7 | ADD_SUBDIRECTORY( DTB_streamline ) 8 | 9 | 10 | ##################################################################################### 11 | ################################### INSTALL ####################################### 12 | ##################################################################################### 13 | INSTALL(FILES "${PROJECT_SOURCE_DIR}/Common/181_vecs.dat" DESTINATION ".") 14 | -------------------------------------------------------------------------------- /src/DTB/Applications/DTB_P0/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ADD_EXECUTABLE( DTB_P0 main.cxx ) 2 | 3 | 4 | ##################################################################################### 5 | ############################ INCLUDE / LINK ####################################### 6 | ##################################################################################### 7 | INCLUDE_DIRECTORIES( ${NIFTI_INCLUDE_DIR} ) 8 | INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIRS} ) 9 | 10 | TARGET_LINK_LIBRARIES( DTB_P0 11 | ${BLITZ_LIBRARIES} 12 | ${NIFTI_LIBRARIES} 13 | ${Boost_PROGRAM_OPTIONS_LIBRARY} 14 | ) 15 | 16 | 17 | ##################################################################################### 18 | ################################### INSTALL ####################################### 19 | ##################################################################################### 20 | INSTALL( 21 | TARGETS DTB_P0 22 | RUNTIME DESTINATION "." 23 | PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE 24 | ) 25 | -------------------------------------------------------------------------------- /src/DTB/Applications/DTB_P0/main.cxx: -------------------------------------------------------------------------------- 1 | /** 2 | * Compute the P0 map from DTK (http://www.trackvis.org/dtk/?subsect=format) diffusion data. 3 | * 4 | * @author alessandro.daducci@epfl.ch 5 | * @date, 08/03/2011 6 | */ 7 | #include 8 | #include 9 | #include 10 | 11 | #include "NIFTI.h" 12 | #include 13 | 14 | namespace po = boost::program_options; 15 | using namespace std; 16 | using namespace blitz; 17 | 18 | 19 | int main(int argc, char** argv) 20 | { 21 | string DSI_basename, DWI_filename; 22 | 23 | 24 | /*--------------------------*/ 25 | /* Check INPUT parameters */ 26 | /*--------------------------*/ 27 | 28 | /* PARSING of INPUT parameters (achieved with BOOST libraries) */ 29 | po::variables_map vm; 30 | try { 31 | po::arg = "ARG"; 32 | po::options_description desc("Parameters syntax"); 33 | desc.add_options() 34 | ("dwi", po::value(&DWI_filename), "DWI path/filename (e.g. \"rawdata/DSI.nii\")") 35 | ("dsi", po::value(&DSI_basename), "DSI path/basename (e.g. \"data/dsi_\")") 36 | ("help", "Print this help message") 37 | ; 38 | po::store(po::command_line_parser(argc, argv).options(desc).run(), vm); 39 | po::notify(vm); 40 | 41 | if ( argc<2 || vm.count("help") ) 42 | { 43 | cout <<"\n"<< desc <<"\n\n"; 44 | return 1; 45 | } 46 | } 47 | catch(exception& e) { 48 | cerr<< e.what() <<"\n"; 49 | return 1; 50 | } 51 | catch(...) { 52 | cerr<<"Exception of unknown type!\n"; 53 | } 54 | 55 | 56 | /* Check values */ 57 | if ( !vm.count("dsi") ) { 58 | cerr<<"'dsi' parameter not set.\n"; 59 | return 1; 60 | } 61 | if ( !vm.count("dwi") ) { 62 | cerr<<"'dwi' parameter not set.\n"; 63 | return 1; 64 | } 65 | 66 | 67 | /*--------------------*/ 68 | /* CALCULATE P0 map */ 69 | /*--------------------*/ 70 | string P0_filename = DSI_basename + "P0.nii"; 71 | 72 | /* READING 'DWI' dataset */ 73 | cout <<"\n-> Reading 'DWI' dataset...\n"; 74 | 75 | NIFTI niiDWI( DWI_filename, true ); 76 | if ( !niiDWI.isValid() ) { 77 | if ( niiDWI.getErrorCode() == NIFTI_ERROR_WRONGDATATYPE ) 78 | cerr<<"Datatype should be INT16!\n"; 79 | else 80 | cerr<<"Unable to open file!\n"; 81 | return 1; 82 | } 83 | 84 | // check the dimension of ODF dataset 85 | if ( niiDWI.hdr->dim[0]!=4 || niiDWI.hdr->dim[4]!=515 ){ 86 | cerr<<"The dimension MUST be (*,*,*,515)!\n"; 87 | return 1; 88 | } 89 | 90 | cout <<" [ OK ]\n\n"; 91 | 92 | 93 | /* CALCULATE P0 map */ 94 | int dim[4] = {niiDWI.hdr->dim[1],niiDWI.hdr->dim[2],niiDWI.hdr->dim[3], 1}; 95 | float pixdim[4] = {niiDWI.hdr->pixdim[1],niiDWI.hdr->pixdim[2],niiDWI.hdr->pixdim[3], 1}; 96 | 97 | NIFTI niiP0; 98 | niiP0.make( 3, dim, pixdim ); 99 | (*niiP0.img) = (*niiP0.img) * 0; 100 | 101 | niiP0.copyHeader( niiDWI.hdr ); 102 | niiP0.hdr->dim[0] = 3; 103 | niiP0.hdr->dim[1] = dim[0]; niiP0.hdr->dim[2] = dim[1]; niiP0.hdr->dim[3] = dim[2]; niiP0.hdr->dim[4] = dim[3]; 104 | niiP0.hdr->pixdim[1] = pixdim[0]; niiP0.hdr->pixdim[2] = pixdim[1]; niiP0.hdr->pixdim[3] = pixdim[2]; niiP0.hdr->pixdim[4] = pixdim[3]; 105 | niiP0.hdr->datatype = DT_FLOAT32; niiP0.hdr->nbyper = 4; 106 | niiP0.hdr->cal_min = 0; niiP0.hdr->cal_max = niiDWI.hdr->dim[4]; 107 | niiP0.hdr->xyz_units = 10; 108 | nifti_update_dims_from_array(niiP0.hdr); 109 | 110 | float b0; 111 | 112 | cout <<"-> Calculating P0 in each voxel...\n"; 113 | for(int x=0; x0 ) { 120 | value = 0; 121 | for(int i=0; idim[4] ;i++) 122 | value += (*niiDWI.img)(x,y,z,i); 123 | (*niiP0.img)(x,y,z) = value / b0; 124 | } 125 | else 126 | (*niiP0.img)(x,y,z) = 0; 127 | } 128 | 129 | 130 | /* SAVE it as .nii */ 131 | niiP0.save( P0_filename ); 132 | cout <<" [ '"<< P0_filename <<"' written ]\n\n"; 133 | 134 | return 0; 135 | } 136 | -------------------------------------------------------------------------------- /src/DTB/Applications/DTB_dtk2dir/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ADD_EXECUTABLE( DTB_dtk2dir main.cxx ) 2 | 3 | 4 | ##################################################################################### 5 | ############################ INCLUDE / LINK ####################################### 6 | ##################################################################################### 7 | INCLUDE_DIRECTORIES( ${NIFTI_INCLUDE_DIR} ) 8 | INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIRS} ) 9 | 10 | TARGET_LINK_LIBRARIES( DTB_dtk2dir 11 | ${BLITZ_LIBRARIES} 12 | ${NIFTI_LIBRARIES} 13 | ${Boost_PROGRAM_OPTIONS_LIBRARY} 14 | ) 15 | 16 | 17 | ##################################################################################### 18 | ################################### INSTALL ####################################### 19 | ##################################################################################### 20 | INSTALL( 21 | TARGETS DTB_dtk2dir 22 | RUNTIME DESTINATION "." 23 | PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE 24 | ) 25 | -------------------------------------------------------------------------------- /src/DTB/Applications/DTB_gfa/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ADD_EXECUTABLE( DTB_gfa main.cxx ) 2 | 3 | 4 | ##################################################################################### 5 | ############################ INCLUDE / LINK ####################################### 6 | ##################################################################################### 7 | INCLUDE_DIRECTORIES( ${NIFTI_INCLUDE_DIR} ) 8 | INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIRS} ) 9 | 10 | TARGET_LINK_LIBRARIES( DTB_gfa 11 | ${BLITZ_LIBRARIES} 12 | ${NIFTI_LIBRARIES} 13 | ${Boost_PROGRAM_OPTIONS_LIBRARY} 14 | ) 15 | 16 | 17 | ##################################################################################### 18 | ################################### INSTALL ####################################### 19 | ##################################################################################### 20 | INSTALL( 21 | TARGETS DTB_gfa 22 | RUNTIME DESTINATION "." 23 | PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE 24 | ) 25 | -------------------------------------------------------------------------------- /src/DTB/Applications/DTB_gfa/main.cxx: -------------------------------------------------------------------------------- 1 | /** 2 | * Compute the GFA map from DTK (http://www.trackvis.org/dtk/?subsect=format) diffusion data. 3 | * 4 | * @author alessandro.daducci@epfl.ch 5 | * @date, 08/03/2011 6 | */ 7 | #include 8 | #include 9 | #include 10 | 11 | #include "NIFTI.h" 12 | #include 13 | 14 | namespace po = boost::program_options; 15 | using namespace std; 16 | using namespace blitz; 17 | 18 | 19 | unsigned int moment; // keep the moment (2,3,4...) to calculate 20 | 21 | 22 | int main(int argc, char** argv) 23 | { 24 | string DSI_basename; 25 | 26 | 27 | /*--------------------------*/ 28 | /* Check INPUT parameters */ 29 | /*--------------------------*/ 30 | 31 | /* PARSING of INPUT parameters (achieved with BOOST libraries) */ 32 | po::variables_map vm; 33 | try { 34 | po::arg = "ARG"; 35 | po::options_description desc("Parameters syntax"); 36 | desc.add_options() 37 | ("dsi", po::value(&DSI_basename), "DSI path/basename (e.g. \"data/dsi_\")") 38 | ("m", po::value(&moment)->default_value(2), "Moment to calculate [2,3,4]") 39 | ("help", "Print this help message") 40 | ; 41 | po::store(po::command_line_parser(argc, argv).options(desc).run(), vm); 42 | po::notify(vm); 43 | 44 | if ( argc<2 || vm.count("help") ) 45 | { 46 | cout <<"\n"<< desc <<"\n\n"; 47 | return 1; 48 | } 49 | } 50 | catch(exception& e) { 51 | cerr<< e.what() <<"\n"; 52 | return 1; 53 | } 54 | catch(...) { 55 | cerr<<"Exception of unknown type!\n"; 56 | } 57 | 58 | 59 | /* Check values */ 60 | if ( !vm.count("dsi") ) 61 | { 62 | cerr<<"'dsi' parameter not set.\n"; 63 | return 1; 64 | } 65 | 66 | string GFA_filename; 67 | switch (moment) 68 | { 69 | case 2: GFA_filename = DSI_basename + "gfa.nii"; break; 70 | case 3: GFA_filename = DSI_basename + "skewness.nii"; break; 71 | case 4: GFA_filename = DSI_basename + "kurtosis.nii"; break; 72 | default: 73 | cerr<<"'m' parameter is not in the {2,3,4} valid range.\n"; 74 | return 1; 75 | } 76 | 77 | 78 | /*---------------------*/ 79 | /* CALCULATE GFA map */ 80 | /*---------------------*/ 81 | 82 | /* READING 'ODF' dataset */ 83 | cout <<"\n-> Reading 'ODF' dataset...\n"; 84 | 85 | string ODF_filename = DSI_basename + "odf.nii"; 86 | NIFTI niiODF( ODF_filename, true ); 87 | if ( !niiODF.isValid() ) { 88 | if ( niiODF.getErrorCode() == NIFTI_ERROR_WRONGDATATYPE ) 89 | cerr<<"Datatype should be FLOAT32!\n"; 90 | else 91 | cerr<<"Unable to open file!\n"; 92 | return 1; 93 | } 94 | // check the dimension of ODF dataset 95 | if ( niiODF.hdr->dim[0]!=4 || niiODF.hdr->dim[1]!=181 ){ 96 | cerr<<"The dimension MUST be (181,*,*,*)!\n"; 97 | return 1; 98 | } 99 | 100 | cout <<" [ OK ]\n\n"; 101 | 102 | 103 | 104 | /* CALCULATE GFA map */ 105 | string B0_filename = DSI_basename + "b0.nii"; 106 | NIFTI niiB0( B0_filename, false ); 107 | int dim[4] = {niiODF.hdr->dim[2], niiODF.hdr->dim[3], niiODF.hdr->dim[4], 1}; 108 | float pixdim[4] = {niiB0.hdr->pixdim[1], niiB0.hdr->pixdim[2], niiB0.hdr->pixdim[3], 1}; 109 | short nDIR = niiODF.hdr->dim[1]; 110 | printf("-> Creating 'scalars' files...\n"); 111 | printf(" dim : %d x %d x %d x %d\n", dim[0],dim[1],dim[2],dim[3]); 112 | printf(" pixdim: %.4f x %.4f x %.4f x %.4f\n", pixdim[0],pixdim[1],pixdim[2],pixdim[3]); 113 | 114 | NIFTI niiGFA; 115 | niiGFA.make( 3, dim, pixdim ); 116 | (*niiGFA.img) = (*niiGFA.img) * 0; 117 | 118 | // update the metadata 119 | niiGFA.copyHeader( niiODF.hdr ); 120 | niiGFA.hdr->dim[0] = 3; 121 | niiGFA.hdr->dim[1] = dim[0]; niiGFA.hdr->dim[2] = dim[1]; niiGFA.hdr->dim[3] = dim[2]; niiGFA.hdr->dim[4] = dim[3]; 122 | niiGFA.hdr->pixdim[1] = pixdim[0]; niiGFA.hdr->pixdim[2] = pixdim[1]; niiGFA.hdr->pixdim[3] = pixdim[2]; niiGFA.hdr->pixdim[4] = pixdim[3]; 123 | niiGFA.hdr->datatype = DT_FLOAT32; niiGFA.hdr->nbyper = 4; 124 | niiGFA.hdr->cal_min = 0; niiGFA.hdr->cal_max = 1; 125 | niiGFA.hdr->xyz_units = 10; 126 | nifti_update_dims_from_array(niiGFA.hdr); 127 | 128 | Array ODF(nDIR); 129 | float STD, RMS, MEAN, SUM, SQRT, sign; 130 | MEAN = 1.0 / nDIR; 131 | SQRT = 1.0 / moment; 132 | 133 | cout <<"-> Calculating GFA in each voxel...\n"; 134 | for(int x=0; x0) 152 | (*niiGFA.img)(x,y,z) = sign * pow( abs(STD / RMS), SQRT); 153 | else 154 | (*niiGFA.img)(x,y,z) = -1; 155 | } 156 | 157 | 158 | /* SAVE it as .nii */ 159 | niiGFA.save( GFA_filename ); 160 | cout <<" [ '"<< GFA_filename <<"' written ]\n\n"; 161 | 162 | return 0; 163 | } 164 | -------------------------------------------------------------------------------- /src/DTB/Applications/DTB_streamline/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ADD_EXECUTABLE( DTB_streamline main.cxx ) 2 | 3 | 4 | ##################################################################################### 5 | ############################ INCLUDE / LINK ####################################### 6 | ##################################################################################### 7 | INCLUDE_DIRECTORIES( ${NIFTI_INCLUDE_DIR} ) 8 | INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIRS} ) 9 | 10 | TARGET_LINK_LIBRARIES( DTB_streamline 11 | ${BLITZ_LIBRARIES} 12 | ${NIFTI_LIBRARIES} 13 | ${Boost_PROGRAM_OPTIONS_LIBRARY} 14 | ) 15 | 16 | ##################################################################################### 17 | ################################### INSTALL ####################################### 18 | ##################################################################################### 19 | INSTALL( 20 | TARGETS DTB_streamline 21 | RUNTIME DESTINATION "." 22 | PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE 23 | ) 24 | -------------------------------------------------------------------------------- /src/DTB/CMake/FindBLITZ.cmake: -------------------------------------------------------------------------------- 1 | FIND_PATH( BLITZ_INCLUDE_DIR 2 | blitz.h 3 | /usr/local/include/blitz /usr/include/blitz 4 | ) 5 | 6 | FIND_LIBRARY( BLITZ_LIBRARIES 7 | NAMES libblitz${CMAKE_STATIC_LIBRARY_SUFFIX} libblitz${CMAKE_SHARED_LIBRARY_SUFFIX} 8 | ) 9 | 10 | IF ( BLITZ_INCLUDE_DIR AND BLITZ_LIBRARIES ) 11 | SET(BLITZ_FOUND TRUE) 12 | ENDIF ( BLITZ_INCLUDE_DIR AND BLITZ_LIBRARIES ) 13 | 14 | IF (BLITZ_FOUND) 15 | IF (NOT BLITZ_FIND_QUIETLY) 16 | MESSAGE(STATUS "Found BLITZ: ${BLITZ_LIBRARIES}") 17 | ENDIF (NOT BLITZ_FIND_QUIETLY) 18 | ELSE (BLITZ_FOUND) 19 | IF (BLITZ_FIND_REQUIRED) 20 | MESSAGE(FATAL_ERROR "Could not find BLITZ (which is required)") 21 | ENDIF (BLITZ_FIND_REQUIRED) 22 | ENDIF (BLITZ_FOUND) 23 | -------------------------------------------------------------------------------- /src/DTB/CMake/FindNIFTI.cmake: -------------------------------------------------------------------------------- 1 | FIND_PATH( NIFTI_INCLUDE_DIR 2 | nifti1.h 3 | /usr/local/include/nifti /usr/include/nifti 4 | ) 5 | 6 | 7 | FIND_LIBRARY( NIFTI_LIBRARIES 8 | NAMES libniftiio${CMAKE_SHARED_LIBRARY_SUFFIX} libniftiio${CMAKE_STATIC_LIBRARY_SUFFIX} 9 | ) 10 | 11 | 12 | IF ( NIFTI_INCLUDE_DIR AND NIFTI_LIBRARIES ) 13 | SET(NIFTI_FOUND TRUE) 14 | ENDIF ( NIFTI_INCLUDE_DIR AND NIFTI_LIBRARIES ) 15 | 16 | IF (NIFTI_FOUND) 17 | IF (NOT NIFTI_FIND_QUIETLY) 18 | MESSAGE(STATUS "Found NIFTI: ${NIFTI_LIBRARIES}") 19 | ENDIF (NOT NIFTI_FIND_QUIETLY) 20 | ELSE (NIFTI_FOUND) 21 | IF (NIFTI_FIND_REQUIRED) 22 | MESSAGE(FATAL_ERROR "Could not find NIFTI (which is required)") 23 | ENDIF (NIFTI_FIND_REQUIRED) 24 | ENDIF (NIFTI_FOUND) 25 | -------------------------------------------------------------------------------- /src/DTB/CMakeFiles/cmake.check_cache: -------------------------------------------------------------------------------- 1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file 2 | -------------------------------------------------------------------------------- /src/DTB/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.8) 2 | 3 | PROJECT( DTB ) 4 | 5 | IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 6 | SET( CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}/bin" CACHE PATH "where binaries will be installed" FORCE) 7 | ENDIF( CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT ) 8 | 9 | 10 | ##################################################################################### 11 | ######################## FIND PACKAGES USED ####################################### 12 | ##################################################################################### 13 | set( CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMake" ) 14 | 15 | FIND_PACKAGE ( BLITZ REQUIRED ) 16 | FIND_PACKAGE ( NIFTI REQUIRED ) 17 | FIND_PACKAGE( Boost 1.40.0 REQUIRED COMPONENTS program_options ) 18 | SET(Boost_USE_STATIC_LIBS ON) 19 | SET(Boost_USE_MULTITHREAD OFF) 20 | 21 | 22 | ##################################################################################### 23 | ############################### SUBPROJECTS ####################################### 24 | ##################################################################################### 25 | INCLUDE_DIRECTORIES ("${PROJECT_SOURCE_DIR}/Common") 26 | 27 | ADD_SUBDIRECTORY( Applications ) 28 | -------------------------------------------------------------------------------- /src/DTB/Common/181_vecs.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LTS5/cmp/93094ce227bda9064512290dd505a7ba75cf7072/src/DTB/Common/181_vecs.dat -------------------------------------------------------------------------------- /src/DTB/Common/utils.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Utility funtions. 3 | * 4 | * @author alessandro.daducci@epfl.ch 5 | * @date, 08/03/2011 6 | */ 7 | #ifndef __UTILS_H__ 8 | #define __UTILS_H__ 9 | 10 | typedef struct { 11 | int x, y, z; 12 | } Vec3Di; 13 | 14 | typedef struct { 15 | float x, y, z; 16 | } Vec3Df; 17 | 18 | 19 | float ScalarProduct(const Vec3Df & v1, const Vec3Df & v2) 20 | { 21 | return v1.x*v2.x + v1.y*v2.y + v1.z*v2.z; 22 | } 23 | float ScalarProduct(const Vec3Di & v1, const Vec3Di & v2) 24 | { 25 | return v1.x*v2.x + v1.y*v2.y + v1.z*v2.z; 26 | } 27 | 28 | void Normalize(Vec3Df & v) 29 | { 30 | float norm = sqrt(v.x*v.x + v.y*v.y + v.z*v.z); 31 | if ( norm > 0 ) { 32 | v.x = v.x / norm; 33 | v.y = v.y / norm; 34 | v.z = v.z / norm; 35 | } 36 | } 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/README.rst: -------------------------------------------------------------------------------- 1 | DTB 2 | === 3 | 4 | For DTB compilation, you need the following development packages:: 5 | 6 | sudo apt-get install cmake-curses-gui libboost1.40-all-dev libnifti-dev libblitz0-dev 7 | 8 | The compiled binaries should be put into cmp/binary/ folders accordingly. 9 | 10 | To compile, go to DTB/ and type 11 | 12 | ccmake . 13 | 14 | Then configure and save and type to build the binaries 15 | 16 | make 17 | --------------------------------------------------------------------------------