PYME.localization.FitFactories.FFBase module

class PYME.localization.FitFactories.FFBase.FFBase(data, metadata, fitfcn=None, background=None, noiseSigma=None, roi_offset=[0, 0])

Bases: object

Create a fit factory which will operate on image data (data), potentially using voxel sizes etc contained in metadata.

FromPoint(x, y, z=None, roiHalfSize=5, axialHalfSize=15)

This should be overridden in derived classes to actually do the fitting. The function which gets implemented should return a numpy record array, of the dtype defined in the module level FitResultsDType variable (the calling function uses FitResultsDType to pre-allocate an array for the results)

get3DROIAtPoint(x, y, z=None, roiHalfSize=5, axialHalfSize=15)

Helper fcn to extract ROI from frame at given x,y, point.

Returns:

X - x coordinates of pixels in ROI in nm Y - y coordinates of pixels in ROI Z - z coordinates of pixels in ROI data - raw pixel data of ROI background - extimated background for ROI sigma - estimated error (std. dev) of pixel values xslice - x slice into original data array used to get ROI yslice - y slice into original data array zslice - z slice into original data array

getMultiviewROIAtPoint(x, y, z=None, roiHalfSize=5, axialHalfSize=15)

Helper fcn to extract ROI from frame at given x,y, point from a multi-channel image.

WARNING: EXPERIMENTAL WORK IN PROGRESS!!! This will eventually replace getSplitROIAtPoint and generalise to higher dimensional splitting (e.g. 4-quadrant systems such as the 4Pi-SMS) but is not useful in it’s current form.

Returns:

Xg - x coordinates of pixels in ROI in nm (channel 1) Yg - y coordinates of pixels in ROI (chanel 1) Xr - x coordinates of pixels in ROI in nm (channel 2) Yr - y coordinates of pixels in ROI (chanel 2) data - raw pixel data of ROI background - extimated background for ROI sigma - estimated error (std. dev) of pixel values xslice - x slice into original data array used to get ROI (channel 1) yslice - y slice into original data array (channel 1) xslice2 - x slice into original data array used to get ROI (channel 2) yslice2 - y slice into original data array (channel 2)

getROIAtPoint(x, y, z=None, roiHalfSize=5, axialHalfSize=15)

Helper fcn to extract ROI from frame at given x,y, point.

Parameters
xint

ROI center position, x [pixels] relative to self.roi_offset

yint

ROI center position, y [pixels] relative to self.roi_offset

zint

ROI center position, z [pixels or frame]. Optional

roiHalfSizeint

lateral ROI extent. Lateral ROI size will be (2 * roiHalfSize) + 1

axialHalfSizeint

axial ROI extent. Axial ROI size will be (2 * axialHalfSize) + 1

Returns
X - x coordinates of pixels in ROI in nm
Y - y coordinates of pixels in ROI
data - raw pixel data of ROI, averaged in Z if axialHalfSize is > 0 and

self.data dim 2 > 1 (which it usually is not).

background - extimated background for ROI
sigma - estimated error (std. dev) of pixel values
xslice - x slice into original data array used to get ROI
yslice - y slice into original data array
zslice - z slice into original data array
getSplitROIAtPoint(x, y, z=None, roiHalfSize=5, axialHalfSize=15)

Helper fcn to extract ROI from frame at given x,y, point from a multi-channel image.

Returns:

Xg - x coordinates of pixels in ROI in nm (channel 1) Yg - y coordinates of pixels in ROI (chanel 1) Xr - x coordinates of pixels in ROI in nm (channel 2) Yr - y coordinates of pixels in ROI (chanel 2) data - raw pixel data of ROI background - extimated background for ROI sigma - estimated error (std. dev) of pixel values xslice - x slice into original data array used to get ROI (channel 1) yslice - y slice into original data array (channel 1) xslice2 - x slice into original data array used to get ROI (channel 2) yslice2 - y slice into original data array (channel 2)

property shift_x
property shift_y
PYME.localization.FitFactories.FFBase.FitFactory

alias of FFBase

PYME.localization.FitFactories.FFBase.get_shiftmap(shiftmap)

Get shiftmap from metadata entry. Module level function to permit future caching