Package: napari-sift-registration
skimage-sift-registrationSimple plugin for 2D keypoint detection and affine registration with RANSAC.Artificial dataMoving and fixed images showing inlier keypoints after RANSACThisnapariplugin was generated withCookiecutterusing@napari'scookiecutter-napari-plugintemplate.
It uses thescikit-imageSIFT keypoint detection routines to find distinctive image points and generate local descriptions of the image around them.
Correspondences between the two images are then found by looking for pairs of keypoints, one in each of the two images, with closely matching descriptors.For typical images, many of these correspondences will be wrong. To reduce these false correspondences, the plugin applies the RANSAC algorithm. This randomly selects a small subset of the matching pairs of keypoints, estimates the affine transformation between this subset of keypoints, and then evaluates how many of the other pairs of keypoints also closely agree with this affine transformation ("inliers"). A large number of random samples are tested, and the transformation with the most inliers retained.The plugin outputs two points layers, one for each image, containing all the corresponding (inlier) SIFT keypoints. It also uses the estimated affine transformation between the two images to deform the "moving" image layer onto the "fixed" image layer.This approach is an attempt to provide similar functionality to the Stephan Saalfeld's Fiji "Extract SIFT Correspondences" pluginextract, and more-or-less
just provides a napari interface to the existing routines in scikit-image. There are great examples in the scikit-image documentation (e.g.SIFT-exampleandRANSAC-example) that can be used if you would like to use these routines in your own analysis scripts.InstallationYou can installnapari-sift-registrationviapip:pip install napari-sift-registrationTo install the latest development version :pip install git+https://github.com/jfozard/napari-sift-registration.gitUsageBasic usageLoad two 2D single channel images in Napari.Select the menu item Plugins > napari-sift-registrationSelect these two images as the "Moving image layer" and the "Fixed image layer". The moving image will be deformed by the transformation to look like the fixed image.The remaining parameters are the default settings from scikit-image; try these default values first.Advanced usageThe parameter values for SIFT feature detection, keypoint matching and RANSAC are accessible from the plugin gui. For further information about their use, see the appropriate scikit-image documentation:Upsampling before feature detection, maximum number of octaves, maximum number of scales in every octave, blur level of seed image, feature descriptor size, feature descriptor orientation bins: seescikit-image-SIFT.Closest/next closest ratio: seescikit-image-match_descriptorsMinimum number of points sampled for each RANSAC model, distance for points to be inliers in RANSAC model, maximum number of trials in RANSAC model: seescikit-image-RANSACOnly show inlier keypoints: If checked, only show corresponding keypoints that are inliers after RANSAC. If unchecked, show all corresponding keypoints.LimitationsOnly 2D, single channel images (for now).ContributingContributions are very welcome. Tests can be run withtox, please ensure
the coverage at least stays the same before you submit a pull request.LicenseDistributed under the terms of theBSD-3license,
"napari-sift-registration" is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.