Ejemplo n.º 1
0
    def process_and_sendoff(image_tags_tuple):
        """

        Parameters
        ----------
        image_tags_tuple :


        Returns
        -------

        """
        if len(image_tags_tuple) != 2:
            raise Exception(
                "If image is returned, it must be of the form (pixel, metadata)"
            )
        if not image_tags_tuple[0].dtype == pixels.dtype:
            raise Exception(
                "Processed image pixels must have same dtype as input image pixels, "
                "but instead they were {} and {}".format(
                    image_tags_tuple[0].dtype, pixels.dtype))

        processed_img = {
            "pixels": serialize_array(image_tags_tuple[0]),
            "metadata": image_tags_tuple[1],
        }
        push_socket.send(processed_img)
Ejemplo n.º 2
0
    def process_and_sendoff(image_tags_tuple):
        if len(image_tags_tuple) != 2:
            raise Exception('If image is returned, it must be of the form (pixel, metadata)')
        if not image_tags_tuple[0].dtype == pixels.dtype:
            raise Exception('Processed image pixels must have same dtype as input image pixels, '
                            'but instead they were {} and {}'.format(image_tags_tuple[0].dtype, pixels.dtype))

        processed_img = {'pixels': serialize_array(image_tags_tuple[0]), 'metadata': image_tags_tuple[1]}
        push_socket.send(processed_img)