<jupyter_start><jupyter_text>ImageContainer object=====================This example shows how to use squidpy.im.ImageContainer to interact withimage structured data.<jupyter_code>import squidpy as sq<jupyter_output><empty_output><jupyter_text>Load a pre-loaded image. To load your own data, use the ImageContainerconstructor: `squidpy.im.ImageContainer()`<jupyter_code>img = sq.datasets.visium_hne_image()<jupyter_output><empty_output><jupyter_text>Representation image in container: The image(s) are in the img.dataattribute of the instance, which is an xarray.Dataset. Note that this isa Dataset so that this attribute can hold multiple image-structuredlayers.<jupyter_code>print(img.data)<jupyter_output><empty_output><jupyter_text>You can access specific image-structured arrays in the image using theirnames.<jupyter_code>print(img["image"])<jupyter_output><empty_output><jupyter_text>Lazy loading: The image data can be lazily loaded with netcdf andexplicitly loaded into memory via `.data.load()` and saved to disk via`.save()`:<jupyter_code>img.data.load()<jupyter_output><empty_output><jupyter_text>You can add images into the ImageContainer using `.add_img()`: Here weare adding the same image again under a different name as a toy example.It shares the same channel dimension with "image", so we can use thesame label for `channel_dim` here. If the added image layer has adifferent channel dimension, just specify a new label for `channel_dim`.<jupyter_code>img.add_img(
    img=img.data["image"],
    layer="image2",
    channel_dim="channels",
    lazy=True,
)
img<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1014312383322962, 'fraction_numerical': 0.0006222775357809583, 'mean_word_length': 7.246153846153846, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '169410', 'license': 'MIT', 'n_tokens_mistral': 495, 'n_tokens_neox': 486, 'n_words': 149, 'path': 'docs/source/auto_examples/image/compute_image_container.ipynb', 'repo_name': 'softbear/squidpy_notebooks', 'size': '1607'}