@@ -1811,7 +1811,7 @@ def scale_data_colormap(self, fmin, fmid, fmax, transparent, verbose=None):
1811
1811
if data is not None :
1812
1812
for surf in data ['surfaces' ]:
1813
1813
cmap = surf .module_manager .scalar_lut_manager
1814
- cmap .lut . table = table_new
1814
+ cmap .load_lut_from_list ( table_new / 255. )
1815
1815
cmap .data_range = np .array ([fmin , fmax ])
1816
1816
1817
1817
# Update the data properties
@@ -2578,7 +2578,8 @@ def __init__(self, subject_id, hemi, surf, figure, geo, geo_curv,
2578
2578
self ._geo_surf = mlab .pipeline .surface (
2579
2579
self ._geo_mesh , figure = self ._f , reset_zoom = True , ** geo_kwargs )
2580
2580
if lut is not None :
2581
- self ._geo_surf .module_manager .scalar_lut_manager .lut .table = lut
2581
+ lut_manager = self ._geo_surf .module_manager .scalar_lut_manager
2582
+ lut_manager .load_lut_from_list (lut / 255. )
2582
2583
if geo_curv and geo_reverse :
2583
2584
curv_bar = mlab .scalarbar (self ._geo_surf )
2584
2585
curv_bar .reverse_lut = True
@@ -2721,7 +2722,8 @@ def add_data(self, array, mlab_plot, vertices, smooth_mat, min, max,
2721
2722
2722
2723
# apply look up table if given
2723
2724
if lut is not None :
2724
- surf .module_manager .scalar_lut_manager .lut .table = lut
2725
+ lut_manager = surf .module_manager .scalar_lut_manager
2726
+ lut_manager .load_lut_from_list (lut / 255. )
2725
2727
2726
2728
# Get the original colormap table
2727
2729
orig_ctable = \
@@ -2750,7 +2752,8 @@ def add_annotation(self, annot, ids, cmap):
2750
2752
surf = mlab .pipeline .surface (mesh , name = annot , figure = self ._f )
2751
2753
2752
2754
# Set the color table
2753
- surf .module_manager .scalar_lut_manager .lut .table = cmap
2755
+ lut_manager = surf .module_manager .scalar_lut_manager
2756
+ lut_manager .load_lut_from_list (cmap / 255. )
2754
2757
2755
2758
# Set the brain attributes
2756
2759
annot = dict (surface = surf , name = annot , colormap = cmap )
@@ -2767,8 +2770,9 @@ def add_label(self, label, label_name, color, alpha):
2767
2770
with warnings .catch_warnings (record = True ):
2768
2771
surf = mlab .pipeline .surface (mesh , name = label_name , figure = self ._f )
2769
2772
color = colorConverter .to_rgba (color , alpha )
2770
- cmap = np .array ([(0 , 0 , 0 , 0 ,), color ]) * 255
2771
- surf .module_manager .scalar_lut_manager .lut .table = cmap
2773
+ cmap = np .array ([(0 , 0 , 0 , 0 ,), color ])
2774
+ lut_manager = surf .module_manager .scalar_lut_manager
2775
+ lut_manager .load_lut_from_list (cmap )
2772
2776
return surf
2773
2777
2774
2778
def add_morphometry (self , morph_data , colormap , measure ,
@@ -2822,7 +2826,8 @@ def add_contour_overlay(self, scalar_data, min=None, max=None,
2822
2826
surf = mlab .pipeline .contour_surface (thresh , contours = n_contours ,
2823
2827
line_width = line_width )
2824
2828
if lut is not None :
2825
- surf .module_manager .scalar_lut_manager .lut .table = lut
2829
+ lut_manager = surf .module_manager .scalar_lut_manager
2830
+ lut_manager .load_lut_from_list (lut / 255. )
2826
2831
2827
2832
# Set the colorbar and range correctly
2828
2833
with warnings .catch_warnings (record = True ): # traits
0 commit comments