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

Created operations for easy application of filters

parent 43a488f4
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.
import qim3d
import qim3d.processing.filters as filters
def remove_background(vol, **kwargs):
"""
Remove background from a volume using a median filter followed by a tophat filter.
Args:
vol: The volume to remove background from.
**kwargs: Additional keyword arguments for the tophat filter.
Returns:
vol: The volume with background removed.
"""
# Create a pipeline with a median filter and a tophat filter
pipeline = filter.Pipeline(
filters.Median(),
filters.Tophat(**kwargs)
)
# Apply the pipeline to the volume
return pipeline(vol)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment