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

RandomTiler issue with tissue_percent parameter #611

Open
Neuro-nerd-scientist opened this issue Aug 16, 2023 · 6 comments · May be fixed by #620
Open

RandomTiler issue with tissue_percent parameter #611

Neuro-nerd-scientist opened this issue Aug 16, 2023 · 6 comments · May be fixed by #620
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@Neuro-nerd-scientist
Copy link

Hello,

I'm working with histolab's RandomTiler to extract some sample tiles from an image of a larger sample of tissue. I have successfully loaded my image (jpg format) into python using PIL and then initialise the image as a Slide object using Histolab's Slide class

I notice that when I use the default tissue_percent value (80%), all the tiles are aggregated on the top of the sample - this behaviour continues for high tissue_percent values as well (tissue_percent>50). To get random sampling throughout the entirety of my tissue sample, I need to supply very low tissue_percent values (tissue_percent<5%) to get uniform sampling throughout the tissue. I have included three screenshots - showing different tissue_percent values with check_tissue set to True to show the odd tiling patterns this is producing:

Example 1 - tissue_percent set to 80% with check_tissue set to True

image

Example 2 - tissue_percent set to 20% with check_tissue set to True

This result was unexpected but also anomalous. Because again the tiles are not being extracted throughout the entirety of the tissue ( which I get at extremely low tissue_percent values)
image

Example 3 - tissue_percent set to 1% with check_tissue set to True

image

I'm not sure why this is occurring, and why I need such low tissue_percent values to be supplied to the RandomTiler extractor to get tiles sampled throughout my whole image. If anyone has experienced this, or has a solution to this issue, please let me know. Any assistance is greatly appreciated.

Thank you for your time, efforts and consideration.

@Neuro-nerd-scientist Neuro-nerd-scientist added help wanted Extra attention is needed question Further information is requested labels Aug 16, 2023
@alessiamarcolini
Copy link
Collaborator

Hi @Neuro-nerd-scientist thank you for opening this issue! The behavior you show is indeed strange, and it might be related to how uniform the image is in the center.

Would you be able to put this image somewhere online so we can have a look and test a few things?

@Neuro-nerd-scientist
Copy link
Author

Neuro-nerd-scientist commented Aug 17, 2023

Certainly! And thank you for the response. Here's the sample image. I should mention this is brain tissue, and the label is in situ hybridization.
MAG_69676224_Sagittal_whole_no_hippocampus_cropped_top_and_bottom

@alessiamarcolini
Copy link
Collaborator

@Neuro-nerd-scientist after some investigation it seems like it's related to #360, but probably adding a border of 10px is not enough in your case, let me work on a fix :)

@Neuro-nerd-scientist
Copy link
Author

Thank you @alessiamarcolini I'll take a look at the post you mentioned. Please keep me updated, I really appreciate it :)

@alessiamarcolini alessiamarcolini linked a pull request Aug 18, 2023 that will close this issue
11 tasks
@alessiamarcolini
Copy link
Collaborator

hey @Neuro-nerd-scientist can we integrate your image in our testing suite and add specific use cases for that? this will help us ensure we are not introducing regressions in the future.

@Neuro-nerd-scientist
Copy link
Author

Neuro-nerd-scientist commented Aug 18, 2023

The image is from the Allen Institute's Mouse Neuroanatomy Database - it's open access- but this is a sample from one of their brain section images.

Is there anything I can do either with regards to the image, or with histolab to account for the behaviour I'm experiencing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants