PointOfInterestFinder.refine_locations¶
- PointOfInterestFinder.refine_locations(image, points_of_interest)[source]¶
This method is used to estimate the subpixel centers of blobs in an image given the pixel level location of the blobs.
The method operates by performing a user specified centroiding algorithm on the image area surrounding the specified pixel level centers of the points of interest. The centroiding algorithm should typically be a subclass of
PointSpreadFunction
, however it can be any object with afit
method that inputs 3 array like parameters with the first two being pixel locations and the last being DN values and returns a object with acentroid
attribute which provides the (x, y) location of the centroid. The centroiding algorithm is specified using thecentroiding
attribute. The size of the area considered in the centroiding algorithm can be specified in thecentroid_size
attribute.This method returns both the subpixel centers of the points of interest as well as the illumination values of the pixels containing the subpixel centers of the points of interest. Optionally, stats about the blobs that the centroid was fit to and then full centroid fit can be returned if
stats
andsnrs
are not None andsave_psf
is set to True, respectively.Note that if a centroid fit is unsuccessful then no information is returned for that point. Therefore the output arrays lengths will be less than or equal to the length of the input array.
This method is designed to be used in conjunction with the
find_poi_in_roi()
method; however, it can be used with any rough identification method so long as the input format is correct.- Parameters:
image (ndarray[tuple[Any, ...], dtype[_ScalarT]]) – The image to be processed
points_of_interest (FindPPOIInROIOut) – The named tuple containing the pixel level information about the points of interest
- Returns:
The subpixel centers of the points of interest (col, row), the intensity of the center of the pois, the fit
PointSpreadFunction
to the pois, the stats from the blobs containing the pois, and the peak SNR of the blobs containing the pois.- Return type: