@@ -2156,6 +2156,8 @@ def add_data(self, array, mlab_plot, vertices, smooth_mat, min, max,
2156
2156
self ._geo .faces ,
2157
2157
scalars = mlab_plot ,
2158
2158
figure = self ._f )
2159
+ mesh .data .point_data .normals = self ._geo .nn
2160
+ mesh .data .cell_data .normals = None
2159
2161
if thresh is not None :
2160
2162
if array_plot .min () >= thresh :
2161
2163
warn ("Data min is greater than threshold." )
@@ -2193,6 +2195,8 @@ def add_annotation(self, annot, ids, cmap):
2193
2195
self ._geo .faces ,
2194
2196
scalars = ids ,
2195
2197
figure = self ._f )
2198
+ mesh .data .point_data .normals = self ._geo .nn
2199
+ mesh .data .cell_data .normals = None
2196
2200
surf = mlab .pipeline .surface (mesh , name = annot , figure = self ._f )
2197
2201
2198
2202
# Set the color table
@@ -2210,6 +2214,8 @@ def add_label(self, label, label_name, color, alpha):
2210
2214
self ._geo .faces ,
2211
2215
scalars = label ,
2212
2216
figure = self ._f )
2217
+ mesh .data .point_data .normals = self ._geo .nn
2218
+ mesh .data .cell_data .normals = None
2213
2219
surf = mlab .pipeline .surface (mesh , name = label_name , figure = self ._f )
2214
2220
color = colorConverter .to_rgba (color , alpha )
2215
2221
cmap = np .array ([(0 , 0 , 0 , 0 ,), color ]) * 255
@@ -2224,6 +2230,8 @@ def add_morphometry(self, morph_data, colormap, measure, min, max):
2224
2230
self ._geo .faces ,
2225
2231
scalars = morph_data ,
2226
2232
figure = self ._f )
2233
+ mesh .data .point_data .normals = self ._geo .nn
2234
+ mesh .data .cell_data .normals = None
2227
2235
2228
2236
surf = mlab .pipeline .surface (mesh , colormap = colormap ,
2229
2237
vmin = min , vmax = max ,
@@ -2258,6 +2266,8 @@ def add_contour_overlay(self, scalar_data, min=None, max=None,
2258
2266
self ._geo .faces ,
2259
2267
scalars = scalar_data ,
2260
2268
figure = self ._f )
2269
+ mesh .data .point_data .normals = self ._geo .nn
2270
+ mesh .data .cell_data .normals = None
2261
2271
thresh = mlab .pipeline .threshold (mesh , low = min )
2262
2272
surf = mlab .pipeline .contour_surface (thresh , contours = n_contours ,
2263
2273
line_width = line_width )
@@ -2381,6 +2391,8 @@ def __init__(self, ol, figure):
2381
2391
kwargs = dict (scalars = ol .mlab_data , figure = figure )
2382
2392
if ol .pos_lims is not None :
2383
2393
pos_mesh = mlab .pipeline .triangular_mesh_source (* args , ** kwargs )
2394
+ pos_mesh .data .point_data .normals = ol .geo .nn
2395
+ pos_mesh .data .cell_data .normals = None
2384
2396
pos_thresh = mlab .pipeline .threshold (pos_mesh , low = ol .pos_lims [0 ])
2385
2397
self .pos = mlab .pipeline .surface (pos_thresh , colormap = "YlOrRd" ,
2386
2398
vmin = ol .pos_lims [1 ],
@@ -2393,6 +2405,8 @@ def __init__(self, ol, figure):
2393
2405
2394
2406
if ol .neg_lims is not None :
2395
2407
neg_mesh = mlab .pipeline .triangular_mesh_source (* args , ** kwargs )
2408
+ neg_mesh .data .point_data .normals = ol .geo .nn
2409
+ neg_mesh .data .cell_data .normals = None
2396
2410
neg_thresh = mlab .pipeline .threshold (neg_mesh ,
2397
2411
up = ol .neg_lims [0 ])
2398
2412
self .neg = mlab .pipeline .surface (neg_thresh , colormap = "PuBu" ,
0 commit comments