Skip to content

Rename apply_background_subtraction() to be more specific #59

@ehrenfeu

Description

@ehrenfeu

Rename apply_background_subtraction() to rollingball_background_subtraction or apply_rollingball_bg_subtraction to be more informative.

Originally posted by @lguerard in #49 (comment)

def apply_background_subtraction(imp, rolling_ball_radius, do_3d=False):
"""Perform background subtraction using a rolling ball method.
Parameters
----------
imp : ij.ImagePlus
Input ImagePlus to filter and threshold
rolling_ball_radius : int
Radius of the rolling ball filter to use
do_3d : bool, optional
If set to True, will do a 3D filtering, by default False
Returns
-------
ij.ImagePlus
Filtered ImagePlus
"""
log.info("Applying rolling ball with radius %d" % rolling_ball_radius)
options = "rolling=" + str(rolling_ball_radius) + " stack" if do_3d else ""
log.debug("Background subtraction options: %s" % options)
imageplus = imp.duplicate()
IJ.run(imageplus, "Substract Background...", options)
return imageplus

Metadata

Metadata

Assignees

Labels

refactoringRewrite / rename / move code etc.

Type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions