<jupyter_start><jupyter_text>LEEM - How to make ROIs and take stack profilesFor a basic tutorial for plotting intensity profiles, see `LEEM_plotting.ipynb`. This tutorial shows how to have multiple ROIs at the same time.<jupyter_code>from uspy import leem<jupyter_output><empty_output><jupyter_text>A ROI is defined either as a circle, rectangle or ellipse. The first two arguments specify the center. If no specific type is given, a circle with a radius of 10px is assumed:<jupyter_code>roi1 = leem.ROI(300, 300)     # same as leem.ROI(x0=300, y0=300)
print(f"{roi1.type_=}")
print(f"{roi1.params=}")<jupyter_output>roi1.type_='circle'
roi1.params={'radius': 10}<jupyter_text>If either parameters like `width` is given or an explicit `type_` (note the underscore), the ROI is different:<jupyter_code>roi2 = leem.ROI(300, 300, width=20, height=80)
print(f"{roi2.type_=}")

roi3 = leem.ROI(200, 350, xradius=40)
print(f"{roi3.type_=}")
print(f"{roi3.params=}")<jupyter_output>roi2.type_='rectangle'
roi3.type_='ellipse'
roi3.params={'xradius': 40, 'yradius': 20}<jupyter_text>In most plotting functions, you can either give a ROI, a list/tuple of ROIs or the arguments as used above:<jupyter_code>leem.plot_intensity_img("../testdata/test_stack_IV_g-Cu", x0=400, y0=400, radius=20)
leem.plot_intensity_img("../testdata/test_stack_IV_g-Cu", (roi1, roi2, roi3))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13184438040345822, 'fraction_numerical': 0.04755043227665706, 'mean_word_length': 6.8474576271186445, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '389571', 'license': 'MIT', 'n_tokens_mistral': 578, 'n_tokens_neox': 539, 'n_words': 134, 'path': 'examples/LEEM_rois.ipynb', 'repo_name': 'surf-sci-bc/uspy', 'size': '1388'}