Skip to content
Snippets Groups Projects

3d removal of background

Merged s204159 requested to merge 3d_removal into main
1 file
+ 5
1
Compare changes
  • Side-by-side
  • Inline
+ 5
1
@@ -232,9 +232,13 @@ def tophat(vol, **kwargs):
background = kwargs["background"] if "background" in kwargs else "dark"
if background == "bright":
log.info("Bright background selected, volume will be inverted.")
log.info("Bright background selected, volume will be temporarily inverted when applying white_tophat")
vol = np.invert(vol)
selem = morphology.ball(radius)
vol = vol - morphology.white_tophat(vol, selem)
if background == "bright":
vol = np.invert(vol)
return vol
Loading