Skip to content

Commit 41f1e48

Browse files
committed
FIX: Wrap to positive
1 parent 6292629 commit 41f1e48

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

surfer/viz.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,13 +1267,11 @@ def add_annotation(self, annot, borders=True, alpha=1, hemi=None,
12671267
self._to_borders(labels, hemi, borders)
12681268

12691269
# Handle null labels properly
1270-
# (tksurfer doesn't use the alpha channel, so sometimes this
1271-
# is set weirdly. For our purposes, it should always be 0.
1272-
# Unless this sometimes causes problems?
12731270
cmap[:, 3] = 255
12741271
bgcolor = self._brain_color
12751272
bgcolor[-1] = 0
1276-
cmap[np.where(cmap[:, 4] <= 0), :4] = bgcolor
1273+
cmap[cmap[:, 4] < 0, 4] += 2 ** 24 # wrap to positive
1274+
cmap[cmap[:, 4] <= 0, :4] = bgcolor
12771275
if np.any(labels == 0) and not np.any(cmap[:, -1] <= 0):
12781276
cmap = np.vstack((cmap, np.concatenate([bgcolor, [0]])))
12791277

0 commit comments

Comments
 (0)