QihuangZhang / CeLEry

CeLEry: cell location recovery in single-cell RNA sequencing
MIT License
26 stars 3 forks source link

Inquiry about the get_ssim function #8

Open cindyway opened 2 months ago

cindyway commented 2 months ago

It is clever to use the predicted result and the actual gene expression as images to obtain quantitative results. However, when I run this on the sc and ST data, I get the same image. So, I would like to ask you about the implementation details of this function:

  1. Why do img_truth and img_predict have been given the same ST gene expression values?

    z = referadata.X[:,i]  
    for inp in range(coords.shape[0]): 
    ...
        img_truth[i, referx.iloc[inp]-referxmin, refery.iloc[inp]-referymin] = z[inp] 
        ...
        if (img_predict[i,x_pixel_pred, y_pixel_pred,1] == 0): 
            img_predict[i,x_pixel_pred, y_pixel_pred,0] = z[inp] 
        else: 
            img_predict[i,x_pixel_pred, y_pixel_pred,0] = (img_predict[i,x_pixel_pred, y_pixel_pred,0] * img_predict[i,x_pixel_pred, y_pixel_pred,1] + z[inp]) / (img_predict[i,x_pixel_pred, y_pixel_pred,1] + 1) 
            img_predict[i,x_pixel_pred, y_pixel_pred,1] = img_predict[i,x_pixel_pred, y_pixel_pred,1] + 1
  2. img_predict[i,x_pixel_pred, y_pixel_pred,1] = img_predict[i,x_pixel_pred, y_pixel_pred,1] + 1 Why is this line of code only after the "else" section? Should it be +1 after every given value, including the "if" section?