nanopyx.core.analysis.ccm

def calculate_ccm(img_stack, ref):

Function used to generate a cross correlation matrix of an image stack. Cross correlation is calculated using either the first image of the stack or the previous image. Cross correlation values are normalized by the minimum and maximum Pearson's correlation between the two images.

Parameters
  • img_stack: numpy array with shape (t, y, x)
  • ref: either 0 or 1, 0 is used to calculate the ccm based on the first frame, 1 used to calculate based on the previous frame
Returns

numpy array with shape (t, y, x), corresponding to the cross correlation matrix

def calculate_ccm_from_ref(img_stack, img_ref):

Function used to generate a cross correlation matrix of an image stack. Cross correlation is calculated using a static image frame. Cross correlation values are normalized by the minimum and maximum Pearson's correlation between the two images.

Parameters
  • img_stack: numpy array with shape (t, y, x)
  • img_ref: numpy array with shape (y, x)
Returns

numpy array with shape (t, y, x), corresponding to the cross correlation matrix

def calculate_slice_ccm(img_ref, img_slice):

Function used to calculate cross correlation between two 2D images.

Parameters
  • img_reg: numpy array with shape (y,x)
  • img_slice: numpy array with shape (y,x)
Returns

numpy array with shape (y,x) corresponding to the cross correlation