-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
215 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
from saenopy.gui.common.TabModule import TabModule | ||
from saenopy.gui.orientation.modules.result import ResultOrientation | ||
from qtpy import QtCore, QtWidgets, QtGui | ||
from qimage2ndarray import array2qimage | ||
from saenopy.gui.common import QtShortCuts, QExtendedGraphicsView | ||
|
||
from saenopy.gui.common.ModuleScaleBar import ModuleScaleBar | ||
from saenopy.gui.common.ModuleColorBar import ModuleColorBar | ||
from saenopy.gui.solver.modules.exporter.ExporterRender2D import render_2d | ||
|
||
|
||
class TabAngle(TabModule): | ||
result: ResultOrientation = None | ||
|
||
def __init__(self, parent: "BatchEvaluate"): | ||
super().__init__(parent) | ||
|
||
with self.parent.tabs.createTab("Angle (x-axis)") as self.tab: | ||
with QtShortCuts.QVBoxLayout() as layout: | ||
#self.label_tab = QtWidgets.QLabel( | ||
# "The deformations from the piv algorithm at every window where the crosscorrelation was evaluated.").addToLayout() | ||
|
||
with QtShortCuts.QHBoxLayout() as layout: | ||
self.label = QExtendedGraphicsView.QExtendedGraphicsView().addToLayout() | ||
self.scale1 = ModuleScaleBar(self, self.label) | ||
self.color1 = ModuleColorBar(self, self.label) | ||
|
||
self.pixmap = QtWidgets.QGraphicsPixmapItem(self.label.origin) | ||
self.contour = QtWidgets.QGraphicsPathItem(self.label.origin) | ||
pen = QtGui.QPen(QtGui.QColor(255, 0, 0)) | ||
pen.setCosmetic(True) | ||
pen.setWidth(2) | ||
self.contour.setPen(pen) | ||
|
||
def check_evaluated(self, result: ResultOrientation) -> bool: | ||
# whether the tab should be enabled for this Result object | ||
return self.result.orientation_map is not None | ||
|
||
def update_display(self, *, plotter=None): | ||
if self.result is None: | ||
return | ||
im = render_2d({ | ||
"image": { | ||
"scale": 1, | ||
"scale_overlay": 1, | ||
"antialiase": 1, | ||
"logo_size": 0, | ||
}, | ||
"stack": { | ||
"image": 1, | ||
"channel": "cells", | ||
"colormap": "gray", | ||
"alpha": 1, | ||
"channel_B": "fibers", | ||
"colormap_B": "gray", | ||
"alpha_B": 1, | ||
"use_reference_stack": False, | ||
"contrast_enhance": None, | ||
"z_proj": False, | ||
"z": 0, | ||
"use_contrast_enhance": True, | ||
}, | ||
"time": { | ||
"t": 0 | ||
}, | ||
"maps": "orientation_x_axis", | ||
"maps_cmap": "gist_rainbow", | ||
"maps_alpha": 0.5, | ||
|
||
"colorbar": { | ||
"hide": True, | ||
}, | ||
|
||
"scalebar": { | ||
"hide": True, | ||
}, | ||
"theme": "dark", | ||
}, self.result) | ||
self.pixmap.setPixmap(QtGui.QPixmap(array2qimage(im))) | ||
self.label.setExtend(im.shape[1], im.shape[0]) | ||
self.scale1.setScale([self.result.pixel_size]) | ||
self.color1.setScale(-90, 90, "gist_rainbow") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
from saenopy.gui.common.TabModule import TabModule | ||
from saenopy.gui.orientation.modules.result import ResultOrientation | ||
from qtpy import QtCore, QtWidgets, QtGui | ||
from qimage2ndarray import array2qimage | ||
from saenopy.gui.common import QtShortCuts, QExtendedGraphicsView | ||
|
||
from saenopy.gui.common.ModuleScaleBar import ModuleScaleBar | ||
from saenopy.gui.common.ModuleColorBar import ModuleColorBar | ||
from saenopy.gui.solver.modules.exporter.ExporterRender2D import render_2d | ||
|
||
|
||
class TabCoherence(TabModule): | ||
result: ResultOrientation = None | ||
|
||
def __init__(self, parent: "BatchEvaluate"): | ||
super().__init__(parent) | ||
|
||
with self.parent.tabs.createTab("Coherence") as self.tab: | ||
with QtShortCuts.QVBoxLayout() as layout: | ||
#self.label_tab = QtWidgets.QLabel( | ||
# "The deformations from the piv algorithm at every window where the crosscorrelation was evaluated.").addToLayout() | ||
|
||
with QtShortCuts.QHBoxLayout() as layout: | ||
self.label = QExtendedGraphicsView.QExtendedGraphicsView().addToLayout() | ||
self.scale1 = ModuleScaleBar(self, self.label) | ||
self.color1 = ModuleColorBar(self, self.label) | ||
|
||
self.pixmap = QtWidgets.QGraphicsPixmapItem(self.label.origin) | ||
self.contour = QtWidgets.QGraphicsPathItem(self.label.origin) | ||
pen = QtGui.QPen(QtGui.QColor(255, 0, 0)) | ||
pen.setCosmetic(True) | ||
pen.setWidth(2) | ||
self.contour.setPen(pen) | ||
|
||
def check_evaluated(self, result: ResultOrientation) -> bool: | ||
# whether the tab should be enabled for this Result object | ||
return self.result.orientation_map is not None | ||
|
||
def update_display(self, *, plotter=None): | ||
if self.result is None: | ||
return | ||
im = render_2d({ | ||
"image": { | ||
"scale": 1, | ||
"scale_overlay": 1, | ||
"antialiase": 1, | ||
"logo_size": 0, | ||
}, | ||
"stack": { | ||
"image": 1, | ||
"channel": "cells", | ||
"colormap": "gray", | ||
"alpha": 1, | ||
"channel_B": "fibers", | ||
"colormap_B": "gray", | ||
"alpha_B": 1, | ||
"use_reference_stack": False, | ||
"contrast_enhance": None, | ||
"z_proj": False, | ||
"z": 0, | ||
"use_contrast_enhance": True, | ||
}, | ||
"time": { | ||
"t": 0 | ||
}, | ||
"maps": "coherence", | ||
"maps_cmap": "turbo", | ||
"maps_alpha": 0.5, | ||
|
||
"colorbar": { | ||
"hide": True, | ||
}, | ||
|
||
"scalebar": { | ||
"hide": True, | ||
}, | ||
"theme": "dark", | ||
}, self.result) | ||
self.pixmap.setPixmap(QtGui.QPixmap(array2qimage(im))) | ||
self.label.setExtend(im.shape[1], im.shape[0]) | ||
self.scale1.setScale([self.result.pixel_size]) | ||
self.color1.setScale(0, 1, "turbo") |
Oops, something went wrong.