How to use the jupyter-innotater.jupyter_innotater.data.ImageInnotation function in jupyter-innotater

To help you get started, we’ve selected a few jupyter-innotater examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ideonate / jupyter-innotater / jupyter-innotater / jupyter_innotater / data.py View on Github external
def post_register(self, datamanager):
        if self.source is not None:
            self.sourcedw = datamanager.get_data_wrapper_by_name(self.source)

            if self.sourcedw is None:
                raise Exception('ImageInnotation named {} not found but specified as source attribute for BoundingBoxInnotation'.format(self.source))

            if not isinstance(self.sourcedw, ImageInnotation):
                raise Exception('Innotation named {} is not an ImageInnotation but is specified as source attribute for BoundingBoxInnotation'.format(self.source))

        else:
            # Find by type
            dws = datamanager.get_data_wrappers_by_type(ImageInnotation)
            if len(dws) != 1:
                # Raises exception if 0 or >1 of these is found
                raise Exception('ImageInnotation not found uniquely')

            self.sourcedw = dws[0]

        super().post_register(datamanager)
github ideonate / jupyter-innotater / jupyter-innotater / jupyter_innotater / data.py View on Github external
def post_register(self, datamanager):
        if self.source is not None:
            self.sourcedw = datamanager.get_data_wrapper_by_name(self.source)

            if self.sourcedw is None:
                raise Exception('ImageInnotation named {} not found but specified as source attribute for BoundingBoxInnotation'.format(self.source))

            if not isinstance(self.sourcedw, ImageInnotation):
                raise Exception('Innotation named {} is not an ImageInnotation but is specified as source attribute for BoundingBoxInnotation'.format(self.source))

        else:
            # Find by type
            dws = datamanager.get_data_wrappers_by_type(ImageInnotation)
            if len(dws) != 1:
                # Raises exception if 0 or >1 of these is found
                raise Exception('ImageInnotation not found uniquely')

            self.sourcedw = dws[0]

        super().post_register(datamanager)