Issues with Strel holefilling in groovy

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Issues with Strel holefilling in groovy

For some reason Stred.fillholes is giving me the error:

No signature of method: static
inra.ijpb.morphology.Reconstruction.fillholes() is applicable for argument
types: (ij.process.ByteProcessor) values: [ip[width=375, height=375, bits=8,
min=0.0, max=255.0]]
Possible solutions: fillHoles(ij.process.ImageProcessor)

but ByteProcessor is a subclass of ImageProcessor so I don't understand why
it won't handle the ByteProcessor input. I've been trying to figure this out
for several hours, if someone could help me out it would be greatly

the fillholes method is as follows:

static ij.process.ImageProcessor fillHoles(ij.process.ImageProcessor image)

My code:

height = image.getHeight();
width = image.getWidth();
depth = image.getSize();

outimage = new ImageStack(width, height);

//closing component
strel = Strel.Shape.DISK.fromRadius(3);

slice = null;
for (int i = 1; i < depth; i++){
        init = image.getProcessor(i);
        slice = init.duplicate();
        //potentially add another loop here
        // ***
        for (int j = 0; j < 30; j++){
        // ***
        slice = Reconstruction.fillholes(slice);
        outimage.addSlice("" + i, slice);

Sent from:

ImageJ mailing list: