Skip to content

Commit

Permalink
Fixing display issue with Histowidget
Browse files Browse the repository at this point in the history
  • Loading branch information
beniroquai committed Dec 5, 2024
1 parent 5fa30bc commit 11186a5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
2 changes: 2 additions & 0 deletions imswitch/imcontrol/view/ImConMainView.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ def _addDocks(self, dockInfoDict, dockArea, position):
prevDock = None
prevDockYPosition = -1
for widgetKey, dockInfo in dockInfoDict.items():
if widgetKey == "ImSwitchServer":
continue
try:
self.widgets[widgetKey] = self.factory.createWidget(
getattr(widgets, f'{widgetKey}Widget')
Expand Down
24 changes: 12 additions & 12 deletions imswitch/imcontrol/view/widgets/HistoScanWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def __post_init__(self):


# load sample layout
self.ScanSelectViewWidget = None
self.ScanSelectViewWidget = ScanSelectView(self)
self.grid.addWidget(self.ScanSelectViewWidget, 12, 0, 2, 2)

# Create a scroll area and set the second tab widget as its content
Expand Down Expand Up @@ -363,12 +363,11 @@ def handleSelectPath(self):
self.setDefaultSavePath(os.path.join(path, "histoScan"))
os.makedirs(os.path.join(path, "histoScan"), exist_ok=True)

def loadSampleLayout(self, index, allScanParameters):
if self.ScanSelectViewWidget is None:
self.ScanSelectViewWidget = ScanSelectView(self, allScanParameters[index])
else:
self.ScanSelectViewWidget.updateParams(allScanParameters[index])
self.ScanSelectViewWidget.setPixmap(QtGui.QPixmap(allScanParameters[index].imagePath))
def loadSampleLayout(self, index=0, allScanParameters=None):
if allScanParameters is not None:
self.allScanParameters = allScanParameters # save all scan parameters
self.ScanSelectViewWidget.updateParams(self.allScanParameters[index])
self.ScanSelectViewWidget.setPixmap(QtGui.QPixmap(self.allScanParameters[index].imagePath))


def setSampleLayouts(self, sampleLayoutList):
Expand Down Expand Up @@ -541,8 +540,9 @@ def __init__(self, color):


class ScanSelectView(QtWidgets.QGraphicsView):
def __init__(self, parent, scanParameters):
def __init__(self, parent):
super().__init__(parent)
self.name = "ScanSelectView"
scene = QtWidgets.QGraphicsScene(self)
self._logger = initLogger(self)
self.setScene(scene)
Expand All @@ -555,10 +555,10 @@ def __init__(self, parent, scanParameters):
self.parent = parent

# real-world coordinates for the scan region that is represented by the image
self.physDimX = scanParameters.physDimX
self.physDimY = scanParameters.physDimY
self.physOffsetX = scanParameters.physOffsetX
self.physOffsetY = scanParameters.physOffsetY
self.physDimX = 0
self.physDimY = 0
self.physOffsetX = 0
self.physOffsetY = 0
self.clickedCoordinates = (0,0)
self._logger = initLogger(self)

Expand Down

0 comments on commit 11186a5

Please sign in to comment.