Skip to content

BlackHatJ produces unexpected results #3

@ctrueden

Description

@ctrueden

The following macro:

newImage("Untitled", "RGB ramp", 64, 64, 1);
makeOval(16, 18, 35, 27);
setForegroundColor(255, 255, 255);
run("Fill", "slice");
run("Select None");
run("BlackHatJ ", "x=2 y=2");

produces this result:
blackhatj

But with odd numbers (e.g. x=3 y=3 or x=5 y=5) the result is all black. And with even numbers (e.g. x=4 y=4 or x=6 y=6) the result is the same as above.

These results also differ from those produced by ImageJ Ops:
blackTopHat-ops

Using the following script:

// @OpService op
// @Dataset image
// @OUTPUT Object result
import net.imglib2.algorithm.neighborhood.HyperSphereShape
shape = new HyperSphereShape(1)
result = op.run("morphology.blackTopHat", image, [shape])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions