# Path: pytripgui/utils/regex.py
# class Regex(Enum):
#     STRING = QRegularExpression(r"\w+[\s\w]*")
#     INT = QRegularExpression(r"-?\d*")
#     INT_POSITIVE = QRegularExpression(r"\d*[1-9]\d*")
#     FLOAT = QRegularExpression(r"-?((\d+([,\.]\d{0,3})?)|(\d*[,\.]\d{1,3}))")
#     FLOAT_POSITIVE = QRegularExpression(r"(\d*[1-9]\d*([,\.]\d{0,3})?)|(\d*[,\.](?=\d{1,3}$)(\d*[1-9]\d*))")
#     FLOAT_UNSIGNED = QRegularExpression(r"0+|((\d*[1-9]\d*([,\.]\d{0,3})?)|(\d*[,\.](?=\d{1,3}$)(\d*[1-9]\d*)))")


import math
from decimal import Decimal
from PyQt5.QtGui import QValidator, QRegularExpressionValidator
from pytrip.ctx import CtxCube
from pytrip.vdx import VdxCube
from pytripgui.utils.regex import Regex
            p["slice_number"] = int(prev["slice_number"].text)
            p["pixel_number_x"] = int(prev["pixel_number_x"].text)
            p["pixel_number_y"] = int(prev["pixel_number_y"].text)
            p["pixel_size"] = float(prev["pixel_size"].text)

    def _set_validators(self) -> None:
        dim = self.view.dimensions_fields

        validator = QRegularExpressionValidator(Regex.STRING.value)
        self.view.name.enable_validation(validator)

        validator = QRegularExpressionValidator(Regex.INT.value)
        self.view.hu_value.enable_validation(validator)

        validator = QRegularExpressionValidator(Regex.INT_POSITIVE.value)
        enable_validation_list(
            validator,
            [dim[1]["slice_number"], dim[2]["slice_number"], dim[2]["pixel_number_x"], dim[2]["pixel_number_y"]])

        validator = QRegularExpressionValidator(Regex.FLOAT.value)
        self.view.xoffset.enable_validation(validator)
        self.view.yoffset.enable_validation(validator)
        self.view.slice_offset.enable_validation(validator)

        validator = QRegularExpressionValidator(Regex.FLOAT_POSITIVE.value)
        enable_validation_list(validator, [
            dim[0]["slice_distance"], dim[0]["pixel_size"], dim[1]["depth"], dim[2]["slice_distance"],
            dim[2]["pixel_size"]
        ])


# Path: pytripgui/utils/regex.py
# class Regex(Enum):
#     STRING = QRegularExpression(r"\w+[\s\w]*")
#     INT = QRegularExpression(r"-?\d*")
#     INT_POSITIVE = QRegularExpression(r"\d*[1-9]\d*")
#     FLOAT = QRegularExpression(r"-?((\d+([,\.]\d{0,3})?)|(\d*[,\.]\d{1,3}))")
#     FLOAT_POSITIVE = QRegularExpression(r"(\d*[1-9]\d*([,\.]\d{0,3})?)|(\d*[,\.](?=\d{1,3}$)(\d*[1-9]\d*))")
#     FLOAT_UNSIGNED = QRegularExpression(r"0+|((\d*[1-9]\d*([,\.]\d{0,3})?)|(\d*[,\.](?=\d{1,3}$)(\d*[1-9]\d*)))")


# Path: pytripgui/empty_patient_vc/empty_patient_cont.py
import math
from decimal import Decimal
from PyQt5.QtGui import QValidator, QRegularExpressionValidator
from pytrip.ctx import CtxCube
from pytrip.vdx import VdxCube
from pytripgui.utils.regex import Regex

            p["slice_number"] = int(prev["slice_number"].text)
            p["pixel_number_x"] = int(prev["pixel_number_x"].text)
            p["pixel_number_y"] = int(prev["pixel_number_y"].text)
            p["pixel_size"] = float(prev["pixel_size"].text)

    def _set_validators(self) -> None:
        dim = self.view.dimensions_fields

        validator = QRegularExpressionValidator(Regex.STRING.value)
        self.view.name.enable_validation(validator)

        validator = QRegularExpressionValidator(Regex.INT.value)
        self.view.hu_value.enable_validation(validator)

        validator = QRegularExpressionValidator(Regex.INT_POSITIVE.value)
        enable_validation_list(
            validator,
            [dim[1]["slice_number"], dim[2]["slice_number"], dim[2]["pixel_number_x"], dim[2]["pixel_number_y"]])

        validator = QRegularExpressionValidator(Regex.FLOAT.value)
        self.view.xoffset.enable_validation(validator)
        self.view.yoffset.enable_validation(validator)
        self.view.slice_offset.enable_validation(validator)

        validator = QRegularExpressionValidator(Regex.FLOAT_POSITIVE.value)
        enable_validation_list(validator, [
            dim[0]["slice_distance"], dim[0]["pixel_size"], dim[1]["depth"], dim[2]["slice_distance"],
            dim[2]["pixel_size"]
        ])


        validator = MultipleOfRegularExpressionValidator(Regex.FLOAT_POSITIVE.value)