<commit_before>from lightning.types.base import Base
from lightning.types.decorators import viztype
from lightning.types.utils import array_to_im


@viztype
class Image(Base):
    _name = 'image'
    @staticmethod
    def clean(imagedata):

        out = []
        out.append(array_to_im(imagedata))
        return {'images': out}


@viztype
class Volume(Base):

    _name = 'volume'

    @staticmethod
    def clean(imagedata):

        out = []
        for im in imagedata:
            out.append(array_to_im(im))<commit_msg>Get coords from image data<commit_after>from lightning.types.base import Base
from lightning.types.decorators import viztype
from lightning.types.utils import array_to_im
import requests


@viztype
class Image(Base):
    _name = 'image'
    
    @staticmethod
    def clean(imagedata):

        out = []
        out.append(array_to_im(imagedata))
        return {'images': out}

    @property
    def coords(self):
        user_data = self.get_user_data()['settings']
        if 'coords' in user_data.keys():
            return user_data['coords']
        else:
            return []

@viztype
class Volume(Base):

    _name = 'volume'

    @staticmethod
    def clean(imagedata):

        out = []
        for im in imagedata:
            out.append(array_to_im(im))
{'fraction_non_alphanumeric': 0.10115830115830116, 'fraction_numerical': 0.0, 'mean_word_length': 2.630252100840336, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3594145', 'n_tokens_mistral': 416, 'n_tokens_neox': 399, 'n_words': 96}