I am trying to create an Imagej/Fiji script to analyze microscopy images. As part of the pipeline, I want to use the rolling ball BackgroundSubtracter supplied in Fiji. According to the Imagej API, that should look something like this:
rollingBallBackground(ImageProcessor ip,
double radius,
boolean createBackground,
boolean lightBackground,
boolean useParaboloid,
boolean doPresmooth,
boolean correctCorners)
However, if I try to run this on one channel of a three-channel image:
from ij import IJ, ImagePlus
from ij import WindowManager as wm
from ij.plugin import ChannelSplitter
from ij.plugin.filter import BackgroundSubtracter
imp = wm.getCurrentImage()
c1, c2, c3 = ChannelSplitter.split(imp)
c1.show() # This works
c1 = c1.getProcessor()
threshold = BackgroundSubtracter.rollingBallBackground(c1,
50.,
False,
False,
True,
False,
False)
I receive an error:
TypeError: rollingBallBackground(): expected 8 args; got 7
If I append another argument, let's say another "False" or "1", I then get this error:
TypeError: rollingBallBackground(): self arg can't be coerced to ij.plugin.filter.BackgroundSubtracter
What am I doing wrong?