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

how to calculate Percentage of IHC+ cell in WSI #19

Open
WeiLiuY opened this issue Sep 1, 2022 · 5 comments
Open

how to calculate Percentage of IHC+ cell in WSI #19

WeiLiuY opened this issue Sep 1, 2022 · 5 comments
Assignees

Comments

@WeiLiuY
Copy link

WeiLiuY commented Sep 1, 2022

Dear DeepLIIF author,

I am trying to use DeepLIIF to do segmentation of IHC + cells on our WSIs.
In the results output folder, i have multiple tiffs plus a results.pickle file.
I am wondering if there is any way to calculate the % of IHC+ from my WSI.
Or should i calculate from the results.pickle?
Many thanks!

Best,
Wei

@WeiLiuY
Copy link
Author

WeiLiuY commented Sep 2, 2022

Hi, i have figured out by myself. Thanks.

@sanadeem sanadeem closed this as completed Sep 2, 2022
@paulrbuckley-kcl
Copy link

Hi, also wondering this. I am trying to use ski-image to extract the cellular data but quite coplex thus far so assuming I am doing something wrong .. Wondering if anyone could provide some assistance please

@jommarin
Copy link
Collaborator

jommarin commented Feb 5, 2025

Are you using the infer_results_for_wsi function (either directly or through a call from cli.py)?

https://github.com/nadeemlab/DeepLIIF/blob/42c7ce4558d790832edce5e98e541b05fbc8e137/deepliif/models/init.py#L641

If so, I see that the counts for each patch are generated, but they are just discarded, and only the generated images are saved. You could add code here to keep a tally of the positive and negative counts (region_scoring['num_pos'] and region_scoring['num_neg']), and then calculate the final percentage at the end.

I am not sure why it was written this way (without accumulating and saving the counts), but I will try to update the repo in the next few days to correct this oversight.

@paulrbuckley-kcl
Copy link

paulrbuckley-kcl commented Feb 6, 2025 via email

@sanadeem
Copy link
Contributor

sanadeem commented Feb 6, 2025

@paulrbuckley-kcl can you please open a separate issue for the following point and we will keep this open to resolve the point you originally raised.

Possibly a different question so can open another issue if necessary, but I’d like to also 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 ..

Paul

@sanadeem sanadeem reopened this Feb 6, 2025
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

4 participants