ptyrad.utils.image_proc

ptyrad.utils.image_proc#

Image processing tools for CoM, fitting, normalization, shifting, etc.

Functions

center_crop(image, crop_height, crop_width)

Center crops a 2D or 3D array (e.g., an image).

create_one_hot_mask(image, percentile)

fit_background(image, mask[, fit_type])

fit_cbed_pattern(image[, initial_guess, verbose])

Estimate the center, radius, and std of a CBED pattern by minimizing the difference between the observed image and a synthetic model.

gaussian_blur_1d(tensor[, kernel_size, sigma])

get_blob_size(dx, blob[, output, ...])

get_center_of_mass(image[, corner_centered])

Finds and returns the center of mass of an real-valued 2/3D tensor

get_gaussian1d(size, std[, norm])

get_local_obj_tilts(pos, objp, dx, ...[, ...])

Estimate the local obj tilts from relative atomic column shifts

guess_radius_of_bright_field_disk(image[, ...])

Utility function that returns an estimate of the radius of rbf from CBED

imshift_batch(img, shifts, grid)

Generates a batch of shifted images from a single input image (..., Ny,Nx) with arbitray leading dimensions.

normalize_by_bit_depth(arr, bit_depth)

normalize_from_zero_to_one(arr)