baseline.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:SamuROI 作者: samuroi 项目源码 文件源码
def linbleeched_F0(data):
    """
    Calculate a linear fit (:math:`y(t)=m t+y_0)` for each pixel, which is assumed to correct for bleeching effects.

    :param data: he video data of shape (M,N,T).
    :return: tuple (m,y0) with two images each with shape (M,N).
    """

    # generate c coordinates
    x = numpy.arange(data.shape[-1])
    # reshape the data to two d array, first dimension is pixel index, second dimension is time
    d = numpy.reshape(data, (data.shape[0] * data.shape[1], data.shape[-1]))
    # find fit parameters
    m, y0 = numpy.polyfit(x, d.T, 1)
    # reshape fit parameters back to image shape
    return m.reshape(data.shape[0:2]), y0.reshape(data.shape[0:2])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号