Plotting API
yabplot.build_cortical_atlas(nii_path, wb_txt_path, out_dir, include_list=None, exclude_list=None, atlasname='atlas')
builds a custom yabplot cortical atlas from a volumetric NIfTI file.
projects a volumetric NIfTI atlas to standard fsLR32k surfaces using connectome workbench, cleans the medial wall, and applies majority-vote boundary smoothing to remove voxel artifacts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nii_path
|
str
|
absolute path to the 3D NIfTI volume of the atlas. |
required |
wb_txt_path
|
str
|
absolute path to the text file formatted specifically for connectome workbench. |
required |
out_dir
|
str
|
directory where the final .csv map and .txt LUT will be saved. |
required |
include_list
|
list of str
|
keywords of regions to strictly include. all other regions are ignored. |
None
|
exclude_list
|
list of str
|
keywords of regions to strictly exclude. all other regions are kept. |
None
|
atlasname
|
str
|
prefix name for the output files. default is 'atlas'. |
'atlas'
|
Raises:
| Type | Description |
|---|---|
ValueError
|
if both include_list and exclude_list are provided. |
Source code in yabplot/atlas_builder.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | |
yabplot.build_subcortical_atlas(nii_path, labels_dict, out_dir, include_list=None, exclude_list=None, smooth_i=15, smooth_f=0.6)
extracts 3D subcortical meshes from a volumetric nifti atlas.
uses the marching cubes algorithm to generate 3D surface meshes for specific regions, applies laplacian smoothing to remove voxel artifacts, and saves them as .vtk files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nii_path
|
str
|
absolute path to the 3D nifti volume. |
required |
labels_dict
|
dict
|
dictionary mapping integer region IDs to string names (e.g., {1: 'thalamus_l'}). |
required |
out_dir
|
str
|
directory where the .vtk mesh files will be saved. |
required |
include_list
|
list of str
|
keywords of regions to strictly include. all other regions are ignored. |
None
|
exclude_list
|
list of str
|
keywords of regions to strictly exclude. all other regions are kept. |
None
|
smooth_i
|
int
|
number of iterations for laplacian mesh smoothing. default is 15. |
15
|
smooth_f
|
float
|
relaxation factor for laplacian mesh smoothing (0.0 to 1.0). default is 0.6. |
0.6
|
Raises:
| Type | Description |
|---|---|
ValueError
|
if both include_list and exclude_list are provided. |
Source code in yabplot/atlas_builder.py
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 | |