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

Extracting single cell information from segmented masks #49

Open
paulrbuckley-kcl opened this issue Feb 6, 2025 · 2 comments
Open

Extracting single cell information from segmented masks #49

paulrbuckley-kcl opened this issue Feb 6, 2025 · 2 comments
Assignees

Comments

@paulrbuckley-kcl
Copy link

Hi

As per previous discussion i am wondering whether you could provide some guidance in how to extract single cell information (ie pve nve cell coordinates, shape etc) from the segmented mask. I’m assuming the pickle file is the best way to do it? wondering if you wouldn’t mind recommending a way of doing this .. currently I was looking at RBG based thresholding but wanted to ensure that was the most appropriate way.

thanks

@jommarin
Copy link
Collaborator

jommarin commented Feb 6, 2025

I think you would want to use the SegRefined image, where the cell boundaries are green and the interiors are red (positive) and blue (negative). As opposed to the Seg image, this is after postprocessing has been performed, so you would not need to do any thresholding yourself. Since borders might be touching, the easiest thing would probably be to mask out the red and blue regions, and then extract the contours for each of them. You could extend the boundaries by a pixel or two if the contour from this is too much away from the cell boundary. I would recommend using the generated tiff file directly, instead of reading in the entire pickle file which contains all of the images. (In fact, the pickle file seems superfluous, and I will probably remove it when I revisit this function.)

In a coincidence of timing, though, we are currently revising the postprocessing to generate individual cell outputs (including the boundary coordinates of each cell). This will be integrated in the coming weeks, and might be useful for you. We are doing this primarily for our own internal use, and the data is heavily encoded to reduce space, but there will be a decode function so it should be generally usable. I will update here when that part is ready.

@paulrbuckley-kcl
Copy link
Author

paulrbuckley-kcl commented Feb 6, 2025 via email

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

2 participants