fixed a bug where plotting of groups and multiple datasets lead to an error
@@ -1725,6 +1725,7 @@ class View(QtGui.QLabel):
def render_multi_channel(self, kwargs, autoscale=False, locs=None, use_cache=False, cache=True):
if locs is None:
locs = self.locs
+ if len(self.locs_paths) == len(locs): #distinguish plotting of groups vs channels
locsall = locs.copy()
for i in range(len(locs)):
if hasattr(locs[i], 'z'):
@@ -1741,7 +1742,7 @@ class View(QtGui.QLabel):
image = self.image
else:
renderings = []
- for i in range(len(locsall)):
+ for i in range(len(self.locs)):
if self.window.dataset_dialog.checks[i].isChecked():
renderings.append(render.render(locsall[i], **kwargs))
if renderings == []: #handle error of no checked -> keep first
@@ -1749,6 +1750,17 @@ class View(QtGui.QLabel):
#renderings = [render.render(_, **kwargs) for _ in locsall]
n_locs = sum([_[0] for _ in renderings])
image = np.array([_[1] for _ in renderings])
+ else:
+ n_channels = len(locs)
+ hues = np.arange(0, 1, 1 / n_channels)
+ colors = [colorsys.hsv_to_rgb(_, 1, 1) for _ in hues]
+ if use_cache:
+ n_locs = self.n_locs
+ image = self.image
+ else:
+ renderings = [render.render(_, **kwargs) for _ in locs]
+ n_locs = sum([_[0] for _ in renderings])
+ image = np.array([_[1] for _ in renderings])
if cache:
self.n_locs = n_locs
self.image = image
