├── ants_seg_to_nidm ├── mapping_data │ ├── __init__.py │ ├── antsmap.json │ └── FreeSurferColorLUT.txt ├── .DS_Store ├── __init__.py ├── antsutils.py └── ants_seg_to_nidm.py ├── MANIFEST.in ├── README.md ├── examples ├── antsbrainvols.csv ├── antsBrainSegmentation.nii.gz ├── 0050002_NIDM.ttl └── antslabelstats.csv ├── requirements.txt ├── .pre-commit-config.yaml ├── tests ├── test_antsutils.py └── test_ants_seg_to_nidm.py ├── LICENSE ├── setup.py └── .gitignore /ants_seg_to_nidm/mapping_data/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include ants_seg_to_nidm/mapping_data/* 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ANTS-Based Structural Segmentation to NIDM Exporter 2 | -------------------------------------------------------------------------------- /ants_seg_to_nidm/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReproNim/ants_seg_to_nidm/master/ants_seg_to_nidm/.DS_Store -------------------------------------------------------------------------------- /examples/antsbrainvols.csv: -------------------------------------------------------------------------------- 1 | PearsonCorrelation,BVOL,GVol,WVol,ThicknessSum 2 | 0.834159,1.66678e+06,631254,464930,2.06411e+06 3 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | -e git+https://github.com/incf-nidash/PyNIDM.git#egg=PyNIDM 2 | pandas 3 | numpy 4 | prov 5 | rdflib 6 | xlrd -------------------------------------------------------------------------------- /examples/antsBrainSegmentation.nii.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ReproNim/ants_seg_to_nidm/master/examples/antsBrainSegmentation.nii.gz -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | # See https://pre-commit.com for more information 2 | # See https://pre-commit.com/hooks.html for more hooks 3 | repos: 4 | - repo: https://github.com/pre-commit/pre-commit-hooks 5 | rev: v2.0.0 6 | hooks: 7 | - id: trailing-whitespace 8 | - id: end-of-file-fixer 9 | - id: check-yaml 10 | - id: check-added-large-files 11 | args: ['--maxkb=1024'] 12 | - repo: https://github.com/psf/black 13 | rev: 19.3b0 14 | hooks: 15 | - id: black 16 | -------------------------------------------------------------------------------- /ants_seg_to_nidm/__init__.py: -------------------------------------------------------------------------------- 1 | # emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- 2 | # ex: set sts=4 ts=4 sw=4 noet: 3 | # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## 4 | # 5 | # See LICENSE file distributed along with the segstats_jsonld package for the 6 | # license terms. 7 | # 8 | # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## 9 | from __future__ import absolute_import 10 | 11 | __version__ = "0.0.1" 12 | 13 | # do imports of all of the functions that should be available here 14 | from .ants_seg_to_nidm import add_seg_data, main 15 | -------------------------------------------------------------------------------- /tests/test_antsutils.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | 3 | from ants_seg_to_nidm.antsutils import read_ants_stats 4 | 5 | EXAMPLES_DIR = Path(__file__).resolve().parents[1] / "examples" 6 | 7 | 8 | def test_read_ants_stats_returns_expected_measurements(): 9 | measures = read_ants_stats( 10 | EXAMPLES_DIR / "antslabelstats.csv", 11 | EXAMPLES_DIR / "antsbrainvols.csv", 12 | EXAMPLES_DIR / "antsBrainSegmentation.nii.gz", 13 | force_error=False, 14 | ) 15 | assert len(measures) == 103 16 | measure_map = dict(measures) 17 | # spot-check a volumetric measurement (in mm^3) that relies on voxel size conversion 18 | assert measure_map["000002"] == "1666780" 19 | # ensure fractional values are preserved for non-volume metrics 20 | assert measure_map["000001"].startswith("0.83") 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 David Keator 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from setuptools import setup 4 | from setuptools import find_packages 5 | from os.path import join as opj 6 | from os.path import dirname 7 | 8 | 9 | def get_version(): 10 | """Load version only 11 | """ 12 | with open(opj(dirname(__file__), 'ants_seg_to_nidm', '__init__.py')) as f: 13 | version_lines = list(filter(lambda x: x.startswith('__version__'), f)) 14 | assert (len(version_lines) == 1) 15 | return version_lines[0].split('=')[1].strip(" '\"\t\n") 16 | 17 | # extension version 18 | version = get_version() 19 | PACKAGES = find_packages() 20 | 21 | README = opj(dirname(__file__), 'README.md') 22 | try: 23 | import pypandoc 24 | long_description = pypandoc.convert(README, 'rst') 25 | except (ImportError, OSError) as exc: 26 | print( 27 | "WARNING: pypandoc failed to import or threw an error while converting" 28 | " README.md to RST: %r .md version will be used as is" %exc 29 | ) 30 | long_description = open(README).read() 31 | 32 | # Metadata 33 | setup( 34 | name='ants_seg_to_nidm', 35 | version=version, 36 | description='ANTS segmentation data to NIDM / jsonld', 37 | long_description=long_description, 38 | author='David Keator', 39 | author_email='dbkeator@uci.edu', 40 | url='https://github.com/dbkeator/ants_seg_to_nidm', 41 | packages=PACKAGES, 42 | install_requires=[ 43 | 'numpy', 44 | 'pynidm', 45 | 'pandas', 46 | ], # Add requirements as necessary 47 | include_package_data=True, 48 | extras_require={ 49 | 'devel-docs': [ 50 | # for converting README.md -> .rst for long description 51 | 'pypandoc', 52 | ]}, 53 | entry_points={ 54 | 'console_scripts': [ 55 | 'antsegstats2nidm=ants_seg_to_nidm.ants_seg_to_nidm:main' # this is where the console entry points are defined 56 | ], 57 | }, 58 | classifiers=[ 59 | "Programming Language :: Python :: 3", 60 | "License :: OSI Approved :: MIT License", 61 | "Operating System :: OS Independent", 62 | ], # Change if necessary 63 | ) 64 | 65 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | share/python-wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | MANIFEST 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .nox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | *.py,cover 50 | .hypothesis/ 51 | .pytest_cache/ 52 | cover/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | .pybuilder/ 76 | target/ 77 | 78 | # Jupyter Notebook 79 | .ipynb_checkpoints 80 | 81 | # IPython 82 | profile_default/ 83 | ipython_config.py 84 | 85 | # pyenv 86 | # For a library or package, you might want to ignore these files since the code is 87 | # intended to run in multiple environments; otherwise, check them in: 88 | # .python-version 89 | 90 | # pipenv 91 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 92 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 93 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 94 | # install all needed dependencies. 95 | #Pipfile.lock 96 | 97 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 98 | __pypackages__/ 99 | 100 | # Celery stuff 101 | celerybeat-schedule 102 | celerybeat.pid 103 | 104 | # SageMath parsed files 105 | *.sage.py 106 | 107 | # Environments 108 | .env 109 | .venv 110 | env/ 111 | venv/ 112 | ENV/ 113 | env.bak/ 114 | venv.bak/ 115 | 116 | # Spyder project settings 117 | .spyderproject 118 | .spyproject 119 | 120 | # Rope project settings 121 | .ropeproject 122 | 123 | # mkdocs documentation 124 | /site 125 | 126 | # mypy 127 | .mypy_cache/ 128 | .dmypy.json 129 | dmypy.json 130 | 131 | # Pyre type checker 132 | .pyre/ 133 | 134 | # pytype static type analyzer 135 | .pytype/ 136 | 137 | # Cython debug symbols 138 | cython_debug/ 139 | 140 | # End of https://mrkandreev.name/snippets/gitignore-generator/#Python -------------------------------------------------------------------------------- /tests/test_ants_seg_to_nidm.py: -------------------------------------------------------------------------------- 1 | 2 | import pytest 3 | from rdflib import BNode, Graph, URIRef, Literal 4 | from rdflib.namespace import RDF, XSD 5 | 6 | from ants_seg_to_nidm.ants_seg_to_nidm import add_seg_data 7 | from nidm.core import Constants 8 | 9 | 10 | class _StatEntity: 11 | def __init__(self, uri): 12 | self.uri = uri 13 | 14 | 15 | SUBJECT_ID = "sub-0050002" 16 | 17 | 18 | def _build_base_graph(): 19 | graph = Graph() 20 | participant_agent = URIRef("http://example.org/agent/participant") 21 | graph.add((participant_agent, RDF.type, Constants.PROV['Agent'])) 22 | graph.add( 23 | ( 24 | participant_agent, 25 | URIRef(Constants.NIDM_SUBJECTID.uri), 26 | Literal(SUBJECT_ID, datatype=XSD.string), 27 | ) 28 | ) 29 | return graph, participant_agent 30 | 31 | 32 | def _add_anatomical_acquisition(graph, participant_agent, acquisition_uri, activity_uri): 33 | acquisition = URIRef(acquisition_uri) 34 | graph.add((acquisition, RDF.type, Constants.NIDM['AcquisitionObject'])) 35 | graph.add( 36 | ( 37 | acquisition, 38 | Constants.NIDM['hadAcquisitionModality'], 39 | Constants.NIDM['MagneticResonanceImaging'], 40 | ) 41 | ) 42 | graph.add( 43 | ( 44 | acquisition, 45 | Constants.NIDM['hadImageUsageType'], 46 | Constants.NIDM['Anatomical'], 47 | ) 48 | ) 49 | acquisition_activity = URIRef(activity_uri) 50 | graph.add((acquisition, Constants.PROV['wasGeneratedBy'], acquisition_activity)) 51 | assoc = BNode() 52 | graph.add((acquisition_activity, Constants.PROV['qualifiedAssociation'], assoc)) 53 | graph.add((assoc, Constants.PROV['agent'], participant_agent)) 54 | return acquisition 55 | 56 | 57 | def test_add_seg_data_links_to_matching_acquisition(): 58 | graph, participant_agent = _build_base_graph() 59 | 60 | acquisition = _add_anatomical_acquisition( 61 | graph, 62 | participant_agent, 63 | "http://example.org/acquisition/object", 64 | "http://example.org/activity/acq", 65 | ) 66 | 67 | add_seg_data( 68 | graph, 69 | SUBJECT_ID, 70 | _StatEntity("http://example.org/entity/stats"), 71 | add_to_nidm=True, 72 | ) 73 | 74 | assert (None, Constants.PROV['used'], acquisition) in graph 75 | 76 | 77 | def test_add_seg_data_warns_when_acquisition_missing(): 78 | graph, _participant_agent = _build_base_graph() 79 | 80 | with pytest.warns(UserWarning, match="No T1-weighted AcquisitionObject"): 81 | add_seg_data( 82 | graph, 83 | SUBJECT_ID, 84 | _StatEntity("http://example.org/entity/stats"), 85 | add_to_nidm=True, 86 | ) 87 | 88 | assert not list(graph.triples((None, Constants.PROV['used'], None))) 89 | 90 | 91 | def test_add_seg_data_warns_and_chooses_first_when_multiple_acquisitions(): 92 | graph, participant_agent = _build_base_graph() 93 | 94 | first = _add_anatomical_acquisition( 95 | graph, 96 | participant_agent, 97 | "http://example.org/acquisition/objectA", 98 | "http://example.org/activity/acqA", 99 | ) 100 | _add_anatomical_acquisition( 101 | graph, 102 | participant_agent, 103 | "http://example.org/acquisition/objectB", 104 | "http://example.org/activity/acqB", 105 | ) 106 | 107 | with pytest.warns(UserWarning, match="Multiple anatomical AcquisitionObjects"): 108 | add_seg_data( 109 | graph, 110 | SUBJECT_ID, 111 | _StatEntity("http://example.org/entity/stats"), 112 | add_to_nidm=True, 113 | ) 114 | 115 | assert (None, Constants.PROV['used'], first) in graph 116 | assert (None, Constants.PROV['used'], URIRef("http://example.org/acquisition/objectB")) not in graph 117 | -------------------------------------------------------------------------------- /ants_seg_to_nidm/antsutils.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Utilities for extracting information from freesurfer stats files 3 | 4 | """ 5 | 6 | import json 7 | import os 8 | from collections import namedtuple 9 | from pathlib import Path 10 | import rdflib as rl 11 | from requests import get 12 | import nibabel as nib 13 | import numpy as np 14 | import pandas as pd 15 | 16 | ANTSDKT = namedtuple("ANTSDKT", ["structure", "hemi", "measure", "unit"]) 17 | cde_file = Path(os.path.dirname(__file__)) / "mapping_data" / "ants-cdes.json" 18 | map_file = Path(os.path.dirname(__file__)) / "mapping_data" / "antsmap.json" 19 | lut_file = Path(os.path.dirname(__file__)) / "mapping_data" / "FreeSurferColorLUT.txt" 20 | 21 | 22 | def get_id_to_struct(id): 23 | with open(lut_file, "r") as fp: 24 | for line in fp.readlines(): 25 | if line.startswith(str(id)): 26 | return line.split()[1] 27 | if id == 91: 28 | return "Left basal forebrain" 29 | if id == 92: 30 | return "Right basal forebrain" 31 | if id == 630: 32 | return "Cerebellar vermal lobules I - V" 33 | if id == 631: 34 | return "Cerebellar vermal lobules VI - VII" 35 | if id == 632: 36 | return "Cerebellar vermal lobules VIII - X" 37 | return None 38 | 39 | 40 | def get_details(key, structure): 41 | hemi = None 42 | if "Left" in structure or "lh" in structure: 43 | hemi = "Left" 44 | if "Right" in structure or "rh" in structure: 45 | hemi = "Right" 46 | if "Area" in key: 47 | unit = "mm^2" 48 | else: 49 | unit = "voxel" 50 | measure = key 51 | return hemi, measure, unit 52 | 53 | 54 | def read_ants_stats(ants_stats_file, ants_brainvols_file, mri_file, force_error=True, collect_missing=False): 55 | """ 56 | Reads in an ANTS stats file along with associated mri_file (for voxel sizes) and converts to a measures dictionary with keys: 57 | ['structure':XX, 'items': [{'name': 'NVoxels', 'description': 'Number of voxels','value':XX, 'units':'unitless'}, 58 | {'name': 'Volume_mm3', 'description': ''Volume', 'value':XX, 'units':'mm^3'}]] 59 | :param ants_stats_file: path to ANTS segmentation output file named "antslabelstats" 60 | :param ants_brainvols_file: path to ANTS segmentation output for Bvol, Gvol, Wvol, and ThicknessSum (called antsbrainvols" 61 | :param mri_file: mri file to extract voxel sizes from 62 | :param freesurfer_lookup_table: Lookup table used to map 1st column of ants_stats_file label numbers to structure names 63 | :return: measures is a list of dictionaries as defined above 64 | """ 65 | 66 | # fs_lookup_table = loadfreesurferlookuptable(freesurfer_lookup_table) 67 | 68 | # open stats file, brain vols file as pandas dataframes 69 | ants_stats = pd.read_csv(ants_stats_file) 70 | brain_vols = pd.read_csv(ants_brainvols_file) 71 | 72 | # load mri_file and extract voxel sizes 73 | img = nib.load(mri_file) 74 | vox_size = np.prod(list(img.header.get_zooms())) 75 | 76 | with open(cde_file, "r") as fp: 77 | ants_cde = json.load(fp) 78 | 79 | measures = [] 80 | changed = False 81 | missing_labels = [] # Collect all missing labels if collect_missing=True 82 | # iterate over columns in brain vols 83 | for key, j in brain_vols.T.iterrows(): 84 | value = j.values[0] 85 | keytuple = ANTSDKT( 86 | structure=key if "vol" in key.lower() else "Brain", 87 | hemi=None, 88 | measure="Volume" if "vol" in key.lower() else key, 89 | unit="mm^3" 90 | if "vol" in key.lower() 91 | else "mm" 92 | if "Thickness" in key 93 | else None, 94 | ) 95 | if str(keytuple) not in ants_cde: 96 | if collect_missing: 97 | missing_labels.append(str(keytuple)) 98 | continue # Skip this entry but continue processing 99 | ants_cde["count"] += 1 100 | ants_cde[str(keytuple)] = { 101 | "id": f"{ants_cde['count']:0>6d}", 102 | "label": f"{key} ({keytuple.unit})", 103 | } 104 | if force_error: 105 | raise ValueError(f"Key {keytuple} not found in ANTS data elements file") 106 | changed = True 107 | if "vol" in key.lower(): 108 | measures.append((f'{ants_cde[str(keytuple)]["id"]}', str(int(value)))) 109 | else: 110 | measures.append((f'{ants_cde[str(keytuple)]["id"]}', str(value))) 111 | 112 | # iterate over columns in brain vols 113 | for row in ants_stats.iterrows(): 114 | structure = None 115 | for key, val in row[1].items(): 116 | if key == "Label": 117 | segid = int(val) 118 | structure = get_id_to_struct(segid) 119 | if structure is None: 120 | if collect_missing: 121 | print(f"Warning: Label {int(val)} not found in FreeSurferColorLUT.txt - skipping this row", file=sys.stderr) 122 | break # Skip entire row for this label 123 | raise ValueError(f"Label ID {int(val):d} did not return any structure in FreeSurferColorLUT.txt") 124 | continue 125 | if "VolumeInVoxels" not in key and "Area" not in key: 126 | continue 127 | hemi, measure, unit = get_details(key, structure) 128 | key_tuple = ANTSDKT( 129 | structure=structure, hemi=hemi, measure=measure, unit=unit 130 | ) 131 | label = f"{structure} {measure} ({unit})" 132 | if str(key_tuple) not in ants_cde: 133 | if collect_missing: 134 | missing_labels.append(str(key_tuple)) 135 | continue # Skip this entry but continue processing 136 | ants_cde["count"] += 1 137 | ants_cde[str(key_tuple)] = { 138 | "id": f"{ants_cde['count']:0>6d}", 139 | "structure_id": segid, 140 | "label": label, 141 | } 142 | if force_error: 143 | raise ValueError( 144 | f"Key {key_tuple} not found in ANTS data elements file" 145 | ) 146 | changed = True 147 | # measures.append((f'{ants_cde[str(key_tuple)]["id"]}', str(val))) 148 | 149 | if "VolumeInVoxels" in key: 150 | measure = "Volume" 151 | unit = "mm^3" 152 | key_tuple = ANTSDKT( 153 | structure=structure, hemi=hemi, measure=measure, unit=unit 154 | ) 155 | label = f"{structure} {measure} ({unit})" 156 | if str(key_tuple) not in ants_cde: 157 | if collect_missing: 158 | missing_labels.append(str(key_tuple)) 159 | continue # Skip this entry but continue processing 160 | ants_cde["count"] += 1 161 | ants_cde[str(key_tuple)] = { 162 | "id": f"{ants_cde['count']:0>6d}", 163 | "structure_id": segid, 164 | "label": label, 165 | } 166 | if force_error: 167 | raise ValueError( 168 | f"Key {key_tuple} not found in ANTS data elements file" 169 | ) 170 | changed = True 171 | measures.append( 172 | (f'{ants_cde[str(key_tuple)]["id"]}', str(val * vox_size)) 173 | ) 174 | 175 | if changed: 176 | with open(cde_file, "w") as fp: 177 | json.dump(ants_cde, fp, indent=2) 178 | 179 | # Report all missing labels if we were collecting them 180 | if collect_missing and missing_labels: 181 | unique_missing_labels = sorted(set(missing_labels)) 182 | num_missing = len(unique_missing_labels) 183 | print(f"\n{'='*70}", file=sys.stderr) 184 | print(f"FOUND {num_missing} MISSING LABEL(S):", file=sys.stderr) 185 | print(f"{'='*70}", file=sys.stderr) 186 | for label in unique_missing_labels: 187 | print(f" {label}", file=sys.stderr) 188 | print(f"{'='*70}\n", file=sys.stderr) 189 | raise ValueError(f"Found {num_missing} missing label(s) - see list above") 190 | 191 | return measures 192 | 193 | 194 | def hemiless(key): 195 | return ( 196 | key.replace("-lh-", "-") 197 | .replace("-rh-", "-") 198 | .replace("_lh_", "-") 199 | .replace("_rh_", "-") 200 | .replace("rh", "") 201 | .replace("lh", "") 202 | .replace("Left-", "") 203 | .replace("Right-", "") 204 | .replace("Left ", "") 205 | .replace("Right ", "") 206 | ) 207 | 208 | 209 | def create_ants_mapper(): 210 | """Create FreeSurfer to ReproNim mapping information 211 | """ 212 | 213 | with open(map_file, "r") as fp: 214 | ants_map = json.load(fp) 215 | 216 | with open(cde_file, "r") as fp: 217 | ants_cde = json.load(fp) 218 | 219 | s = ants_map["Structures"] 220 | m = ants_map["Measures"] 221 | for key in ants_cde: 222 | if key == "count": 223 | continue 224 | key_tuple = eval(key) 225 | sk = key_tuple.structure 226 | mk = key_tuple.measure 227 | hk = hemiless(sk) 228 | if hk in s: 229 | if sk not in s[hk]["antskey"]: 230 | s[hk]["antskey"].append(sk) 231 | else: 232 | s[hk] = dict(isAbout=None, antskey=[sk]) 233 | if mk not in m: 234 | m[mk] = dict(measureOf=None, datumType=None, hasUnit=key_tuple.unit) 235 | 236 | if s[hk]["isAbout"] is not None and ( 237 | "UNKNOWN" not in s[hk]["isAbout"] and "CUSTOM" not in s[hk]["isAbout"] 238 | ): 239 | ants_cde[key]["isAbout"] = s[hk]["isAbout"] 240 | 241 | if m[key_tuple.measure]["measureOf"] is not None: 242 | ants_cde[key].update(**m[key_tuple.measure]) 243 | 244 | with open(map_file, "w") as fp: 245 | json.dump(ants_map, fp, sort_keys=True, indent=2) 246 | fp.write("\n") 247 | 248 | with open(cde_file, "w") as fp: 249 | json.dump(ants_cde, fp, indent=2) 250 | fp.write("\n") 251 | 252 | return ants_map, ants_cde 253 | 254 | 255 | def create_cde_graph(restrict_to=None): 256 | """Create an RDFLIB graph with the FreeSurfer CDEs 257 | 258 | Any CDE that has a mapping will be mapped 259 | """ 260 | with open(cde_file, "r") as fp: 261 | ants_cde = json.load(fp) 262 | from nidm.core import Constants 263 | 264 | ants = Constants.ANTS 265 | nidm = Constants.NIDM 266 | 267 | g = rl.Graph() 268 | g.bind("ants", ants) 269 | g.bind("nidm", nidm) 270 | g.bind("uberon", "http://purl.obolibrary.org/obo/UBERON_") 271 | g.bind("ilx", "http://uri.interlex.org/base/ilx_") 272 | 273 | # added by DBK to create subclass relationship 274 | g.add((ants["DataElement"], rl.RDFS['subClassOf'], nidm['DataElement'])) 275 | 276 | 277 | for key, value in ants_cde.items(): 278 | if key == "count": 279 | continue 280 | if restrict_to is not None: 281 | if value["id"] not in restrict_to: 282 | continue 283 | for subkey, item in value.items(): 284 | if subkey == "id": 285 | antsid = "ants_" + item 286 | g.add((ants[antsid], rl.RDF.type, ants["DataElement"])) 287 | continue 288 | if item is None or "unknown" in str(item): 289 | continue 290 | if subkey in ["isAbout", "datumType", "measureOf"]: 291 | g.add((ants[antsid], nidm[subkey], rl.URIRef(item))) 292 | elif subkey in ["hasUnit"]: 293 | g.add((ants[antsid], nidm[subkey], rl.Literal(item))) 294 | # added by DBK to use rdfs:label 295 | elif subkey in ["label"]: 296 | g.add((ants[antsid], rl.RDFS['label'], rl.Literal(item))) 297 | else: 298 | if isinstance(item, rl.URIRef): 299 | g.add((ants[antsid], ants[subkey], item)) 300 | else: 301 | g.add((ants[antsid], ants[subkey], rl.Literal(item))) 302 | key_tuple = eval(key) 303 | for subkey, item in key_tuple._asdict().items(): 304 | if item is None: 305 | continue 306 | if subkey == "hemi": 307 | g.add((ants[antsid], nidm["hasLaterality"], rl.Literal(item))) 308 | else: 309 | g.add((ants[antsid], ants[subkey], rl.Literal(item))) 310 | return g 311 | 312 | 313 | def convert_stats_to_nidm(stats): 314 | """Convert a stats record into a NIDM entity 315 | 316 | Returns the entity and the prov document 317 | """ 318 | from nidm.core import Constants 319 | from nidm.experiment.Core import getUUID 320 | import prov 321 | 322 | ants = prov.model.Namespace("ants", str(Constants.ANTS)) 323 | niiri = prov.model.Namespace("niiri", str(Constants.NIIRI)) 324 | nidm = prov.model.Namespace("nidm", "http://purl.org/nidash/nidm#") 325 | doc = prov.model.ProvDocument() 326 | e = doc.entity(identifier=niiri[getUUID()]) 327 | e.add_asserted_type(nidm["ANTSStatsCollection"]) 328 | e.add_attributes( 329 | { 330 | ants["ants_" + val[0]]: prov.model.Literal( 331 | val[1], 332 | datatype=prov.model.XSD["float"] 333 | if "." in val[1] 334 | else prov.model.XSD["integer"], 335 | ) 336 | for val in stats 337 | } 338 | ) 339 | return e, doc 340 | -------------------------------------------------------------------------------- /ants_seg_to_nidm/mapping_data/antsmap.json: -------------------------------------------------------------------------------- 1 | { 2 | "Measures": { 3 | "AxesLength_x": { 4 | "datumType": null, 5 | "hasUnit": "voxel", 6 | "measureOf": null 7 | }, 8 | "AxesLength_y": { 9 | "datumType": null, 10 | "hasUnit": "voxel", 11 | "measureOf": null 12 | }, 13 | "AxesLength_z": { 14 | "datumType": null, 15 | "hasUnit": "voxel", 16 | "measureOf": null 17 | }, 18 | "BoundingBoxLower_x": { 19 | "datumType": null, 20 | "hasUnit": "voxel", 21 | "measureOf": null 22 | }, 23 | "BoundingBoxLower_y": { 24 | "datumType": null, 25 | "hasUnit": "voxel", 26 | "measureOf": null 27 | }, 28 | "BoundingBoxLower_z": { 29 | "datumType": null, 30 | "hasUnit": "voxel", 31 | "measureOf": null 32 | }, 33 | "BoundingBoxUpper_x": { 34 | "datumType": null, 35 | "hasUnit": "voxel", 36 | "measureOf": null 37 | }, 38 | "BoundingBoxUpper_y": { 39 | "datumType": null, 40 | "hasUnit": "voxel", 41 | "measureOf": null 42 | }, 43 | "BoundingBoxUpper_z": { 44 | "datumType": null, 45 | "hasUnit": "voxel", 46 | "measureOf": null 47 | }, 48 | "Centroid_x": { 49 | "datumType": null, 50 | "hasUnit": "voxel", 51 | "measureOf": null 52 | }, 53 | "Centroid_y": { 54 | "datumType": null, 55 | "hasUnit": "voxel", 56 | "measureOf": null 57 | }, 58 | "Centroid_z": { 59 | "datumType": null, 60 | "hasUnit": "voxel", 61 | "measureOf": null 62 | }, 63 | "Eccentricity": { 64 | "datumType": null, 65 | "hasUnit": "voxel", 66 | "measureOf": null 67 | }, 68 | "Elongation": { 69 | "datumType": null, 70 | "hasUnit": "voxel", 71 | "measureOf": null 72 | }, 73 | "IntegratedIntensity": { 74 | "datumType": null, 75 | "hasUnit": "voxel", 76 | "measureOf": null 77 | }, 78 | "NVoxels": { 79 | "datumType": "http://uri.interlex.org/base/ilx_0102597", 80 | "hasUnit": "voxel", 81 | "measureOf": "http://uri.interlex.org/base/ilx_0112559" 82 | }, 83 | "Orientation": { 84 | "datumType": null, 85 | "hasUnit": "voxel", 86 | "measureOf": null 87 | }, 88 | "PearsonCorrelation": { 89 | "datumType": null, 90 | "hasUnit": null, 91 | "measureOf": null 92 | }, 93 | "SurfaceAreaInMillimetersSquared": { 94 | "datumType": "http://uri.interlex.org/base/ilx_0738276", 95 | "hasUnit": "mm^2", 96 | "measureOf": "http://purl.obolibrary.org/obo/PATO_0001323" 97 | }, 98 | "ThicknessSum": { 99 | "datumType": null, 100 | "hasUnit": "mm", 101 | "measureOf": null 102 | }, 103 | "Volume": { 104 | "datumType": "http://uri.interlex.org/base/ilx_0738276", 105 | "hasUnit": "mm^3", 106 | "measureOf": "http://uri.interlex.org/base/ilx_0112559" 107 | }, 108 | "VolumeInVoxels": { 109 | "datumType": "http://uri.interlex.org/base/ilx_0102597", 110 | "hasUnit": "voxel", 111 | "measureOf": "http://uri.interlex.org/base/ilx_0112559" 112 | }, 113 | "WeightedCentroid_x": { 114 | "datumType": null, 115 | "hasUnit": "voxel", 116 | "measureOf": null 117 | }, 118 | "WeightedCentroid_y": { 119 | "datumType": null, 120 | "hasUnit": "voxel", 121 | "measureOf": null 122 | }, 123 | "WeightedCentroid_z": { 124 | "datumType": null, 125 | "hasUnit": "voxel", 126 | "measureOf": null 127 | } 128 | }, 129 | "Structures": { 130 | "3rd-Ventricle": { 131 | "antskey": [ 132 | "3rd-Ventricle" 133 | ], 134 | "isAbout": "http://purl.obolibrary.org/obo/UBERON_0002286" 135 | }, 136 | "4th-Ventricle": { 137 | "antskey": [ 138 | "4th-Ventricle" 139 | ], 140 | "isAbout": "http://purl.obolibrary.org/obo/UBERON_0002422" 141 | }, 142 | "Accumbens-area": { 143 | "antskey": [ 144 | "Left-Accumbens-area", 145 | "Right-Accumbens-area" 146 | ], 147 | "isAbout": "http://purl.obolibrary.org/obo/UBERON_0001882" 148 | }, 149 | "Amygdala": { 150 | "antskey": [ 151 | "Left-Amygdala", 152 | "Right-Amygdala" 153 | ], 154 | "isAbout": "http://purl.obolibrary.org/obo/UBERON_0001876" 155 | }, 156 | "BVOL": { 157 | "antskey": [ 158 | "BVOL" 159 | ], 160 | "isAbout": "http://purl.obolibrary.org/obo/UBERON_0000955" 161 | }, 162 | "Brain": { 163 | "antskey": [ 164 | "Brain" 165 | ], 166 | "isAbout": "http://purl.obolibrary.org/obo/UBERON_0000955" 167 | }, 168 | "Brain-Stem": { 169 | "antskey": [ 170 | "Brain-Stem" 171 | ], 172 | "isAbout": "http://purl.obolibrary.org/obo/UBERON_0002298" 173 | }, 174 | "CSF": { 175 | "antskey": [ 176 | "CSF" 177 | ], 178 | "isAbout": "http://purl.obolibrary.org/obo/UBERON_0001359" 179 | }, 180 | "Caudate": { 181 | "antskey": [ 182 | "Left-Caudate", 183 | "Right-Caudate" 184 | ], 185 | "isAbout": "http://purl.obolibrary.org/obo/UBERON_0001873" 186 | }, 187 | "Cerebellar vermal lobules I - V": { 188 | "antskey": [ 189 | "Cerebellar vermal lobules I - V" 190 | ], 191 | "isAbout": null 192 | }, 193 | "Cerebellar vermal lobules VI - VII": { 194 | "antskey": [ 195 | "Cerebellar vermal lobules VI - VII" 196 | ], 197 | "isAbout": null 198 | }, 199 | "Cerebellar vermal lobules VIII - X": { 200 | "antskey": [ 201 | "Cerebellar vermal lobules VIII - X" 202 | ], 203 | "isAbout": null 204 | }, 205 | "Cerebellum-Exterior": { 206 | "antskey": [ 207 | "Left-Cerebellum-Exterior", 208 | "Right-Cerebellum-Exterior" 209 | ], 210 | "isAbout": null 211 | }, 212 | "Cerebellum-White-Matter": { 213 | "antskey": [ 214 | "Left-Cerebellum-White-Matter", 215 | "Right-Cerebellum-White-Matter" 216 | ], 217 | "isAbout": "http://purl.obolibrary.org/obo/UBERON_0002317" 218 | }, 219 | "GVol": { 220 | "antskey": [ 221 | "GVol" 222 | ], 223 | "isAbout": "http://purl.obolibrary.org/obo/UBERON_0000956" 224 | }, 225 | "Hippocampus": { 226 | "antskey": [ 227 | "Left-Hippocampus", 228 | "Right-Hippocampus" 229 | ], 230 | "isAbout": "http://purl.obolibrary.org/obo/UBERON_0001954" 231 | }, 232 | "Inf-Lat-Vent": { 233 | "antskey": [ 234 | "Left-Inf-Lat-Vent", 235 | "Right-Inf-Lat-Vent" 236 | ], 237 | "isAbout": "http://purl.obolibrary.org/obo/UBERON_0006091" 238 | }, 239 | "Lateral-Ventricle": { 240 | "antskey": [ 241 | "Left-Lateral-Ventricle", 242 | "Right-Lateral-Ventricle" 243 | ], 244 | "isAbout": "http://purl.obolibrary.org/obo/UBERON_0002285" 245 | }, 246 | "Optic-Chiasm": { 247 | "antskey": [ 248 | "Optic-Chiasm" 249 | ], 250 | "isAbout": "http://purl.obolibrary.org/obo/UBERON_0000959" 251 | }, 252 | "Pallidum": { 253 | "antskey": [ 254 | "Left-Pallidum", 255 | "Right-Pallidum" 256 | ], 257 | "isAbout": "http://purl.obolibrary.org/obo/UBERON_0006514" 258 | }, 259 | "Putamen": { 260 | "antskey": [ 261 | "Left-Putamen", 262 | "Right-Putamen" 263 | ], 264 | "isAbout": "http://purl.obolibrary.org/obo/UBERON_0001874" 265 | }, 266 | "Thalamus-Proper": { 267 | "antskey": [ 268 | "Left-Thalamus-Proper", 269 | "Right-Thalamus-Proper" 270 | ], 271 | "isAbout": "http://purl.obolibrary.org/obo/UBERON_0001897" 272 | }, 273 | "VentralDC": { 274 | "antskey": [ 275 | "Left-VentralDC", 276 | "Right-VentralDC" 277 | ], 278 | "isAbout": "CUSTOM: it was 'invented' by CMA. Something like: Ventral Diencephalon contains the hypothalamus, basal forebrain, and sublenticular extended amygdala (SLEA), as well as a large portion of ventral tegmentum. See also https://doi.org/10.1016/j.biopsych.2008.01.018" 279 | }, 280 | "WVol": { 281 | "antskey": [ 282 | "WVol" 283 | ], 284 | "isAbout": "http://purl.obolibrary.org/obo/UBERON_0002437" 285 | }, 286 | "basal forebrain": { 287 | "antskey": [ 288 | "Left basal forebrain", 289 | "Right basal forebrain" 290 | ], 291 | "isAbout": null 292 | }, 293 | "ctx-caudalanteriorcingulate": { 294 | "antskey": [ 295 | "ctx-lh-caudalanteriorcingulate", 296 | "ctx-rh-caudalanteriorcingulate" 297 | ], 298 | "isAbout": null 299 | }, 300 | "ctx-caudalmiddlefrontal": { 301 | "antskey": [ 302 | "ctx-lh-caudalmiddlefrontal", 303 | "ctx-rh-caudalmiddlefrontal" 304 | ], 305 | "isAbout": null 306 | }, 307 | "ctx-cuneus": { 308 | "antskey": [ 309 | "ctx-lh-cuneus", 310 | "ctx-rh-cuneus" 311 | ], 312 | "isAbout": null 313 | }, 314 | "ctx-entoinal": { 315 | "antskey": [ 316 | "ctx-lh-entorhinal", 317 | "ctx-rh-entorhinal" 318 | ], 319 | "isAbout": null 320 | }, 321 | "ctx-fusiform": { 322 | "antskey": [ 323 | "ctx-lh-fusiform", 324 | "ctx-rh-fusiform" 325 | ], 326 | "isAbout": null 327 | }, 328 | "ctx-inferiorparietal": { 329 | "antskey": [ 330 | "ctx-lh-inferiorparietal", 331 | "ctx-rh-inferiorparietal" 332 | ], 333 | "isAbout": null 334 | }, 335 | "ctx-inferiortemporal": { 336 | "antskey": [ 337 | "ctx-lh-inferiortemporal", 338 | "ctx-rh-inferiortemporal" 339 | ], 340 | "isAbout": null 341 | }, 342 | "ctx-insula": { 343 | "antskey": [ 344 | "ctx-lh-insula", 345 | "ctx-rh-insula" 346 | ], 347 | "isAbout": null 348 | }, 349 | "ctx-isthmuscingulate": { 350 | "antskey": [ 351 | "ctx-lh-isthmuscingulate", 352 | "ctx-rh-isthmuscingulate" 353 | ], 354 | "isAbout": null 355 | }, 356 | "ctx-lateraloccipital": { 357 | "antskey": [ 358 | "ctx-lh-lateraloccipital", 359 | "ctx-rh-lateraloccipital" 360 | ], 361 | "isAbout": null 362 | }, 363 | "ctx-lateralorbitofrontal": { 364 | "antskey": [ 365 | "ctx-lh-lateralorbitofrontal", 366 | "ctx-rh-lateralorbitofrontal" 367 | ], 368 | "isAbout": null 369 | }, 370 | "ctx-lingual": { 371 | "antskey": [ 372 | "ctx-lh-lingual", 373 | "ctx-rh-lingual" 374 | ], 375 | "isAbout": null 376 | }, 377 | "ctx-medialorbitofrontal": { 378 | "antskey": [ 379 | "ctx-lh-medialorbitofrontal", 380 | "ctx-rh-medialorbitofrontal" 381 | ], 382 | "isAbout": null 383 | }, 384 | "ctx-middletemporal": { 385 | "antskey": [ 386 | "ctx-lh-middletemporal", 387 | "ctx-rh-middletemporal" 388 | ], 389 | "isAbout": null 390 | }, 391 | "ctx-paracentral": { 392 | "antskey": [ 393 | "ctx-lh-paracentral", 394 | "ctx-rh-paracentral" 395 | ], 396 | "isAbout": null 397 | }, 398 | "ctx-parahippocampal": { 399 | "antskey": [ 400 | "ctx-lh-parahippocampal", 401 | "ctx-rh-parahippocampal" 402 | ], 403 | "isAbout": null 404 | }, 405 | "ctx-parsopercularis": { 406 | "antskey": [ 407 | "ctx-lh-parsopercularis", 408 | "ctx-rh-parsopercularis" 409 | ], 410 | "isAbout": null 411 | }, 412 | "ctx-parsorbitalis": { 413 | "antskey": [ 414 | "ctx-lh-parsorbitalis", 415 | "ctx-rh-parsorbitalis" 416 | ], 417 | "isAbout": null 418 | }, 419 | "ctx-parstriangularis": { 420 | "antskey": [ 421 | "ctx-lh-parstriangularis", 422 | "ctx-rh-parstriangularis" 423 | ], 424 | "isAbout": null 425 | }, 426 | "ctx-pericalcarine": { 427 | "antskey": [ 428 | "ctx-lh-pericalcarine", 429 | "ctx-rh-pericalcarine" 430 | ], 431 | "isAbout": null 432 | }, 433 | "ctx-postcentral": { 434 | "antskey": [ 435 | "ctx-lh-postcentral", 436 | "ctx-rh-postcentral" 437 | ], 438 | "isAbout": null 439 | }, 440 | "ctx-posteriorcingulate": { 441 | "antskey": [ 442 | "ctx-lh-posteriorcingulate", 443 | "ctx-rh-posteriorcingulate" 444 | ], 445 | "isAbout": null 446 | }, 447 | "ctx-precentral": { 448 | "antskey": [ 449 | "ctx-lh-precentral", 450 | "ctx-rh-precentral" 451 | ], 452 | "isAbout": null 453 | }, 454 | "ctx-precuneus": { 455 | "antskey": [ 456 | "ctx-lh-precuneus", 457 | "ctx-rh-precuneus" 458 | ], 459 | "isAbout": null 460 | }, 461 | "ctx-rostralanteriorcingulate": { 462 | "antskey": [ 463 | "ctx-lh-rostralanteriorcingulate", 464 | "ctx-rh-rostralanteriorcingulate" 465 | ], 466 | "isAbout": null 467 | }, 468 | "ctx-rostralmiddlefrontal": { 469 | "antskey": [ 470 | "ctx-lh-rostralmiddlefrontal", 471 | "ctx-rh-rostralmiddlefrontal" 472 | ], 473 | "isAbout": null 474 | }, 475 | "ctx-superiorfrontal": { 476 | "antskey": [ 477 | "ctx-lh-superiorfrontal", 478 | "ctx-rh-superiorfrontal" 479 | ], 480 | "isAbout": null 481 | }, 482 | "ctx-superiorparietal": { 483 | "antskey": [ 484 | "ctx-lh-superiorparietal", 485 | "ctx-rh-superiorparietal" 486 | ], 487 | "isAbout": null 488 | }, 489 | "ctx-superiortemporal": { 490 | "antskey": [ 491 | "ctx-lh-superiortemporal", 492 | "ctx-rh-superiortemporal" 493 | ], 494 | "isAbout": null 495 | }, 496 | "ctx-supramarginal": { 497 | "antskey": [ 498 | "ctx-lh-supramarginal", 499 | "ctx-rh-supramarginal" 500 | ], 501 | "isAbout": null 502 | }, 503 | "ctx-transversetemporal": { 504 | "antskey": [ 505 | "ctx-lh-transversetemporal", 506 | "ctx-rh-transversetemporal" 507 | ], 508 | "isAbout": null 509 | }, 510 | "vessel": { 511 | "antskey": [ 512 | "Left-vessel", 513 | "Right-vessel" 514 | ], 515 | "isAbout": "http://purl.obolibrary.org/obo/UBERON_0001981" 516 | } 517 | } 518 | } 519 | -------------------------------------------------------------------------------- /examples/0050002_NIDM.ttl: -------------------------------------------------------------------------------- 1 | @prefix Neuroimaging_Analysis_Software: . 2 | @prefix dct: . 3 | @prefix hasDatumType: . 4 | @prefix hasLaterality: . 5 | @prefix hasMeasurementType: . 6 | @prefix hasUnit: . 7 | @prefix ilk: . 8 | @prefix isAbout: . 9 | @prefix measurement_datum: . 10 | @prefix ndar: . 11 | @prefix nidm: . 12 | @prefix niiri: . 13 | @prefix obo: . 14 | @prefix prov: . 15 | @prefix rdf: . 16 | @prefix rdfs: . 17 | @prefix sio: . 18 | @prefix xml: . 19 | @prefix xsd: . 20 | 21 | niiri:a56b0f00-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 22 | prov:Entity ; 23 | rdfs:label "fourth ventricle"^^xsd:string ; 24 | dct:description "fourth ventricle cerebral spinal fluid"^^xsd:string ; 25 | hasUnit: "mm^3"^^xsd:string ; 26 | isAbout: obo:UBERON_0002422 ; 27 | hasLaterality: "None"^^xsd:string ; 28 | hasMeasurementType: ilk:ilx_0112559 ; 29 | hasDatumType: ilk:ilx_0738276 . 30 | 31 | niiri:a5712fb6-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 32 | prov:Entity ; 33 | rdfs:label "caudate nucleus"^^xsd:string ; 34 | dct:description "caudate nucleus gray matter"^^xsd:string ; 35 | hasUnit: "mm^3"^^xsd:string ; 36 | isAbout: obo:UBERON_0001873 ; 37 | hasLaterality: "Right"^^xsd:string ; 38 | hasMeasurementType: ilk:ilx_0112559 ; 39 | hasDatumType: ilk:ilx_0738276 . 40 | 41 | niiri:a5734a9e-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 42 | prov:Entity ; 43 | rdfs:label "amygdala"^^xsd:string ; 44 | dct:description "amygdala gray matter"^^xsd:string ; 45 | hasUnit: "mm^3"^^xsd:string ; 46 | isAbout: obo:UBERON_0001876 ; 47 | hasLaterality: "Right"^^xsd:string ; 48 | hasMeasurementType: ilk:ilx_0112559 ; 49 | hasDatumType: ilk:ilx_0738276 . 50 | 51 | niiri:a574575e-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 52 | prov:Entity ; 53 | rdfs:label "ventral diencephalon gray matter"^^xsd:string ; 54 | dct:description "ventral diencephalon gray matter"^^xsd:string ; 55 | hasUnit: "mm^3"^^xsd:string ; 56 | hasLaterality: "Right"^^xsd:string ; 57 | hasMeasurementType: ilk:ilx_0112559 ; 58 | hasDatumType: ilk:ilx_0738276 . 59 | 60 | niiri:b5658256-eae9-11e9-a542-003ee1ce9545 a nidm:ANTSStatsCollection, 61 | prov:Entity ; 62 | niiri:a56b0f00-eae9-11e9-a542-003ee1ce9545 1.458484e+03 ; 63 | niiri:a5712fb6-eae9-11e9-a542-003ee1ce9545 3.778609e+03 ; 64 | niiri:a5734a9e-eae9-11e9-a542-003ee1ce9545 1.088609e+03 ; 65 | niiri:a574575e-eae9-11e9-a542-003ee1ce9545 5.07002e+03 ; 66 | niiri:b56c13fa-eae9-11e9-a542-003ee1ce9545 3.428699e+03 ; 67 | niiri:b5723de8-eae9-11e9-a542-003ee1ce9545 1.542547e+03 ; 68 | niiri:b572c40c-eae9-11e9-a542-003ee1ce9545 3.301555e+03 ; 69 | niiri:b574cdb0-eae9-11e9-a542-003ee1ce9545 1.576172e+01 ; 70 | niiri:c5690584-eae9-11e9-a542-003ee1ce9545 3.746035e+03 ; 71 | niiri:c56b8fb6-eae9-11e9-a542-003ee1ce9545 1.798517e+04 ; 72 | niiri:c56c9604-eae9-11e9-a542-003ee1ce9545 1.130641e+03 ; 73 | niiri:c56d987e-eae9-11e9-a542-003ee1ce9545 5.390508e+02 ; 74 | niiri:d56808aa-eae9-11e9-a542-003ee1ce9545 1.478449e+04 ; 75 | niiri:d56e1d94-eae9-11e9-a542-003ee1ce9545 5.334816e+03 ; 76 | niiri:d56f12a8-eae9-11e9-a542-003ee1ce9545 8.641625e+03 ; 77 | niiri:d57029d6-eae9-11e9-a542-003ee1ce9545 1.468257e+04 ; 78 | niiri:d570ad34-eae9-11e9-a542-003ee1ce9545 7.770527e+03 ; 79 | niiri:d5756086-eae9-11e9-a542-003ee1ce9545 2.206641e+01 ; 80 | niiri:e56a027c-eae9-11e9-a542-003ee1ce9545 1.68125e+03 ; 81 | niiri:e56e8ee6-eae9-11e9-a542-003ee1ce9545 9.457031e+00 ; 82 | niiri:e56f94bc-eae9-11e9-a542-003ee1ce9545 2.280195e+02 ; 83 | niiri:e573d3b0-eae9-11e9-a542-003ee1ce9545 5.159336e+02 ; 84 | niiri:f5663372-eae9-11e9-a542-003ee1ce9545 6.686121e+03 ; 85 | niiri:f5677854-eae9-11e9-a542-003ee1ce9545 1.607695e+02 ; 86 | niiri:f5688776-eae9-11e9-a542-003ee1ce9545 7.88191e+03 ; 87 | niiri:f569839c-eae9-11e9-a542-003ee1ce9545 4.993312e+03 ; 88 | niiri:f56a8bac-eae9-11e9-a542-003ee1ce9545 7.176836e+02 ; 89 | niiri:f56d169c-eae9-11e9-a542-003ee1ce9545 1.122234e+03 ; 90 | niiri:f571b5c6-eae9-11e9-a542-003ee1ce9545 5.046902e+03 ; 91 | prov:wasGeneratedBy niiri:d5644dd2-eae9-11e9-a542-003ee1ce9545 . 92 | 93 | niiri:b56c13fa-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 94 | prov:Entity ; 95 | rdfs:label "hippocampus"^^xsd:string ; 96 | dct:description "hippocampus gray matter"^^xsd:string ; 97 | hasUnit: "mm^3"^^xsd:string ; 98 | isAbout: obo:UBERON_0001954 ; 99 | hasLaterality: "Left"^^xsd:string ; 100 | hasMeasurementType: ilk:ilx_0112559 ; 101 | hasDatumType: ilk:ilx_0738276 . 102 | 103 | niiri:b5723de8-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 104 | prov:Entity ; 105 | rdfs:label "pallidum"^^xsd:string ; 106 | dct:description "pallidum gray matter"^^xsd:string ; 107 | hasUnit: "mm^3"^^xsd:string ; 108 | isAbout: obo:UBERON_0006514 ; 109 | hasLaterality: "Right"^^xsd:string ; 110 | hasMeasurementType: ilk:ilx_0112559 ; 111 | hasDatumType: ilk:ilx_0738276 . 112 | 113 | niiri:b572c40c-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 114 | prov:Entity ; 115 | rdfs:label "hippocampus"^^xsd:string ; 116 | dct:description "hippocampus gray matter"^^xsd:string ; 117 | hasUnit: "mm^3"^^xsd:string ; 118 | isAbout: obo:UBERON_0001954 ; 119 | hasLaterality: "Right"^^xsd:string ; 120 | hasMeasurementType: ilk:ilx_0112559 ; 121 | hasDatumType: ilk:ilx_0738276 . 122 | 123 | niiri:b574cdb0-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 124 | prov:Entity ; 125 | rdfs:label "perivascular space"^^xsd:string ; 126 | dct:description "perivascular space blood"^^xsd:string ; 127 | hasUnit: "mm^3"^^xsd:string ; 128 | isAbout: obo:UBERON_0014930 ; 129 | hasLaterality: "Right"^^xsd:string ; 130 | hasMeasurementType: ilk:ilx_0112559 ; 131 | hasDatumType: ilk:ilx_0738276 . 132 | 133 | niiri:c5690584-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 134 | prov:Entity ; 135 | rdfs:label "caudate nucleus"^^xsd:string ; 136 | dct:description "caudate nucleus gray matter"^^xsd:string ; 137 | hasUnit: "mm^3"^^xsd:string ; 138 | isAbout: obo:UBERON_0001873 ; 139 | hasLaterality: "Left"^^xsd:string ; 140 | hasMeasurementType: ilk:ilx_0112559 ; 141 | hasDatumType: ilk:ilx_0738276 . 142 | 143 | niiri:c56b8fb6-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 144 | prov:Entity ; 145 | rdfs:label "brainstem"^^xsd:string ; 146 | dct:description "brainstem gray matter"^^xsd:string ; 147 | hasUnit: "mm^3"^^xsd:string ; 148 | isAbout: obo:UBERON_0002298 ; 149 | hasLaterality: "None"^^xsd:string ; 150 | hasMeasurementType: ilk:ilx_0112559 ; 151 | hasDatumType: ilk:ilx_0738276 . 152 | 153 | niiri:c56c9604-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 154 | prov:Entity ; 155 | rdfs:label "amygdala"^^xsd:string ; 156 | dct:description "amygdala gray matter"^^xsd:string ; 157 | hasUnit: "mm^3"^^xsd:string ; 158 | isAbout: obo:UBERON_0001876 ; 159 | hasLaterality: "Left"^^xsd:string ; 160 | hasMeasurementType: ilk:ilx_0112559 ; 161 | hasDatumType: ilk:ilx_0738276 . 162 | 163 | niiri:c56d987e-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 164 | prov:Entity ; 165 | rdfs:label "nucleus accumbens"^^xsd:string ; 166 | dct:description "nucleus accumbens gray matter"^^xsd:string ; 167 | hasUnit: "mm^3"^^xsd:string ; 168 | isAbout: obo:UBERON_0001882 ; 169 | hasLaterality: "Left"^^xsd:string ; 170 | hasMeasurementType: ilk:ilx_0112559 ; 171 | hasDatumType: ilk:ilx_0738276 . 172 | 173 | niiri:d56808aa-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 174 | prov:Entity ; 175 | rdfs:label "cerebellum white matter"^^xsd:string ; 176 | dct:description "cerebellum white matter"^^xsd:string ; 177 | hasUnit: "mm^3"^^xsd:string ; 178 | isAbout: obo:UBERON_0002037 ; 179 | hasLaterality: "Left"^^xsd:string ; 180 | hasMeasurementType: ilk:ilx_0112559 ; 181 | hasDatumType: ilk:ilx_0738276 . 182 | 183 | niiri:d56e1d94-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 184 | prov:Entity ; 185 | rdfs:label "ventral diencephalon gray matter"^^xsd:string ; 186 | dct:description "ventral diencephalon gray matter"^^xsd:string ; 187 | hasUnit: "mm^3"^^xsd:string ; 188 | hasLaterality: "Left"^^xsd:string ; 189 | hasMeasurementType: ilk:ilx_0112559 ; 190 | hasDatumType: ilk:ilx_0738276 . 191 | 192 | niiri:d56f12a8-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 193 | prov:Entity ; 194 | rdfs:label "lateral ventricle"^^xsd:string ; 195 | dct:description "lateral ventricle cerebral spinal fluid"^^xsd:string ; 196 | hasUnit: "mm^3"^^xsd:string ; 197 | isAbout: obo:UBERON_0002285 ; 198 | hasLaterality: "Right"^^xsd:string ; 199 | hasMeasurementType: ilk:ilx_0112559 ; 200 | hasDatumType: ilk:ilx_0738276 . 201 | 202 | niiri:d57029d6-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 203 | prov:Entity ; 204 | rdfs:label "cerebellum white matter"^^xsd:string ; 205 | dct:description "cerebellum white matter"^^xsd:string ; 206 | hasUnit: "mm^3"^^xsd:string ; 207 | isAbout: obo:UBERON_0002037 ; 208 | hasLaterality: "Right"^^xsd:string ; 209 | hasMeasurementType: ilk:ilx_0112559 ; 210 | hasDatumType: ilk:ilx_0738276 . 211 | 212 | niiri:d570ad34-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 213 | prov:Entity ; 214 | rdfs:label "thalamus"^^xsd:string ; 215 | dct:description "thalamus gray matter"^^xsd:string ; 216 | hasUnit: "mm^3"^^xsd:string ; 217 | isAbout: obo:UBERON_0001897 ; 218 | hasLaterality: "Right"^^xsd:string ; 219 | hasMeasurementType: ilk:ilx_0112559 ; 220 | hasDatumType: ilk:ilx_0738276 . 221 | 222 | niiri:d5756086-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 223 | prov:Entity ; 224 | rdfs:label "optic chiasm"^^xsd:string ; 225 | dct:description "optic chiasm white matter"^^xsd:string ; 226 | hasUnit: "mm^3"^^xsd:string ; 227 | isAbout: obo:UBERON_0000959 ; 228 | hasLaterality: "None"^^xsd:string ; 229 | hasMeasurementType: ilk:ilx_0112559 ; 230 | hasDatumType: ilk:ilx_0738276 . 231 | 232 | niiri:e56a027c-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 233 | prov:Entity ; 234 | rdfs:label "pallidum"^^xsd:string ; 235 | dct:description "pallidum gray matter"^^xsd:string ; 236 | hasUnit: "mm^3"^^xsd:string ; 237 | isAbout: obo:UBERON_0006514 ; 238 | hasLaterality: "Left"^^xsd:string ; 239 | hasMeasurementType: ilk:ilx_0112559 ; 240 | hasDatumType: ilk:ilx_0738276 . 241 | 242 | niiri:e56e8ee6-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 243 | prov:Entity ; 244 | rdfs:label "perivascular space"^^xsd:string ; 245 | dct:description "perivascular space blood"^^xsd:string ; 246 | hasUnit: "mm^3"^^xsd:string ; 247 | isAbout: obo:UBERON_0014930 ; 248 | hasLaterality: "Left"^^xsd:string ; 249 | hasMeasurementType: ilk:ilx_0112559 ; 250 | hasDatumType: ilk:ilx_0738276 . 251 | 252 | niiri:e56f94bc-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 253 | prov:Entity ; 254 | rdfs:label "inferior horn of the lateral ventricle"^^xsd:string ; 255 | dct:description "inferior horn of the lateral ventricle cerebral spinal fluid"^^xsd:string ; 256 | hasUnit: "mm^3"^^xsd:string ; 257 | isAbout: obo:UBERON_0006091 ; 258 | hasLaterality: "Right"^^xsd:string ; 259 | hasMeasurementType: ilk:ilx_0112559 ; 260 | hasDatumType: ilk:ilx_0738276 . 261 | 262 | niiri:e573d3b0-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 263 | prov:Entity ; 264 | rdfs:label "nucleus accumbens"^^xsd:string ; 265 | dct:description "nucleus accumbens gray matter"^^xsd:string ; 266 | hasUnit: "mm^3"^^xsd:string ; 267 | isAbout: obo:UBERON_0001882 ; 268 | hasLaterality: "Right"^^xsd:string ; 269 | hasMeasurementType: ilk:ilx_0112559 ; 270 | hasDatumType: ilk:ilx_0738276 . 271 | 272 | niiri:f5663372-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 273 | prov:Entity ; 274 | rdfs:label "lateral ventricle"^^xsd:string ; 275 | dct:description "lateral ventricle cerebral spinal fluid"^^xsd:string ; 276 | hasUnit: "mm^3"^^xsd:string ; 277 | isAbout: obo:UBERON_0002285 ; 278 | hasLaterality: "Left"^^xsd:string ; 279 | hasMeasurementType: ilk:ilx_0112559 ; 280 | hasDatumType: ilk:ilx_0738276 . 281 | 282 | niiri:f5677854-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 283 | prov:Entity ; 284 | rdfs:label "inferior horn of the lateral ventricle"^^xsd:string ; 285 | dct:description "inferior horn of the lateral ventricle cerebral spinal fluid"^^xsd:string ; 286 | hasUnit: "mm^3"^^xsd:string ; 287 | isAbout: obo:UBERON_0006091 ; 288 | hasLaterality: "Left"^^xsd:string ; 289 | hasMeasurementType: ilk:ilx_0112559 ; 290 | hasDatumType: ilk:ilx_0738276 . 291 | 292 | niiri:f5688776-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 293 | prov:Entity ; 294 | rdfs:label "thalamus"^^xsd:string ; 295 | dct:description "thalamus gray matter"^^xsd:string ; 296 | hasUnit: "mm^3"^^xsd:string ; 297 | isAbout: obo:UBERON_0001897 ; 298 | hasLaterality: "Left"^^xsd:string ; 299 | hasMeasurementType: ilk:ilx_0112559 ; 300 | hasDatumType: ilk:ilx_0738276 . 301 | 302 | niiri:f569839c-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 303 | prov:Entity ; 304 | rdfs:label "putamen"^^xsd:string ; 305 | dct:description "putamen gray matter"^^xsd:string ; 306 | hasUnit: "mm^3"^^xsd:string ; 307 | isAbout: obo:UBERON_0001874 ; 308 | hasLaterality: "Left"^^xsd:string ; 309 | hasMeasurementType: ilk:ilx_0112559 ; 310 | hasDatumType: ilk:ilx_0738276 . 311 | 312 | niiri:f56a8bac-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 313 | prov:Entity ; 314 | rdfs:label "third ventricle"^^xsd:string ; 315 | dct:description "third ventricle cerebral spinal fluid"^^xsd:string ; 316 | hasUnit: "mm^3"^^xsd:string ; 317 | isAbout: obo:UBERON_0002286 ; 318 | hasLaterality: "None"^^xsd:string ; 319 | hasMeasurementType: ilk:ilx_0112559 ; 320 | hasDatumType: ilk:ilx_0738276 . 321 | 322 | niiri:f56d169c-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 323 | prov:Entity ; 324 | rdfs:label "cerebrum cerebral spinal fluid"^^xsd:string ; 325 | dct:description "cerebrum cerebral spinal fluid"^^xsd:string ; 326 | hasUnit: "mm^3"^^xsd:string ; 327 | isAbout: obo:UBERON_0001869 ; 328 | hasLaterality: "None"^^xsd:string ; 329 | hasMeasurementType: ilk:ilx_0112559 ; 330 | hasDatumType: ilk:ilx_0738276 . 331 | 332 | niiri:f571b5c6-eae9-11e9-a542-003ee1ce9545 a measurement_datum:, 333 | prov:Entity ; 334 | rdfs:label "putamen"^^xsd:string ; 335 | dct:description "putamen gray matter"^^xsd:string ; 336 | hasUnit: "mm^3"^^xsd:string ; 337 | isAbout: obo:UBERON_0001874 ; 338 | hasLaterality: "Right"^^xsd:string ; 339 | hasMeasurementType: ilk:ilx_0112559 ; 340 | hasDatumType: ilk:ilx_0738276 . 341 | 342 | niiri:a564c096-eae9-11e9-a542-003ee1ce9545 a prov:Agent, 343 | prov:SoftwareAgent ; 344 | Neuroimaging_Analysis_Software: "http://stnava.github.io/ANTs/"^^xsd:string . 345 | 346 | niiri:d5644dd2-eae9-11e9-a542-003ee1ce9545 a prov:Activity ; 347 | dct:description "ANTS segmentation statistics"^^xsd:string ; 348 | prov:qualifiedAssociation [ a prov:Association ; 349 | prov:agent niiri:a564c096-eae9-11e9-a542-003ee1ce9545 ; 350 | prov:hadRole "http://purl.org/nidash/nidm#NIDM_0000164"^^xsd:string ], 351 | [ a prov:Association ; 352 | prov:agent niiri:d5651bae-eae9-11e9-a542-003ee1ce9545 ; 353 | prov:hadRole sio:Subject ] . 354 | 355 | niiri:d5651bae-eae9-11e9-a542-003ee1ce9545 a prov:Agent ; 356 | ndar:src_subject_id "0050002"^^xsd:string . 357 | 358 | -------------------------------------------------------------------------------- /ants_seg_to_nidm/ants_seg_to_nidm.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #!/usr/bin/env python 3 | #************************************************************************************** 4 | #************************************************************************************** 5 | # ants_seg_to_nidm.py 6 | # License: GPL 7 | #************************************************************************************** 8 | #************************************************************************************** 9 | # Date: June 6, 2019 Coded by: Brainhack'ers 10 | # Filename: ants_seg_to_nidm.py 11 | # 12 | # Program description: This program will load in JSON output from FSL's FAST/FIRST 13 | # segmentation tool, augment the FSL anatomical region designations with common data element 14 | # anatomical designations, and save the statistics + region designations out as 15 | # NIDM serializations (i.e. TURTLE, JSON-LD RDF) 16 | # 17 | # 18 | #************************************************************************************** 19 | # Development environment: Python - PyCharm IDE 20 | # 21 | #************************************************************************************** 22 | # System requirements: Python 3.X 23 | # Libraries: PyNIDM, 24 | #************************************************************************************** 25 | # Start date: June 6, 2019 26 | # Update history: 27 | # DATE MODIFICATION Who 28 | # 29 | # 30 | #************************************************************************************** 31 | # Programmer comments: 32 | # 33 | # 34 | #************************************************************************************** 35 | #************************************************************************************** 36 | 37 | 38 | from nidm.core import Constants 39 | from nidm.experiment.Core import getUUID 40 | from nidm.experiment.Core import Core 41 | from prov.model import QualifiedName,PROV_ROLE, ProvDocument, PROV_ATTR_USED_ENTITY,PROV_ACTIVITY,PROV_AGENT,PROV_ROLE 42 | 43 | from prov.model import Namespace as provNamespace 44 | 45 | # standard library 46 | from pickle import dumps 47 | import os 48 | from os.path import join,dirname 49 | from socket import getfqdn 50 | import glob 51 | 52 | import prov.model as prov 53 | import json 54 | import urllib.request as ur 55 | from urllib.parse import urlparse 56 | import re 57 | import pandas as pd 58 | import warnings 59 | 60 | from pathlib import Path 61 | 62 | from rdflib import Graph, RDF, URIRef, util, term,Namespace,Literal,BNode,XSD 63 | from rdflib.plugins.sparql import prepareQuery 64 | from ants_seg_to_nidm.antsutils import read_ants_stats, create_cde_graph, convert_stats_to_nidm 65 | from io import StringIO 66 | 67 | import tempfile 68 | 69 | # cde_file = Path(os.path.dirname(__file__)) / "mapping_data" / "ants-cdes.ttl" 70 | 71 | 72 | 73 | def url_validator(url): 74 | ''' 75 | Tests whether url is a valide url 76 | :param url: url to test 77 | :return: True for valid url else False 78 | ''' 79 | try: 80 | result = urlparse(url) 81 | return all([result.scheme, result.netloc, result.path]) 82 | 83 | except: 84 | return False 85 | 86 | def add_seg_data(nidmdoc,subjid,stats_entity_id, add_to_nidm=False, forceagent=False): 87 | ''' 88 | WIP: this function creates a NIDM file of brain volume data and if user supplied a NIDM-E file it will add brain volumes to the 89 | NIDM-E file for the matching subject ID 90 | :param nidmdoc: 91 | :param header: 92 | :param add_to_nidm: 93 | :return: 94 | ''' 95 | 96 | 97 | #for each of the header items create a dictionary where namespaces are freesurfer 98 | niiri=Namespace("http://iri.nidash.org/") 99 | nidmdoc.bind("niiri",niiri) 100 | # add namespace for subject id 101 | ndar = Namespace(Constants.NDAR) 102 | nidmdoc.bind("ndar",ndar) 103 | dct = Namespace(Constants.DCT) 104 | nidmdoc.bind("dct",dct) 105 | sio = Namespace(Constants.SIO) 106 | nidmdoc.bind("sio",sio) 107 | 108 | 109 | software_activity = niiri[getUUID()] 110 | nidmdoc.add((software_activity,RDF.type,Constants.PROV['Activity'])) 111 | nidmdoc.add((software_activity,Constants.DCT["description"],Literal("ANTS segmentation statistics"))) 112 | fs = Namespace(Constants.ANTS) 113 | 114 | 115 | #create software agent and associate with software activity 116 | #search and see if a software agent exists for this software, if so use it, if not create it 117 | for software_uid in nidmdoc.subjects(predicate=Constants.NIDM_NEUROIMAGING_ANALYSIS_SOFTWARE,object=URIRef(Constants.ANTS) ): 118 | software_agent = software_uid 119 | break 120 | else: 121 | software_agent = niiri[getUUID()] 122 | nidmdoc.add((software_agent,RDF.type,Constants.PROV['Agent'])) 123 | neuro_soft=Namespace(Constants.NIDM_NEUROIMAGING_ANALYSIS_SOFTWARE) 124 | nidmdoc.add((software_agent,Constants.NIDM_NEUROIMAGING_ANALYSIS_SOFTWARE,URIRef(Constants.ANTS))) 125 | nidmdoc.add((software_agent,RDF.type,Constants.PROV["SoftwareAgent"])) 126 | association_bnode = BNode() 127 | nidmdoc.add((software_activity,Constants.PROV['qualifiedAssociation'],association_bnode)) 128 | nidmdoc.add((association_bnode,RDF.type,Constants.PROV['Association'])) 129 | nidmdoc.add((association_bnode,Constants.PROV['hadRole'],Constants.NIDM_NEUROIMAGING_ANALYSIS_SOFTWARE)) 130 | nidmdoc.add((association_bnode,Constants.PROV['agent'],software_agent)) 131 | 132 | if not add_to_nidm: 133 | 134 | # create a new agent for subjid 135 | participant_agent = niiri[getUUID()] 136 | nidmdoc.add((participant_agent,RDF.type,Constants.PROV['Agent'])) 137 | nidmdoc.add((participant_agent,URIRef(Constants.NIDM_SUBJECTID.uri),Literal(subjid, datatype=XSD.string))) 138 | 139 | 140 | else: 141 | # query to get agent id for subjid 142 | #find subject ids and sessions in NIDM document 143 | query = """ 144 | PREFIX ndar: 145 | PREFIX rdf: 146 | PREFIX prov: 147 | PREFIX xsd: 148 | 149 | select distinct ?agent 150 | where { 151 | 152 | ?agent rdf:type prov:Agent ; 153 | ndar:src_subject_id \"%s\"^^xsd:string . 154 | 155 | }""" % subjid 156 | #print(query) 157 | qres = nidmdoc.query(query) 158 | if len(qres) == 0: 159 | print('Subject ID (%s) was not found in existing NIDM file...' %subjid) 160 | # Initialize qres2 to empty result set 161 | qres2 = [] 162 | ############################################################################## 163 | # Try stripping 'sub-' prefix (common in BIDS) 164 | subjid_stripped = subjid 165 | if subjid.startswith('sub-'): 166 | subjid_stripped = subjid[4:] # Remove 'sub-' prefix 167 | print('Trying to find subject ID without "sub-" prefix: %s....' % subjid_stripped) 168 | query = """ 169 | PREFIX ndar: 170 | PREFIX rdf: 171 | PREFIX prov: 172 | PREFIX xsd: 173 | 174 | select distinct ?agent 175 | where { 176 | 177 | ?agent rdf:type prov:Agent ; 178 | ndar:src_subject_id \"%s\"^^xsd:string . 179 | 180 | }""" % subjid_stripped 181 | qres2 = nidmdoc.query(query) 182 | if len(qres2) > 0: 183 | for row in qres2: 184 | print('Found subject ID after stripping "sub-" prefix: %s in NIDM file (agent: %s)' %(subjid_stripped,row[0])) 185 | participant_agent = row[0] 186 | 187 | # Try stripping leading zeros if still not found 188 | if len(qres2) == 0 and (len(subjid_stripped) - len(subjid_stripped.lstrip('0'))) != 0: 189 | print('Trying to find subject ID without leading zeros....') 190 | query = """ 191 | PREFIX ndar: 192 | PREFIX rdf: 193 | PREFIX prov: 194 | PREFIX xsd: 195 | 196 | select distinct ?agent 197 | where { 198 | 199 | ?agent rdf:type prov:Agent ; 200 | ndar:src_subject_id \"%s\"^^xsd:string . 201 | 202 | }""" % subjid_stripped.lstrip('0') 203 | #print(query) 204 | qres2 = nidmdoc.query(query) 205 | if len(qres2) == 0: 206 | print("Still can't find subject id after stripping leading zeros...") 207 | else: 208 | for row in qres2: 209 | print('Found subject ID after stripping zeros: %s in NIDM file (agent: %s)' %(subjid_stripped.lstrip('0'),row[0])) 210 | participant_agent = row[0] 211 | ####################################################################################### 212 | if (forceagent is not False) and (len(qres2)==0): 213 | print('Explicitly creating agent in existing NIDM file...') 214 | participant_agent = niiri[getUUID()] 215 | nidmdoc.add((participant_agent,RDF.type,Constants.PROV['Agent'])) 216 | nidmdoc.add((participant_agent,URIRef(Constants.NIDM_SUBJECTID.uri),Literal(subjid, datatype=XSD.string))) 217 | elif (forceagent is False) and (len(qres)==0) and (len(qres2)==0): 218 | print('Not explicitly adding agent to NIDM file, no output written') 219 | exit() 220 | else: 221 | for row in qres: 222 | print('Found subject ID: %s in NIDM file (agent: %s)' %(subjid,row[0])) 223 | participant_agent = row[0] 224 | 225 | 226 | if add_to_nidm: 227 | query_acq = prepareQuery( 228 | """ 229 | PREFIX prov: 230 | PREFIX nidm: 231 | SELECT DISTINCT ?acqObj 232 | WHERE { 233 | ?acqObj a nidm:AcquisitionObject ; 234 | prov:wasGeneratedBy/prov:qualifiedAssociation/prov:agent ?subject ; 235 | nidm:hadAcquisitionModality nidm:MagneticResonanceImaging ; 236 | nidm:hadImageUsageType nidm:Anatomical . 237 | } 238 | """ 239 | ) 240 | results = list( 241 | nidmdoc.query(query_acq, initBindings={'subject': participant_agent}) 242 | ) 243 | if not results: 244 | warnings.warn( 245 | f"No anatomical MRI AcquisitionObject found for subject {subjid}" 246 | ) 247 | acquisition_obj = None 248 | else: 249 | candidates = sorted({row.acqObj for row in results}, key=str) 250 | if len(candidates) > 1: 251 | warnings.warn( 252 | f"Multiple anatomical AcquisitionObjects found for subject {subjid}; using {candidates[0]}" 253 | ) 254 | acquisition_obj = candidates[0] 255 | 256 | if acquisition_obj: 257 | nidmdoc.add((software_activity, Constants.PROV['used'], acquisition_obj)) 258 | 259 | #create a blank node and qualified association with prov:Agent for participant 260 | association_bnode = BNode() 261 | nidmdoc.add((software_activity,Constants.PROV['qualifiedAssociation'],association_bnode)) 262 | nidmdoc.add((association_bnode,RDF.type,Constants.PROV['Association'])) 263 | nidmdoc.add((association_bnode,Constants.PROV['hadRole'],Constants.SIO["Subject"])) 264 | nidmdoc.add((association_bnode,Constants.PROV['agent'],participant_agent)) 265 | 266 | # add association between ANTSStatsCollection and computation activity 267 | nidmdoc.add((URIRef(stats_entity_id.uri),Constants.PROV['wasGeneratedBy'],software_activity)) 268 | 269 | # get project uuid from NIDM doc and make association with software_activity 270 | query = """ 271 | prefix nidm: 272 | PREFIX rdf: 273 | 274 | select distinct ?project 275 | where { 276 | 277 | ?project rdf:type nidm:Project . 278 | 279 | }""" 280 | 281 | qres = nidmdoc.query(query) 282 | for row in qres: 283 | nidmdoc.add((software_activity, Constants.DCT["isPartOf"], row['project'])) 284 | 285 | 286 | def test_connection(remote=False): 287 | """helper function to test whether an internet connection exists. 288 | Used for preventing timeout errors when scraping interlex.""" 289 | import socket 290 | remote_server = 'www.google.com' if not remote else remote # TODO: maybe improve for China 291 | try: 292 | # does the host name resolve? 293 | host = socket.gethostbyname(remote_server) 294 | # can we establish a connection to the host name? 295 | con = socket.create_connection((host, 80), 2) 296 | return True 297 | except: 298 | print("Can't connect to a server...") 299 | pass 300 | return False 301 | 302 | 303 | 304 | def main(): 305 | 306 | import argparse 307 | parser = argparse.ArgumentParser(prog='ants_seg_to_nidm.py', 308 | description='''This program will load in the ReproNim-style ANTS brain 309 | segmentation outputs, augment the ANTS anatomical region designations with common data element 310 | anatomical designations, and save the statistics + region designations out as 311 | NIDM serializations (i.e. TURTLE, JSON-LD RDF)''',formatter_class=argparse.RawDescriptionHelpFormatter) 312 | 313 | parser.add_argument('-f', '--ants_stats', dest='stats_files',required=True, type=str,help='''A comma separated string of paths to: ANTS \"lablestats\" CSV 314 | file (col 1=Label number, col 2=VolumeinVoxels), ANTS \"brainvols\" CSV file (col 2=BVOL, col 3=GVol, col 4=WVol), 315 | MRI or Image file to extract voxel sizes OR A comma separated string of path \n OR URLs to a ANTS segmentation files and 316 | an image file for voxel sizes: /..../antslabelstats,/..../antsbrainvols,/..../mri_file. \n Note, currently this is tested 317 | on ReproNim data''') 318 | parser.add_argument('-subjid','--subjid',dest='subjid',required=False, help='If a path to a URL or a stats file' 319 | 'is supplied via the -f/--seg_file parameters then -subjid parameter must be set with' 320 | 'the subject identifier to be used in the NIDM files') 321 | parser.add_argument('-o', '--output', dest='output_dir', type=str, 322 | help='Output filename with full path', required=True) 323 | parser.add_argument('-j', '--jsonld', dest='jsonld', action='store_true', default = False, 324 | help='If flag set then NIDM file will be written as JSONLD instead of TURTLE') 325 | parser.add_argument('-add_de', '--add_de', dest='add_de', action='store_true', default = None, 326 | help='If flag set then data element data dictionary will be added to nidm file else it will written to a' 327 | 'separate file as ants_cde.ttl in the output directory (or same directory as nidm file if -n paramemter' 328 | 'is used.') 329 | parser.add_argument('-n','--nidm', dest='nidm_file', type=str, required=False, 330 | help='Optional NIDM file to add segmentation data to.') 331 | parser.add_argument('-forcenidm','--forcenidm', action='store_true',required=False, 332 | help='If adding to NIDM file this parameter forces the data to be added even if the participant' 333 | 'doesnt currently exist in the NIDM file.') 334 | parser.add_argument('--collect-missing', action='store_true', required=False, 335 | help='Collect and report all missing labels instead of stopping at the first error. ' 336 | 'Useful for identifying all labels that need to be filtered in wrapper.py.') 337 | args = parser.parse_args() 338 | 339 | # test whether user supplied stats file directly and if so they the subject id must also be supplied so we 340 | # know which subject the stats file is for 341 | if (args.stats_files and (args.subjid is None)): 342 | parser.error("-f/--ants_urls and -d/--ants_stats requires -subjid/--subjid to be set!") 343 | 344 | # if output_dir doesn't exist then create it 345 | out_path = os.path.dirname(args.output_dir) 346 | if not os.path.exists(out_path): 347 | os.makedirs(out_path) 348 | 349 | 350 | # WIP: ANTS URL forms as comma spearated string in args.stats_urls: 351 | # 1: https://fcp-indi.s3.amazonaws.com/data/Projects/ABIDE/Outputs/mindboggle_swf/mindboggle/ants_subjects/sub-0050002/antslabelstats.csv 352 | # 2: https://fcp-indi.s3.amazonaws.com/data/Projects/ABIDE/Outputs/mindboggle_swf/mindboggle/ants_subjects/sub-0050002/antsbrainvols.csv 353 | # 3: https://fcp-indi.s3.amazonaws.com/data/Projects/ABIDE/Outputs/mindboggle_swf/mindboggle/ants_subjects/sub-0050002/antsBrainSegmentation.nii.gz 354 | 355 | # split input string argument into the 3 URLs above 356 | url_list = args.stats_files.split(',') 357 | 358 | 359 | # check url 1, the labelstats.csv 360 | url = url_validator(url_list[0]) 361 | # if user supplied a url as a segfile 362 | if url is not False: 363 | 364 | #try to open the url and get the pointed to file...for labelstats file 365 | try: 366 | #open url and get file 367 | opener = ur.urlopen(url_list[0]) 368 | # write temporary file to disk and use for stats 369 | temp = tempfile.NamedTemporaryFile(delete=False) 370 | temp.write(opener.read()) 371 | temp.close() 372 | labelstats= temp.name 373 | except: 374 | print("ERROR! Can't open url: %s" %url) 375 | exit() 376 | 377 | #try to open the url and get the pointed to file...for brainvols file 378 | try: 379 | #open url and get file 380 | opener = ur.urlopen(url_list[1]) 381 | # write temporary file to disk and use for stats 382 | temp = tempfile.NamedTemporaryFile(delete=False) 383 | temp.write(opener.read()) 384 | temp.close() 385 | brainvol= temp.name 386 | except: 387 | print("ERROR! Can't open url: %s" %url) 388 | exit() 389 | 390 | #try to open the url and get the pointed to file...for brainvols file 391 | try: 392 | #open url and get file 393 | opener = ur.urlopen(url_list[2]) 394 | # write temporary file to disk and use for stats 395 | temp = tempfile.NamedTemporaryFile(delete=False, suffix=".nii.gz") 396 | temp.write(opener.read()) 397 | temp.close() 398 | imagefile= temp.name 399 | 400 | except: 401 | print("ERROR! Can't open url: %s" %url) 402 | exit() 403 | 404 | # else these must be a paths to the stats files 405 | else: 406 | 407 | # split input string argument into the 3 URLs above 408 | file_list = args.stats_files.split(',') 409 | 410 | labelstats=file_list[0] 411 | brainvol=file_list[1] 412 | imagefile=file_list[2] 413 | 414 | 415 | measures = read_ants_stats(labelstats, brainvol, imagefile, 416 | force_error=not args.collect_missing, 417 | collect_missing=args.collect_missing) 418 | [e,doc] = convert_stats_to_nidm(measures) 419 | g = create_cde_graph() 420 | 421 | # convert nidm stats graph to rdflib 422 | g2 = Graph() 423 | g2.parse(source=StringIO(doc.serialize(format='rdf',rdf_format='turtle')),format='turtle') 424 | 425 | 426 | # for measures we need to create NIDM structures using anatomy mappings 427 | # If user has added an existing NIDM file as a command line parameter then add to existing file for subjects who exist in the NIDM file 428 | if args.nidm_file is None: 429 | 430 | print("Creating NIDM file...") 431 | 432 | # name output NIDM file by subjid 433 | # args.subjid + "_" + [everything after the last / in the first supplied URL] 434 | output_filename = args.subjid + "_NIDM" 435 | # If user did not choose to add this data to an existing NIDM file then create a new one for the CSV data 436 | 437 | if args.add_de is not None: 438 | nidmdoc = g+g2 439 | else: 440 | nidmdoc = g2 441 | 442 | # print(nidmdoc.serializeTurtle()) 443 | 444 | # add seg data to new NIDM file 445 | add_seg_data(nidmdoc=nidmdoc,subjid=args.subjid,stats_entity_id=e.identifier) 446 | 447 | #serialize NIDM file 448 | print("Writing NIDM file...") 449 | if args.jsonld is not False: 450 | # nidmdoc.serialize(destination=join(args.output_dir,output_filename +'.json'),format='jsonld') 451 | nidmdoc.serialize(destination=join(args.output_dir),format='jsonld') 452 | else: 453 | # nidmdoc.serialize(destination=join(args.output_dir,output_filename +'.ttl'),format='turtle') 454 | nidmdoc.serialize(destination=join(args.output_dir),format='turtle') 455 | # added to support separate cde serialization 456 | if args.add_de is None: 457 | # serialize cde graph 458 | g.serialize(destination=join(dirname(args.output_dir),"ants_cde.ttl"),format='turtle') 459 | 460 | #nidmdoc.save_DotGraph(join(args.output_dir,output_filename + ".pdf"), format="pdf") 461 | # we adding these data to an existing NIDM file 462 | else: 463 | #read in NIDM file with rdflib 464 | print("Reading in NIDM graph....") 465 | g1 = Graph() 466 | g1.parse(args.nidm_file,format=util.guess_format(args.nidm_file)) 467 | 468 | if args.add_de is not None: 469 | print("Combining graphs...") 470 | nidmdoc = g + g1 + g2 471 | else: 472 | nidmdoc = g1 + g2 473 | 474 | if args.forcenidm is not False: 475 | add_seg_data(nidmdoc=nidmdoc,subjid=args.subjid,stats_entity_id=e.identifier,add_to_nidm=True, forceagent=True) 476 | else: 477 | add_seg_data(nidmdoc=nidmdoc,subjid=args.subjid,stats_entity_id=e.identifier,add_to_nidm=True) 478 | 479 | 480 | #serialize NIDM file 481 | print("Writing Augmented NIDM file...") 482 | if args.jsonld is not False: 483 | nidmdoc.serialize(destination=args.output_dir,format='jsonld') 484 | else: 485 | nidmdoc.serialize(destination=args.output_dir,format='turtle') 486 | 487 | if args.add_de is None: 488 | # serialize cde graph 489 | g.serialize(destination=join(dirname(args.output_dir),"ants_cde.ttl"),format='turtle') 490 | 491 | 492 | if __name__ == "__main__": 493 | main() 494 | -------------------------------------------------------------------------------- /examples/antslabelstats.csv: -------------------------------------------------------------------------------- 1 | Label,VolumeInVoxels,SurfaceAreaInMillimetersSquared,Eccentricity,Elongation,Orientation,Centroid_x,Centroid_y,Centroid_z,AxesLength_x,AxesLength_y,AxesLength_z,BoundingBoxLower_x,BoundingBoxUpper_x,BoundingBoxLower_y,BoundingBoxUpper_y,BoundingBoxLower_z,BoundingBoxUpper_z,IntegratedIntensity,WeightedCentroid_x,WeightedCentroid_y,WeightedCentroid_z 2 | 4,6363,4064.9674378927,0.986985273215982,6.21849298477173,1.86570927641919,100.878202105925,115.772277227723,140.491906333491,15.2026977539062,25.8577213287354,94.5378723144531,90,119,61,156,111,156,165.091890454292,68.513359250263,50.9776705375487,71.7539787533035 3 | 5,153,332.386142316899,0.995838039433697,10.9720649719238,1.68658260652003,118.019607843137,118.418300653595,115.549019607843,3.81268930435181,17.36305809021,41.8330764770508,108,122,101,132,111,120,92.8618567585945,84.5772448898735,82.8434867504197,84.0818854214581 4 | 6,58040,17029.6493201508,0.668376664161374,1.34440588951111,1.13446621786425,108.396002756719,89.5462784286699,81.7906271536871,43.9647903442383,48.3249816894531,59.1065254211426,85,139,57,118,59,115,4105.52336549759,96.0189395858479,81.9561770924715,86.0158300322326 5 | 7,14070,7542.97322193835,0.931571857156738,2.75059843063354,1.7155179563807,102.963965884861,96.8487562189055,86.4110163468372,17.4095020294189,36.8279762268066,47.8865509033203,86,129,68,124,69,106,0,-nan,-nan,-nan 6 | 10,7501,2414.74542560549,0.860656473571156,1.96391868591309,2.06286695383535,98.901346487135,113.333822157046,132.488334888682,16.9958229064941,19.8680973052979,33.3784141540527,88,111,100,131,118,146,14.3926588594913,22.6504361134786,21.4692784020395,25.0127515363567 7 | 11,3565,1924.38150136388,0.971969819244374,4.25340700149536,1.63031142389035,101.367741935484,136.452734922861,147.203927068724,10.5998620986938,16.9101104736328,45.0855255126953,94,107,104,154,135,156,0,-nan,-nan,-nan 8 | 12,4752,2172.15539585161,0.956610234733219,3.43205451965332,1.81653988634821,111.839225589226,132.29819023569,136.345328282828,10.9160118103027,20.9923152923584,37.4643478393555,101,118,112,150,121,148,0,-nan,-nan,-nan 9 | 13,1600,880.787569435381,0.914957061602741,2.47800040245056,2.15462602940825,106.5825,128.940625,132.598125,9.09912490844727,11.8144292831421,22.5476341247559,99,113,118,139,125,141,0,-nan,-nan,-nan 10 | 14,683,730.911640292165,0.994027244514286,9.16319847106934,1.50907845473848,88.601756954612,125.196193265007,128.581259150805,3.75594210624695,12.6779699325562,34.4164428710938,86,91,109,142,122,137,0,-nan,-nan,-nan 11 | 15,1388,1238.66365676223,0.940502628551654,2.94302558898926,1.75588337314062,86.614553314121,105.828530259366,94.2514409221902,11.4049024581909,12.8020277023315,33.5649185180664,74,97,96,112,71,122,0,-nan,-nan,-nan 12 | 16,17116,5147.70863563719,0.895847703428773,2.25042128562927,1.94904700674087,87.3317363870063,117.495793409675,98.2971488665576,22.7672424316406,26.9583282470703,51.2358894348145,74,102,102,133,68,125,2.70179033279419,56.2589917341224,94.0117361872834,79.2067383625144 13 | 17,3263,1944.90845293388,0.98314286769475,5.46929264068604,1.58539476226385,112.21820410665,116.65767698437,115.308611707018,7.78140354156494,20.3553066253662,42.5587730407715,99,122,95,134,109,125,7874.04375645518,90.2432119985952,95.5361721711664,92.0303496416219 14 | 18,1076,719.130369884634,0.918654979581103,2.53125596046448,0.186415683896277,108.808550185874,132.960037174721,117.256505576208,6.75779104232788,14.7722272872925,17.1056995391846,99,118,125,141,111,123,4550.14704728127,96.9041209917505,118.300352583468,103.721483085254 15 | 24,1068,820.226077252583,0.866186998388527,2.00112056732178,1.42939219847361,87.5702247191011,108.056179775281,133.154494382022,10.9372043609619,11.4342794418335,21.8866653442383,80,94,103,126,123,142,0,-nan,-nan,-nan 16 | 26,513,461.198857324222,0.94894471209181,3.17015051841736,1.33903362938981,98.6003898635478,144.803118908382,134.173489278752,4.9215874671936,11.2563352584839,15.6021728515625,94,104,140,151,127,141,0,-nan,-nan,-nan 17 | 28,5077,2232.3086605954,0.813961559589945,1.72141110897064,1.98680590620457,96.9712428599567,122.599960606657,120.302540870593,16.4900722503662,20.017692565918,28.386194229126,88,113,109,141,109,133,85.13801664114,75.3247521260807,92.2854479112141,87.246570839315 18 | 30,9,25.2068090537163,0.967873683333157,3.97714066505432,2.20927691856101,114.777777777778,131,126.888888888889,1.72673273086548,2.1034038066864,6.86745882034302,113,116,129,133,126,128,0,-nan,-nan,-nan 19 | 43,8224,4688.03727903168,0.986163365051659,6.03222179412842,1.1934848332508,75.8471546692607,114.678137159533,140.992217898833,16.4466094970703,26.0776195526123,99.2095947265625,55,90,58,158,113,157,277.325990557671,33.9275809709706,43.0756597172085,66.9320605785053 20 | 44,217,394.029733916127,0.982971092582274,5.44187307357788,1.39570318941421,62.9400921658986,127.230414746544,116.944700460829,5.73283243179321,17.8607349395752,31.1973457336426,54,69,104,137,110,121,87.0638442635536,45.3115760436441,90.0488608826793,83.5478844465063 21 | 45,56361,16016.312545661,0.630810030289292,1.28876388072968,1.91324128590891,62.1824311137134,91.0232785081883,83.3419385745462,44.1496467590332,48.7265663146973,56.8984718322754,34,86,57,119,62,114,2545.06971919537,54.5434959808832,79.545954467607,87.1119554516932 22 | 46,13973,7171.23922659445,0.926550420116071,2.65836811065674,1.24342860899942,68.009017390682,98.5353896800973,87.9249266442425,17.6885643005371,35.4855918884277,47.0227165222168,41,86,71,125,71,107,0,-nan,-nan,-nan 23 | 49,7395,2389.40927755596,0.872600596472088,2.04735779762268,1.00147612718719,77.5291413116971,114.482623394185,133.374036511156,16.5020847320557,19.9131546020508,33.7856712341309,64,88,101,131,119,147,15.1947745978832,0,0,0 24 | 50,3596,1951.61902119494,0.976428343111195,4.63302278518677,1.41687482689295,77.0856507230256,137.589822024472,148.121802002225,10.0169095993042,16.8800868988037,46.4085693359375,70,85,105,156,136,156,0,-nan,-nan,-nan 25 | 51,4803,2171.48770058673,0.955072131873462,3.37412166595459,1.2223808965848,66.3870497605663,134.678742452634,136.805538205288,11.0588407516479,20.981616973877,37.3138732910156,59,78,114,153,123,148,0,-nan,-nan,-nan 26 | 52,1468,845.484214078233,0.919714252910586,2.54719638824463,0.924864278552572,70.9489100817439,130.612397820163,133.257493188011,8.64270782470703,11.6177206039429,22.0146751403809,64,79,120,141,126,141,0,-nan,-nan,-nan 27 | 53,3142,1956.50520110414,0.986904410002694,6.19939041137695,1.42152636918919,65.1508593252705,118.926479949077,116.939847231063,7.37395906448364,20.9697704315186,45.7140502929688,55,80,97,137,110,127,7269.72518774867,52.121089891892,97.5800297369542,92.5772271466594 28 | 54,1036,691.174115793947,0.934958971148888,2.81884026527405,2.75029912273132,70.453667953668,135.15250965251,117.694980694981,6.46852970123291,13.619553565979,18.2337512969971,62,80,127,141,111,124,4896.67552518845,63.0919893325198,122.152263698743,105.714376486091 29 | 58,491,451.020500927223,0.955222160243699,3.37963938713074,1.80438750023206,80.9837067209776,145.951120162933,134.989816700611,4.74200582504272,10.7442321777344,16.0262699127197,76,85,140,153,129,142,0,-nan,-nan,-nan 30 | 60,4825,2188.20449297762,0.842487488097185,1.85626602172852,1.01500881960241,80.0735751295337,123.043937823834,120.836476683938,15.9827222824097,19.2475032806396,29.6681842803955,64,90,110,141,110,133,53.4174571186304,49.6466912326132,86.2452136156293,81.6399775510657 31 | 62,15,37.8964810043316,0.968525918558182,4.01747226715088,0.877360073804956,64,134.533333333333,127.6,1.97137415409088,2.22345948219299,7.91994094848633,62,66,132,137,127,129,0,-nan,-nan,-nan 32 | 85,21,51.4086040676642,0.985675378659203,5.92931175231934,3.05045766714017,88.6666666666667,142.190476190476,121.857142857143,1.66584324836731,2.76508474349976,9.87730407714844,85,93,141,143,121,122,0,-nan,-nan,-nan 33 | 91,59,123.654442523795,0.991865193496449,7.85590887069702,3.1228409390119,98.0169491525424,140.796610169492,124.847457627119,2.45113706588745,4.87056875228882,19.2559089660645,92,110,139,142,122,128,1.01217257976532,99.7853548091746,140.29228101884,121.520778628995 34 | 92,221,329.795296439442,0.985150538521911,5.82435607910156,3.11401603036144,79.0045248868778,140.864253393665,126.076923076923,3.73126006126404,6.76475191116333,21.7321872711182,66,87,139,144,122,131,13.856135904789,53.6224532658635,103.492056505045,89.1301881337031 35 | 630,5209,2419.0882483657,0.821233432374499,1.7525646686554,1.43015398611954,86.2683816471492,90.3864465348435,106.025340756383,15.2842111587524,21.6236610412598,26.7865676879883,77,97,76,104,93,118,5.13467574119568,67.3849756906809,64.6584159806534,84.9128595408581 36 | 631,1773,1216.97297242802,0.895631095316065,2.24821329116821,1.35084747777025,84.4760293288212,78.0885504794134,90.941342357586,9.20803546905518,17.1922931671143,20.7016277313232,78,90,65,89,77,101,0,-nan,-nan,-nan 37 | 632,3214,1576.70154958593,0.894456657926464,2.23636269569397,1.51386328623944,84.9495955196017,90.3973242065961,81.3995021779714,12.5086765289307,15.2285604476929,27.9739379882812,76,94,79,105,67,95,0,-nan,-nan,-nan 38 | 1002,4297,3588.57193278587,0.956811610624975,3.43986940383911,1.48856225868439,95.8047474982546,138.343030020945,169.131719804515,12.124321937561,19.9125671386719,41.7060852050781,90,104,116,157,158,180,15826.0884519815,82.6510608713439,120.313683686103,147.387587721206 39 | 1003,8235,7847.12734553393,0.750995963867328,1.51444756984711,1.73357104313801,122.34948391014,124.521797207043,176.836672738312,24.1571445465088,34.2867393493652,36.5847282409668,107,140,101,146,156,192,22076.5620753765,100.129132083728,101.792661027891,144.518018208937 40 | 1005,3771,4485.61454987704,0.847061475091114,1.88148546218872,1.16722752771842,94.0861840360647,55.4616812516574,124.096791302042,19.9673404693604,30.7138805389404,37.5682601928711,85,109,40,76,97,139,9343.01773917675,75.1316137458016,44.0750527822807,99.0886484265174 41 | 1006,1706,1530.52671332194,0.847381103716436,1.88329172134399,1.43486470691089,110.885697538101,137.538100820633,105.831184056272,11.9723482131958,16.9790172576904,22.5474243164062,103,120,126,149,97,115,8375.69620428234,98.9230005233926,123.945278658653,94.5080839483271 42 | 1007,9844,8398.75860735696,0.978879481703689,4.89145517349243,1.47612558210505,120.661824461601,97.6081877285656,100.726229175132,15.6479825973511,26.0829906463623,76.5414047241211,106,137,60,141,90,113,41778.6826719046,106.745826215317,88.5276835807756,88.7516016031189 43 | 1008,9694,9944.88911041743,0.852298658925603,1.91184318065643,0.948768857762502,126.679286156385,62.1857850216629,130.638332989478,22.2059783935547,35.0999412536621,42.4543495178223,108,143,43,86,111,153,32007.4588102102,107.737481455416,52.1944591073591,109.65434715737 44 | 1009,9288,8762.68371981686,0.98632038744242,6.06650304794312,1.78195580456786,133.091192937123,118.409453057709,99.655684754522,15.5287532806396,30.1176280975342,94.2052307128906,108,151,71,158,90,111,38572.7641689181,116.367185414648,104.931422137008,87.4392352394018 45 | 1010,2270,2162.31473413381,0.92772221801088,2.67901635169983,0.643820653566352,94.4290748898678,86.352422907489,131.381057268722,15.1177673339844,15.7031707763672,40.5007476806641,88,110,78,99,115,148,8398.36676442623,80.9639563349618,74.0441585183002,114.288411892854 46 | 1011,8420,9553.50312714369,0.939019753220392,2.90813302993774,0.754713972767631,114.935985748219,55.2916864608076,104.396555819477,18.2921905517578,36.0816078186035,53.1961250305176,90,138,38,80,85,129,24420.3043160439,96.402115613823,46.4939742480628,86.606046043845 47 | 1012,8175,7662.46380026438,0.977741178050208,4.76611137390137,1.6254113346958,112.154617737003,167.346177370031,133.621529051988,14.190242767334,29.2423267364502,67.6322784423828,99,133,142,197,114,157,27570.2934284955,95.4952476957976,142.395183793814,113.804011848387 48 | 1013,6399,6853.87924965908,0.94671910659544,3.10500717163086,1.11956696729745,98.5477418346617,76.125332083138,106.003594311611,16.490213394165,27.4308643341064,51.2022323608398,84,118,50,100,87,121,19515.3659000993,82.984403586907,65.0255806883715,88.8740702520559 49 | 1014,3846,4168.36382895027,0.991879897470061,7.86298942565918,1.52367519509024,96.5535621424857,172.003900156006,137.378055122205,8.89144325256348,19.8124694824219,69.9133224487305,92,104,142,196,119,162,13533.1023395061,82.9553321800246,147.856267528456,118.254629267689 50 | 1015,12859,11375.5341877743,0.97748262961561,4.73897933959961,1.59511266434368,141.281748191928,116.379111906058,111.274204837079,20.9439945220947,27.9264755249023,99.2531585693359,122,156,69,161,97,126,51169.582896471,124.181879943333,103.178191049201,97.3057570172883 51 | 1016,2012,1840.32997587797,0.979507871662503,4.96509838104248,1.22121105515501,109.174453280318,112.388170974155,107.729125248509,7.70219659805298,18.5140380859375,38.2421646118164,96,125,97,128,98,118,7946.09685462713,96.0773589810244,97.5126548512678,93.5979026692722 52 | 1017,4375,4457.96878819421,0.952178118561069,3.27285647392273,1.57112963550014,94.2427428571429,89.52,168.713142857143,13.7076578140259,30.6651096343994,44.8631973266602,88,105,62,110,150,190,10522.6049727798,74.9693637688277,73.6228340799671,135.683892315007 53 | 1018,4192,3846.56113178604,0.878160183083753,2.09044647216797,2.72750908434359,133.859255725191,138.762643129771,148.562261450382,15.7068347930908,27.7031059265137,32.8342971801758,117,147,125,146,130,164,10760.5907368064,106.114434414303,109.767672508894,117.699579045219 54 | 1019,1814,1990.54483856233,0.911549663638959,2.43196582794189,0.841785111008165,128.117420066152,162.220507166483,135.541896361632,11.5280284881592,20.9160270690918,28.0357723236084,114,139,152,176,127,148,5145.41998447478,104.700102542745,132.541367285418,110.006569280618 55 | 1020,4972,4951.35400908038,0.619304712325762,1.27364087104797,1.22707628006345,133.344931617056,155.582260659694,147.758849557522,24.4537830352783,25.505578994751,31.145336151123,115,145,142,174,134,164,14506.0514675379,109.251163457301,128.730551120604,120.748640932355 56 | 1021,1850,2477.71768902972,0.953977014840762,3.3346700668335,1.34011648252522,95.8864864864865,61.5967567567568,111.841081081081,10.7457590103149,17.4490222930908,35.8335609436035,88,111,44,74,96,122,4560.98547312617,76.5178933492178,49.4219947263937,89.971345538782 57 | 1022,8704,10111.5386525611,0.981739953724596,5.25685167312622,0.950225424381753,130.611902573529,98.4579503676471,156.077780330882,17.002124786377,34.2702980041504,89.3776473999023,91,152,60,125,134,179,18757.672013849,101.86983750378,78.299321947608,116.668422306577 58 | 1023,3674,3252.07041888333,0.954236913045523,3.34390354156494,1.57244203351106,93.4774088187262,101.57403375068,157.465160587915,13.4303188323975,18.0293235778809,44.9096908569336,87,104,81,122,143,174,13592.4718926549,80.1228068449059,87.5050549593363,136.441407762055 59 | 1024,13626,13172.4518747492,0.972631131810058,4.30376577377319,0.91090655982441,127.548069866432,109.161896374578,163.529355643622,22.4844532012939,34.1618461608887,96.767822265625,90,150,73,139,130,190,32996.3881415725,100.404413531126,86.1661884870926,128.384960857662 60 | 1025,9116,8775.89698574852,0.917925182264841,2.52045655250549,1.25472551759778,96.0082272926722,68.7867485739359,141.131088196577,20.1613311767578,30.2980880737305,50.8157577514648,87,113,45,86,116,173,27174.6873210669,78.9840182755683,58.1175408327751,116.420658777825 61 | 1026,3686,3398.00403121788,0.95520618152762,3.37905025482178,0.513091550610397,96.8391209983722,164.746337493218,155.955507325014,12.7413902282715,21.1705131530762,43.0537986755371,89,107,151,176,132,177,16451.0126173496,85.5020923463745,146.052286013449,138.361026943684 62 | 1027,11431,11137.3041500969,0.951104659513035,3.23762083053589,1.62233618918851,127.079170676231,160.902195783396,165.686291663022,19.9200687408447,32.5207366943359,64.4936294555664,109,142,129,191,135,188,43216.5528696775,110.231512780893,140.812781120027,142.374219863268 63 | 1028,22103,19814.3008413036,0.969915125019408,4.10773229598999,1.5361287669085,104.24317965887,147.571687101298,179.966701352758,28.0135192871094,31.7928123474121,115.072036743164,90,123,88,196,146,197,69737.5389937162,87.3549610138797,126.154394418661,151.570648355578 64 | 1029,9110,10657.2632698401,0.936236540011969,2.84599995613098,1.02889702279072,112.39407244786,62.2437980241493,151.266630076839,20.2339916229248,39.2134284973145,57.5859375,93,132,40,88,118,173,18218.1968200207,88.1635002556843,48.280080004043,118.676344391231 65 | 1030,15447,13263.7671525161,0.983239382618319,5.4848837852478,1.84461206170033,136.454716126109,123.590082216612,122.093869359746,18.3430690765381,34.8758850097656,100.609603881836,107,154,74,166,103,136,49349.4897320867,114.305903275273,105.465568707106,101.894731380182 66 | 1031,11340,10264.4752108388,0.72786506060831,1.45832026004791,1.48398141779856,138.616578483245,89.0335978835979,142.70176366843,29.6382503509521,31.822660446167,43.2220611572266,117,152,64,110,124,162,35109.4183011055,117.839947233467,75.6162627711894,120.151292847457 67 | 1034,1289,1432.44863263122,0.951320600471748,3.24461436271667,0.920542934737964,128.729247478666,111.190845616757,130.630721489527,8.82971954345703,14.844217300415,28.6490345001221,117,140,98,125,124,135,3313.24240195751,103.597008114229,88.8905682922552,104.75448454811 68 | 1035,6157,4403.96881734986,0.972494908652773,4.29324340820312,1.62421484795998,121.748416436576,133.023388013643,134.760435276921,12.8104095458984,29.110782623291,54.9982070922852,112,130,99,156,120,154,26559.4570388198,108.354624712158,119.777109725936,118.775846787423 69 | 2002,1874,1956.5975503619,0.97171909102432,4.23477935791016,1.5425768283746,85.7705442902882,141.099786552828,165.490394877268,9.58799648284912,14.9094867706299,40.6030502319336,79,90,120,159,157,178,7109.62110710144,74.7274702823934,123.863140768556,144.253256896573 70 | 2003,6702,7092.65654191724,0.81060237313223,1.70765912532806,1.55555642742937,56.1365264100269,124.904058490003,178.24589674724,22.1388378143311,29.4133186340332,37.8055877685547,38,70,100,144,160,192,17054.3227096796,44.7153494736659,100.450309822487,144.062009487222 71 | 2005,3685,4555.81229055883,0.898206547975702,2.27493166923523,2.03445293896437,78.4640434192673,54.3074626865672,127.127001356852,18.3869075775146,29.8554306030273,41.8289566040039,63,87,38,77,103,141,8177.50593137741,61.5342873759606,42.4032709862667,98.0730563487238 72 | 2006,1769,1720.95614483671,0.901798426597157,2.31397438049316,1.37450916378811,70.3578292820803,140.537591859808,106.302430751837,10.1870880126953,19.0657005310059,23.572660446167,59,79,128,153,97,116,8520.54123315215,63.4254309922603,127.36221447737,95.6986155794171 73 | 2007,7567,7181.11376827918,0.978583794665492,4.85793256759644,1.54944067403763,55.8911061186732,101.164794502445,104.488304479979,15.4040393829346,23.0429744720459,74.831787109375,40,69,63,145,93,115,30240.2190709114,48.4012697318031,89.9138327544547,90.8835677927901 74 | 2008,10065,9778.54370851105,0.868873529065657,2.0200629234314,2.10861835929204,43.6235469448584,66.9593641331346,136.128464977645,21.6534156799316,33.8780136108398,43.7412605285645,27,61,47,91,116,157,32184.1506553888,35.7329299229912,56.2451070833806,114.060055190096 75 | 2009,10537,10450.7049300372,0.987286666934689,6.29129457473755,1.30637072448119,43.7162380184113,118.369080383411,104.189237923508,16.5134906768799,31.0990238189697,103.891235351562,26,72,75,162,93,117,44419.9469099045,38.9901861772334,104.646162892273,91.6030135797555 76 | 2010,2003,2019.06347169602,0.942206757439559,2.98478984832764,2.41920407117621,80.7254118821767,86.6160758861707,132.756864702946,14.2022190093994,17.1045761108398,42.3906402587891,68,87,75,102,116,148,6719.30357778072,69.1690730475234,73.0644172148195,113.729494605213 77 | 2011,11299,11983.8507540687,0.939284793227766,2.9142746925354,2.30753973023257,55.0418621116913,56.8912293123285,108.008230816886,19.7921619415283,40.5832366943359,57.6797981262207,35,80,38,82,87,134,34386.6263824105,45.6635374036924,48.3911385052642,90.1187562146295 78 | 2012,8540,7883.39068366698,0.978680679758658,4.86883926391602,1.40582593130542,71.4183840749415,171.08700234192,135.553981264637,13.9107065200806,31.0201740264893,67.7289962768555,51,91,143,198,116,158,28548.3446240127,60.2755789403152,144.490164117271,114.58016368657 79 | 2013,6902,7630.87870761696,0.942536435869421,2.99308562278748,1.83784463618708,73.1066357577514,75.2502173283106,107.672268907563,18.354284286499,26.3317012786865,54.9359436035156,58,85,45,102,88,124,20860.4733907282,61.2960202795936,62.5637767443991,88.9714708403944 80 | 2014,4440,4560.81588288616,0.987527593003356,6.35138320922852,1.46920118027475,87.7972972972973,172.393243243243,138.497072072072,10.2424154281616,19.9448623657227,65.0535049438477,80,93,145,196,120,163,16360.789364621,75.8209749147231,148.635921275203,119.480665415026 81 | 2015,12995,11857.4460526516,0.977167411993408,4.70652866363525,1.43337951315751,34.9002693343594,114.872412466333,117.410080800308,20.781888961792,26.7918872833252,97.8105545043945,23,66,70,163,101,132,47806.7467149496,30.0261803748951,99.7997631683235,101.554285401349 82 | 2016,1448,1646.61665689873,0.987820143398965,6.42673492431641,1.82079671883553,67.5227900552486,114.655386740331,110.374309392265,6.00861072540283,19.8899250030518,38.6157493591309,56,78,99,131,103,118,4448.87970042229,56.2883280427273,94.9821142522443,93.0061111701278 83 | 2017,4109,4248.75072472974,0.952362111134888,3.27901601791382,1.31519879717565,82.3660257970309,88.9849111706011,169.596008761256,12.4412546157837,31.7005558013916,40.7950744628906,70,88,63,108,152,194,9406.30792671442,61.9831930383817,67.7446459295938,127.487746450894 84 | 2018,4713,4701.80016261609,0.862060599797178,1.97314476966858,2.15603050968139,46.6736685762784,141.916401442818,150.448970931466,17.962516784668,24.3069953918457,35.4426460266113,34,63,126,152,133,172,13741.61931777,38.1817446595621,118.73054858172,125.434853065026 85 | 2019,2020,2165.67772509824,0.932692754473588,2.77260279655457,1.77041914984871,54.4158415841584,169.774257425743,137.408415841584,11.7071199417114,20.0586261749268,32.4591941833496,43,66,154,185,130,148,5941.21826130152,44.6258643159019,140.405715345199,113.424380381605 86 | 2020,4931,4916.72801945209,0.584021994625258,1.23192489147186,1.68466597028539,48.2768201176232,160.884810383289,148.212532954776,23.220386505127,26.3643379211426,28.6057720184326,37,64,148,180,135,167,13647.7953277826,38.9750129764308,131.524100185318,120.024513898256 87 | 2021,1215,2004.56978140577,0.925591154808438,2.64183497428894,1.57607903660055,74.9358024691358,60.6707818930041,115.791769547325,11.9000282287598,17.6445293426514,31.4379100799561,63,84,45,74,98,125,2454.82135745883,56.9141210929615,44.3246102896206,85.2192357559397 88 | 2022,7759,10079.2145285686,0.984453647647586,5.6933159828186,2.20377863121745,48.2456502126563,99.0609614641062,159.088800103106,16.6398029327393,34.3023452758789,94.7356567382812,27,86,60,127,136,181,16896.904553473,34.2536704381772,79.1317128985721,115.693675951918 89 | 2023,3226,3114.0905606923,0.958152651660662,3.49335527420044,1.4963276439074,83.6729696218227,102.06385616863,158.355238685679,12.7163438796997,17.6330623626709,44.4227066040039,73,89,81,123,144,174,11396.4243127108,72.7775640184739,87.4554134394922,137.032542589539 90 | 2024,12639,12409.4270069742,0.973290110197546,4.35580587387085,2.15426355089268,50.3828625682412,110.420049054514,165.795869926418,22.316219329834,31.4420471191406,97.2051162719727,29,86,75,142,134,192,32615.4179975688,38.691363700875,90.7371783559725,131.282327895328 91 | 2025,9252,8608.50345293798,0.900220782362789,2.29656076431274,2.03073364622333,78.6324038045828,69.6891482922611,141.608084738435,22.233907699585,31.2898921966553,51.0615196228027,59,88,47,87,117,172,26383.3151848316,65.2257302747673,58.2289977297182,115.089895971289 92 | 2026,1594,1673.24518800075,0.927198103639305,2.66971850395203,1.43149624588014,85.693851944793,163.782936010038,152.26913425345,11.7981910705566,16.1276588439941,31.4978485107422,78,91,150,174,133,166,6314.74260807037,74.932903741043,142.986825598567,133.479549732204 93 | 2027,10565,10886.6263867993,0.949336084255014,3.18205189704895,1.40499906024489,55.288878371983,162.009843823947,167.607856128727,20.1052856445312,30.4573860168457,63.9760627746582,38,71,133,193,141,188,34023.0371953249,46.0950617370368,136.57875319369,139.250678086171 94 | 2028,28169,25689.1220623074,0.959448287741271,3.54754972457886,1.53394932427723,79.1032695516348,149.798395399198,178.404416202208,31.1597003936768,33.2486381530762,110.540588378906,57,93,91,197,138,197,83086.8995524645,66.5628279522913,125.719903574019,147.907745579555 95 | 2029,9077,10412.0828266123,0.911373892226907,2.42966461181641,2.05829737364672,62.5718849840256,63.1857441886086,154.660240167456,21.6640529632568,36.1924629211426,52.6363830566406,44,85,40,90,126,175,18736.0569480658,47.5617149579595,47.8036548716011,119.087170058497 96 | 2030,12843,11399.0884469601,0.986005086676556,5.99825191497803,1.1710092939909,43.7345635754886,132.373900179086,125.652729113136,15.6801176071167,32.5711441040039,94.0532989501953,24,73,88,168,103,141,39547.1557798386,38.5248691076974,114.873848963774,104.53077897722 97 | 2031,9387,9243.25971675977,0.702940845894087,1.40597867965698,1.60010593386958,38.8513902205177,92.1426440822414,149.595717481624,28.3193206787109,32.3810424804688,39.8163604736328,26,60,71,111,131,169,26351.1238880754,31.3566511815429,75.3858927777631,122.740229742673 98 | 2034,952,1132.82861461787,0.977721870291597,4.76406860351562,2.10756731870876,47.9737394957983,117.109243697479,133.542016806723,7.14613962173462,10.7997961044312,34.0447006225586,38,58,101,131,127,138,2379.81744265556,37.4423678064017,92.0015947759774,104.8042574735 99 | 2035,6502,4899.03069828082,0.96977942965092,4.09864091873169,1.45766094751653,56.4254075669025,135.553675792064,135.50676714857,13.604323387146,29.1374378204346,55.7592353820801,47,70,102,159,119,154,25796.0469207764,48.8851258440046,120.158526983588,118.354180753991 100 | -------------------------------------------------------------------------------- /ants_seg_to_nidm/mapping_data/FreeSurferColorLUT.txt: -------------------------------------------------------------------------------- 1 | #$Id: FreeSurferColorLUT.txt,v 1.105 2015/07/29 18:23:03 greve Exp $ 2 | 3 | #No. Label Name: R G B A 4 | 5 | 0 Unknown 0 0 0 0 6 | 1 Left-Cerebral-Exterior 70 130 180 0 7 | 2 Left-Cerebral-White-Matter 245 245 245 0 8 | 3 Left-Cerebral-Cortex 205 62 78 0 9 | 4 Left-Lateral-Ventricle 120 18 134 0 10 | 5 Left-Inf-Lat-Vent 196 58 250 0 11 | 6 Left-Cerebellum-Exterior 0 148 0 0 12 | 7 Left-Cerebellum-White-Matter 220 248 164 0 13 | 8 Left-Cerebellum-Cortex 230 148 34 0 14 | 9 Left-Thalamus 0 118 14 0 15 | 10 Left-Thalamus-Proper 0 118 14 0 16 | 11 Left-Caudate 122 186 220 0 17 | 12 Left-Putamen 236 13 176 0 18 | 13 Left-Pallidum 12 48 255 0 19 | 14 3rd-Ventricle 204 182 142 0 20 | 15 4th-Ventricle 42 204 164 0 21 | 16 Brain-Stem 119 159 176 0 22 | 17 Left-Hippocampus 220 216 20 0 23 | 18 Left-Amygdala 103 255 255 0 24 | 19 Left-Insula 80 196 98 0 25 | 20 Left-Operculum 60 58 210 0 26 | 21 Line-1 60 58 210 0 27 | 22 Line-2 60 58 210 0 28 | 23 Line-3 60 58 210 0 29 | 24 CSF 60 60 60 0 30 | 25 Left-Lesion 255 165 0 0 31 | 26 Left-Accumbens-area 255 165 0 0 32 | 27 Left-Substancia-Nigra 0 255 127 0 33 | 28 Left-VentralDC 165 42 42 0 34 | 29 Left-undetermined 135 206 235 0 35 | 30 Left-vessel 160 32 240 0 36 | 31 Left-choroid-plexus 0 200 200 0 37 | 32 Left-F3orb 100 50 100 0 38 | 33 Left-lOg 135 50 74 0 39 | 34 Left-aOg 122 135 50 0 40 | 35 Left-mOg 51 50 135 0 41 | 36 Left-pOg 74 155 60 0 42 | 37 Left-Stellate 120 62 43 0 43 | 38 Left-Porg 74 155 60 0 44 | 39 Left-Aorg 122 135 50 0 45 | 40 Right-Cerebral-Exterior 70 130 180 0 46 | 41 Right-Cerebral-White-Matter 245 245 245 0 47 | 42 Right-Cerebral-Cortex 205 62 78 0 48 | 43 Right-Lateral-Ventricle 120 18 134 0 49 | 44 Right-Inf-Lat-Vent 196 58 250 0 50 | 45 Right-Cerebellum-Exterior 0 148 0 0 51 | 46 Right-Cerebellum-White-Matter 220 248 164 0 52 | 47 Right-Cerebellum-Cortex 230 148 34 0 53 | 48 Right-Thalamus 0 118 14 0 54 | 49 Right-Thalamus-Proper 0 118 14 0 55 | 50 Right-Caudate 122 186 220 0 56 | 51 Right-Putamen 236 13 176 0 57 | 52 Right-Pallidum 13 48 255 0 58 | 53 Right-Hippocampus 220 216 20 0 59 | 54 Right-Amygdala 103 255 255 0 60 | 55 Right-Insula 80 196 98 0 61 | 56 Right-Operculum 60 58 210 0 62 | 57 Right-Lesion 255 165 0 0 63 | 58 Right-Accumbens-area 255 165 0 0 64 | 59 Right-Substancia-Nigra 0 255 127 0 65 | 60 Right-VentralDC 165 42 42 0 66 | 61 Right-undetermined 135 206 235 0 67 | 62 Right-vessel 160 32 240 0 68 | 63 Right-choroid-plexus 0 200 221 0 69 | 64 Right-F3orb 100 50 100 0 70 | 65 Right-lOg 135 50 74 0 71 | 66 Right-aOg 122 135 50 0 72 | 67 Right-mOg 51 50 135 0 73 | 68 Right-pOg 74 155 60 0 74 | 69 Right-Stellate 120 62 43 0 75 | 70 Right-Porg 74 155 60 0 76 | 71 Right-Aorg 122 135 50 0 77 | 72 5th-Ventricle 120 190 150 0 78 | 73 Left-Interior 122 135 50 0 79 | 74 Right-Interior 122 135 50 0 80 | # 75/76 removed. duplicates of 4/43 81 | 77 WM-hypointensities 200 70 255 0 82 | 78 Left-WM-hypointensities 255 148 10 0 83 | 79 Right-WM-hypointensities 255 148 10 0 84 | 80 non-WM-hypointensities 164 108 226 0 85 | 81 Left-non-WM-hypointensities 164 108 226 0 86 | 82 Right-non-WM-hypointensities 164 108 226 0 87 | 83 Left-F1 255 218 185 0 88 | 84 Right-F1 255 218 185 0 89 | 85 Optic-Chiasm 234 169 30 0 90 | 192 Corpus_Callosum 250 255 50 0 91 | 92 | 86 Left_future_WMSA 200 120 255 0 93 | 87 Right_future_WMSA 200 121 255 0 94 | 88 future_WMSA 200 122 255 0 95 | 96 | 97 | 96 Left-Amygdala-Anterior 205 10 125 0 98 | 97 Right-Amygdala-Anterior 205 10 125 0 99 | 98 Dura 160 32 240 0 100 | 101 | 100 Left-wm-intensity-abnormality 124 140 178 0 102 | 101 Left-caudate-intensity-abnormality 125 140 178 0 103 | 102 Left-putamen-intensity-abnormality 126 140 178 0 104 | 103 Left-accumbens-intensity-abnormality 127 140 178 0 105 | 104 Left-pallidum-intensity-abnormality 124 141 178 0 106 | 105 Left-amygdala-intensity-abnormality 124 142 178 0 107 | 106 Left-hippocampus-intensity-abnormality 124 143 178 0 108 | 107 Left-thalamus-intensity-abnormality 124 144 178 0 109 | 108 Left-VDC-intensity-abnormality 124 140 179 0 110 | 109 Right-wm-intensity-abnormality 124 140 178 0 111 | 110 Right-caudate-intensity-abnormality 125 140 178 0 112 | 111 Right-putamen-intensity-abnormality 126 140 178 0 113 | 112 Right-accumbens-intensity-abnormality 127 140 178 0 114 | 113 Right-pallidum-intensity-abnormality 124 141 178 0 115 | 114 Right-amygdala-intensity-abnormality 124 142 178 0 116 | 115 Right-hippocampus-intensity-abnormality 124 143 178 0 117 | 116 Right-thalamus-intensity-abnormality 124 144 178 0 118 | 117 Right-VDC-intensity-abnormality 124 140 179 0 119 | 120 | 118 Epidermis 255 20 147 0 121 | 119 Conn-Tissue 205 179 139 0 122 | 120 SC-Fat-Muscle 238 238 209 0 123 | 121 Cranium 200 200 200 0 124 | 122 CSF-SA 74 255 74 0 125 | 123 Muscle 238 0 0 0 126 | 124 Ear 0 0 139 0 127 | 125 Adipose 173 255 47 0 128 | 126 Spinal-Cord 133 203 229 0 129 | 127 Soft-Tissue 26 237 57 0 130 | 128 Nerve 34 139 34 0 131 | 129 Bone 30 144 255 0 132 | 130 Air 147 19 173 0 133 | 131 Orbital-Fat 238 59 59 0 134 | 132 Tongue 221 39 200 0 135 | 133 Nasal-Structures 238 174 238 0 136 | 134 Globe 255 0 0 0 137 | 135 Teeth 72 61 139 0 138 | 136 Left-Caudate-Putamen 21 39 132 0 139 | 137 Right-Caudate-Putamen 21 39 132 0 140 | 138 Left-Claustrum 65 135 20 0 141 | 139 Right-Claustrum 65 135 20 0 142 | 140 Cornea 134 4 160 0 143 | 142 Diploe 221 226 68 0 144 | 143 Vitreous-Humor 255 255 254 0 145 | 144 Lens 52 209 226 0 146 | 145 Aqueous-Humor 239 160 223 0 147 | 146 Outer-Table 70 130 180 0 148 | 147 Inner-Table 70 130 181 0 149 | 148 Periosteum 139 121 94 0 150 | 149 Endosteum 224 224 224 0 151 | 150 R-C-S 255 0 0 0 152 | 151 Iris 205 205 0 0 153 | 152 SC-Adipose-Muscle 238 238 209 0 154 | 153 SC-Tissue 139 121 94 0 155 | 154 Orbital-Adipose 238 59 59 0 156 | 157 | 155 Left-IntCapsule-Ant 238 59 59 0 158 | 156 Right-IntCapsule-Ant 238 59 59 0 159 | 157 Left-IntCapsule-Pos 62 10 205 0 160 | 158 Right-IntCapsule-Pos 62 10 205 0 161 | 162 | # These labels are for babies/children 163 | 159 Left-Cerebral-WM-unmyelinated 0 118 14 0 164 | 160 Right-Cerebral-WM-unmyelinated 0 118 14 0 165 | 161 Left-Cerebral-WM-myelinated 220 216 21 0 166 | 162 Right-Cerebral-WM-myelinated 220 216 21 0 167 | 163 Left-Subcortical-Gray-Matter 122 186 220 0 168 | 164 Right-Subcortical-Gray-Matter 122 186 220 0 169 | 165 Skull 120 120 120 0 170 | 166 Posterior-fossa 14 48 255 0 171 | 167 Scalp 166 42 42 0 172 | 168 Hematoma 121 18 134 0 173 | 169 Left-Basal-Ganglia 236 13 127 0 174 | 176 Right-Basal-Ganglia 236 13 126 0 175 | 176 | # Label names and colors for Brainstem consituents 177 | # No. Label Name: R G B A 178 | 170 brainstem 119 159 176 0 179 | 171 DCG 119 0 176 0 180 | 172 Vermis 119 100 176 0 181 | 173 Midbrain 242 104 76 0 182 | 174 Pons 206 195 58 0 183 | 175 Medulla 119 159 176 0 184 | 177 Vermis-White-Matter 119 50 176 0 185 | 178 SCP 142 182 0 0 186 | 179 Floculus 19 100 176 0 187 | 188 | #176 Right-Basal-Ganglia found in babies/children section above 189 | 190 | 180 Left-Cortical-Dysplasia 73 61 139 0 191 | 181 Right-Cortical-Dysplasia 73 62 139 0 192 | 182 CblumNodulus 10 100 176 0 193 | 194 | #192 Corpus_Callosum listed after #85 above 195 | 193 Left-hippocampal_fissure 0 196 255 0 196 | 194 Left-CADG-head 255 164 164 0 197 | 195 Left-subiculum 196 196 0 0 198 | 196 Left-fimbria 0 100 255 0 199 | 197 Right-hippocampal_fissure 128 196 164 0 200 | 198 Right-CADG-head 0 126 75 0 201 | 199 Right-subiculum 128 96 64 0 202 | 200 Right-fimbria 0 50 128 0 203 | 201 alveus 255 204 153 0 204 | 202 perforant_pathway 255 128 128 0 205 | 203 parasubiculum 255 255 0 0 206 | 204 presubiculum 64 0 64 0 207 | 205 subiculum 0 0 255 0 208 | 206 CA1 255 0 0 0 209 | 207 CA2 128 128 255 0 210 | 208 CA3 0 128 0 0 211 | 209 CA4 196 160 128 0 212 | 210 GC-DG 32 200 255 0 213 | 211 HATA 128 255 128 0 214 | 212 fimbria 204 153 204 0 215 | 213 lateral_ventricle 121 17 136 0 216 | 214 molecular_layer_HP 128 0 0 0 217 | 215 hippocampal_fissure 128 32 255 0 218 | 216 entorhinal_cortex 255 204 102 0 219 | 217 molecular_layer_subiculum 128 128 128 0 220 | 218 Amygdala 104 255 255 0 221 | 219 Cerebral_White_Matter 0 226 0 0 222 | 220 Cerebral_Cortex 205 63 78 0 223 | 221 Inf_Lat_Vent 197 58 250 0 224 | 222 Perirhinal 33 150 250 0 225 | 223 Cerebral_White_Matter_Edge 226 0 0 0 226 | 224 Background 100 100 100 0 227 | 225 Ectorhinal 197 150 250 0 228 | 226 HP_tail 170 170 255 0 229 | 230 | 250 Fornix 255 0 0 0 231 | 251 CC_Posterior 0 0 64 0 232 | 252 CC_Mid_Posterior 0 0 112 0 233 | 253 CC_Central 0 0 160 0 234 | 254 CC_Mid_Anterior 0 0 208 0 235 | 255 CC_Anterior 0 0 255 0 236 | 237 | # This is for keeping track of voxel changes 238 | 256 Voxel-Unchanged 0 0 0 0 239 | 240 | 257 CSF-ExtraCerebral 60 60 60 0 241 | 258 Head-ExtraCerebral 150 150 200 0 242 | 259 SkullApprox 120 120 120 0 243 | 260 BoneOrAir 119 159 176 0 244 | 261 PossibleFluid 120 18 134 0 245 | 262 Sinus 119 159 176 0 246 | 263 Left-Eustachian 119 159 176 0 247 | 264 Right-Eustachian 119 159 176 0 248 | 249 | # lymph node and vascular labels 250 | 331 Aorta 255 0 0 0 251 | 332 Left-Common-IliacA 255 80 0 0 252 | 333 Right-Common-IliacA 255 160 0 0 253 | 334 Left-External-IliacA 255 255 0 0 254 | 335 Right-External-IliacA 0 255 0 0 255 | 336 Left-Internal-IliacA 255 0 160 0 256 | 337 Right-Internal-IliacA 255 0 255 0 257 | 338 Left-Lateral-SacralA 255 50 80 0 258 | 339 Right-Lateral-SacralA 80 255 50 0 259 | 340 Left-ObturatorA 160 255 50 0 260 | 341 Right-ObturatorA 160 200 255 0 261 | 342 Left-Internal-PudendalA 0 255 160 0 262 | 343 Right-Internal-PudendalA 0 0 255 0 263 | 344 Left-UmbilicalA 80 50 255 0 264 | 345 Right-UmbilicalA 160 0 255 0 265 | 346 Left-Inf-RectalA 255 210 0 0 266 | 347 Right-Inf-RectalA 0 160 255 0 267 | 348 Left-Common-IliacV 255 200 80 0 268 | 349 Right-Common-IliacV 255 200 160 0 269 | 350 Left-External-IliacV 255 80 200 0 270 | 351 Right-External-IliacV 255 160 200 0 271 | 352 Left-Internal-IliacV 30 255 80 0 272 | 353 Right-Internal-IliacV 80 200 255 0 273 | 354 Left-ObturatorV 80 255 200 0 274 | 355 Right-ObturatorV 195 255 200 0 275 | 356 Left-Internal-PudendalV 120 200 20 0 276 | 357 Right-Internal-PudendalV 170 10 200 0 277 | 358 Pos-Lymph 20 130 180 0 278 | 359 Neg-Lymph 20 180 130 0 279 | 280 | 400 V1 206 62 78 0 281 | 401 V2 121 18 134 0 282 | 402 BA44 199 58 250 0 283 | 403 BA45 1 148 0 0 284 | 404 BA4a 221 248 164 0 285 | 405 BA4p 231 148 34 0 286 | 406 BA6 1 118 14 0 287 | 407 BA2 120 118 14 0 288 | 408 BA1_old 123 186 221 0 289 | 409 BAun2 238 13 177 0 290 | 410 BA1 123 186 220 0 291 | 411 BA2b 138 13 206 0 292 | 412 BA3a 238 130 176 0 293 | 413 BA3b 218 230 76 0 294 | 414 MT 38 213 176 0 295 | 415 AIPS_AIP_l 1 225 176 0 296 | 416 AIPS_AIP_r 1 225 176 0 297 | 417 AIPS_VIP_l 200 2 100 0 298 | 418 AIPS_VIP_r 200 2 100 0 299 | 419 IPL_PFcm_l 5 200 90 0 300 | 420 IPL_PFcm_r 5 200 90 0 301 | 421 IPL_PF_l 100 5 200 0 302 | 422 IPL_PFm_l 25 255 100 0 303 | 423 IPL_PFm_r 25 255 100 0 304 | 424 IPL_PFop_l 230 7 100 0 305 | 425 IPL_PFop_r 230 7 100 0 306 | 426 IPL_PF_r 100 5 200 0 307 | 427 IPL_PFt_l 150 10 200 0 308 | 428 IPL_PFt_r 150 10 200 0 309 | 429 IPL_PGa_l 175 10 176 0 310 | 430 IPL_PGa_r 175 10 176 0 311 | 431 IPL_PGp_l 10 100 255 0 312 | 432 IPL_PGp_r 10 100 255 0 313 | 433 Visual_V3d_l 150 45 70 0 314 | 434 Visual_V3d_r 150 45 70 0 315 | 435 Visual_V4_l 45 200 15 0 316 | 436 Visual_V4_r 45 200 15 0 317 | 437 Visual_V5_b 227 45 100 0 318 | 438 Visual_VP_l 227 45 100 0 319 | 439 Visual_VP_r 227 45 100 0 320 | 321 | # wm lesions 322 | 498 wmsa 143 188 143 0 323 | 499 other_wmsa 255 248 220 0 324 | 325 | # HiRes Hippocampus labeling 326 | 500 right_CA2_3 17 85 136 0 327 | 501 right_alveus 119 187 102 0 328 | 502 right_CA1 204 68 34 0 329 | 503 right_fimbria 204 0 255 0 330 | 504 right_presubiculum 221 187 17 0 331 | 505 right_hippocampal_fissure 153 221 238 0 332 | 506 right_CA4_DG 51 17 17 0 333 | 507 right_subiculum 0 119 85 0 334 | 508 right_fornix 20 100 200 0 335 | 336 | 550 left_CA2_3 17 85 137 0 337 | 551 left_alveus 119 187 103 0 338 | 552 left_CA1 204 68 35 0 339 | 553 left_fimbria 204 0 254 0 340 | 554 left_presubiculum 221 187 16 0 341 | 555 left_hippocampal_fissure 153 221 239 0 342 | 556 left_CA4_DG 51 17 18 0 343 | 557 left_subiculum 0 119 86 0 344 | 558 left_fornix 20 100 201 0 345 | 346 | 600 Tumor 254 254 254 0 347 | 348 | 349 | # Cerebellar parcellation labels from SUIT (matches labels in cma.h) 350 | #No. Label Name: R G B A 351 | 601 Cbm_Left_I_IV 70 130 180 0 352 | 602 Cbm_Right_I_IV 245 245 245 0 353 | 603 Cbm_Left_V 205 62 78 0 354 | 604 Cbm_Right_V 120 18 134 0 355 | 605 Cbm_Left_VI 196 58 250 0 356 | 606 Cbm_Vermis_VI 0 148 0 0 357 | 607 Cbm_Right_VI 220 248 164 0 358 | 608 Cbm_Left_CrusI 230 148 34 0 359 | 609 Cbm_Vermis_CrusI 0 118 14 0 360 | 610 Cbm_Right_CrusI 0 118 14 0 361 | 611 Cbm_Left_CrusII 122 186 220 0 362 | 612 Cbm_Vermis_CrusII 236 13 176 0 363 | 613 Cbm_Right_CrusII 12 48 255 0 364 | 614 Cbm_Left_VIIb 204 182 142 0 365 | 615 Cbm_Vermis_VIIb 42 204 164 0 366 | 616 Cbm_Right_VIIb 119 159 176 0 367 | 617 Cbm_Left_VIIIa 220 216 20 0 368 | 618 Cbm_Vermis_VIIIa 103 255 255 0 369 | 619 Cbm_Right_VIIIa 80 196 98 0 370 | 620 Cbm_Left_VIIIb 60 58 210 0 371 | 621 Cbm_Vermis_VIIIb 60 58 210 0 372 | 622 Cbm_Right_VIIIb 60 58 210 0 373 | 623 Cbm_Left_IX 60 58 210 0 374 | 624 Cbm_Vermis_IX 60 60 60 0 375 | 625 Cbm_Right_IX 255 165 0 0 376 | 626 Cbm_Left_X 255 165 0 0 377 | 627 Cbm_Vermis_X 0 255 127 0 378 | 628 Cbm_Right_X 165 42 42 0 379 | 380 | # Cerebellar lobule parcellations 381 | 640 Cbm_Right_I_V_med 204 0 0 0 382 | 641 Cbm_Right_I_V_mid 255 0 0 0 383 | 642 Cbm_Right_VI_med 0 0 255 0 384 | 643 Cbm_Right_VI_mid 30 144 255 0 385 | 644 Cbm_Right_VI_lat 100 212 237 0 386 | 645 Cbm_Right_CrusI_med 218 165 32 0 387 | 646 Cbm_Right_CrusI_mid 255 215 0 0 388 | 647 Cbm_Right_CrusI_lat 255 255 166 0 389 | 648 Cbm_Right_CrusII_med 153 0 204 0 390 | 649 Cbm_Right_CrusII_mid 153 141 209 0 391 | 650 Cbm_Right_CrusII_lat 204 204 255 0 392 | 651 Cbm_Right_7med 31 212 194 0 393 | 652 Cbm_Right_7mid 3 255 237 0 394 | 653 Cbm_Right_7lat 204 255 255 0 395 | 654 Cbm_Right_8med 86 74 147 0 396 | 655 Cbm_Right_8mid 114 114 190 0 397 | 656 Cbm_Right_8lat 184 178 255 0 398 | 657 Cbm_Right_PUNs 126 138 37 0 399 | 658 Cbm_Right_TONs 189 197 117 0 400 | 659 Cbm_Right_FLOs 240 230 140 0 401 | 660 Cbm_Left_I_V_med 204 0 0 0 402 | 661 Cbm_Left_I_V_mid 255 0 0 0 403 | 662 Cbm_Left_VI_med 0 0 255 0 404 | 663 Cbm_Left_VI_mid 30 144 255 0 405 | 664 Cbm_Left_VI_lat 100 212 237 0 406 | 665 Cbm_Left_CrusI_med 218 165 32 0 407 | 666 Cbm_Left_CrusI_mid 255 215 0 0 408 | 667 Cbm_Left_CrusI_lat 255 255 166 0 409 | 668 Cbm_Left_CrusII_med 153 0 204 0 410 | 669 Cbm_Left_CrusII_mid 153 141 209 0 411 | 670 Cbm_Left_CrusII_lat 204 204 255 0 412 | 671 Cbm_Left_7med 31 212 194 0 413 | 672 Cbm_Left_7mid 3 255 237 0 414 | 673 Cbm_Left_7lat 204 255 255 0 415 | 674 Cbm_Left_8med 86 74 147 0 416 | 675 Cbm_Left_8mid 114 114 190 0 417 | 676 Cbm_Left_8lat 184 178 255 0 418 | 677 Cbm_Left_PUNs 126 138 37 0 419 | 678 Cbm_Left_TONs 189 197 117 0 420 | 679 Cbm_Left_FLOs 240 230 140 0 421 | # Added by DNG 7/31/14 422 | 690 CbmWM_Gyri_Left 122 135 50 0 423 | 691 CbmWM_Gyri_Right 122 135 50 0 424 | 425 | 701 CSF-FSL-FAST 120 18 134 0 426 | 702 GrayMatter-FSL-FAST 205 62 78 0 427 | 703 WhiteMatter-FSL-FAST 0 225 0 0 428 | 429 | 999 SUSPICIOUS 255 100 100 0 430 | 431 | # Below is the color table for the cortical labels of the seg volume 432 | # created by mri_aparc2aseg in which the aseg cortex label is replaced 433 | # by the labels in the aparc. It also supports wm labels that will 434 | # eventually be created by mri_aparc2aseg. Otherwise, the aseg labels 435 | # do not change from above. The cortical lables are the same as in 436 | # colortable_desikan_killiany.txt, except that left hemisphere has 437 | # 1000 added to the index and the right has 2000 added. The label 438 | # names are also prepended with ctx-lh or ctx-rh. The white matter 439 | # labels are the same as in colortable_desikan_killiany.txt, except 440 | # that left hemisphere has 3000 added to the index and the right has 441 | # 4000 added. The label names are also prepended with wm-lh or wm-rh. 442 | # Centrum semiovale is also labled with 5001 (left) and 5002 (right). 443 | # Even further below are the color tables for aparc.a2005s and aparc.a2009s. 444 | 445 | #No. Label Name: R G B A 446 | 1000 ctx-lh-unknown 25 5 25 0 447 | 1001 ctx-lh-bankssts 25 100 40 0 448 | 1002 ctx-lh-caudalanteriorcingulate 125 100 160 0 449 | 1003 ctx-lh-caudalmiddlefrontal 100 25 0 0 450 | 1004 ctx-lh-corpuscallosum 120 70 50 0 451 | 1005 ctx-lh-cuneus 220 20 100 0 452 | 1006 ctx-lh-entorhinal 220 20 10 0 453 | 1007 ctx-lh-fusiform 180 220 140 0 454 | 1008 ctx-lh-inferiorparietal 220 60 220 0 455 | 1009 ctx-lh-inferiortemporal 180 40 120 0 456 | 1010 ctx-lh-isthmuscingulate 140 20 140 0 457 | 1011 ctx-lh-lateraloccipital 20 30 140 0 458 | 1012 ctx-lh-lateralorbitofrontal 35 75 50 0 459 | 1013 ctx-lh-lingual 225 140 140 0 460 | 1014 ctx-lh-medialorbitofrontal 200 35 75 0 461 | 1015 ctx-lh-middletemporal 160 100 50 0 462 | 1016 ctx-lh-parahippocampal 20 220 60 0 463 | 1017 ctx-lh-paracentral 60 220 60 0 464 | 1018 ctx-lh-parsopercularis 220 180 140 0 465 | 1019 ctx-lh-parsorbitalis 20 100 50 0 466 | 1020 ctx-lh-parstriangularis 220 60 20 0 467 | 1021 ctx-lh-pericalcarine 120 100 60 0 468 | 1022 ctx-lh-postcentral 220 20 20 0 469 | 1023 ctx-lh-posteriorcingulate 220 180 220 0 470 | 1024 ctx-lh-precentral 60 20 220 0 471 | 1025 ctx-lh-precuneus 160 140 180 0 472 | 1026 ctx-lh-rostralanteriorcingulate 80 20 140 0 473 | 1027 ctx-lh-rostralmiddlefrontal 75 50 125 0 474 | 1028 ctx-lh-superiorfrontal 20 220 160 0 475 | 1029 ctx-lh-superiorparietal 20 180 140 0 476 | 1030 ctx-lh-superiortemporal 140 220 220 0 477 | 1031 ctx-lh-supramarginal 80 160 20 0 478 | 1032 ctx-lh-frontalpole 100 0 100 0 479 | 1033 ctx-lh-temporalpole 70 70 70 0 480 | 1034 ctx-lh-transversetemporal 150 150 200 0 481 | 1035 ctx-lh-insula 255 192 32 0 482 | 483 | 2000 ctx-rh-unknown 25 5 25 0 484 | 2001 ctx-rh-bankssts 25 100 40 0 485 | 2002 ctx-rh-caudalanteriorcingulate 125 100 160 0 486 | 2003 ctx-rh-caudalmiddlefrontal 100 25 0 0 487 | 2004 ctx-rh-corpuscallosum 120 70 50 0 488 | 2005 ctx-rh-cuneus 220 20 100 0 489 | 2006 ctx-rh-entorhinal 220 20 10 0 490 | 2007 ctx-rh-fusiform 180 220 140 0 491 | 2008 ctx-rh-inferiorparietal 220 60 220 0 492 | 2009 ctx-rh-inferiortemporal 180 40 120 0 493 | 2010 ctx-rh-isthmuscingulate 140 20 140 0 494 | 2011 ctx-rh-lateraloccipital 20 30 140 0 495 | 2012 ctx-rh-lateralorbitofrontal 35 75 50 0 496 | 2013 ctx-rh-lingual 225 140 140 0 497 | 2014 ctx-rh-medialorbitofrontal 200 35 75 0 498 | 2015 ctx-rh-middletemporal 160 100 50 0 499 | 2016 ctx-rh-parahippocampal 20 220 60 0 500 | 2017 ctx-rh-paracentral 60 220 60 0 501 | 2018 ctx-rh-parsopercularis 220 180 140 0 502 | 2019 ctx-rh-parsorbitalis 20 100 50 0 503 | 2020 ctx-rh-parstriangularis 220 60 20 0 504 | 2021 ctx-rh-pericalcarine 120 100 60 0 505 | 2022 ctx-rh-postcentral 220 20 20 0 506 | 2023 ctx-rh-posteriorcingulate 220 180 220 0 507 | 2024 ctx-rh-precentral 60 20 220 0 508 | 2025 ctx-rh-precuneus 160 140 180 0 509 | 2026 ctx-rh-rostralanteriorcingulate 80 20 140 0 510 | 2027 ctx-rh-rostralmiddlefrontal 75 50 125 0 511 | 2028 ctx-rh-superiorfrontal 20 220 160 0 512 | 2029 ctx-rh-superiorparietal 20 180 140 0 513 | 2030 ctx-rh-superiortemporal 140 220 220 0 514 | 2031 ctx-rh-supramarginal 80 160 20 0 515 | 2032 ctx-rh-frontalpole 100 0 100 0 516 | 2033 ctx-rh-temporalpole 70 70 70 0 517 | 2034 ctx-rh-transversetemporal 150 150 200 0 518 | 2035 ctx-rh-insula 255 192 32 0 519 | 520 | 3000 wm-lh-unknown 230 250 230 0 521 | 3001 wm-lh-bankssts 230 155 215 0 522 | 3002 wm-lh-caudalanteriorcingulate 130 155 95 0 523 | 3003 wm-lh-caudalmiddlefrontal 155 230 255 0 524 | 3004 wm-lh-corpuscallosum 135 185 205 0 525 | 3005 wm-lh-cuneus 35 235 155 0 526 | 3006 wm-lh-entorhinal 35 235 245 0 527 | 3007 wm-lh-fusiform 75 35 115 0 528 | 3008 wm-lh-inferiorparietal 35 195 35 0 529 | 3009 wm-lh-inferiortemporal 75 215 135 0 530 | 3010 wm-lh-isthmuscingulate 115 235 115 0 531 | 3011 wm-lh-lateraloccipital 235 225 115 0 532 | 3012 wm-lh-lateralorbitofrontal 220 180 205 0 533 | 3013 wm-lh-lingual 30 115 115 0 534 | 3014 wm-lh-medialorbitofrontal 55 220 180 0 535 | 3015 wm-lh-middletemporal 95 155 205 0 536 | 3016 wm-lh-parahippocampal 235 35 195 0 537 | 3017 wm-lh-paracentral 195 35 195 0 538 | 3018 wm-lh-parsopercularis 35 75 115 0 539 | 3019 wm-lh-parsorbitalis 235 155 205 0 540 | 3020 wm-lh-parstriangularis 35 195 235 0 541 | 3021 wm-lh-pericalcarine 135 155 195 0 542 | 3022 wm-lh-postcentral 35 235 235 0 543 | 3023 wm-lh-posteriorcingulate 35 75 35 0 544 | 3024 wm-lh-precentral 195 235 35 0 545 | 3025 wm-lh-precuneus 95 115 75 0 546 | 3026 wm-lh-rostralanteriorcingulate 175 235 115 0 547 | 3027 wm-lh-rostralmiddlefrontal 180 205 130 0 548 | 3028 wm-lh-superiorfrontal 235 35 95 0 549 | 3029 wm-lh-superiorparietal 235 75 115 0 550 | 3030 wm-lh-superiortemporal 115 35 35 0 551 | 3031 wm-lh-supramarginal 175 95 235 0 552 | 3032 wm-lh-frontalpole 155 255 155 0 553 | 3033 wm-lh-temporalpole 185 185 185 0 554 | 3034 wm-lh-transversetemporal 105 105 55 0 555 | 3035 wm-lh-insula 20 220 160 0 556 | 557 | 4000 wm-rh-unknown 230 250 230 0 558 | 4001 wm-rh-bankssts 230 155 215 0 559 | 4002 wm-rh-caudalanteriorcingulate 130 155 95 0 560 | 4003 wm-rh-caudalmiddlefrontal 155 230 255 0 561 | 4004 wm-rh-corpuscallosum 135 185 205 0 562 | 4005 wm-rh-cuneus 35 235 155 0 563 | 4006 wm-rh-entorhinal 35 235 245 0 564 | 4007 wm-rh-fusiform 75 35 115 0 565 | 4008 wm-rh-inferiorparietal 35 195 35 0 566 | 4009 wm-rh-inferiortemporal 75 215 135 0 567 | 4010 wm-rh-isthmuscingulate 115 235 115 0 568 | 4011 wm-rh-lateraloccipital 235 225 115 0 569 | 4012 wm-rh-lateralorbitofrontal 220 180 205 0 570 | 4013 wm-rh-lingual 30 115 115 0 571 | 4014 wm-rh-medialorbitofrontal 55 220 180 0 572 | 4015 wm-rh-middletemporal 95 155 205 0 573 | 4016 wm-rh-parahippocampal 235 35 195 0 574 | 4017 wm-rh-paracentral 195 35 195 0 575 | 4018 wm-rh-parsopercularis 35 75 115 0 576 | 4019 wm-rh-parsorbitalis 235 155 205 0 577 | 4020 wm-rh-parstriangularis 35 195 235 0 578 | 4021 wm-rh-pericalcarine 135 155 195 0 579 | 4022 wm-rh-postcentral 35 235 235 0 580 | 4023 wm-rh-posteriorcingulate 35 75 35 0 581 | 4024 wm-rh-precentral 195 235 35 0 582 | 4025 wm-rh-precuneus 95 115 75 0 583 | 4026 wm-rh-rostralanteriorcingulate 175 235 115 0 584 | 4027 wm-rh-rostralmiddlefrontal 180 205 130 0 585 | 4028 wm-rh-superiorfrontal 235 35 95 0 586 | 4029 wm-rh-superiorparietal 235 75 115 0 587 | 4030 wm-rh-superiortemporal 115 35 35 0 588 | 4031 wm-rh-supramarginal 175 95 235 0 589 | 4032 wm-rh-frontalpole 155 255 155 0 590 | 4033 wm-rh-temporalpole 185 185 185 0 591 | 4034 wm-rh-transversetemporal 105 105 55 0 592 | 4035 wm-rh-insula 20 220 160 0 593 | 594 | 595 | # Below is the color table for a lobar white matter parcelation 596 | # obtained from running 597 | # mri_annotation2label --subject subject --hemi lh --lobesStrict lobes 598 | # mri_annotation2label --subject subject --hemi rh --lobesStrict lobes 599 | # mri_aparc2aseg --s subject --labelwm --hypo-as-wm --rip-unknown \ 600 | # --volmask --o wmparc.lobes.mgz --ctxseg aparc+aseg.mgz \ 601 | # --annot lobes --base-offset 200 [--base-offset must be last arg] 602 | 603 | 3201 wm-lh-frontal-lobe 235 35 95 0 604 | 3203 wm-lh-cingulate-lobe 35 75 35 0 605 | 3204 wm-lh-occiptal-lobe 135 155 195 0 606 | 3205 wm-lh-temporal-lobe 115 35 35 0 607 | 3206 wm-lh-parietal-lobe 35 195 35 0 608 | 3207 wm-lh-insula-lobe 20 220 160 0 609 | 610 | 4201 wm-rh-frontal-lobe 235 35 95 0 611 | 4203 wm-rh-cingulate-lobe 35 75 35 0 612 | 4204 wm-rh-occiptal-lobe 135 155 195 0 613 | 4205 wm-rh-temporal-lobe 115 35 35 0 614 | 4206 wm-rh-parietal-lobe 35 195 35 0 615 | 4207 wm-rh-insula-lobe 20 220 160 0 616 | 617 | # Below is the color table for the cortical labels of the seg volume 618 | # created by mri_aparc2aseg (with --a2005s flag) in which the aseg 619 | # cortex label is replaced by the labels in the aparc.a2005s. The 620 | # cortical labels are the same as in Simple_surface_labels2005.txt, 621 | # except that left hemisphere has 1100 added to the index and the 622 | # right has 2100 added. The label names are also prepended with 623 | # ctx-lh or ctx-rh. The aparc.a2009s labels are further below 624 | 625 | #No. Label Name: R G B A 626 | 1100 ctx-lh-Unknown 0 0 0 0 627 | 1101 ctx-lh-Corpus_callosum 50 50 50 0 628 | 1102 ctx-lh-G_and_S_Insula_ONLY_AVERAGE 180 20 30 0 629 | 1103 ctx-lh-G_cingulate-Isthmus 60 25 25 0 630 | 1104 ctx-lh-G_cingulate-Main_part 25 60 60 0 631 | 632 | 1200 ctx-lh-G_cingulate-caudal_ACC 25 60 61 0 633 | 1201 ctx-lh-G_cingulate-rostral_ACC 25 90 60 0 634 | 1202 ctx-lh-G_cingulate-posterior 25 120 60 0 635 | 636 | 1205 ctx-lh-S_cingulate-caudal_ACC 25 150 60 0 637 | 1206 ctx-lh-S_cingulate-rostral_ACC 25 180 60 0 638 | 1207 ctx-lh-S_cingulate-posterior 25 210 60 0 639 | 640 | 1210 ctx-lh-S_pericallosal-caudal 25 150 90 0 641 | 1211 ctx-lh-S_pericallosal-rostral 25 180 90 0 642 | 1212 ctx-lh-S_pericallosal-posterior 25 210 90 0 643 | 644 | 1105 ctx-lh-G_cuneus 180 20 20 0 645 | 1106 ctx-lh-G_frontal_inf-Opercular_part 220 20 100 0 646 | 1107 ctx-lh-G_frontal_inf-Orbital_part 140 60 60 0 647 | 1108 ctx-lh-G_frontal_inf-Triangular_part 180 220 140 0 648 | 1109 ctx-lh-G_frontal_middle 140 100 180 0 649 | 1110 ctx-lh-G_frontal_superior 180 20 140 0 650 | 1111 ctx-lh-G_frontomarginal 140 20 140 0 651 | 1112 ctx-lh-G_insular_long 21 10 10 0 652 | 1113 ctx-lh-G_insular_short 225 140 140 0 653 | 1114 ctx-lh-G_and_S_occipital_inferior 23 60 180 0 654 | 1115 ctx-lh-G_occipital_middle 180 60 180 0 655 | 1116 ctx-lh-G_occipital_superior 20 220 60 0 656 | 1117 ctx-lh-G_occipit-temp_lat-Or_fusiform 60 20 140 0 657 | 1118 ctx-lh-G_occipit-temp_med-Lingual_part 220 180 140 0 658 | 1119 ctx-lh-G_occipit-temp_med-Parahippocampal_part 65 100 20 0 659 | 1120 ctx-lh-G_orbital 220 60 20 0 660 | 1121 ctx-lh-G_paracentral 60 100 60 0 661 | 1122 ctx-lh-G_parietal_inferior-Angular_part 20 60 220 0 662 | 1123 ctx-lh-G_parietal_inferior-Supramarginal_part 100 100 60 0 663 | 1124 ctx-lh-G_parietal_superior 220 180 220 0 664 | 1125 ctx-lh-G_postcentral 20 180 140 0 665 | 1126 ctx-lh-G_precentral 60 140 180 0 666 | 1127 ctx-lh-G_precuneus 25 20 140 0 667 | 1128 ctx-lh-G_rectus 20 60 100 0 668 | 1129 ctx-lh-G_subcallosal 60 220 20 0 669 | 1130 ctx-lh-G_subcentral 60 20 220 0 670 | 1131 ctx-lh-G_temporal_inferior 220 220 100 0 671 | 1132 ctx-lh-G_temporal_middle 180 60 60 0 672 | 1133 ctx-lh-G_temp_sup-G_temp_transv_and_interm_S 60 60 220 0 673 | 1134 ctx-lh-G_temp_sup-Lateral_aspect 220 60 220 0 674 | 1135 ctx-lh-G_temp_sup-Planum_polare 65 220 60 0 675 | 1136 ctx-lh-G_temp_sup-Planum_tempolare 25 140 20 0 676 | 1137 ctx-lh-G_and_S_transverse_frontopolar 13 0 250 0 677 | 1138 ctx-lh-Lat_Fissure-ant_sgt-ramus_horizontal 61 20 220 0 678 | 1139 ctx-lh-Lat_Fissure-ant_sgt-ramus_vertical 61 20 60 0 679 | 1140 ctx-lh-Lat_Fissure-post_sgt 61 60 100 0 680 | 1141 ctx-lh-Medial_wall 25 25 25 0 681 | 1142 ctx-lh-Pole_occipital 140 20 60 0 682 | 1143 ctx-lh-Pole_temporal 220 180 20 0 683 | 1144 ctx-lh-S_calcarine 63 180 180 0 684 | 1145 ctx-lh-S_central 221 20 10 0 685 | 1146 ctx-lh-S_central_insula 21 220 20 0 686 | 1147 ctx-lh-S_cingulate-Main_part_and_Intracingulate 183 100 20 0 687 | 1148 ctx-lh-S_cingulate-Marginalis_part 221 20 100 0 688 | 1149 ctx-lh-S_circular_insula_anterior 221 60 140 0 689 | 1150 ctx-lh-S_circular_insula_inferior 221 20 220 0 690 | 1151 ctx-lh-S_circular_insula_superior 61 220 220 0 691 | 1152 ctx-lh-S_collateral_transverse_ant 100 200 200 0 692 | 1153 ctx-lh-S_collateral_transverse_post 10 200 200 0 693 | 1154 ctx-lh-S_frontal_inferior 221 220 20 0 694 | 1155 ctx-lh-S_frontal_middle 141 20 100 0 695 | 1156 ctx-lh-S_frontal_superior 61 220 100 0 696 | 1157 ctx-lh-S_frontomarginal 21 220 60 0 697 | 1158 ctx-lh-S_intermedius_primus-Jensen 141 60 20 0 698 | 1159 ctx-lh-S_intraparietal-and_Parietal_transverse 143 20 220 0 699 | 1160 ctx-lh-S_occipital_anterior 61 20 180 0 700 | 1161 ctx-lh-S_occipital_middle_and_Lunatus 101 60 220 0 701 | 1162 ctx-lh-S_occipital_superior_and_transversalis 21 20 140 0 702 | 1163 ctx-lh-S_occipito-temporal_lateral 221 140 20 0 703 | 1164 ctx-lh-S_occipito-temporal_medial_and_S_Lingual 141 100 220 0 704 | 1165 ctx-lh-S_orbital-H_shapped 101 20 20 0 705 | 1166 ctx-lh-S_orbital_lateral 221 100 20 0 706 | 1167 ctx-lh-S_orbital_medial-Or_olfactory 181 200 20 0 707 | 1168 ctx-lh-S_paracentral 21 180 140 0 708 | 1169 ctx-lh-S_parieto_occipital 101 100 180 0 709 | 1170 ctx-lh-S_pericallosal 181 220 20 0 710 | 1171 ctx-lh-S_postcentral 21 140 200 0 711 | 1172 ctx-lh-S_precentral-Inferior-part 21 20 240 0 712 | 1173 ctx-lh-S_precentral-Superior-part 21 20 200 0 713 | 1174 ctx-lh-S_subcentral_ant 61 180 60 0 714 | 1175 ctx-lh-S_subcentral_post 61 180 250 0 715 | 1176 ctx-lh-S_suborbital 21 20 60 0 716 | 1177 ctx-lh-S_subparietal 101 60 60 0 717 | 1178 ctx-lh-S_supracingulate 21 220 220 0 718 | 1179 ctx-lh-S_temporal_inferior 21 180 180 0 719 | 1180 ctx-lh-S_temporal_superior 223 220 60 0 720 | 1181 ctx-lh-S_temporal_transverse 221 60 60 0 721 | 722 | 2100 ctx-rh-Unknown 0 0 0 0 723 | 2101 ctx-rh-Corpus_callosum 50 50 50 0 724 | 2102 ctx-rh-G_and_S_Insula_ONLY_AVERAGE 180 20 30 0 725 | 2103 ctx-rh-G_cingulate-Isthmus 60 25 25 0 726 | 2104 ctx-rh-G_cingulate-Main_part 25 60 60 0 727 | 728 | 2105 ctx-rh-G_cuneus 180 20 20 0 729 | 2106 ctx-rh-G_frontal_inf-Opercular_part 220 20 100 0 730 | 2107 ctx-rh-G_frontal_inf-Orbital_part 140 60 60 0 731 | 2108 ctx-rh-G_frontal_inf-Triangular_part 180 220 140 0 732 | 2109 ctx-rh-G_frontal_middle 140 100 180 0 733 | 2110 ctx-rh-G_frontal_superior 180 20 140 0 734 | 2111 ctx-rh-G_frontomarginal 140 20 140 0 735 | 2112 ctx-rh-G_insular_long 21 10 10 0 736 | 2113 ctx-rh-G_insular_short 225 140 140 0 737 | 2114 ctx-rh-G_and_S_occipital_inferior 23 60 180 0 738 | 2115 ctx-rh-G_occipital_middle 180 60 180 0 739 | 2116 ctx-rh-G_occipital_superior 20 220 60 0 740 | 2117 ctx-rh-G_occipit-temp_lat-Or_fusiform 60 20 140 0 741 | 2118 ctx-rh-G_occipit-temp_med-Lingual_part 220 180 140 0 742 | 2119 ctx-rh-G_occipit-temp_med-Parahippocampal_part 65 100 20 0 743 | 2120 ctx-rh-G_orbital 220 60 20 0 744 | 2121 ctx-rh-G_paracentral 60 100 60 0 745 | 2122 ctx-rh-G_parietal_inferior-Angular_part 20 60 220 0 746 | 2123 ctx-rh-G_parietal_inferior-Supramarginal_part 100 100 60 0 747 | 2124 ctx-rh-G_parietal_superior 220 180 220 0 748 | 2125 ctx-rh-G_postcentral 20 180 140 0 749 | 2126 ctx-rh-G_precentral 60 140 180 0 750 | 2127 ctx-rh-G_precuneus 25 20 140 0 751 | 2128 ctx-rh-G_rectus 20 60 100 0 752 | 2129 ctx-rh-G_subcallosal 60 220 20 0 753 | 2130 ctx-rh-G_subcentral 60 20 220 0 754 | 2131 ctx-rh-G_temporal_inferior 220 220 100 0 755 | 2132 ctx-rh-G_temporal_middle 180 60 60 0 756 | 2133 ctx-rh-G_temp_sup-G_temp_transv_and_interm_S 60 60 220 0 757 | 2134 ctx-rh-G_temp_sup-Lateral_aspect 220 60 220 0 758 | 2135 ctx-rh-G_temp_sup-Planum_polare 65 220 60 0 759 | 2136 ctx-rh-G_temp_sup-Planum_tempolare 25 140 20 0 760 | 2137 ctx-rh-G_and_S_transverse_frontopolar 13 0 250 0 761 | 2138 ctx-rh-Lat_Fissure-ant_sgt-ramus_horizontal 61 20 220 0 762 | 2139 ctx-rh-Lat_Fissure-ant_sgt-ramus_vertical 61 20 60 0 763 | 2140 ctx-rh-Lat_Fissure-post_sgt 61 60 100 0 764 | 2141 ctx-rh-Medial_wall 25 25 25 0 765 | 2142 ctx-rh-Pole_occipital 140 20 60 0 766 | 2143 ctx-rh-Pole_temporal 220 180 20 0 767 | 2144 ctx-rh-S_calcarine 63 180 180 0 768 | 2145 ctx-rh-S_central 221 20 10 0 769 | 2146 ctx-rh-S_central_insula 21 220 20 0 770 | 2147 ctx-rh-S_cingulate-Main_part_and_Intracingulate 183 100 20 0 771 | 2148 ctx-rh-S_cingulate-Marginalis_part 221 20 100 0 772 | 2149 ctx-rh-S_circular_insula_anterior 221 60 140 0 773 | 2150 ctx-rh-S_circular_insula_inferior 221 20 220 0 774 | 2151 ctx-rh-S_circular_insula_superior 61 220 220 0 775 | 2152 ctx-rh-S_collateral_transverse_ant 100 200 200 0 776 | 2153 ctx-rh-S_collateral_transverse_post 10 200 200 0 777 | 2154 ctx-rh-S_frontal_inferior 221 220 20 0 778 | 2155 ctx-rh-S_frontal_middle 141 20 100 0 779 | 2156 ctx-rh-S_frontal_superior 61 220 100 0 780 | 2157 ctx-rh-S_frontomarginal 21 220 60 0 781 | 2158 ctx-rh-S_intermedius_primus-Jensen 141 60 20 0 782 | 2159 ctx-rh-S_intraparietal-and_Parietal_transverse 143 20 220 0 783 | 2160 ctx-rh-S_occipital_anterior 61 20 180 0 784 | 2161 ctx-rh-S_occipital_middle_and_Lunatus 101 60 220 0 785 | 2162 ctx-rh-S_occipital_superior_and_transversalis 21 20 140 0 786 | 2163 ctx-rh-S_occipito-temporal_lateral 221 140 20 0 787 | 2164 ctx-rh-S_occipito-temporal_medial_and_S_Lingual 141 100 220 0 788 | 2165 ctx-rh-S_orbital-H_shapped 101 20 20 0 789 | 2166 ctx-rh-S_orbital_lateral 221 100 20 0 790 | 2167 ctx-rh-S_orbital_medial-Or_olfactory 181 200 20 0 791 | 2168 ctx-rh-S_paracentral 21 180 140 0 792 | 2169 ctx-rh-S_parieto_occipital 101 100 180 0 793 | 2170 ctx-rh-S_pericallosal 181 220 20 0 794 | 2171 ctx-rh-S_postcentral 21 140 200 0 795 | 2172 ctx-rh-S_precentral-Inferior-part 21 20 240 0 796 | 2173 ctx-rh-S_precentral-Superior-part 21 20 200 0 797 | 2174 ctx-rh-S_subcentral_ant 61 180 60 0 798 | 2175 ctx-rh-S_subcentral_post 61 180 250 0 799 | 2176 ctx-rh-S_suborbital 21 20 60 0 800 | 2177 ctx-rh-S_subparietal 101 60 60 0 801 | 2178 ctx-rh-S_supracingulate 21 220 220 0 802 | 2179 ctx-rh-S_temporal_inferior 21 180 180 0 803 | 2180 ctx-rh-S_temporal_superior 223 220 60 0 804 | 2181 ctx-rh-S_temporal_transverse 221 60 60 0 805 | 806 | 807 | 2200 ctx-rh-G_cingulate-caudal_ACC 25 60 61 0 808 | 2201 ctx-rh-G_cingulate-rostral_ACC 25 90 60 0 809 | 2202 ctx-rh-G_cingulate-posterior 25 120 60 0 810 | 811 | 2205 ctx-rh-S_cingulate-caudal_ACC 25 150 60 0 812 | 2206 ctx-rh-S_cingulate-rostral_ACC 25 180 60 0 813 | 2207 ctx-rh-S_cingulate-posterior 25 210 60 0 814 | 815 | 2210 ctx-rh-S_pericallosal-caudal 25 150 90 0 816 | 2211 ctx-rh-S_pericallosal-rostral 25 180 90 0 817 | 2212 ctx-rh-S_pericallosal-posterior 25 210 90 0 818 | 819 | 3100 wm-lh-Unknown 0 0 0 0 820 | 3101 wm-lh-Corpus_callosum 50 50 50 0 821 | 3102 wm-lh-G_and_S_Insula_ONLY_AVERAGE 180 20 30 0 822 | 3103 wm-lh-G_cingulate-Isthmus 60 25 25 0 823 | 3104 wm-lh-G_cingulate-Main_part 25 60 60 0 824 | 3105 wm-lh-G_cuneus 180 20 20 0 825 | 3106 wm-lh-G_frontal_inf-Opercular_part 220 20 100 0 826 | 3107 wm-lh-G_frontal_inf-Orbital_part 140 60 60 0 827 | 3108 wm-lh-G_frontal_inf-Triangular_part 180 220 140 0 828 | 3109 wm-lh-G_frontal_middle 140 100 180 0 829 | 3110 wm-lh-G_frontal_superior 180 20 140 0 830 | 3111 wm-lh-G_frontomarginal 140 20 140 0 831 | 3112 wm-lh-G_insular_long 21 10 10 0 832 | 3113 wm-lh-G_insular_short 225 140 140 0 833 | 3114 wm-lh-G_and_S_occipital_inferior 23 60 180 0 834 | 3115 wm-lh-G_occipital_middle 180 60 180 0 835 | 3116 wm-lh-G_occipital_superior 20 220 60 0 836 | 3117 wm-lh-G_occipit-temp_lat-Or_fusiform 60 20 140 0 837 | 3118 wm-lh-G_occipit-temp_med-Lingual_part 220 180 140 0 838 | 3119 wm-lh-G_occipit-temp_med-Parahippocampal_part 65 100 20 0 839 | 3120 wm-lh-G_orbital 220 60 20 0 840 | 3121 wm-lh-G_paracentral 60 100 60 0 841 | 3122 wm-lh-G_parietal_inferior-Angular_part 20 60 220 0 842 | 3123 wm-lh-G_parietal_inferior-Supramarginal_part 100 100 60 0 843 | 3124 wm-lh-G_parietal_superior 220 180 220 0 844 | 3125 wm-lh-G_postcentral 20 180 140 0 845 | 3126 wm-lh-G_precentral 60 140 180 0 846 | 3127 wm-lh-G_precuneus 25 20 140 0 847 | 3128 wm-lh-G_rectus 20 60 100 0 848 | 3129 wm-lh-G_subcallosal 60 220 20 0 849 | 3130 wm-lh-G_subcentral 60 20 220 0 850 | 3131 wm-lh-G_temporal_inferior 220 220 100 0 851 | 3132 wm-lh-G_temporal_middle 180 60 60 0 852 | 3133 wm-lh-G_temp_sup-G_temp_transv_and_interm_S 60 60 220 0 853 | 3134 wm-lh-G_temp_sup-Lateral_aspect 220 60 220 0 854 | 3135 wm-lh-G_temp_sup-Planum_polare 65 220 60 0 855 | 3136 wm-lh-G_temp_sup-Planum_tempolare 25 140 20 0 856 | 3137 wm-lh-G_and_S_transverse_frontopolar 13 0 250 0 857 | 3138 wm-lh-Lat_Fissure-ant_sgt-ramus_horizontal 61 20 220 0 858 | 3139 wm-lh-Lat_Fissure-ant_sgt-ramus_vertical 61 20 60 0 859 | 3140 wm-lh-Lat_Fissure-post_sgt 61 60 100 0 860 | 3141 wm-lh-Medial_wall 25 25 25 0 861 | 3142 wm-lh-Pole_occipital 140 20 60 0 862 | 3143 wm-lh-Pole_temporal 220 180 20 0 863 | 3144 wm-lh-S_calcarine 63 180 180 0 864 | 3145 wm-lh-S_central 221 20 10 0 865 | 3146 wm-lh-S_central_insula 21 220 20 0 866 | 3147 wm-lh-S_cingulate-Main_part_and_Intracingulate 183 100 20 0 867 | 3148 wm-lh-S_cingulate-Marginalis_part 221 20 100 0 868 | 3149 wm-lh-S_circular_insula_anterior 221 60 140 0 869 | 3150 wm-lh-S_circular_insula_inferior 221 20 220 0 870 | 3151 wm-lh-S_circular_insula_superior 61 220 220 0 871 | 3152 wm-lh-S_collateral_transverse_ant 100 200 200 0 872 | 3153 wm-lh-S_collateral_transverse_post 10 200 200 0 873 | 3154 wm-lh-S_frontal_inferior 221 220 20 0 874 | 3155 wm-lh-S_frontal_middle 141 20 100 0 875 | 3156 wm-lh-S_frontal_superior 61 220 100 0 876 | 3157 wm-lh-S_frontomarginal 21 220 60 0 877 | 3158 wm-lh-S_intermedius_primus-Jensen 141 60 20 0 878 | 3159 wm-lh-S_intraparietal-and_Parietal_transverse 143 20 220 0 879 | 3160 wm-lh-S_occipital_anterior 61 20 180 0 880 | 3161 wm-lh-S_occipital_middle_and_Lunatus 101 60 220 0 881 | 3162 wm-lh-S_occipital_superior_and_transversalis 21 20 140 0 882 | 3163 wm-lh-S_occipito-temporal_lateral 221 140 20 0 883 | 3164 wm-lh-S_occipito-temporal_medial_and_S_Lingual 141 100 220 0 884 | 3165 wm-lh-S_orbital-H_shapped 101 20 20 0 885 | 3166 wm-lh-S_orbital_lateral 221 100 20 0 886 | 3167 wm-lh-S_orbital_medial-Or_olfactory 181 200 20 0 887 | 3168 wm-lh-S_paracentral 21 180 140 0 888 | 3169 wm-lh-S_parieto_occipital 101 100 180 0 889 | 3170 wm-lh-S_pericallosal 181 220 20 0 890 | 3171 wm-lh-S_postcentral 21 140 200 0 891 | 3172 wm-lh-S_precentral-Inferior-part 21 20 240 0 892 | 3173 wm-lh-S_precentral-Superior-part 21 20 200 0 893 | 3174 wm-lh-S_subcentral_ant 61 180 60 0 894 | 3175 wm-lh-S_subcentral_post 61 180 250 0 895 | 3176 wm-lh-S_suborbital 21 20 60 0 896 | 3177 wm-lh-S_subparietal 101 60 60 0 897 | 3178 wm-lh-S_supracingulate 21 220 220 0 898 | 3179 wm-lh-S_temporal_inferior 21 180 180 0 899 | 3180 wm-lh-S_temporal_superior 223 220 60 0 900 | 3181 wm-lh-S_temporal_transverse 221 60 60 0 901 | 902 | 4100 wm-rh-Unknown 0 0 0 0 903 | 4101 wm-rh-Corpus_callosum 50 50 50 0 904 | 4102 wm-rh-G_and_S_Insula_ONLY_AVERAGE 180 20 30 0 905 | 4103 wm-rh-G_cingulate-Isthmus 60 25 25 0 906 | 4104 wm-rh-G_cingulate-Main_part 25 60 60 0 907 | 4105 wm-rh-G_cuneus 180 20 20 0 908 | 4106 wm-rh-G_frontal_inf-Opercular_part 220 20 100 0 909 | 4107 wm-rh-G_frontal_inf-Orbital_part 140 60 60 0 910 | 4108 wm-rh-G_frontal_inf-Triangular_part 180 220 140 0 911 | 4109 wm-rh-G_frontal_middle 140 100 180 0 912 | 4110 wm-rh-G_frontal_superior 180 20 140 0 913 | 4111 wm-rh-G_frontomarginal 140 20 140 0 914 | 4112 wm-rh-G_insular_long 21 10 10 0 915 | 4113 wm-rh-G_insular_short 225 140 140 0 916 | 4114 wm-rh-G_and_S_occipital_inferior 23 60 180 0 917 | 4115 wm-rh-G_occipital_middle 180 60 180 0 918 | 4116 wm-rh-G_occipital_superior 20 220 60 0 919 | 4117 wm-rh-G_occipit-temp_lat-Or_fusiform 60 20 140 0 920 | 4118 wm-rh-G_occipit-temp_med-Lingual_part 220 180 140 0 921 | 4119 wm-rh-G_occipit-temp_med-Parahippocampal_part 65 100 20 0 922 | 4120 wm-rh-G_orbital 220 60 20 0 923 | 4121 wm-rh-G_paracentral 60 100 60 0 924 | 4122 wm-rh-G_parietal_inferior-Angular_part 20 60 220 0 925 | 4123 wm-rh-G_parietal_inferior-Supramarginal_part 100 100 60 0 926 | 4124 wm-rh-G_parietal_superior 220 180 220 0 927 | 4125 wm-rh-G_postcentral 20 180 140 0 928 | 4126 wm-rh-G_precentral 60 140 180 0 929 | 4127 wm-rh-G_precuneus 25 20 140 0 930 | 4128 wm-rh-G_rectus 20 60 100 0 931 | 4129 wm-rh-G_subcallosal 60 220 20 0 932 | 4130 wm-rh-G_subcentral 60 20 220 0 933 | 4131 wm-rh-G_temporal_inferior 220 220 100 0 934 | 4132 wm-rh-G_temporal_middle 180 60 60 0 935 | 4133 wm-rh-G_temp_sup-G_temp_transv_and_interm_S 60 60 220 0 936 | 4134 wm-rh-G_temp_sup-Lateral_aspect 220 60 220 0 937 | 4135 wm-rh-G_temp_sup-Planum_polare 65 220 60 0 938 | 4136 wm-rh-G_temp_sup-Planum_tempolare 25 140 20 0 939 | 4137 wm-rh-G_and_S_transverse_frontopolar 13 0 250 0 940 | 4138 wm-rh-Lat_Fissure-ant_sgt-ramus_horizontal 61 20 220 0 941 | 4139 wm-rh-Lat_Fissure-ant_sgt-ramus_vertical 61 20 60 0 942 | 4140 wm-rh-Lat_Fissure-post_sgt 61 60 100 0 943 | 4141 wm-rh-Medial_wall 25 25 25 0 944 | 4142 wm-rh-Pole_occipital 140 20 60 0 945 | 4143 wm-rh-Pole_temporal 220 180 20 0 946 | 4144 wm-rh-S_calcarine 63 180 180 0 947 | 4145 wm-rh-S_central 221 20 10 0 948 | 4146 wm-rh-S_central_insula 21 220 20 0 949 | 4147 wm-rh-S_cingulate-Main_part_and_Intracingulate 183 100 20 0 950 | 4148 wm-rh-S_cingulate-Marginalis_part 221 20 100 0 951 | 4149 wm-rh-S_circular_insula_anterior 221 60 140 0 952 | 4150 wm-rh-S_circular_insula_inferior 221 20 220 0 953 | 4151 wm-rh-S_circular_insula_superior 61 220 220 0 954 | 4152 wm-rh-S_collateral_transverse_ant 100 200 200 0 955 | 4153 wm-rh-S_collateral_transverse_post 10 200 200 0 956 | 4154 wm-rh-S_frontal_inferior 221 220 20 0 957 | 4155 wm-rh-S_frontal_middle 141 20 100 0 958 | 4156 wm-rh-S_frontal_superior 61 220 100 0 959 | 4157 wm-rh-S_frontomarginal 21 220 60 0 960 | 4158 wm-rh-S_intermedius_primus-Jensen 141 60 20 0 961 | 4159 wm-rh-S_intraparietal-and_Parietal_transverse 143 20 220 0 962 | 4160 wm-rh-S_occipital_anterior 61 20 180 0 963 | 4161 wm-rh-S_occipital_middle_and_Lunatus 101 60 220 0 964 | 4162 wm-rh-S_occipital_superior_and_transversalis 21 20 140 0 965 | 4163 wm-rh-S_occipito-temporal_lateral 221 140 20 0 966 | 4164 wm-rh-S_occipito-temporal_medial_and_S_Lingual 141 100 220 0 967 | 4165 wm-rh-S_orbital-H_shapped 101 20 20 0 968 | 4166 wm-rh-S_orbital_lateral 221 100 20 0 969 | 4167 wm-rh-S_orbital_medial-Or_olfactory 181 200 20 0 970 | 4168 wm-rh-S_paracentral 21 180 140 0 971 | 4169 wm-rh-S_parieto_occipital 101 100 180 0 972 | 4170 wm-rh-S_pericallosal 181 220 20 0 973 | 4171 wm-rh-S_postcentral 21 140 200 0 974 | 4172 wm-rh-S_precentral-Inferior-part 21 20 240 0 975 | 4173 wm-rh-S_precentral-Superior-part 21 20 200 0 976 | 4174 wm-rh-S_subcentral_ant 61 180 60 0 977 | 4175 wm-rh-S_subcentral_post 61 180 250 0 978 | 4176 wm-rh-S_suborbital 21 20 60 0 979 | 4177 wm-rh-S_subparietal 101 60 60 0 980 | 4178 wm-rh-S_supracingulate 21 220 220 0 981 | 4179 wm-rh-S_temporal_inferior 21 180 180 0 982 | 4180 wm-rh-S_temporal_superior 223 220 60 0 983 | 4181 wm-rh-S_temporal_transverse 221 60 60 0 984 | 985 | 5001 Left-UnsegmentedWhiteMatter 20 30 40 0 986 | 5002 Right-UnsegmentedWhiteMatter 20 30 40 0 987 | 988 | # Below is the color table for white-matter pathways produced by dmri_paths 989 | 990 | #No. Label Name: R G B A 991 | # 992 | 5100 fmajor 204 102 102 0 993 | 5101 fminor 204 102 102 0 994 | # 995 | 5102 lh.atr 255 255 102 0 996 | 5103 lh.cab 153 204 0 0 997 | 5104 lh.ccg 0 153 153 0 998 | 5105 lh.cst 204 153 255 0 999 | 5106 lh.ilf 255 153 51 0 1000 | 5107 lh.slfp 204 204 204 0 1001 | 5108 lh.slft 153 255 255 0 1002 | 5109 lh.unc 102 153 255 0 1003 | # 1004 | 5110 rh.atr 255 255 102 0 1005 | 5111 rh.cab 153 204 0 0 1006 | 5112 rh.ccg 0 153 153 0 1007 | 5113 rh.cst 204 153 255 0 1008 | 5114 rh.ilf 255 153 51 0 1009 | 5115 rh.slfp 204 204 204 0 1010 | 5116 rh.slft 153 255 255 0 1011 | 5117 rh.unc 102 153 255 0 1012 | 1013 | # These are the same tracula labels as above in human-readable form 1014 | 5200 CC-ForcepsMajor 204 102 102 0 1015 | 5201 CC-ForcepsMinor 204 102 102 0 1016 | 5202 LAntThalRadiation 255 255 102 0 1017 | 5203 LCingulumAngBundle 153 204 0 0 1018 | 5204 LCingulumCingGyrus 0 153 153 0 1019 | 5205 LCorticospinalTract 204 153 255 0 1020 | 5206 LInfLongFas 255 153 51 0 1021 | 5207 LSupLongFasParietal 204 204 204 0 1022 | 5208 LSupLongFasTemporal 153 255 255 0 1023 | 5209 LUncinateFas 102 153 255 0 1024 | 5210 RAntThalRadiation 255 255 102 0 1025 | 5211 RCingulumAngBundle 153 204 0 0 1026 | 5212 RCingulumCingGyrus 0 153 153 0 1027 | 5213 RCorticospinalTract 204 153 255 0 1028 | 5214 RInfLongFas 255 153 51 0 1029 | 5215 RSupLongFasParietal 204 204 204 0 1030 | 5216 RSupLongFasTemporal 153 255 255 0 1031 | 5217 RUncinateFas 102 153 255 0 1032 | 1033 | ######################################## 1034 | 1035 | 6000 CST-orig 0 255 0 0 1036 | 6001 CST-hammer 255 255 0 0 1037 | 6002 CST-CVS 0 255 255 0 1038 | 6003 CST-flirt 0 0 255 0 1039 | 1040 | 6010 Left-SLF1 236 16 231 0 1041 | 6020 Right-SLF1 237 18 232 0 1042 | 1043 | 6030 Left-SLF3 236 13 227 0 1044 | 6040 Right-SLF3 236 17 228 0 1045 | 1046 | 6050 Left-CST 1 255 1 0 1047 | 6060 Right-CST 2 255 1 0 1048 | 1049 | 6070 Left-SLF2 236 14 230 0 1050 | 6080 Right-SLF2 237 14 230 0 1051 | 1052 | #No. Label Name: R G B A 1053 | 1054 | 7001 Lateral-nucleus 72 132 181 0 1055 | 7002 Basolateral-nucleus 243 243 243 0 1056 | 7003 Basal-nucleus 207 63 79 0 1057 | 7004 Centromedial-nucleus 121 20 135 0 1058 | 7005 Central-nucleus 197 60 248 0 1059 | 7006 Medial-nucleus 2 149 2 0 1060 | 7007 Cortical-nucleus 221 249 166 0 1061 | 7008 Accessory-Basal-nucleus 232 146 35 0 1062 | 7009 Corticoamygdaloid-transitio 20 60 120 0 1063 | 7010 Anterior-amygdaloid-area-AAA 250 250 0 0 1064 | 7011 Fusion-amygdala-HP-FAH 122 187 222 0 1065 | 7012 Hippocampal-amygdala-transition-HATA 237 12 177 0 1066 | 7013 Endopiriform-nucleus 10 49 255 0 1067 | 7014 Lateral-nucleus-olfactory-tract 205 184 144 0 1068 | 7015 Paralaminar-nucleus 45 205 165 0 1069 | 7016 Intercalated-nucleus 117 160 175 0 1070 | 7017 Prepiriform-cortex 221 217 21 0 1071 | 7018 Periamygdaloid-cortex 20 60 120 0 1072 | 7019 Envelope-Amygdala 141 21 100 0 1073 | 7020 Extranuclear-Amydala 225 140 141 0 1074 | 1075 | 7100 Brainstem-inferior-colliculus 42 201 168 0 1076 | 7101 Brainstem-cochlear-nucleus 168 104 162 0 1077 | 1078 | 8001 Thalamus-Anterior 74 130 181 0 1079 | 8002 Thalamus-Ventral-anterior 242 241 240 0 1080 | 8003 Thalamus-Lateral-dorsal 206 65 78 0 1081 | 8004 Thalamus-Lateral-posterior 120 21 133 0 1082 | 8005 Thalamus-Ventral-lateral 195 61 246 0 1083 | 8006 Thalamus-Ventral-posterior-medial 3 147 6 0 1084 | 8007 Thalamus-Ventral-posterior-lateral 220 251 163 0 1085 | 8008 Thalamus-intralaminar 232 146 33 0 1086 | 8009 Thalamus-centromedian 4 114 14 0 1087 | 8010 Thalamus-mediodorsal 121 184 220 0 1088 | 8011 Thalamus-medial 235 11 175 0 1089 | 8012 Thalamus-pulvinar 12 46 250 0 1090 | 8013 Thalamus-lateral-geniculate 203 182 143 0 1091 | 8014 Thalamus-medial-geniculate 42 204 167 0 1092 | 1093 | # 1094 | # Labels for thalamus parcellation using probabilistic tractography. See: 1095 | # Functional--Anatomical Validation and Individual Variation of Diffusion 1096 | # Tractography-based Segmentation of the Human Thalamus; Cerebral Cortex 1097 | # January 2005;15:31--39, doi:10.1093/cercor/bhh105, Advance Access 1098 | # publication July 6, 2004 1099 | # 1100 | 1101 | #No. Label Name: R G B A 1102 | 9000 ctx-lh-prefrontal 50 100 30 0 1103 | 9001 ctx-lh-primary-motor 30 100 45 0 1104 | 9002 ctx-lh-premotor 130 100 165 0 1105 | 9003 ctx-lh-temporal 105 25 5 0 1106 | 9004 ctx-lh-posterior-parietal 125 70 55 0 1107 | 9005 ctx-lh-prim-sec-somatosensory 225 20 105 0 1108 | 9006 ctx-lh-occipital 225 20 15 0 1109 | 1110 | 9500 ctx-rh-prefrontal 50 200 30 0 1111 | 9501 ctx-rh-primary-motor 30 150 45 0 1112 | 9502 ctx-rh-premotor 130 150 165 0 1113 | 9503 ctx-rh-temporal 105 75 5 0 1114 | 9504 ctx-rh-posterior-parietal 125 120 55 0 1115 | 9505 ctx-rh-prim-sec-somatosensory 225 70 105 0 1116 | 9506 ctx-rh-occipital 225 70 15 0 1117 | 1118 | # Below is the color table for the cortical labels of the seg volume 1119 | # created by mri_aparc2aseg (with --a2009s flag) in which the aseg 1120 | # cortex label is replaced by the labels in the aparc.a2009s. The 1121 | # cortical labels are the same as in Simple_surface_labels2009.txt, 1122 | # except that left hemisphere has 11100 added to the index and the 1123 | # right has 12100 added. The label names are also prepended with 1124 | # ctx_lh_, ctx_rh_, wm_lh_ and wm_rh_ (note usage of _ instead of - 1125 | # to differentiate from a2005s labels). 1126 | 1127 | #No. Label Name: R G B A 1128 | 11100 ctx_lh_Unknown 0 0 0 0 1129 | 11101 ctx_lh_G_and_S_frontomargin 23 220 60 0 1130 | 11102 ctx_lh_G_and_S_occipital_inf 23 60 180 0 1131 | 11103 ctx_lh_G_and_S_paracentral 63 100 60 0 1132 | 11104 ctx_lh_G_and_S_subcentral 63 20 220 0 1133 | 11105 ctx_lh_G_and_S_transv_frontopol 13 0 250 0 1134 | 11106 ctx_lh_G_and_S_cingul-Ant 26 60 0 0 1135 | 11107 ctx_lh_G_and_S_cingul-Mid-Ant 26 60 75 0 1136 | 11108 ctx_lh_G_and_S_cingul-Mid-Post 26 60 150 0 1137 | 11109 ctx_lh_G_cingul-Post-dorsal 25 60 250 0 1138 | 11110 ctx_lh_G_cingul-Post-ventral 60 25 25 0 1139 | 11111 ctx_lh_G_cuneus 180 20 20 0 1140 | 11112 ctx_lh_G_front_inf-Opercular 220 20 100 0 1141 | 11113 ctx_lh_G_front_inf-Orbital 140 60 60 0 1142 | 11114 ctx_lh_G_front_inf-Triangul 180 220 140 0 1143 | 11115 ctx_lh_G_front_middle 140 100 180 0 1144 | 11116 ctx_lh_G_front_sup 180 20 140 0 1145 | 11117 ctx_lh_G_Ins_lg_and_S_cent_ins 23 10 10 0 1146 | 11118 ctx_lh_G_insular_short 225 140 140 0 1147 | 11119 ctx_lh_G_occipital_middle 180 60 180 0 1148 | 11120 ctx_lh_G_occipital_sup 20 220 60 0 1149 | 11121 ctx_lh_G_oc-temp_lat-fusifor 60 20 140 0 1150 | 11122 ctx_lh_G_oc-temp_med-Lingual 220 180 140 0 1151 | 11123 ctx_lh_G_oc-temp_med-Parahip 65 100 20 0 1152 | 11124 ctx_lh_G_orbital 220 60 20 0 1153 | 11125 ctx_lh_G_pariet_inf-Angular 20 60 220 0 1154 | 11126 ctx_lh_G_pariet_inf-Supramar 100 100 60 0 1155 | 11127 ctx_lh_G_parietal_sup 220 180 220 0 1156 | 11128 ctx_lh_G_postcentral 20 180 140 0 1157 | 11129 ctx_lh_G_precentral 60 140 180 0 1158 | 11130 ctx_lh_G_precuneus 25 20 140 0 1159 | 11131 ctx_lh_G_rectus 20 60 100 0 1160 | 11132 ctx_lh_G_subcallosal 60 220 20 0 1161 | 11133 ctx_lh_G_temp_sup-G_T_transv 60 60 220 0 1162 | 11134 ctx_lh_G_temp_sup-Lateral 220 60 220 0 1163 | 11135 ctx_lh_G_temp_sup-Plan_polar 65 220 60 0 1164 | 11136 ctx_lh_G_temp_sup-Plan_tempo 25 140 20 0 1165 | 11137 ctx_lh_G_temporal_inf 220 220 100 0 1166 | 11138 ctx_lh_G_temporal_middle 180 60 60 0 1167 | 11139 ctx_lh_Lat_Fis-ant-Horizont 61 20 220 0 1168 | 11140 ctx_lh_Lat_Fis-ant-Vertical 61 20 60 0 1169 | 11141 ctx_lh_Lat_Fis-post 61 60 100 0 1170 | 11142 ctx_lh_Medial_wall 25 25 25 0 1171 | 11143 ctx_lh_Pole_occipital 140 20 60 0 1172 | 11144 ctx_lh_Pole_temporal 220 180 20 0 1173 | 11145 ctx_lh_S_calcarine 63 180 180 0 1174 | 11146 ctx_lh_S_central 221 20 10 0 1175 | 11147 ctx_lh_S_cingul-Marginalis 221 20 100 0 1176 | 11148 ctx_lh_S_circular_insula_ant 221 60 140 0 1177 | 11149 ctx_lh_S_circular_insula_inf 221 20 220 0 1178 | 11150 ctx_lh_S_circular_insula_sup 61 220 220 0 1179 | 11151 ctx_lh_S_collat_transv_ant 100 200 200 0 1180 | 11152 ctx_lh_S_collat_transv_post 10 200 200 0 1181 | 11153 ctx_lh_S_front_inf 221 220 20 0 1182 | 11154 ctx_lh_S_front_middle 141 20 100 0 1183 | 11155 ctx_lh_S_front_sup 61 220 100 0 1184 | 11156 ctx_lh_S_interm_prim-Jensen 141 60 20 0 1185 | 11157 ctx_lh_S_intrapariet_and_P_trans 143 20 220 0 1186 | 11158 ctx_lh_S_oc_middle_and_Lunatus 101 60 220 0 1187 | 11159 ctx_lh_S_oc_sup_and_transversal 21 20 140 0 1188 | 11160 ctx_lh_S_occipital_ant 61 20 180 0 1189 | 11161 ctx_lh_S_oc-temp_lat 221 140 20 0 1190 | 11162 ctx_lh_S_oc-temp_med_and_Lingual 141 100 220 0 1191 | 11163 ctx_lh_S_orbital_lateral 221 100 20 0 1192 | 11164 ctx_lh_S_orbital_med-olfact 181 200 20 0 1193 | 11165 ctx_lh_S_orbital-H_Shaped 101 20 20 0 1194 | 11166 ctx_lh_S_parieto_occipital 101 100 180 0 1195 | 11167 ctx_lh_S_pericallosal 181 220 20 0 1196 | 11168 ctx_lh_S_postcentral 21 140 200 0 1197 | 11169 ctx_lh_S_precentral-inf-part 21 20 240 0 1198 | 11170 ctx_lh_S_precentral-sup-part 21 20 200 0 1199 | 11171 ctx_lh_S_suborbital 21 20 60 0 1200 | 11172 ctx_lh_S_subparietal 101 60 60 0 1201 | 11173 ctx_lh_S_temporal_inf 21 180 180 0 1202 | 11174 ctx_lh_S_temporal_sup 223 220 60 0 1203 | 11175 ctx_lh_S_temporal_transverse 221 60 60 0 1204 | 1205 | 12100 ctx_rh_Unknown 0 0 0 0 1206 | 12101 ctx_rh_G_and_S_frontomargin 23 220 60 0 1207 | 12102 ctx_rh_G_and_S_occipital_inf 23 60 180 0 1208 | 12103 ctx_rh_G_and_S_paracentral 63 100 60 0 1209 | 12104 ctx_rh_G_and_S_subcentral 63 20 220 0 1210 | 12105 ctx_rh_G_and_S_transv_frontopol 13 0 250 0 1211 | 12106 ctx_rh_G_and_S_cingul-Ant 26 60 0 0 1212 | 12107 ctx_rh_G_and_S_cingul-Mid-Ant 26 60 75 0 1213 | 12108 ctx_rh_G_and_S_cingul-Mid-Post 26 60 150 0 1214 | 12109 ctx_rh_G_cingul-Post-dorsal 25 60 250 0 1215 | 12110 ctx_rh_G_cingul-Post-ventral 60 25 25 0 1216 | 12111 ctx_rh_G_cuneus 180 20 20 0 1217 | 12112 ctx_rh_G_front_inf-Opercular 220 20 100 0 1218 | 12113 ctx_rh_G_front_inf-Orbital 140 60 60 0 1219 | 12114 ctx_rh_G_front_inf-Triangul 180 220 140 0 1220 | 12115 ctx_rh_G_front_middle 140 100 180 0 1221 | 12116 ctx_rh_G_front_sup 180 20 140 0 1222 | 12117 ctx_rh_G_Ins_lg_and_S_cent_ins 23 10 10 0 1223 | 12118 ctx_rh_G_insular_short 225 140 140 0 1224 | 12119 ctx_rh_G_occipital_middle 180 60 180 0 1225 | 12120 ctx_rh_G_occipital_sup 20 220 60 0 1226 | 12121 ctx_rh_G_oc-temp_lat-fusifor 60 20 140 0 1227 | 12122 ctx_rh_G_oc-temp_med-Lingual 220 180 140 0 1228 | 12123 ctx_rh_G_oc-temp_med-Parahip 65 100 20 0 1229 | 12124 ctx_rh_G_orbital 220 60 20 0 1230 | 12125 ctx_rh_G_pariet_inf-Angular 20 60 220 0 1231 | 12126 ctx_rh_G_pariet_inf-Supramar 100 100 60 0 1232 | 12127 ctx_rh_G_parietal_sup 220 180 220 0 1233 | 12128 ctx_rh_G_postcentral 20 180 140 0 1234 | 12129 ctx_rh_G_precentral 60 140 180 0 1235 | 12130 ctx_rh_G_precuneus 25 20 140 0 1236 | 12131 ctx_rh_G_rectus 20 60 100 0 1237 | 12132 ctx_rh_G_subcallosal 60 220 20 0 1238 | 12133 ctx_rh_G_temp_sup-G_T_transv 60 60 220 0 1239 | 12134 ctx_rh_G_temp_sup-Lateral 220 60 220 0 1240 | 12135 ctx_rh_G_temp_sup-Plan_polar 65 220 60 0 1241 | 12136 ctx_rh_G_temp_sup-Plan_tempo 25 140 20 0 1242 | 12137 ctx_rh_G_temporal_inf 220 220 100 0 1243 | 12138 ctx_rh_G_temporal_middle 180 60 60 0 1244 | 12139 ctx_rh_Lat_Fis-ant-Horizont 61 20 220 0 1245 | 12140 ctx_rh_Lat_Fis-ant-Vertical 61 20 60 0 1246 | 12141 ctx_rh_Lat_Fis-post 61 60 100 0 1247 | 12142 ctx_rh_Medial_wall 25 25 25 0 1248 | 12143 ctx_rh_Pole_occipital 140 20 60 0 1249 | 12144 ctx_rh_Pole_temporal 220 180 20 0 1250 | 12145 ctx_rh_S_calcarine 63 180 180 0 1251 | 12146 ctx_rh_S_central 221 20 10 0 1252 | 12147 ctx_rh_S_cingul-Marginalis 221 20 100 0 1253 | 12148 ctx_rh_S_circular_insula_ant 221 60 140 0 1254 | 12149 ctx_rh_S_circular_insula_inf 221 20 220 0 1255 | 12150 ctx_rh_S_circular_insula_sup 61 220 220 0 1256 | 12151 ctx_rh_S_collat_transv_ant 100 200 200 0 1257 | 12152 ctx_rh_S_collat_transv_post 10 200 200 0 1258 | 12153 ctx_rh_S_front_inf 221 220 20 0 1259 | 12154 ctx_rh_S_front_middle 141 20 100 0 1260 | 12155 ctx_rh_S_front_sup 61 220 100 0 1261 | 12156 ctx_rh_S_interm_prim-Jensen 141 60 20 0 1262 | 12157 ctx_rh_S_intrapariet_and_P_trans 143 20 220 0 1263 | 12158 ctx_rh_S_oc_middle_and_Lunatus 101 60 220 0 1264 | 12159 ctx_rh_S_oc_sup_and_transversal 21 20 140 0 1265 | 12160 ctx_rh_S_occipital_ant 61 20 180 0 1266 | 12161 ctx_rh_S_oc-temp_lat 221 140 20 0 1267 | 12162 ctx_rh_S_oc-temp_med_and_Lingual 141 100 220 0 1268 | 12163 ctx_rh_S_orbital_lateral 221 100 20 0 1269 | 12164 ctx_rh_S_orbital_med-olfact 181 200 20 0 1270 | 12165 ctx_rh_S_orbital-H_Shaped 101 20 20 0 1271 | 12166 ctx_rh_S_parieto_occipital 101 100 180 0 1272 | 12167 ctx_rh_S_pericallosal 181 220 20 0 1273 | 12168 ctx_rh_S_postcentral 21 140 200 0 1274 | 12169 ctx_rh_S_precentral-inf-part 21 20 240 0 1275 | 12170 ctx_rh_S_precentral-sup-part 21 20 200 0 1276 | 12171 ctx_rh_S_suborbital 21 20 60 0 1277 | 12172 ctx_rh_S_subparietal 101 60 60 0 1278 | 12173 ctx_rh_S_temporal_inf 21 180 180 0 1279 | 12174 ctx_rh_S_temporal_sup 223 220 60 0 1280 | 12175 ctx_rh_S_temporal_transverse 221 60 60 0 1281 | 1282 | #No. Label Name: R G B A 1283 | 13100 wm_lh_Unknown 0 0 0 0 1284 | 13101 wm_lh_G_and_S_frontomargin 23 220 60 0 1285 | 13102 wm_lh_G_and_S_occipital_inf 23 60 180 0 1286 | 13103 wm_lh_G_and_S_paracentral 63 100 60 0 1287 | 13104 wm_lh_G_and_S_subcentral 63 20 220 0 1288 | 13105 wm_lh_G_and_S_transv_frontopol 13 0 250 0 1289 | 13106 wm_lh_G_and_S_cingul-Ant 26 60 0 0 1290 | 13107 wm_lh_G_and_S_cingul-Mid-Ant 26 60 75 0 1291 | 13108 wm_lh_G_and_S_cingul-Mid-Post 26 60 150 0 1292 | 13109 wm_lh_G_cingul-Post-dorsal 25 60 250 0 1293 | 13110 wm_lh_G_cingul-Post-ventral 60 25 25 0 1294 | 13111 wm_lh_G_cuneus 180 20 20 0 1295 | 13112 wm_lh_G_front_inf-Opercular 220 20 100 0 1296 | 13113 wm_lh_G_front_inf-Orbital 140 60 60 0 1297 | 13114 wm_lh_G_front_inf-Triangul 180 220 140 0 1298 | 13115 wm_lh_G_front_middle 140 100 180 0 1299 | 13116 wm_lh_G_front_sup 180 20 140 0 1300 | 13117 wm_lh_G_Ins_lg_and_S_cent_ins 23 10 10 0 1301 | 13118 wm_lh_G_insular_short 225 140 140 0 1302 | 13119 wm_lh_G_occipital_middle 180 60 180 0 1303 | 13120 wm_lh_G_occipital_sup 20 220 60 0 1304 | 13121 wm_lh_G_oc-temp_lat-fusifor 60 20 140 0 1305 | 13122 wm_lh_G_oc-temp_med-Lingual 220 180 140 0 1306 | 13123 wm_lh_G_oc-temp_med-Parahip 65 100 20 0 1307 | 13124 wm_lh_G_orbital 220 60 20 0 1308 | 13125 wm_lh_G_pariet_inf-Angular 20 60 220 0 1309 | 13126 wm_lh_G_pariet_inf-Supramar 100 100 60 0 1310 | 13127 wm_lh_G_parietal_sup 220 180 220 0 1311 | 13128 wm_lh_G_postcentral 20 180 140 0 1312 | 13129 wm_lh_G_precentral 60 140 180 0 1313 | 13130 wm_lh_G_precuneus 25 20 140 0 1314 | 13131 wm_lh_G_rectus 20 60 100 0 1315 | 13132 wm_lh_G_subcallosal 60 220 20 0 1316 | 13133 wm_lh_G_temp_sup-G_T_transv 60 60 220 0 1317 | 13134 wm_lh_G_temp_sup-Lateral 220 60 220 0 1318 | 13135 wm_lh_G_temp_sup-Plan_polar 65 220 60 0 1319 | 13136 wm_lh_G_temp_sup-Plan_tempo 25 140 20 0 1320 | 13137 wm_lh_G_temporal_inf 220 220 100 0 1321 | 13138 wm_lh_G_temporal_middle 180 60 60 0 1322 | 13139 wm_lh_Lat_Fis-ant-Horizont 61 20 220 0 1323 | 13140 wm_lh_Lat_Fis-ant-Vertical 61 20 60 0 1324 | 13141 wm_lh_Lat_Fis-post 61 60 100 0 1325 | 13142 wm_lh_Medial_wall 25 25 25 0 1326 | 13143 wm_lh_Pole_occipital 140 20 60 0 1327 | 13144 wm_lh_Pole_temporal 220 180 20 0 1328 | 13145 wm_lh_S_calcarine 63 180 180 0 1329 | 13146 wm_lh_S_central 221 20 10 0 1330 | 13147 wm_lh_S_cingul-Marginalis 221 20 100 0 1331 | 13148 wm_lh_S_circular_insula_ant 221 60 140 0 1332 | 13149 wm_lh_S_circular_insula_inf 221 20 220 0 1333 | 13150 wm_lh_S_circular_insula_sup 61 220 220 0 1334 | 13151 wm_lh_S_collat_transv_ant 100 200 200 0 1335 | 13152 wm_lh_S_collat_transv_post 10 200 200 0 1336 | 13153 wm_lh_S_front_inf 221 220 20 0 1337 | 13154 wm_lh_S_front_middle 141 20 100 0 1338 | 13155 wm_lh_S_front_sup 61 220 100 0 1339 | 13156 wm_lh_S_interm_prim-Jensen 141 60 20 0 1340 | 13157 wm_lh_S_intrapariet_and_P_trans 143 20 220 0 1341 | 13158 wm_lh_S_oc_middle_and_Lunatus 101 60 220 0 1342 | 13159 wm_lh_S_oc_sup_and_transversal 21 20 140 0 1343 | 13160 wm_lh_S_occipital_ant 61 20 180 0 1344 | 13161 wm_lh_S_oc-temp_lat 221 140 20 0 1345 | 13162 wm_lh_S_oc-temp_med_and_Lingual 141 100 220 0 1346 | 13163 wm_lh_S_orbital_lateral 221 100 20 0 1347 | 13164 wm_lh_S_orbital_med-olfact 181 200 20 0 1348 | 13165 wm_lh_S_orbital-H_Shaped 101 20 20 0 1349 | 13166 wm_lh_S_parieto_occipital 101 100 180 0 1350 | 13167 wm_lh_S_pericallosal 181 220 20 0 1351 | 13168 wm_lh_S_postcentral 21 140 200 0 1352 | 13169 wm_lh_S_precentral-inf-part 21 20 240 0 1353 | 13170 wm_lh_S_precentral-sup-part 21 20 200 0 1354 | 13171 wm_lh_S_suborbital 21 20 60 0 1355 | 13172 wm_lh_S_subparietal 101 60 60 0 1356 | 13173 wm_lh_S_temporal_inf 21 180 180 0 1357 | 13174 wm_lh_S_temporal_sup 223 220 60 0 1358 | 13175 wm_lh_S_temporal_transverse 221 60 60 0 1359 | 1360 | 14100 wm_rh_Unknown 0 0 0 0 1361 | 14101 wm_rh_G_and_S_frontomargin 23 220 60 0 1362 | 14102 wm_rh_G_and_S_occipital_inf 23 60 180 0 1363 | 14103 wm_rh_G_and_S_paracentral 63 100 60 0 1364 | 14104 wm_rh_G_and_S_subcentral 63 20 220 0 1365 | 14105 wm_rh_G_and_S_transv_frontopol 13 0 250 0 1366 | 14106 wm_rh_G_and_S_cingul-Ant 26 60 0 0 1367 | 14107 wm_rh_G_and_S_cingul-Mid-Ant 26 60 75 0 1368 | 14108 wm_rh_G_and_S_cingul-Mid-Post 26 60 150 0 1369 | 14109 wm_rh_G_cingul-Post-dorsal 25 60 250 0 1370 | 14110 wm_rh_G_cingul-Post-ventral 60 25 25 0 1371 | 14111 wm_rh_G_cuneus 180 20 20 0 1372 | 14112 wm_rh_G_front_inf-Opercular 220 20 100 0 1373 | 14113 wm_rh_G_front_inf-Orbital 140 60 60 0 1374 | 14114 wm_rh_G_front_inf-Triangul 180 220 140 0 1375 | 14115 wm_rh_G_front_middle 140 100 180 0 1376 | 14116 wm_rh_G_front_sup 180 20 140 0 1377 | 14117 wm_rh_G_Ins_lg_and_S_cent_ins 23 10 10 0 1378 | 14118 wm_rh_G_insular_short 225 140 140 0 1379 | 14119 wm_rh_G_occipital_middle 180 60 180 0 1380 | 14120 wm_rh_G_occipital_sup 20 220 60 0 1381 | 14121 wm_rh_G_oc-temp_lat-fusifor 60 20 140 0 1382 | 14122 wm_rh_G_oc-temp_med-Lingual 220 180 140 0 1383 | 14123 wm_rh_G_oc-temp_med-Parahip 65 100 20 0 1384 | 14124 wm_rh_G_orbital 220 60 20 0 1385 | 14125 wm_rh_G_pariet_inf-Angular 20 60 220 0 1386 | 14126 wm_rh_G_pariet_inf-Supramar 100 100 60 0 1387 | 14127 wm_rh_G_parietal_sup 220 180 220 0 1388 | 14128 wm_rh_G_postcentral 20 180 140 0 1389 | 14129 wm_rh_G_precentral 60 140 180 0 1390 | 14130 wm_rh_G_precuneus 25 20 140 0 1391 | 14131 wm_rh_G_rectus 20 60 100 0 1392 | 14132 wm_rh_G_subcallosal 60 220 20 0 1393 | 14133 wm_rh_G_temp_sup-G_T_transv 60 60 220 0 1394 | 14134 wm_rh_G_temp_sup-Lateral 220 60 220 0 1395 | 14135 wm_rh_G_temp_sup-Plan_polar 65 220 60 0 1396 | 14136 wm_rh_G_temp_sup-Plan_tempo 25 140 20 0 1397 | 14137 wm_rh_G_temporal_inf 220 220 100 0 1398 | 14138 wm_rh_G_temporal_middle 180 60 60 0 1399 | 14139 wm_rh_Lat_Fis-ant-Horizont 61 20 220 0 1400 | 14140 wm_rh_Lat_Fis-ant-Vertical 61 20 60 0 1401 | 14141 wm_rh_Lat_Fis-post 61 60 100 0 1402 | 14142 wm_rh_Medial_wall 25 25 25 0 1403 | 14143 wm_rh_Pole_occipital 140 20 60 0 1404 | 14144 wm_rh_Pole_temporal 220 180 20 0 1405 | 14145 wm_rh_S_calcarine 63 180 180 0 1406 | 14146 wm_rh_S_central 221 20 10 0 1407 | 14147 wm_rh_S_cingul-Marginalis 221 20 100 0 1408 | 14148 wm_rh_S_circular_insula_ant 221 60 140 0 1409 | 14149 wm_rh_S_circular_insula_inf 221 20 220 0 1410 | 14150 wm_rh_S_circular_insula_sup 61 220 220 0 1411 | 14151 wm_rh_S_collat_transv_ant 100 200 200 0 1412 | 14152 wm_rh_S_collat_transv_post 10 200 200 0 1413 | 14153 wm_rh_S_front_inf 221 220 20 0 1414 | 14154 wm_rh_S_front_middle 141 20 100 0 1415 | 14155 wm_rh_S_front_sup 61 220 100 0 1416 | 14156 wm_rh_S_interm_prim-Jensen 141 60 20 0 1417 | 14157 wm_rh_S_intrapariet_and_P_trans 143 20 220 0 1418 | 14158 wm_rh_S_oc_middle_and_Lunatus 101 60 220 0 1419 | 14159 wm_rh_S_oc_sup_and_transversal 21 20 140 0 1420 | 14160 wm_rh_S_occipital_ant 61 20 180 0 1421 | 14161 wm_rh_S_oc-temp_lat 221 140 20 0 1422 | 14162 wm_rh_S_oc-temp_med_and_Lingual 141 100 220 0 1423 | 14163 wm_rh_S_orbital_lateral 221 100 20 0 1424 | 14164 wm_rh_S_orbital_med-olfact 181 200 20 0 1425 | 14165 wm_rh_S_orbital-H_Shaped 101 20 20 0 1426 | 14166 wm_rh_S_parieto_occipital 101 100 180 0 1427 | 14167 wm_rh_S_pericallosal 181 220 20 0 1428 | 14168 wm_rh_S_postcentral 21 140 200 0 1429 | 14169 wm_rh_S_precentral-inf-part 21 20 240 0 1430 | 14170 wm_rh_S_precentral-sup-part 21 20 200 0 1431 | 14171 wm_rh_S_suborbital 21 20 60 0 1432 | 14172 wm_rh_S_subparietal 101 60 60 0 1433 | 14173 wm_rh_S_temporal_inf 21 180 180 0 1434 | 14174 wm_rh_S_temporal_sup 223 220 60 0 1435 | 14175 wm_rh_S_temporal_transverse 221 60 60 0 1436 | --------------------------------------------------------------------------------