ConnectedComponents { public int getNParticles() { return nParticles; } ConnectedComponents(); int[][] run(final ImagePlus imp, final int phase); int getNParticles(); byte[][] getWorkArray(); static final int FORE; static final int BACK; }
@Test public void testGetNParticles() { for (int z = 1; z <= 57; z += 8) { for (int y = 0; y < 56; y += 8) { for (int x = 0; x < 56; x += 8) { final ImagePlus imp = brick(64, 64, 64, 8, 8, 8, x, y, z); ConnectedComponents cc = new ConnectedComponents(); cc.run(imp, ConnectedComponents.FORE); assertEquals(2, cc.getNParticles()); } } } }