Skip to content
Snippets Groups Projects
Commit 87a51e28 authored by Christian Kento Rasmussen's avatar Christian Kento Rasmussen
Browse files

tophat inverts colors back if baground is white

parent ccc23e8e
No related branches found
No related tags found
1 merge request!683d removal of background
This commit is part of merge request !68. Comments created here will be created in the context of that merge request.
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment