# Path: pytripgui/view/qt_view_adapter.py
# class LineEdit:
#     def __init__(self, line_edit):
#         self._ui = line_edit
# 
#     @property
#     def text(self):
#         return self._ui.text()
# 
#     @text.setter
#     def text(self, text):
#         self._ui.setText(str(text))
# 
#     def clear(self):
#         self._ui.clear()
# 
#     def set_enabled(self, enabled):
#         self._ui.setEnabled(enabled)
# 
#     def emit_on_text_change(self, callback):
#         """
#         When user have changed text in UI, callback will be called with new text:
#         callback(new_text)
#         """
#         self._ui.textChanged.connect(callback)
# 
#     def set_validator(self, validator):
#         self._ui.setValidator(validator)
# 
#     def enable_validation(self, validator, custom_validation=None):
#         self._ui.setValidator(validator)
#         if custom_validation:
#             self._ui.textChanged.connect(custom_validation)
#         else:
#             self._ui.textChanged.connect(self.validate)
# 
#     def disable_validation(self):
#         self._ui.textChanged.disconnect()
# 
#     def validate(self):
#         if self._ui.validator():
#             state = self._ui.validator().validate(self._ui.text(), 0)[0]
#             if state == QValidator.Acceptable:
#                 self.reset_border()
#                 return True
#             self.highlight_border()
#         return False
# 
#     def highlight_border(self):
#         self._ui.setStyleSheet("border: 1px solid red")
# 
#     def reset_border(self):
#         self._ui.setStyleSheet("")
# 
# class TabWidget:
#     def __init__(self, tab_widget):
#         self._ui = tab_widget
#         self._previous_index = self._ui.currentIndex()
# 
#     @property
#     def current_index(self):
#         return self._ui.currentIndex()
# 
#     @property
#     def previous_index(self):
#         return self._previous_index
# 
#     def update_previous_index(self):
#         self._previous_index = self._ui.currentIndex()
# 
#     def emit_on_tab_change(self, callback):
#         self._ui.currentChanged.connect(callback)
# 
# class LineEditMath(LineEdit):
#     @property
#     def text(self):
#         return self._ui.text().replace(",", ".")
# 
#     @text.setter
#     def text(self, text):
#         self._ui.setText(str(text))
# 
# Path: pytripgui/view/qt_gui.py
# class EmptyPatientDialog(QtWidgets.QDialog):
#     def __init__(self, parent=None):
#         super(EmptyPatientDialog, self).__init__(parent)
#         ui_path = os.path.join(current_directory, 'empty_patient.ui')
#         uic.loadUi(ui_path, self)
# 
#         self.setWindowFlags(Qt.Dialog | Qt.MSWindowsFixedSizeDialogHint)


from pytripgui.view.qt_view_adapter import LineEdit, TabWidget, LineEditMath
from pytripgui.view.qt_gui import EmptyPatientDialog
import logging
    """
    """
    def __init__(self, parent=None):
        self._ui = EmptyPatientDialog(parent)
        self.name = LineEdit(self._ui.name_lineEdit)
        self.hu_value = LineEditMath(self._ui.hUValue_lineEdit)

        self.dimensions_tabs = TabWidget(self._ui.dimensions_tabWidget)
        self.dimensions_fields = [{
            "width": LineEditMath(self._ui.width_lineEdit_1),
            "height": LineEditMath(self._ui.height_lineEdit_1),
            "depth": LineEditMath(self._ui.depth_lineEdit_1),
            "slice_distance": LineEditMath(self._ui.sliceDistance_lineEdit_1),
            "pixel_size": LineEditMath(self._ui.pixelSize_lineEdit_1),
        }, {
            "width": LineEditMath(self._ui.width_lineEdit_2),
            "height": LineEditMath(self._ui.height_lineEdit_2),
            "depth": LineEditMath(self._ui.depth_lineEdit_2),
            "slice_number": LineEditMath(self._ui.sliceNumber_lineEdit_2),
            "pixel_number_x": LineEditMath(self._ui.pixelNumberX_lineEdit_2),
            "pixel_number_y": LineEditMath(self._ui.pixelNumberY_lineEdit_2),
        }, {
            "slice_number": LineEditMath(self._ui.sliceNumber_lineEdit_3),
            "slice_distance": LineEditMath(self._ui.sliceDistance_lineEdit_3),
            "pixel_number_x": LineEditMath(self._ui.pixelNumberX_lineEdit_3),
            "pixel_number_y": LineEditMath(self._ui.pixelNumberY_lineEdit_3),
            "pixel_size": LineEditMath(self._ui.pixelSize_lineEdit_3),
        }]

        self.xoffset = LineEditMath(self._ui.xOffset_lineEdit)

# Path: pytripgui/view/qt_view_adapter.py
# class LineEdit:
#     def __init__(self, line_edit):
#         self._ui = line_edit
# 
#     @property
#     def text(self):
#         return self._ui.text()
# 
#     @text.setter
#     def text(self, text):
#         self._ui.setText(str(text))
# 
#     def clear(self):
#         self._ui.clear()
# 
#     def set_enabled(self, enabled):
#         self._ui.setEnabled(enabled)
# 
#     def emit_on_text_change(self, callback):
#         """
#         When user have changed text in UI, callback will be called with new text:
#         callback(new_text)
#         """
#         self._ui.textChanged.connect(callback)
# 
#     def set_validator(self, validator):
#         self._ui.setValidator(validator)
# 
#     def enable_validation(self, validator, custom_validation=None):
#         self._ui.setValidator(validator)
#         if custom_validation:
#             self._ui.textChanged.connect(custom_validation)
#         else:
#             self._ui.textChanged.connect(self.validate)
# 
#     def disable_validation(self):
#         self._ui.textChanged.disconnect()
# 
#     def validate(self):
#         if self._ui.validator():
#             state = self._ui.validator().validate(self._ui.text(), 0)[0]
#             if state == QValidator.Acceptable:
#                 self.reset_border()
#                 return True
#             self.highlight_border()
#         return False
# 
#     def highlight_border(self):
#         self._ui.setStyleSheet("border: 1px solid red")
# 
#     def reset_border(self):
#         self._ui.setStyleSheet("")
# 
# class TabWidget:
#     def __init__(self, tab_widget):
#         self._ui = tab_widget
#         self._previous_index = self._ui.currentIndex()
# 
#     @property
#     def current_index(self):
#         return self._ui.currentIndex()
# 
#     @property
#     def previous_index(self):
#         return self._previous_index
# 
#     def update_previous_index(self):
#         self._previous_index = self._ui.currentIndex()
# 
#     def emit_on_tab_change(self, callback):
#         self._ui.currentChanged.connect(callback)
# 
# class LineEditMath(LineEdit):
#     @property
#     def text(self):
#         return self._ui.text().replace(",", ".")
# 
#     @text.setter
#     def text(self, text):
#         self._ui.setText(str(text))
# 
# Path: pytripgui/view/qt_gui.py
# class EmptyPatientDialog(QtWidgets.QDialog):
#     def __init__(self, parent=None):
#         super(EmptyPatientDialog, self).__init__(parent)
#         ui_path = os.path.join(current_directory, 'empty_patient.ui')
#         uic.loadUi(ui_path, self)
# 
#         self.setWindowFlags(Qt.Dialog | Qt.MSWindowsFixedSizeDialogHint)


# Path: pytripgui/empty_patient_vc/empty_patient_view.py
from pytripgui.view.qt_view_adapter import LineEdit, TabWidget, LineEditMath
from pytripgui.view.qt_gui import EmptyPatientDialog
import logging

    """
    """
    def __init__(self, parent=None):
        self._ui = EmptyPatientDialog(parent)
        self.name = LineEdit(self._ui.name_lineEdit)
        self.hu_value = LineEditMath(self._ui.hUValue_lineEdit)

        self.dimensions_tabs = TabWidget(self._ui.dimensions_tabWidget)
        self.dimensions_fields = [{
            "width": LineEditMath(self._ui.width_lineEdit_1),
            "height": LineEditMath(self._ui.height_lineEdit_1),
            "depth": LineEditMath(self._ui.depth_lineEdit_1),
            "slice_distance": LineEditMath(self._ui.sliceDistance_lineEdit_1),
            "pixel_size": LineEditMath(self._ui.pixelSize_lineEdit_1),
        }, {
            "width": LineEditMath(self._ui.width_lineEdit_2),
            "height": LineEditMath(self._ui.height_lineEdit_2),
            "depth": LineEditMath(self._ui.depth_lineEdit_2),
            "slice_number": LineEditMath(self._ui.sliceNumber_lineEdit_2),
            "pixel_number_x": LineEditMath(self._ui.pixelNumberX_lineEdit_2),
            "pixel_number_y": LineEditMath(self._ui.pixelNumberY_lineEdit_2),
        }, {
            "slice_number": LineEditMath(self._ui.sliceNumber_lineEdit_3),
            "slice_distance": LineEditMath(self._ui.sliceDistance_lineEdit_3),
            "pixel_number_x": LineEditMath(self._ui.pixelNumberX_lineEdit_3),
            "pixel_number_y": LineEditMath(self._ui.pixelNumberY_lineEdit_3),
            "pixel_size": LineEditMath(self._ui.pixelSize_lineEdit_3),
        }]

        self.xoffset = LineEditMath(self._ui.xOffset_lineEdit)

        self.yoffset = LineEditMath(self._ui.yOffset_lineEdit)