Beispiel #1
0
    def genTheoreticalModel(self, md):
        from PYME.Analysis.PSFGen.ps_app import genWidefieldPSF

        vs = md.voxelsize_nm

        if not self.dx == vs.x and not self.dy == vs.y and not self.dz == vs.z:

            self.IntXVals = vs.x * mgrid[-20:20]
            self.IntYVals = vs.y * mgrid[-20:20]
            self.IntZVals = vs.z * mgrid[-20:20]

            self.dx, self.dy, self.dx = vs

            P = arange(0, 1.01, .01)

            interpModel = genWidefieldPSF(self.IntXVals, self.IntYVals,
                                          self.IntZVals, P, 1e3, 0, 0, 0,
                                          2 * pi / 525, 1.47, 10e3)

            self.interpModel = interpModel / interpModel.max()  #normalise to 1

            self.shape = interpModel.shape

            self._precompute()

            return True
        else:
            return False
Beispiel #2
0
def f_PSF3d(p, X, Y, Z, P, *args):
    """3D PSF model function with constant background - parameter vector [A, x0, y0, z0, background]"""
    A, x0, y0, z0, b = p
    #return A*scipy.exp(-((X-x0)**2 + (Y - y0)**2)/(2*s**2)) + b
    return genWidefieldPSF(X, Y, Z, P, A * 1e3, x0, y0, z0, *args) + b