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

Redo segmentations #7

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

MikeLippincott
Copy link
Member

This PR performs segmentations within python to import masks into CellProfiler later for feature extraction

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Member

@jenna-tomkinson jenna-tomkinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Exciting to see this optimization, super interesting! I left some comment and one major concern for mycoplasma with the nuclei, other than that nice job!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woahhh that IC hurts haha. Maybe would require some changes, one I can recommend is definitely changing from background to regular method and go from there. Very odd!

Also GSDMC is definitely better for segmentation only because there is clear contrast, those other channels are very messy... interesting stuff!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks to be empty unfortunately :(((((

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the red line? Mean of the diameter?

Also, very interesting how small the nuclei are, but I am not as familiar with the data so it might be expected! Might need some coSMicQC if those diameters are cluster nuclei/over-segmented haha

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

45 diameter looks to be pretty optimal! Unfortunately I can't see all of the options though.

One main thing I noticed (that we chatted about in person) was that these nuclei look very messy and look to contain mycoplasma, in my opinion. I have only seen it once and these nuclei look very similar to what I saw for mycoplasma.

As we discussed, it would be good to ask the collaborators to test the cells to ensure no contamination.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any examples in this file for what the cell segmentations look like, so I can't provide feedback on that unfortunately :(((

# save to a dict for later use
for img in nuclei:
img = normalize(img)
masks, flows, styles, diams = model.eval(img, channels=channels, diameter=50)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally agree with this diameter!

#!/usr/bin/env python
# coding: utf-8

# This notebook focuses on trying to find a way to segment cells within organoids properly.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# This notebook focuses on trying to find a way to segment cells within organoids properly.
# This notebook focuses on trying to find a way to segment cells properly.

Same comment as in the nuclei segmentation script.


# ## Cellpose

# In[ ]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing here.

# get masks for all the images
# save to a dict for later use
for img in imgs:
# masks, flows, styles, diams = model.eval(img, diameter=diameter, channels=channels)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend removing commented out code.

Comment on lines +4 to +6
# This notebook focuses on trying to find a way to segment cells within organoids properly.
# The end goals is to segment cell and extract morphology features from cellprofiler.
# These masks must be imported into cellprofiler to extract features.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider updating this to reflect the cytoplasm issue checking.

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

Successfully merging this pull request may close these issues.

2 participants