Skip to content

Commit

Permalink
Fixed image pane resizing
Browse files Browse the repository at this point in the history
  • Loading branch information
bbfrederick committed Jun 29, 2023
1 parent 684e489 commit ba9ff53
Show file tree
Hide file tree
Showing 5 changed files with 256 additions and 274 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# History of changes

## Version 1.4.4 (6/29/23)
* Fixed image pane resizing.

## Version 1.4.3 (6/9/23)
* Added reference file matching - if you specify a set of reference components, any IC with a spatial correlation with any reference component above a threshold is retained.

Expand Down
80 changes: 27 additions & 53 deletions picachooser/picachooserTemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(1746, 839)
MainWindow.setMinimumSize(QtCore.QSize(0, 100))
self.centralwidget = QtWidgets.QWidget(MainWindow)
sizePolicy = QtWidgets.QSizePolicy(
QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred
)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.centralwidget.sizePolicy().hasHeightForWidth())
Expand All @@ -33,14 +32,10 @@ def setupUi(self, MainWindow):
self.verticalLayout.setObjectName("verticalLayout")
self.translation_graphicsView = GraphicsLayoutWidget(self.centralwidget)
self.translation_graphicsView.setEnabled(True)
sizePolicy = QtWidgets.QSizePolicy(
QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding
)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(
self.translation_graphicsView.sizePolicy().hasHeightForWidth()
)
sizePolicy.setHeightForWidth(self.translation_graphicsView.sizePolicy().hasHeightForWidth())
self.translation_graphicsView.setSizePolicy(sizePolicy)
self.translation_graphicsView.setMinimumSize(QtCore.QSize(400, 100))
self.translation_graphicsView.setMaximumSize(QtCore.QSize(610, 1000))
Expand All @@ -49,9 +44,7 @@ def setupUi(self, MainWindow):
self.verticalLayout.addWidget(self.translation_graphicsView)
self.rotation_graphicsView = GraphicsLayoutWidget(self.centralwidget)
self.rotation_graphicsView.setEnabled(True)
sizePolicy = QtWidgets.QSizePolicy(
QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding
)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.rotation_graphicsView.sizePolicy().hasHeightForWidth())
Expand All @@ -63,9 +56,7 @@ def setupUi(self, MainWindow):
self.verticalLayout.addWidget(self.rotation_graphicsView)
self.timecourse_graphicsView = GraphicsLayoutWidget(self.centralwidget)
self.timecourse_graphicsView.setEnabled(True)
sizePolicy = QtWidgets.QSizePolicy(
QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding
)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.timecourse_graphicsView.sizePolicy().hasHeightForWidth())
Expand All @@ -77,9 +68,7 @@ def setupUi(self, MainWindow):
self.verticalLayout.addWidget(self.timecourse_graphicsView)
self.spectrum_graphicsView = GraphicsLayoutWidget(self.centralwidget)
self.spectrum_graphicsView.setEnabled(True)
sizePolicy = QtWidgets.QSizePolicy(
QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding
)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.spectrum_graphicsView.sizePolicy().hasHeightForWidth())
Expand All @@ -91,37 +80,31 @@ def setupUi(self, MainWindow):
self.verticalLayout.addWidget(self.spectrum_graphicsView)
self.horizontalLayout.addLayout(self.verticalLayout)
self.stackedWidget = QtWidgets.QStackedWidget(self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(
QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding
)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.stackedWidget.sizePolicy().hasHeightForWidth())
self.stackedWidget.setSizePolicy(sizePolicy)
self.stackedWidget.setSizeIncrement(QtCore.QSize(1, 1))
self.stackedWidget.setObjectName("stackedWidget")
self.page = QtWidgets.QWidget()
sizePolicy = QtWidgets.QSizePolicy(
QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding
)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.page.sizePolicy().hasHeightForWidth())
self.page.setSizePolicy(sizePolicy)
self.page.setMinimumSize(QtCore.QSize(100, 100))
self.page.setSizeIncrement(QtCore.QSize(1, 1))
self.page.setObjectName("page")
self.horizontalLayoutWidget = QtWidgets.QWidget(self.page)
self.horizontalLayoutWidget.setGeometry(QtCore.QRect(0, 0, 861, 741))
self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget")
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget)
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.page)
self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setSizeConstraint(QtWidgets.QLayout.SetNoConstraint)
self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.image_graphicsView = GraphicsLayoutWidget(self.horizontalLayoutWidget)
self.image_graphicsView = GraphicsLayoutWidget(self.page)
self.image_graphicsView.setEnabled(True)
sizePolicy = QtWidgets.QSizePolicy(
QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding
)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.image_graphicsView.sizePolicy().hasHeightForWidth())
Expand All @@ -131,29 +114,26 @@ def setupUi(self, MainWindow):
self.image_graphicsView.setSizeIncrement(QtCore.QSize(1, 1))
self.image_graphicsView.setObjectName("image_graphicsView")
self.horizontalLayout_2.addWidget(self.image_graphicsView)
self.verticalLayout_2.addLayout(self.horizontalLayout_2)
self.stackedWidget.addWidget(self.page)
self.page_2 = QtWidgets.QWidget()
sizePolicy = QtWidgets.QSizePolicy(
QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding
)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.page_2.sizePolicy().hasHeightForWidth())
self.page_2.setSizePolicy(sizePolicy)
self.page_2.setMinimumSize(QtCore.QSize(100, 100))
self.page_2.setSizeIncrement(QtCore.QSize(1, 1))
self.page_2.setObjectName("page_2")
self.horizontalLayoutWidget_2 = QtWidgets.QWidget(self.page_2)
self.horizontalLayoutWidget_2.setGeometry(QtCore.QRect(1, 1, 861, 741))
self.horizontalLayoutWidget_2.setObjectName("horizontalLayoutWidget_2")
self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_2)
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.page_2)
self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_3.setObjectName("verticalLayout_3")
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
self.horizontalLayout_3.setSizeConstraint(QtWidgets.QLayout.SetNoConstraint)
self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.image_altgraphicsView = GraphicsLayoutWidget(self.horizontalLayoutWidget_2)
self.image_altgraphicsView = GraphicsLayoutWidget(self.page_2)
self.image_altgraphicsView.setEnabled(True)
sizePolicy = QtWidgets.QSizePolicy(
QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding
)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.image_altgraphicsView.sizePolicy().hasHeightForWidth())
Expand All @@ -163,6 +143,7 @@ def setupUi(self, MainWindow):
self.image_altgraphicsView.setSizeIncrement(QtCore.QSize(1, 1))
self.image_altgraphicsView.setObjectName("image_altgraphicsView")
self.horizontalLayout_3.addWidget(self.image_altgraphicsView)
self.verticalLayout_3.addLayout(self.horizontalLayout_3)
self.stackedWidget.addWidget(self.page_2)
self.horizontalLayout.addWidget(self.stackedWidget)
self.gridLayout.addLayout(self.horizontalLayout, 0, 0, 1, 1)
Expand All @@ -185,12 +166,5 @@ def setupUi(self, MainWindow):
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.label.setText(
_translate(
"MainWindow",
'Right and left arrows step through components. Up and down arrows toggle component retention. "r" to reset component. "a", "c", and "s" select axial, coronal, or sagittal views. ESC to write component file.',
)
)


self.label.setText(_translate("MainWindow", "Right and left arrows step through components. Up and down arrows toggle component retention. \"r\" to reset component. \"a\", \"c\", and \"s\" select axial, coronal, or sagittal views. ESC to write component file."))
from pyqtgraph import GraphicsLayoutWidget
194 changes: 103 additions & 91 deletions picachooser/picachooserTemplate.ui
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
</size>
</property>
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="page">
<property name="sizePolicy">
Expand All @@ -196,52 +196,58 @@
<height>1</height>
</size>
</property>
<widget class="QWidget" name="horizontalLayoutWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>861</width>
<height>741</height>
</rect>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0">
<property name="sizeConstraint">
<enum>QLayout::SetNoConstraint</enum>
</property>
<item>
<widget class="GraphicsLayoutWidget" name="image_graphicsView">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16384</width>
<height>8192</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>1</width>
<height>1</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0">
<property name="sizeConstraint">
<enum>QLayout::SetNoConstraint</enum>
</property>
<item>
<widget class="GraphicsLayoutWidget" name="image_graphicsView">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>600</width>
<height>100</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16384</width>
<height>8192</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>1</width>
<height>1</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="page_2">
<property name="sizePolicy">
Expand All @@ -262,52 +268,58 @@
<height>1</height>
</size>
</property>
<widget class="QWidget" name="horizontalLayoutWidget_2">
<property name="geometry">
<rect>
<x>1</x>
<y>1</y>
<width>861</width>
<height>741</height>
</rect>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3" stretch="0">
<property name="sizeConstraint">
<enum>QLayout::SetNoConstraint</enum>
</property>
<item>
<widget class="GraphicsLayoutWidget" name="image_altgraphicsView">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>600</width>
<height>100</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16384</width>
<height>8192</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>1</width>
<height>1</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3" stretch="0">
<property name="sizeConstraint">
<enum>QLayout::SetNoConstraint</enum>
</property>
<item>
<widget class="GraphicsLayoutWidget" name="image_altgraphicsView">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>600</width>
<height>100</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16384</width>
<height>8192</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>1</width>
<height>1</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
Expand Down
Loading

0 comments on commit ba9ff53

Please sign in to comment.