16
16
17
17
from .. import (read_geometry , read_morph_data , read_annot , read_label ,
18
18
write_geometry , write_morph_data , write_annot )
19
- from ..io import _pack_rgba
19
+ from ..io import _pack_rgb
20
20
21
21
from ...tests .nibabel_data import get_nibabel_data , needs_nibabel_data
22
22
from ...fileslice import strided_scalar
@@ -236,8 +236,7 @@ def test_read_write_annot():
236
236
# Generate the annotation values for each LUT entry
237
237
rgbal [:, 4 ] = (rgbal [:, 0 ] +
238
238
rgbal [:, 1 ] * (2 ** 8 ) +
239
- rgbal [:, 2 ] * (2 ** 16 ) +
240
- rgbal [:, 3 ] * (2 ** 24 ))
239
+ rgbal [:, 2 ] * (2 ** 16 ))
241
240
annot_path = 'c.annot'
242
241
with InTemporaryDirectory ():
243
242
write_annot (annot_path , labels , rgbal , names , fill_ctab = False )
@@ -287,8 +286,7 @@ def test_write_annot_fill_ctab():
287
286
rgbal = np .hstack ((rgba , np .zeros ((nlabels , 1 ), dtype = np .int32 )))
288
287
rgbal [:, 4 ] = (rgbal [:, 0 ] +
289
288
rgbal [:, 1 ] * (2 ** 8 ) +
290
- rgbal [:, 2 ] * (2 ** 16 ) +
291
- rgbal [:, 3 ] * (2 ** 24 ))
289
+ rgbal [:, 2 ] * (2 ** 16 ))
292
290
with clear_and_catch_warnings () as w :
293
291
write_annot (annot_path , labels , rgbal , names , fill_ctab = False )
294
292
assert_true (
@@ -307,7 +305,7 @@ def gen_old_annot_file(fpath, nverts, labels, rgba, names):
307
305
dt = '>i'
308
306
vdata = np .zeros ((nverts , 2 ), dtype = dt )
309
307
vdata [:, 0 ] = np .arange (nverts )
310
- vdata [:, [1 ]] = _pack_rgba (rgba [labels , :])
308
+ vdata [:, [1 ]] = _pack_rgb (rgba [labels , :3 ])
311
309
fbytes = b''
312
310
# number of vertices
313
311
fbytes += struct .pack (dt , nverts )
0 commit comments