@@ -85,17 +85,17 @@ def _pack_rgba(rgba):
8585 """Pack an RGBA sequence into a single integer.
8686
8787 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.
8989
9090 Parameters
9191 ----------
9292 rgba : ndarray, shape (n, 4)
93- RGBA colours
93+ RGBA colors
9494
9595 Returns
9696 -------
9797 out : ndarray, shape (n, 1)
98- Annotation values for each colour .
98+ Annotation values for each color .
9999 """
100100 bitshifts = 2 ** np .array ([[0 ], [8 ], [16 ], [24 ]], dtype = rgba .dtype )
101101 return rgba .dot (bitshifts )
@@ -328,14 +328,14 @@ def read_annot(filepath, orig_ids=False):
328328
329329 An ``.annot`` file contains a sequence of vertices with a label (also known
330330 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.
332332
333333 Annotation file format versions 1 and 2 are supported, corresponding to
334334 the "old-style" and "new-style" color table layout.
335335
336336 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
339339
340340 Parameters
341341 ----------
@@ -366,13 +366,13 @@ def read_annot(filepath, orig_ids=False):
366366 data = np .fromfile (fobj , dt , vnum * 2 ).reshape (vnum , 2 )
367367 labels = data [:, 1 ]
368368
369- # is there a colour table?
369+ # is there a color table?
370370 ctab_exists = np .fromfile (fobj , dt , 1 )[0 ]
371371 if not ctab_exists :
372372 raise Exception ('Color table not found in annotation file' )
373373
374374 # 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
376376 # equal to -2
377377 n_entries = np .fromfile (fobj , dt , 1 )[0 ]
378378
@@ -395,18 +395,18 @@ def read_annot(filepath, orig_ids=False):
395395
396396
397397def _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`.
399399
400400 This function is used by :func:`read_annot`.
401401
402402 Parameters
403403 ----------
404404
405- fobj : file-like
405+ fobj : file
406406 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.
408408 n_entries : int
409- Number of entries in the colour table.
409+ Number of entries in the color table.
410410
411411 Returns
412412 -------
@@ -436,18 +436,18 @@ def _read_annot_ctab_old_format(fobj, n_entries):
436436
437437
438438def _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`.
440440
441441 This function is used by :func:`read_annot`.
442442
443443 Parameters
444444 ----------
445445
446- fobj : file-like
446+ fobj : file
447447 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.
449449 ctab_version : int
450- Colour table format version - must be equal to 2
450+ Color table format version - must be equal to 2
451451
452452 Returns
453453 -------
@@ -487,8 +487,8 @@ def write_annot(filepath, labels, ctab, names, fill_ctab=True):
487487 """Write out a "new-style" Freesurfer annotation file.
488488
489489 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
492492
493493 Parameters
494494 ----------
0 commit comments