-
Notifications
You must be signed in to change notification settings - Fork 58
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
Segmentation outline with Mesmer #474
Comments
Hi @marcovarrone
to the list of s3segmenter parameters? The logSigma parameter allows you to filter out cells that deviate outside of that cell diameter range (in pixels). Feel free to leave that out if you want to accept all cell objects. |
Minor adjustment. Whether or not the output of a segmentation module goes through I would recommend trying the following:
MCMICRO will then pass the output of Mesmer to S3Seg, automatically providing |
Riding on the request here I have the same need to create segmentation outlines from Mesmer output except I generated the mask using at the whole-cell level instead of nuclear level. What should the settings be to outline the whole-cell boundaries? |
Hi @nancyliy, Clarence can correct me if I'm wrong, but when using the I just tested exemplar-001 with the following workflow:
segmentation: mesmer
options:
s3seg: --logSigma 15 300
modules:
segmentation:
-
name: mesmer
watershed: bypass where
|
Hi @nancyliy If you have a nuclei AND cell mask from Mesmer and you want outlines for both, then the easiest thing to do right now is run MCMICRO twice (first, pass the nuclei mask into s3seg and save the nucleiOutlines file somewhere to avoid it getting overwritten. Then rerun s3seg and pass the cell mask instead and take the cellOutlines file). As Artem mentioned, nucleiOutlines and cellOutlines have identical contents within each MCMICRO run in your case. |
Thanks both for your kind and helpful input. I performed a run using This error seems to be similar to the one I raised in issue #475. I would really appreciate if I could receive some advice on how to resolve it. Thank you. |
@nancyliy For unmicst, this is really meant for segmenting nuclei. If you are expecting whole cell segmentation, then unmicst would not work. The pixel size must also be right and we have seen that all segmentation methods do not give optimal results when this does not match. |
@nancyliy which compartment are you segmenting with Mesmer? Nucleus, cytoplasm, or both? I remember getting a similar error while using |
@marcovarrone in my command I was trying to use @marcovarrone regarding input for |
@marcovarrone @nancyliy there would indeed be an error from s3seg if the mask is two or more channels instead of one. We always run it on one compartment per mask. Please try one and see if it is better. Thanks! |
@nancyliy Yes, I managed to obtain nuclear and whole-cell quantification results once I ran every compartment separately. One aspect you have to be careful of is that, regardless of whether you are obtaining the masks for nuclear and whole-cell separately or with I am right now working on a script to match nuclear masks with the whole-cell ones based on their overlap. |
Thanks so much @marcovarrone and @clarenceyapp on your help! the |
@nancyliy @marcovarrone great to hear it is now working! One easy thing to do could be to split the two channel mask into individual images and re-save them as separate files. This can be done in imageJ or programmatically. |
@clarenceyapp thank you for the suggestion on computing the cytoplasm rings using s3seg! If I use the parameter However, in the version without I tried to see if it was a matter of nucleus size, so I put a big range for the size filter, i.e. I report here the full params.yml file:
|
Hi @marcovarrone , can you email me your Mesmer and s3seg outputs and raw images either as a Dropbox link or attachment to Clarence AT hms.harvard.edu ? I'll take a look today to see what the issue is. You can also test my original set of parameters at top of thread in the meantime if you like. |
@clarenceyapp I am using human patient data, so unfortunately at the moment I cannot send you the raw images. EDIT: I also tried to run MCMICRO with |
@marcovarrone ok is it alright to just send the Mesmer mask and s3seg outputs without raw channels? |
@clarenceyapp I sent you the raw DAPI image and the masks of a non-sensitive dataset in which the same thing happens. |
Hi @marcovarrone, thanks for your patience. I see the issue and have identified what might be causing the problem. The I believe the immediate short term solution for the 2nd issue is to stop right after s3segmenter has finished, manually put the Mesmer mask in the |
@clarenceyapp Thank you for the info! I would have never guessed the problem, so your help has been invaluable. However, I can create a script to add a one-pixel gap between the masks and then run s3seg+quantification. Is there a way to run s3seg in MCMICRO without rerunning the Mesmer segmentation? I think this may be necessary if I want to change the mask between Mesmer and s3seg. Again, thank you very much for your help :) |
@marcovarrone You shouldn't need to move files around by hand. By default, S3seg doesn't get run on Mesmer, and Mesmer outputs get automatically copied to the
above, so you would just take these lines out of your If you do have a way to add 1-pixel gaps and want to continue running S3seg, then you can start MCMICRO at that step without rerunning Mesmer by adding
|
Hi @marcovarrone |
Hi @ciszew Sorry for not being more helpful than this :/ |
hello! @ArtemSokolov I have just ran the script you have suggested: But was returned the following error: |
Hi @ke2rchan, That looks like a parsing error. Can you confirm that you have the correct indentation in your YAML config file? I see that you posted the following above:
But it should be:
Please note that the above are spaces and not tabs. |
@ArtemSokolov Hello, thank you so so much for your help and for the prompt response! That solved my issue. However, the outline ouput is slightly different from the one generated by unmicst, where each cell is fully outlined/circled. Could I then check with you, for the s3seg outline output, if there is any way I can quantify how many cells are identified in each outline? (since the mesmer+s3seg outline outlines several cells at once rather than each individual cell in unmicst+s3seg)(see image attached below) For reference, the .yml I used is as follows: options: modules: |
Hi @ke2rchan, This looks like a possible issue with the segmentation accuracy. @clarenceyapp developed s3seg and may be able to help with parameter settings. |
Hi,
I am using Mesmer to segment cell nuclei of multiplexed immunofluorescence images.
To check if the segmentation works well, is it possible to obtain the segmentation outlines overlaid on the channels as described in the documentation of s3seg?
As far as I understood s3segmenter works with probability maps, so it's not possible to run it on the output of Mesmer which is masks directly. However, is there a way to run the mask-to-outline part of s3seg only?
Thank you very much
The text was updated successfully, but these errors were encountered: