starfish
starfish copied to clipboard
add 3D support to LocalMaxPeakFinder
Currently, LocalMaxPeakFinder indicates that it does not support 3D
However, @ttung dove in and skimage's peak_local_max does support 3D! However, the border exclusion can prevent any peaks from being found if len(z) <= 2 * exclude_border
:
By exposing the exclude_borders
argument in LocalMaxPeakFinder, users can set this to 0 (or less than half the size of z) and get 3D support immediately.
- expose exclude_borders as an argument for starfish, leaving it default to True
- (optional) throw a warning if is_volume=True and len(z)<=2*exclude_borders
- fix the docs to clarify that this spot finder DOES support 3D if certain conditions are met
Given the nature of data starfish users are processing, it is likely that a different border exclusion would be useful for x/y vs z, but skimage does not support this. If skimage's peak_local_max function accepted tuples, we could support this.
- open issues on skimage to request support for tuples on exclude_borders and min_distance
- do the work outlined in (4) and contribute it to skimage
- update LocalMaxPeakFinder to accept tuples
If we can do 4-6 quickly, we should consider going straight to this solution.
the footprint argument theoretically allows us to do what we want to do. It allows us to control the regions being considered for each axis. Unfortunately, it has an off-by-one error (!!), where if the footprint's shape along an axis is 1, it trims one pixel instead of 0 pixels as it ought to!