scallops.visualize.napari.radial_distortion_estimation
- scallops.visualize.napari.radial_distortion_estimation(top_left, top_right, bottom_left, bottom_right, channel=0, proportion_overlap=0.0)
Run radial distortion estimation. This function initializes a Napari viewer with four images positioned to form a larger composite image. It applies radial distortion correction to the images, allowing the user to adjust the correction parameter interactively through a graphical user interface. Images must be adjacent.
- Parameters:
top_left (str) – Path to the top-left image file.
top_right (str) – Path to the top-right image file.
bottom_left (str) – Path to the bottom-left image file.
bottom_right (str) – Path to the bottom-right image file.
channel (int) – Index of the channel to be extracted from the image files.
proportion_overlap (float) – Proportion of overlap between adjacent images, expressed as a fraction of the image size. This is used to compute the translations for positioning the images within the viewer.
- Example:
To run the distortion correction process, use the following code with your own S3 URIs:
radial_distortion_estimation( top_left="s3://your-bucket/path/to/image_top_left.nd2", top_right="s3://your-bucket/path/to/image_top_right.nd2", bottom_left="s3://your-bucket/path/to/image_bottom_left.nd2", bottom_right="s3://your-bucket/path/to/image_bottom_right.nd2", channel=0, proportion_overlap=0.05, )
This should open a napari window with the 4 images displayed. Adjust the alignment of the images, and use the Apply Distortion Correction slider to identify the K for radial correction. You can pass that to the stitch command of scallops or ashlar.
- Return type:
None