File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -402,7 +402,7 @@ def _read_annot_ctab_old_format(fobj, n_entries):
402
402
Parameters
403
403
----------
404
404
405
- fobj : file
405
+ fobj : file-like
406
406
Open file handle to a Freesurfer `.annot` file, with seek point
407
407
at the beginning of the color table data.
408
408
n_entries : int
@@ -416,8 +416,9 @@ def _read_annot_ctab_old_format(fobj, n_entries):
416
416
names : list of str
417
417
The names of the labels. The length of the list is n_entries.
418
418
"""
419
- dt = _ANNOT_DT
419
+ assert hasattr ( fobj , 'read' )
420
420
421
+ dt = _ANNOT_DT
421
422
# orig_tab string length + string
422
423
length = np .fromfile (fobj , dt , 1 )[0 ]
423
424
orig_tab = np .fromfile (fobj , '>c' , length )
@@ -443,7 +444,7 @@ def _read_annot_ctab_new_format(fobj, ctab_version):
443
444
Parameters
444
445
----------
445
446
446
- fobj : file
447
+ fobj : file-like
447
448
Open file handle to a Freesurfer `.annot` file, with seek point
448
449
at the beginning of the color table data.
449
450
ctab_version : int
@@ -457,6 +458,8 @@ def _read_annot_ctab_new_format(fobj, ctab_version):
457
458
names : list of str
458
459
The names of the labels. The length of the list is n_labels.
459
460
"""
461
+ assert hasattr (fobj , 'read' )
462
+
460
463
dt = _ANNOT_DT
461
464
# This code works with a file version == 2, nothing else
462
465
if ctab_version != 2 :
You can’t perform that action at this time.
0 commit comments