From 65954359704c79953a659a4d8cee8cb3baab971b Mon Sep 17 00:00:00 2001 From: oesteban Date: Sun, 19 Apr 2020 17:21:26 -0700 Subject: [PATCH] doc: add detailed docstring to new function, with link to Aseg LUT [skip ci] --- smriprep/workflows/anatomical.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/smriprep/workflows/anatomical.py b/smriprep/workflows/anatomical.py index ec1d8c7604..371918fbe0 100644 --- a/smriprep/workflows/anatomical.py +++ b/smriprep/workflows/anatomical.py @@ -634,6 +634,18 @@ def _pop(inlist): def _aseg_to_three(): + """ + Map FreeSurfer's segmentation onto a brain (3-)tissue segmentation. + + This function generates an index of 255+0 labels and maps them into zero (bg), + 1 (GM), 2 (WM), or 3 (CSF). The new values are set according to BIDS-Derivatives. + Then the index is populated (e.g., label 3 in the original segmentation maps to label + 1 in the output). + The `aseg lookup table + `__ + is available in the FreeSurfer source. + + """ import numpy as np # Base struct aseg_lut = np.zeros((256,), dtype="int")