"""UI for the Particle Segmentation 3D Prediction Window."""
# Form implementation generated from reading ui file 'runWindow_PartSeg3D_Main.ui'
#
# Created by: PyQt6 UI code generator 6.4.2
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again.  Do not edit this file unless you know what you are doing.


from PyQt6 import QtCore, QtWidgets


class UI_ParticleSeg3DPredict:
    """UI for the Particle Segmentation 3D Prediction Window."""

    def setupUi(self, Dialog):
        """Set up the UI components for the Particle Segmentation 3D Prediction Window."""
        Dialog.setObjectName("Dialog")
        Dialog.resize(315, 258)

        # widget
        self.widget = QtWidgets.QWidget(parent=Dialog)
        self.widget.setGeometry(QtCore.QRect(70, 230, 239, 25))
        self.widget.setObjectName("widget")

        # buttons for widget
        # self.pushButton = QtWidgets.QPushButton(parent=self.widget)
        # self.pushButton.setObjectName("pushButton")
        # self.horizontalLayout_6.addWidget(self.pushButton)
        self.pushButton_2 = QtWidgets.QPushButton(parent=self.widget)
        self.pushButton_2.setObjectName("pushButton_2")
        self.pushButton_3 = QtWidgets.QPushButton(parent=self.widget)
        self.pushButton_3.setObjectName("pushButton_3")
        self.row7 = QtWidgets.QHBoxLayout(self.widget)
        self.row7.setContentsMargins(0, 0, 0, 0)
        self.row7.setObjectName("horizontalLayout_6")
        self.row7.addWidget(self.pushButton_2)
        self.row7.addWidget(self.pushButton_3)

        # layout widget
        self.layoutWidget = QtWidgets.QWidget(parent=Dialog)
        self.layoutWidget.setGeometry(QtCore.QRect(0, 0, 311, 224))
        self.layoutWidget.setObjectName("layoutWidget")

        # column 1
        self.column1 = QtWidgets.QVBoxLayout(self.layoutWidget)
        self.column1.setContentsMargins(0, 0, 0, 0)
        self.column1.setObjectName("verticalLayout")

        # row 1
        self.particle_size = QtWidgets.QLabel(parent=self.layoutWidget)
        self.particle_size.setObjectName("particle_size")

        self.particle_size_box = QtWidgets.QDoubleSpinBox(parent=self.layoutWidget)
        self.particle_size_box.setSingleStep(0.1)
        self.particle_size_box.setMaximum(1000)
        self.particle_size_box.setObjectName("spinBox")

        self.row1 = QtWidgets.QHBoxLayout()
        self.row1.setObjectName("horizontalLayout")
        self.row1.addWidget(self.particle_size)
        self.row1.addWidget(self.particle_size_box)

        # row 2
        self.voxel_size = QtWidgets.QLabel(parent=self.layoutWidget)
        self.voxel_size.setObjectName("voxel_size")

        self.voxel_size_box = QtWidgets.QDoubleSpinBox(parent=self.layoutWidget)
        self.voxel_size_box.setDecimals(3)
        self.voxel_size_box.setSingleStep(0.01)
        self.voxel_size_box.setObjectName("voxel_size_box")

        self.row2 = QtWidgets.QHBoxLayout()
        self.row2.setObjectName("horizontalLayout_2")
        self.row2.addWidget(self.voxel_size)
        self.row2.addWidget(self.voxel_size_box)

        # row 3
        self.input_image = QtWidgets.QLabel(parent=self.layoutWidget)
        self.input_image.setObjectName("input_image")

        self.input_image_button = QtWidgets.QCommandLinkButton(parent=self.layoutWidget)
        self.input_image_button.setObjectName("input_image_button")

        self.row3 = QtWidgets.QHBoxLayout()
        self.row3.setObjectName("horizontalLayout_3")
        self.row3.addWidget(self.input_image)
        self.row3.addWidget(self.input_image_button)

        # row 4
        self.model_name = QtWidgets.QLabel(parent=self.layoutWidget)
        self.model_name.setObjectName("model_name")

        self.model_name_box = QtWidgets.QComboBox(parent=self.layoutWidget)
        self.model_name_box.setObjectName("model_name_box")

        self.row4 = QtWidgets.QHBoxLayout()
        self.row4.setObjectName("horizontalLayout_4")
        self.row4.addWidget(self.model_name)
        self.row4.addWidget(self.model_name_box)

        # row 5
        self.slice_indicator = QtWidgets.QCheckBox(parent=self.layoutWidget)
        self.slice_indicator.setObjectName("slice_indicator")

        self.slice_input = QtWidgets.QSpinBox(parent=self.layoutWidget)
        self.slice_input.setObjectName("slice_input")

        self.row5 = QtWidgets.QHBoxLayout()
        self.row5.setObjectName("horizontalLayout_7")
        self.row5.addWidget(self.slice_indicator)
        self.row5.addWidget(self.slice_input)

        # row 6
        self.save_label = QtWidgets.QCheckBox(parent=self.layoutWidget)
        self.save_label.setObjectName("save_label")

        self.save_label_path = QtWidgets.QCommandLinkButton(parent=self.layoutWidget)
        self.save_label_path.setObjectName("save_label_path")

        self.row6 = QtWidgets.QHBoxLayout()
        self.row6.setObjectName("horizontalLayout_5")
        self.row6.addWidget(self.save_label)
        self.row6.addWidget(self.save_label_path)

        # build column 1
        self.column1.addLayout(self.row1)
        self.column1.addLayout(self.row2)
        self.column1.addLayout(self.row3)
        self.column1.addLayout(self.row4)
        self.column1.addLayout(self.row5)
        self.column1.addLayout(self.row6)

        self.retranslateUi(Dialog)
        self.add_help()
        QtCore.QMetaObject.connectSlotsByName(Dialog)

    def add_help(self):
        """Add tooltips to the UI components for better user guidance."""
        # Add tooltips to the relevant widgets
        self.particle_size.setToolTip("Enter the average particle size in millimeters.")
        self.particle_size_box.setToolTip(
            "Specify the average particle size in millimeters."
        )

        self.voxel_size.setToolTip("Enter the voxel size in millimeters.")
        self.voxel_size_box.setToolTip(
            "Specify the voxel size in millimeters. Supports up to 3 decimal places."
        )

        self.input_image.setToolTip("Select the input 16-bit image.")
        self.input_image_button.setToolTip(
            "Click to choose the folder containing the input 16-bit image."
        )

        self.model_name.setToolTip("Choose the model for particle segmentation.")
        self.model_name_box.setToolTip("Select the model from the dropdown list.")

        self.slice_indicator.setToolTip(
            "Check to apply the operation to a specific slice number."
        )
        self.slice_input.setToolTip("Enter the slice number to apply the operation to.")

        self.save_label.setToolTip("Check to save the labeled images.")
        self.save_label_path.setToolTip(
            "Click to choose the folder to save the labeled images."
        )

    def retranslateUi(self, Dialog):
        """Set the text for the UI elements."""
        _translate = QtCore.QCoreApplication.translate
        Dialog.setWindowTitle(_translate("UI_ParticleSeg3DMain", "Dialog"))
        self.particle_size.setText(
            _translate("UI_ParticleSeg3DMain", "Average particle size (mm)")
        )
        self.voxel_size.setText(_translate("UI_ParticleSeg3DMain", "Voxel size (mm)"))
        self.input_image.setText(
            _translate("UI_ParticleSeg3DMain", "Input 16bit image")
        )
        self.input_image_button.setText(
            _translate("UI_ParticleSeg3DMain", "Choose folder")
        )
        self.model_name.setText(_translate("UI_ParticleSeg3DMain", "Choose the model"))
        self.slice_indicator.setText(
            _translate("UI_ParticleSeg3DMain", "Apply to slice number")
        )
        self.save_label.setText(
            _translate("UI_ParticleSeg3DMain", "Save Labelled images")
        )
        self.save_label_path.setText(
            _translate("UI_ParticleSeg3DMain", "Choose folder")
        )
        # self.pushButton.setText(_translate("UI_ParticleSeg3DMain", "Advanced"))
        self.pushButton_2.setText(_translate("UI_ParticleSeg3DMain", "Ok"))
        self.pushButton_3.setText(_translate("UI_ParticleSeg3DMain", "Cancel"))


if __name__ == "__main__":
    import sys

    app = QtWidgets.QApplication(sys.argv)
    Dialog = QtWidgets.QDialog()
    ui = UI_ParticleSeg3DPredict()
    ui.setupUi(Dialog)
    Dialog.show()
    sys.exit(app.exec())
