qem.gui_classes
Functions
|
Get a subset of atom positions within region spanned to verticies. |
|
An iterator to generate unique colors by cycling through the HSV color space. |
|
Zoom in on the center of a 1D or 2D array using Fourier upsampling. |
Classes
|
|
|
|
|
|
|
- qem.gui_classes.get_atom_selection_from_verts(atom_positions, verts, invert_selection=False)[source]
Get a subset of atom positions within region spanned to verticies.
- Parameters:
atom_positions (
list
orNumPy array
) – In the form [[x0, y0]. [x1, y1], …]verts (
list
oftuples
) – List of positions, spanning an enclosed region. [(x0, y0), (x1, y1), …]. Need to have at least 3 positions.invert_selection (
bool
, optional) – Get the atom positions outside the region, instead of the ones inside it. Default False.
- Returns:
atom_positions_selected (
NumPy array
)
Examples
>>> from numpy.random import randint >>> from atomap.tools import _get_atom_selection_from_verts >>> atom_positions = randint(0, 200, size=(200, 2)) >>> verts = [(200, 400), (400, 600), (100, 100)] >>> atom_positions_selected = _get_atom_selection_from_verts( ... atom_positions=atom_positions, verts=verts)
Get atom positions inside the region
>>> atom_positions_selected = _get_atom_selection_from_verts( ... atom_positions=atom_positions, verts=verts, ... invert_selection=True)
- class qem.gui_classes.GetAtomSelection(image, atom_positions, invert_selection=False, size=1)[source]
- class qem.gui_classes.InteractivePlot(image: numpy.ndarray, peaks_locations: numpy.ndarray, atom_types: numpy.ndarray | None = None, tolerance: float = 10, dx: float = 1, units: str = 'A', dimension: str = 'si-length', zoom: float = 1)[source]
- __init__(image: numpy.ndarray, peaks_locations: numpy.ndarray, atom_types: numpy.ndarray | None = None, tolerance: float = 10, dx: float = 1, units: str = 'A', dimension: str = 'si-length', zoom: float = 1)[source]
- property scalebar