@@ -85,17 +85,17 @@ def _pack_rgba(rgba):
85
85
"""Pack an RGBA sequence into a single integer.
86
86
87
87
Used by :func:`read_annot` and :func:`write_annot` to generate
88
- "annotation values" for a Freesuerfer ``.annot`` file.
88
+ "annotation values" for a Freesurfer ``.annot`` file.
89
89
90
90
Parameters
91
91
----------
92
92
rgba : ndarray, shape (n, 4)
93
- RGBA colours
93
+ RGBA colors
94
94
95
95
Returns
96
96
-------
97
97
out : ndarray, shape (n, 1)
98
- Annotation values for each colour .
98
+ Annotation values for each color .
99
99
"""
100
100
bitshifts = 2 ** np .array ([[0 ], [8 ], [16 ], [24 ]], dtype = rgba .dtype )
101
101
return rgba .dot (bitshifts )
@@ -328,14 +328,14 @@ def read_annot(filepath, orig_ids=False):
328
328
329
329
An ``.annot`` file contains a sequence of vertices with a label (also known
330
330
as an "annotation value") associated with each vertex, and then a sequence
331
- of colours corresponding to each label.
331
+ of colors corresponding to each label.
332
332
333
333
Annotation file format versions 1 and 2 are supported, corresponding to
334
334
the "old-style" and "new-style" color table layout.
335
335
336
336
See:
337
- https://surfer.nmr.mgh.harvard.edu/fswiki/LabelsClutsAnnotationFiles#Annotation
338
- https://github.com/freesurfer/freesurfer/blob/dev/matlab/read_annotation.m
337
+ * https://surfer.nmr.mgh.harvard.edu/fswiki/LabelsClutsAnnotationFiles#Annotation
338
+ * https://github.com/freesurfer/freesurfer/blob/dev/matlab/read_annotation.m
339
339
340
340
Parameters
341
341
----------
@@ -366,13 +366,13 @@ def read_annot(filepath, orig_ids=False):
366
366
data = np .fromfile (fobj , dt , vnum * 2 ).reshape (vnum , 2 )
367
367
labels = data [:, 1 ]
368
368
369
- # is there a colour table?
369
+ # is there a color table?
370
370
ctab_exists = np .fromfile (fobj , dt , 1 )[0 ]
371
371
if not ctab_exists :
372
372
raise Exception ('Color table not found in annotation file' )
373
373
374
374
# in old-format files, the next field will contain the number of
375
- # entries in the colour table. In new-format files, this must be
375
+ # entries in the color table. In new-format files, this must be
376
376
# equal to -2
377
377
n_entries = np .fromfile (fobj , dt , 1 )[0 ]
378
378
@@ -395,18 +395,18 @@ def read_annot(filepath, orig_ids=False):
395
395
396
396
397
397
def _read_annot_ctab_old_format (fobj , n_entries ):
398
- """Read in an old-style Freesurfer colour table from `fobj`.
398
+ """Read in an old-style Freesurfer color table from `fobj`.
399
399
400
400
This function is used by :func:`read_annot`.
401
401
402
402
Parameters
403
403
----------
404
404
405
- fobj : file-like
405
+ fobj : file
406
406
Open file handle to a Freesurfer `.annot` file, with seek point
407
- at the beginning of the colour table data.
407
+ at the beginning of the color table data.
408
408
n_entries : int
409
- Number of entries in the colour table.
409
+ Number of entries in the color table.
410
410
411
411
Returns
412
412
-------
@@ -436,18 +436,18 @@ def _read_annot_ctab_old_format(fobj, n_entries):
436
436
437
437
438
438
def _read_annot_ctab_new_format (fobj , ctab_version ):
439
- """Read in a new-style Freesurfer colour table from `fobj`.
439
+ """Read in a new-style Freesurfer color table from `fobj`.
440
440
441
441
This function is used by :func:`read_annot`.
442
442
443
443
Parameters
444
444
----------
445
445
446
- fobj : file-like
446
+ fobj : file
447
447
Open file handle to a Freesurfer `.annot` file, with seek point
448
- at the beginning of the colour table data.
448
+ at the beginning of the color table data.
449
449
ctab_version : int
450
- Colour table format version - must be equal to 2
450
+ Color table format version - must be equal to 2
451
451
452
452
Returns
453
453
-------
@@ -487,8 +487,8 @@ def write_annot(filepath, labels, ctab, names, fill_ctab=True):
487
487
"""Write out a "new-style" Freesurfer annotation file.
488
488
489
489
See:
490
- https://surfer.nmr.mgh.harvard.edu/fswiki/LabelsClutsAnnotationFiles#Annotation
491
- https://github.com/freesurfer/freesurfer/blob/dev/matlab/write_annotation.m
490
+ * https://surfer.nmr.mgh.harvard.edu/fswiki/LabelsClutsAnnotationFiles#Annotation
491
+ * https://github.com/freesurfer/freesurfer/blob/dev/matlab/write_annotation.m
492
492
493
493
Parameters
494
494
----------
0 commit comments