1616
1717from .. 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
2121from ...tests .nibabel_data import get_nibabel_data , needs_nibabel_data
2222from ...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