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

force detect_foreground to pick up small cells #166

Open
jazberna1 opened this issue Nov 20, 2024 · 6 comments
Open

force detect_foreground to pick up small cells #166

jazberna1 opened this issue Nov 20, 2024 · 6 comments

Comments

@jazberna1
Copy link

Hello,

This not really an issue. It happens to me that I have very small objects that are not picked up by the detect_foreground function.
Is there a way to force that smaller cells are detected? I have played with different values of sigma and min_foreground but that made of effect on picking up those small objects. This is a Napari screenshot of my data there I mark a detected cell (blue arrow) and non-detected cell (red arrow).

detection_napai

Thanks!!!
Jorge

@JoOkuma
Copy link
Member

JoOkuma commented Dec 2, 2024

Hi @jazberna1, if they are smaller than config.segmentation_config.min_area they will be ignored.

Sorry for the delay, I was on vacation.

@jazberna1
Copy link
Author

Hi @JoOkuma,

Thanks for answering back to me.

I have tried with config.segmentation_config.min_area = 4
but then I get this error when running the 'Auto detect foreground and contours from image' workflow
sys:1: RuntimeWarning: RuntimeError in aborted thread: Region too small. Size of 1 found.

Should I change something else in the configuration to avoid the error?

Thanks
Jorge

@JoOkuma
Copy link
Member

JoOkuma commented Dec 2, 2024

@jazberna1 could you increase the min_area a bit.
I forgot about a recent change where min_area removes everything that's smaller min_area / 4

@jazberna1
Copy link
Author

Hello @JoOkuma ,

I got it to work with min_area = 8, below that I get the RuntimeError in aborted thread: Region too small. Size of 1 found.
These are my combined foreground and contour layers. I still see cells not detected but I suppose if reached already the minimun area that Ultrack can detect I would have to preproces my images somehow, right? i.e. upscaling.

Tcells_combined_foreground_detetction_min_area_8

Thanks for your help
Jorge

@JoOkuma
Copy link
Member

JoOkuma commented Dec 2, 2024

@jazberna1 Since you're detecting other small objects, I think they are not being selected because the ILP considers them false objects.

Have you checked if the movement is within linking_config.max_distance?
If that's the case, I suggest tuning the tracking_config weights.

We provide some guidelines here, https://royerlab.github.io/ultrack/optimizing.html

@jazberna1
Copy link
Author

jazberna1 commented Dec 3, 2024

Hi @JoOkuma,

Yes, I agree I am detecting objects that seem to be as small as the ones that I don't detect.

I undestood however that cells not included in the detection layer are not tracked no matter how I set the tracking parameters, right?

Nevertheless I checked the movement is within my setting of linking_config.max_distance. If I start setting it higher I eventually see the tracking links different cells.

Then I made more negative the appear, disappear and division tracking weights. I see those changes altered the tracking of the already detected cells but still have most of them undetected. Is there any other place you could think I am missing those cells? Any advice will be much appreciated.

Thanks
Jorge

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

2 participants