cellfinder
cellfinder copied to clipboard
[BUG] Cell detection ignores borders
Describe the bug Hello, I wasn't sure whether to post this in the main cellfinder repo or here. I am running cell detection through the napari plugin on a small (Z: 160, Y: 400, X: 400) , 16-bit volume of cleared mouse brain imaged on a lightsheet system (LifeCanvas SmartSpim).
When I run the cell detection, it appears to ignore some fraction of the volume border. Here are XY, XZ, ZY projections of the images along with the detected cells (colored blue), the red border shows the bounding box of all detected cells. The issue seems to be worse along Z
To Reproduce
These are the parameters I used, all defaults except the voxel size, which I changed to match the image.
I tried decreasing the Threshold
, which detected more cells within the same region, but did not improve detection at the borders.
The only thing that seems to help is increasing the voxel size. If I set it to (5.0, 5.0, 5.0), it captures more cells towards the edges, but also causes many false-positives.
Is this expected, and do you have any other suggestions for how to improve detection at the borders?
Thank you, Cameron
System Info
- OS: Windows 10 64 bit
- Version 20H2
- Hardware specs: 4 core, 16GB RAM, no GPU
Hi @carshadi unfortunately this is expected. cellfinder was designed for whole organ images, with empty space around the tissue of interest. The algorithm can only detect objects with sufficient space around them (particularly in the 3rd dimension). You may find that padding the images helps, or using the original, full-size image.
Alternatively, as cellfinder was designed for much larger images (e.g. 2k x 5k x 5k), you may find there are cell segmentation algorithms that can do a better job for your smaller volume (e.g. cellpose or stardist).
I'm going to close this issue, but if you have any further queries, feel free to ask a question on the forum and tag your question with brainglobe
and cellfinder
.
Thanks @adamltyson , padding the image with zeros works
Thanks for the update @carshadi. I'm going to reopen this issue to track the possibility of automating this padding process.