We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 63b7a52 commit e018adfCopy full SHA for e018adf
nibabel/freesurfer/io.py
@@ -561,7 +561,7 @@ def write_string(s):
561
write(-2)
562
563
# maxstruc
564
- write(np.max(labels) + 1)
+ write(max(np.max(labels) + 1, ctab.shape[0]))
565
566
# File of LUT is unknown.
567
write_string('NOFILE')
nibabel/freesurfer/tests/test_io.py
@@ -359,7 +359,7 @@ def test_label():
359
360
361
def test_write_annot_maxstruct():
362
- """Verify we can write files with repeated labels - test by reading"""
+ """Test writing ANNOT files with repeated labels"""
363
with InTemporaryDirectory():
364
nlabels = 3
365
names = ['label {}'.format(l) for l in range(1, nlabels + 1)]
0 commit comments