imagej / ImageJ

Public domain software for processing and analyzing scientific images
http://imagej.org
Other
513 stars 218 forks source link

3D filter on hyperstacks #237

Open jboulanger opened 5 months ago

jboulanger commented 5 months ago

Hello,

I didn't find an opened issue on this so here it is. The filter3d function behaves differently on stacks and hyperstack in an unexpected way. Here is an example:

function test(type, nframes) {
    newImage("HyperStack", type + " grayscale-mode", 300, 200, 1, 10, nframes);
    for (t = 1; t <= 20; t++) {
        Stack.setFrame(t);
        for (z = 1; z <= 4; z++) {
            Stack.setSlice(z);
            makeOval(50, 50, 200, 100);
            setColor(1);
            fill();
        }
    }
    run("Select None");
    run("Maximum 3D...", "x=2 y=2 z=2");
    Stack.setFrame(1);
    Stack.setSlice(10); 
    val = getPixel(150,100);
    setMinAndMax(0, 1);
    if (val == 0) print(type + ", nframes :" +nframes + ": ok");
    else print(type + ", nframes :" +nframes + ": failed"); 
}
run("Close All");
for (nframes = 1; nframes <= 3; nframes++) {
    test("8-bit",nframes);  
}