Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About mouse olfactory bulb dataset #48

Open
cquzys opened this issue May 18, 2022 · 2 comments
Open

About mouse olfactory bulb dataset #48

cquzys opened this issue May 18, 2022 · 2 comments

Comments

@cquzys
Copy link

cquzys commented May 18, 2022

Hi author:
I obtained the mouse olfactory bulb dataset obeyed the address: https://www.spatialresearch.org/resources-published-datasets/doi-10-1126science-aaf2403/.
However, I didn't understand how to plot the data on top of the HE image. For example, the instructions in section Alignments: "you can either rescale the image to the array size (1,1,33,35) or transform the spot coordinates to image pixel coordinates using these alignment 3×3 matrices:"

Can you tell me how to plot the data on the top of the HE image easily?

Thanks

@ludvb
Copy link
Owner

ludvb commented May 19, 2022

Hi,

Here is an example showing how to use the alignment matrix to convert the array coordinates in the count file to pixel coordinates:

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from imageio import imread

data = pd.read_csv("./Rep1_MOB_count_matrix-1.tsv", sep="\t", index_col=0)
alignment_matrix = np.loadtxt("./Rep1_MOB_transformation.txt")
image = imread("./HE_Rep1_MOB.jpg")

array_coords = np.array([[float(a) for a in x.split('x')] for x in data.index])
array_coords_h = np.concatenate([array_coords, np.ones((array_coords.shape[0], 1))], 1)
pixel_coords_h = array_coords_h @ alignment_matrix.reshape(3,3)
pixel_coords = pixel_coords_h[:, :2]

plt.imshow(image)
plt.scatter(pixel_coords[:, 0], pixel_coords[:, 1])
plt.show()

Let me know if you have any questions!

@Yizhi-Zhang
Copy link

Hi, @ludvb

Thank you for your interesting work.

I encountered some issues when applying XFuse to the mouse olfactory bulb dataset. Could you please advise on how to modify my config.toml file and could you provide a reference configuration file?

Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants