<jupyter_start><jupyter_text>Crop images with ImageContainer===============================This example shows how crop images from squidpy.im.ImageContainer.Specifically, it shows how to use:> -   squidpy.im.ImageContainer.crop\_corner()> -   squidpy.im.ImageContainer.crop\_center()<jupyter_code>import squidpy as sq

import matplotlib.pyplot as plt<jupyter_output><empty_output><jupyter_text>Load a H&E Visium image.<jupyter_code>img = sq.datasets.visium_hne_image_crop()<jupyter_output><empty_output><jupyter_text>Extracting single crops: Crops need to be sized and located. Wedistinguish crops located based on a corner coordinate of the crop andcrops located based on the center coordinate of the crop. You canspecify the crop coordinates in pixels (as `int`) or in percentage oftotal image size (as `float`)<jupyter_code>crop_corner = img.crop_corner(1000, 1000, size=400)

crop_center = img.crop_center(1200, 1200, radius=200)

fig, axes = plt.subplots(1, 2)
crop_corner.show(ax=axes[0])
crop_center.show(ax=axes[1])<jupyter_output><empty_output><jupyter_text>The result of the cropping functions is another ImageContainer<jupyter_code>crop_corner<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11570945945945946, 'fraction_numerical': 0.02195945945945946, 'mean_word_length': 7.777777777777778, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '361773', 'license': 'MIT', 'n_tokens_mistral': 426, 'n_tokens_neox': 394, 'n_words': 98, 'path': 'docs/source/auto_examples/image/compute_crops.ipynb', 'repo_name': 'softbear/squidpy_notebooks', 'size': '1184'}