File qt_plot.py changed (mode: 100644) (index e9c99e3..bc079bc) |
... |
... |
class Boundaries: |
557 |
557 |
if self.item.checkState(): |
if self.item.checkState(): |
558 |
558 |
for bound, item in self.bounds: |
for bound, item in self.bounds: |
559 |
559 |
pos = getattr(bound, self.w.space) |
pos = getattr(bound, self.w.space) |
560 |
|
item.setData(pos) |
|
|
560 |
|
mask = np.all(np.isfinite(pos), axis=1) |
|
561 |
|
item.setData(pos[mask]) |
561 |
562 |
item.show() |
item.show() |
562 |
563 |
|
|
563 |
564 |
else: |
else: |
|
... |
... |
class Triangulation: |
592 |
593 |
def show_slot(self, item): |
def show_slot(self, item): |
593 |
594 |
if item is self.item: |
if item is self.item: |
594 |
595 |
if (self.w.sample_box.nvar==2) and self.item.checkState(): |
if (self.w.sample_box.nvar==2) and self.item.checkState(): |
595 |
|
for item in self.plot_items: |
|
596 |
|
item.show() |
|
|
596 |
|
#for item in self.plot_items: |
|
597 |
|
# item.show() |
597 |
598 |
|
|
598 |
599 |
#оӵ Мед сюредалоз! |
#оӵ Мед сюредалоз! |
599 |
600 |
self.replot() |
self.replot() |
|
... |
... |
class Triangulation: |
614 |
615 |
if (self.w.sample_box.nvar==2) and self.item.checkState(): |
if (self.w.sample_box.nvar==2) and self.item.checkState(): |
615 |
616 |
try: |
try: |
616 |
617 |
self.simplices = self.w.sample_box.tri.simplices |
self.simplices = self.w.sample_box.tri.simplices |
|
618 |
|
for item in self.plot_items: |
|
619 |
|
item.hide() |
617 |
620 |
self.draw_triangles(range(self.w.sample_box.tri.nsimplex)) |
self.draw_triangles(range(self.w.sample_box.tri.nsimplex)) |
618 |
621 |
|
|
619 |
622 |
except BaseException as e: |
except BaseException as e: |
|
... |
... |
class Triangulation: |
664 |
667 |
# Update the data |
# Update the data |
665 |
668 |
plot_item = self.plot_items[simplex_id] |
plot_item = self.plot_items[simplex_id] |
666 |
669 |
plot_item.setData(pos) |
plot_item.setData(pos) |
667 |
|
#plot_item.show() |
|
|
670 |
|
plot_item.show() |
668 |
671 |
else: #č spolehám na korektnost volajícího kódu |
else: #č spolehám na korektnost volajícího kódu |
669 |
672 |
#оӵ Суредасько |
#оӵ Суредасько |
670 |
673 |
plot_item = plot_widget.plot(pos, pen=0.7) |
plot_item = plot_widget.plot(pos, pen=0.7) |
|
... |
... |
class Triangulation: |
695 |
698 |
# Update the data |
# Update the data |
696 |
699 |
plot_item = self.plot_items[simplex_id] |
plot_item = self.plot_items[simplex_id] |
697 |
700 |
plot_item.setData(pos) |
plot_item.setData(pos) |
698 |
|
#plot_item.show() |
|
|
701 |
|
plot_item.show() |
699 |
702 |
else: #č spolehám na korektnost volajícího kódu |
else: #č spolehám na korektnost volajícího kódu |
700 |
703 |
#оӵ Суредасько |
#оӵ Суредасько |
701 |
704 |
plot_item = plot_widget.plot(pos, pen=0.7) |
plot_item = plot_widget.plot(pos, pen=0.7) |
|
... |
... |
class FastSimplexEstimationWidget(pg.LayoutWidget): |
1356 |
1359 |
#č nejdřív triangulace |
#č nejdřív triangulace |
1357 |
1360 |
for tri_bound, plot_item in self.triangulation: |
for tri_bound, plot_item in self.triangulation: |
1358 |
1361 |
plot_item.hide() |
plot_item.hide() |
|
1362 |
|
# keep the GUI responsive :) |
|
1363 |
|
#self.sb_item.app.processEvents() |
1359 |
1364 |
|
|
1360 |
1365 |
#č teď tečičky |
#č teď tečičky |
1361 |
1366 |
for nodes, plot_item, cell_stats in self.simplices: |
for nodes, plot_item, cell_stats in self.simplices: |
1362 |
1367 |
plot_item.hide() |
plot_item.hide() |
|
1368 |
|
# keep the GUI responsive :) |
|
1369 |
|
#self.sb_item.app.processEvents() |
1363 |
1370 |
|
|
1364 |
1371 |
|
|
1365 |
1372 |
def recolor(self): |
def recolor(self): |
1366 |
|
#č nejdřív triangulace |
|
1367 |
|
for tri_bound, plot_item in self.triangulation: |
|
1368 |
|
plot_item.show() |
|
1369 |
|
|
|
1370 |
|
#č teď tečičky |
|
1371 |
|
for nodes, plot_item, cell_stats in self.simplices: |
|
1372 |
|
event = cell_stats['event'] |
|
1373 |
|
if event in self.max_simplices: |
|
1374 |
|
cell_probability = cell_stats['cell_probability'] |
|
1375 |
|
cm = self.param.getValues()[event][0] #č očekávám tam kolor mapu |
|
1376 |
|
blue_intensity = cell_probability / self.max_simplices[event] |
|
1377 |
|
color = cm.mapToQColor(blue_intensity) |
|
1378 |
|
else: # outside |
|
1379 |
|
color = 0.6 |
|
1380 |
|
#symbolSize = np.sqrt(nodes.w / min(nodes.w)) # not bad |
|
1381 |
|
size = self.param.getValues()['node (pixel) size'][0] |
|
1382 |
|
plot_item.setSymbolBrush(color) |
|
1383 |
|
plot_item.setSymbolSize(size) |
|
1384 |
|
plot_item.show() |
|
|
1373 |
|
with pg.BusyCursor(): |
|
1374 |
|
# keep the GUI responsive :) |
|
1375 |
|
self.sb_item.app.processEvents() |
|
1376 |
|
#č nejdřív triangulace |
|
1377 |
|
for tri_bound, plot_item in self.triangulation: |
|
1378 |
|
plot_item.show() |
|
1379 |
|
|
|
1380 |
|
|
|
1381 |
|
#č teď tečičky |
|
1382 |
|
for nodes, plot_item, cell_stats in self.simplices: |
|
1383 |
|
event = cell_stats['event'] |
|
1384 |
|
if event in self.max_simplices: |
|
1385 |
|
cell_probability = cell_stats['cell_probability'] |
|
1386 |
|
cm = self.param.getValues()[event][0] #č očekávám tam kolor mapu |
|
1387 |
|
blue_intensity = cell_probability / self.max_simplices[event] |
|
1388 |
|
color = cm.mapToQColor(blue_intensity) |
|
1389 |
|
else: # outside |
|
1390 |
|
color = 0.6 |
|
1391 |
|
#symbolSize = np.sqrt(nodes.w / min(nodes.w)) # not bad |
|
1392 |
|
size = self.param.getValues()['node (pixel) size'][0] |
|
1393 |
|
plot_item.setSymbolBrush(color) |
|
1394 |
|
plot_item.setSymbolSize(size) |
|
1395 |
|
plot_item.show() |
|
1396 |
|
# keep the GUI responsive :) |
|
1397 |
|
#self.sb_item.app.processEvents() |
1385 |
1398 |
|
|
1386 |
1399 |
|
|
1387 |
1400 |
|
|
1388 |
1401 |
def on_space_changed(self, *args, **kwargs): |
def on_space_changed(self, *args, **kwargs): |
|
1402 |
|
#with pg.BusyCursor(): |
|
1403 |
|
#self.hide() |
|
1404 |
|
# keep the GUI responsive :) |
|
1405 |
|
#self.sb_item.app.processEvents() |
1389 |
1406 |
#č nejdřív triangulace |
#č nejdřív triangulace |
1390 |
1407 |
for tri_bound, plot_item in self.triangulation: |
for tri_bound, plot_item in self.triangulation: |
1391 |
1408 |
pos = getattr(tri_bound, self.sb_item.space) |
pos = getattr(tri_bound, self.sb_item.space) |
1392 |
|
plot_item.setData(pos=pos) |
|
|
1409 |
|
plot_item.setData(pos) |
|
1410 |
|
#plot_item.show() |
|
1411 |
|
# keep the GUI responsive :) |
|
1412 |
|
#self.sb_item.app.processEvents() |
1393 |
1413 |
|
|
1394 |
1414 |
#č teď tečičky |
#č teď tečičky |
1395 |
1415 |
for nodes, plot_item, cell_stats in self.simplices: |
for nodes, plot_item, cell_stats in self.simplices: |
1396 |
1416 |
pos = getattr(nodes, self.sb_item.space) |
pos = getattr(nodes, self.sb_item.space) |
1397 |
|
plot_item.setData(pos=pos) |
|
|
1417 |
|
plot_item.setData(pos) |
|
1418 |
|
#plot_item.show() |
|
1419 |
|
# keep the GUI responsive :) |
|
1420 |
|
#self.sb_item.app.processEvents() |
1398 |
1421 |
|
|
1399 |
1422 |
|
|
1400 |
1423 |
#č ten hlavní modul se dočkal na překopávání |
#č ten hlavní modul se dočkal na překopávání |