Skip to content

Commit

Permalink
BUG: Update data probe module to avoid resizing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
hannah-morilak committed Jan 12, 2024
1 parent 0725f3a commit 5a2bbea
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions Modules/Scripted/DataProbe/DataProbe.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,17 +216,11 @@ def processEvent(self, observee, event):
self.layerNames[layer].setText("")
self.layerIJKs[layer].setText("")
self.layerValues[layer].setText("")
self.imageLabel.hide()
self.viewerColor.hide()
self.viewInfo.hide()
self.viewerFrame.hide()
self.showImageFrame.show()
self.displayableManagerInfo.setText("S")
if not self.showImageBox.isChecked():
self.imageLabel.hide()
return

self.viewerColor.show()
self.viewInfo.show()
self.viewerFrame.show()
self.showImageFrame.hide()

# populate the widgets
self.viewerColor.setText(" ")
Expand Down Expand Up @@ -275,10 +269,10 @@ def _roundInt(value):
if infoString != "":
aggregatedDisplayableManagerInfo += infoString + "<br>"
if aggregatedDisplayableManagerInfo != "":
aggregatedDisplayableManagerInfo = aggregatedDisplayableManagerInfo[:-4] # Remove the last break
self.displayableManagerInfo.text = "<html>" + aggregatedDisplayableManagerInfo + "</html>"
self.displayableManagerInfo.show()
else:
self.displayableManagerInfo.hide()
self.displayableManagerInfo.text = "<html>S <b>None</b></html>"

# set image
if (not slicer.mrmlScene.IsBatchProcessing()) and sliceLogic and hasVolume and self.showImage:
Expand Down Expand Up @@ -474,6 +468,7 @@ def _setFixedFontFamily(widget, family=None):
col += 1
self.layerNames[layer] = qt.QLabel()
layout.addWidget(self.layerNames[layer], row, col)
layout.setColumnStretch(col, 100)
col += 1
self.layerIJKs[layer] = qt.QLabel()
layout.addWidget(self.layerIJKs[layer], row, col)
Expand All @@ -493,7 +488,7 @@ def _setFixedFontFamily(widget, family=None):
self.displayableManagerInfo.wordWrap = True
self.frame.layout().addWidget(self.displayableManagerInfo)
# only show if not empty
self.displayableManagerInfo.hide()
self.displayableManagerInfo.text = "S"

# goto module button
self.goToModule = qt.QPushButton("->", self.frame)
Expand All @@ -512,7 +507,8 @@ def onShowImage(self, value=False):
if value:
self.imageLabel.show()
else:
self.imageLabel.hide()
if not self.showImageBox.isChecked():
self.imageLabel.hide()
pixmap = qt.QPixmap()
self.imageLabel.setPixmap(pixmap)

Expand Down

0 comments on commit 5a2bbea

Please sign in to comment.