Skip to content

Commit 10dbdda

Browse files
committed
TEST: Update tests to use RGB only
1 parent b5dd5d7 commit 10dbdda

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

nibabel/freesurfer/tests/test_io.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
from .. import (read_geometry, read_morph_data, read_annot, read_label,
1818
write_geometry, write_morph_data, write_annot)
19-
from ..io import _pack_rgba
19+
from ..io import _pack_rgb
2020

2121
from ...tests.nibabel_data import get_nibabel_data, needs_nibabel_data
2222
from ...fileslice import strided_scalar
@@ -236,8 +236,7 @@ def test_read_write_annot():
236236
# Generate the annotation values for each LUT entry
237237
rgbal[:, 4] = (rgbal[:, 0] +
238238
rgbal[:, 1] * (2 ** 8) +
239-
rgbal[:, 2] * (2 ** 16) +
240-
rgbal[:, 3] * (2 ** 24))
239+
rgbal[:, 2] * (2 ** 16))
241240
annot_path = 'c.annot'
242241
with InTemporaryDirectory():
243242
write_annot(annot_path, labels, rgbal, names, fill_ctab=False)
@@ -287,8 +286,7 @@ def test_write_annot_fill_ctab():
287286
rgbal = np.hstack((rgba, np.zeros((nlabels, 1), dtype=np.int32)))
288287
rgbal[:, 4] = (rgbal[:, 0] +
289288
rgbal[:, 1] * (2 ** 8) +
290-
rgbal[:, 2] * (2 ** 16) +
291-
rgbal[:, 3] * (2 ** 24))
289+
rgbal[:, 2] * (2 ** 16))
292290
with clear_and_catch_warnings() as w:
293291
write_annot(annot_path, labels, rgbal, names, fill_ctab=False)
294292
assert_true(
@@ -307,7 +305,7 @@ def gen_old_annot_file(fpath, nverts, labels, rgba, names):
307305
dt = '>i'
308306
vdata = np.zeros((nverts, 2), dtype=dt)
309307
vdata[:, 0] = np.arange(nverts)
310-
vdata[:, [1]] = _pack_rgba(rgba[labels, :])
308+
vdata[:, [1]] = _pack_rgb(rgba[labels, :3])
311309
fbytes = b''
312310
# number of vertices
313311
fbytes += struct.pack(dt, nverts)

0 commit comments

Comments
 (0)