manual_registration#
Attributes#
Classes#
Manual image correction using a graphical user interface. Corrections |
Functions#
|
Apply transformation to coordinates. Coordinates are expected to be |
|
Rescale image intensities from (vmin, vmax) to (0.0, 1.0). Values |
|
Transform and rescale 2D slice. Transform consists of a translation |
Module Contents#
- class manual_registration.ManualImageCorrection(data, resolution, downsample_factor, transforms=None, custom_ranges=None)[source]#
Manual image correction using a graphical user interface. Corrections include independent translation and rotation of each z-slice as well as image intensities rescaling per z-slice.
- Parameters:
data (ndarray of shape (nz, ny, nx)) – Stack of images, where images are stacked along the first axis (z).
resolution (3-tuple) – Resolution of the dataset (rz, ry, rx).
downsample_factor (int) – Factor by which the full resolution images are downscaled prior to rendering. Tradeoff between image quality and interactivity of the GUI. Does not influence the resolution of the corrected image.
transforms (ndarray (nz, 3), optional) – Transform for each slice where each array (3,) contains a translation (ty, tx) and a rotation (theta).
custom_ranges (ndarray (nz, 2), optional) – Intensities for rescaling each slice. One (vmin, vmax) per slice.
- manual_registration.apply_transform(ty, tx, theta, coordinates)[source]#
Apply transformation to coordinates. Coordinates are expected to be of shape (nz, ny, nx, 3), with each coordinate given in the order (z, y, x).
- Parameters:
- Returns:
coordinates – Transformed coordinates.
- Return type:
ndarray (nz, ny, nx, 3)
- manual_registration.apply_scaling(data, vmin, vmax)[source]#
Rescale image intensities from (vmin, vmax) to (0.0, 1.0). Values outside the range (vmin, vmax) are clipped.
Rescaling can be performed with a single range for the whole image or with a different range for each ROW. In the case, the first dimension of data should correspond to the number of elements in vmin, vmax.
- Parameters:
- Returns:
data – Recaled intensities.
- Return type:
ndarray
- manual_registration.transform_and_rescale_slice(slice, ty, tx, theta, vmin, vmax)[source]#
Transform and rescale 2D slice. Transform consists of a translation (ty, tx) and a rotation theta. Rescaling clips intensities to (vmin, vmax) and rescales the resulting values to the range (0, 1).
- Parameters:
- Returns:
slice – Processed slice.
- Return type:
ndarray of shape (ny, nx)