Пример #1
0
 def verify_image(image: Image, silent=True) -> Union[Image, bool]:
     if image.is_time:
         if image.is_stack:
             raise TimeAndStackException()
         if silent:
             return image.swap_time_and_stack()
         raise SwapTimeStackException()
     return True
Пример #2
0
    def set_image(self, image: Image) -> bool:
        if image is None:
            return False
        if image.is_time:
            if image.is_stack:
                QMessageBox.warning(self, "Not supported", "Data that are time data are currently not supported")
                return False

            res = QMessageBox.question(
                self,
                "Not supported",
                "Time data are currently not supported. Maybe You would like to treat time as z-stack",
                QMessageBox.Yes | QMessageBox.No,
                QMessageBox.No,
            )

            if res == QMessageBox.Yes:
                image = image.swap_time_and_stack()
            else:
                return False
        self.settings.image = image
        return True
Пример #3
0
 def transform(
     cls, image: Image, arguments: dict, callback_function: typing.Optional[typing.Callable[[str, int], None]] = None
 ) -> Image:
     return image.swap_time_and_stack()