Open dstansby opened 1 year ago
I don't think there's any such warning. It's clear for cellfinder (CLI) that it needs to be a whole-brain image, which should always have an "empty" corner. For the python package (and napari plugin) there's no such instruction. TBH the approach should probably be made more general to not rely on this assumption.
Renaming this issue to better reflect what needs to be done.
Not sure how to do this without an area we know is outside the tissue, but maybe the mean of the middle plane or something?
That would have my vote, we can then explore dropping the brain mask and just do everything with a single pass using a threshold above the mean of the middle plane to identify signal.
I'm currently going through the 2D filter to understand how it works (and refaactoring along the way, PR incoming soon!), and noticed that the
TileWalker
uses data in the corner of a 2D plane to calculate a threshold, above which a tile is considered to be within the brain.If a user tries to use a cropped brain this isn't going to work though - the threshold will be calculated based on signal data within the brain, which leaves open the possibility of tiles within the brain being discarded.
There should be a clear warning in the docs that users need to use whole brain data that includes the a corner outside the brain with very low signal.
(p.s. there might be already, I haven't checked, in which case this can just be closed)