-
Notifications
You must be signed in to change notification settings - Fork 89
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
Visium hires image segmentation #298
Comments
Hi @chsher thank you for trying out squidpy! Indeed segmentation is quite difficult on hne stain, especially if low resolution. You can play around with the |
Thanks for your speedy reply @giovp. Here is a crop of the image (left: original, right: smoothed). |
mmh I see yes, it looks pretty difficult. Seems like each nuclei is only represented by a handful of pixels, and smoothing definitely doesn't help. I see it difficult also for DL based approaches. If you'd like to try one I would suggest you to start with this maybe https://github.com/MouseLand/cellpose We provide a segmentation custom class that you can use with any callable (e.g. a DL model) here: https://squidpy.readthedocs.io/en/latest/classes.html#segmentationcustom If that also doesn't work out of the box, then you probably have to pre-train the model with some ground truth that you'd have to segment yourself. It can be complicated and time consuming... pinging @hspitzer who might have some smart tips. I just want to mention that for Tangram you don't need to have segmentation masks at all costs, and the deconvolved proportions (as showed in the tutorial) works quite well already. In case you don't manage with segmenting it, could be interesting to try out tangram without it anyway. |
Hi @giovp , here is Tancredi from Rajewsky Lab, first of all: I'm grateful for this great tool! I'm following up on this question as I've a similar problem with segmenting nuclei in fresh frozen HE images and I've tried cellpose and other DL segmentation tools (e.g. stardist: [https://github.com/stardist/stardist] ) achieving satisfactory results. Now I'm facing problems when including these models in squidpy custom segmentation. What are exactly the requirements of this function? The function I'm inputting as 'method' is callable, takes as input a numpy array of shape (x, y, channels) and returns a numpy array of shape (x, y) with integers identifying pixels belonging segmented objects. Does this makes sense to you?
The precise error message, which occurs only with custom segmentation, is:
Thanks in advance for your help! |
Hi @tpentim ! thank you for your interest in squidpy! The image container is currently undergoing bit of a refactoring (see here #296 ) shouldn't take long to get it merged. Furthermore, we are gonna provide extensive tutorials on how to use stardist and cellpose (currently worked on here theislab/squidpy_reproducibility#12 and here theislab/squidpy_reproducibility#11 ). Both of them will end up in the tutorials page in the docs. Therefore, if you could give it 2-3 weeks, we'll provide all info necessary for reproducibility. I will ping you here when everything is merged. Thank you in advance for your patient 🙏 |
Hi @giovp, thanks for your reply. It's great news there will be tutorials to integrate stardist and cellpose! |
we are gonna release squidpy 1.2 sometime next week. Meanwhile, if you install it with pip install -e . from the dev branch, you can already try out the new tutorials. squidpy.readthedocs.io/en/latest/external_tutorials/tutorial_cellpose_segmentation.html let us know if that helps, they should also be general enough to help you plug in your own pretrained/fine tuned favourite model. |
hi both, with the new release those notebooks are now stable will close this but feel free to reopen if not addressed |
Thank you for creating this great tool. I am working on cell type deconvolution based on your tutorial (https://squidpy.readthedocs.io/en/latest/external_tutorials/tutorial_tangram.html), but I am running into an issue with cell segmentation. Namely, the Visium H&E image is not very high-resolution (2000 pixels x 1843 pixels), and I am having trouble finding a threshold to detect the nuclei based on your example (https://squidpy.readthedocs.io/en/latest/auto_examples/image/compute_segment_hne.html). Do you have any recommendations for segmenting the cells in a Visium H&E image?
The text was updated successfully, but these errors were encountered: