@Test public void testNegativeConnectivityShowsInfoDialog() throws Exception { final SwingDialogPrompt mockPrompt = mock(SwingDialogPrompt.class); when(MOCK_UI.dialogPrompt(eq(NEGATIVE_CONNECTIVITY), anyString(), eq( INFORMATION_MESSAGE), any())).thenReturn(mockPrompt); final DefaultLinearAxis xAxis = new DefaultLinearAxis(Axes.X, "mm"); final DefaultLinearAxis yAxis = new DefaultLinearAxis(Axes.Y, "mm"); final DefaultLinearAxis zAxis = new DefaultLinearAxis(Axes.Z, "mm"); final DefaultLinearAxis cAxis = new DefaultLinearAxis(Axes.CHANNEL); final Img<BitType> img = ArrayImgs.bits(5, 5, 5, 2); final ImgPlus<BitType> imgPlus = new ImgPlus<>(img, "Test image", xAxis, yAxis, zAxis, cAxis); final RandomAccess<BitType> access = imgPlus.randomAccess(); access.setPosition(new long[] { 1, 1, 1, 0 }); access.get().setOne(); access.setPosition(new long[] { 3, 3, 3, 0 }); access.get().setOne(); access.setPosition(new long[] { 1, 1, 1, 1 }); access.get().setOne(); access.setPosition(new long[] { 3, 3, 3, 1 }); access.get().setOne(); command().run(ConnectivityWrapper.class, true, "inputImage", imgPlus).get(); verify(MOCK_UI, timeout(1000).times(1)).dialogPrompt(eq( NEGATIVE_CONNECTIVITY), anyString(), eq(INFORMATION_MESSAGE), any()); }
@Override public void run() { statusService.showStatus("Connectivity: initialising"); final String name = inputImage.getName(); subspaces = find3DSubspaces(inputImage); determineResultUnit(); matchOps(subspaces.get(0).interval); subspaces.forEach(subspace -> { progress = 0; statusService.showProgress(progress, PROGRESS_STEPS); progress++; final String suffix = subspace.toString(); final String label = suffix.isEmpty() ? name : name + " " + suffix; subspaceConnectivity(label, subspace.interval); }); resultsTable = SharedTable.getTable(); reportUsage(); }
ConnectivityWrapper extends BoneJCommand { @Override public void run() { statusService.showStatus("Connectivity: initialising"); final String name = inputImage.getName(); subspaces = find3DSubspaces(inputImage); determineResultUnit(); matchOps(subspaces.get(0).interval); subspaces.forEach(subspace -> { progress = 0; statusService.showProgress(progress, PROGRESS_STEPS); progress++; final String suffix = subspace.toString(); final String label = suffix.isEmpty() ? name : name + " " + suffix; subspaceConnectivity(label, subspace.interval); }); resultsTable = SharedTable.getTable(); reportUsage(); } }
ConnectivityWrapper extends BoneJCommand { @Override public void run() { statusService.showStatus("Connectivity: initialising"); final String name = inputImage.getName(); subspaces = find3DSubspaces(inputImage); determineResultUnit(); matchOps(subspaces.get(0).interval); subspaces.forEach(subspace -> { progress = 0; statusService.showProgress(progress, PROGRESS_STEPS); progress++; final String suffix = subspace.toString(); final String label = suffix.isEmpty() ? name : name + " " + suffix; subspaceConnectivity(label, subspace.interval); }); resultsTable = SharedTable.getTable(); reportUsage(); }  }
ConnectivityWrapper extends BoneJCommand { @Override public void run() { statusService.showStatus("Connectivity: initialising"); final String name = inputImage.getName(); subspaces = find3DSubspaces(inputImage); determineResultUnit(); matchOps(subspaces.get(0).interval); subspaces.forEach(subspace -> { progress = 0; statusService.showProgress(progress, PROGRESS_STEPS); progress++; final String suffix = subspace.toString(); final String label = suffix.isEmpty() ? name : name + " " + suffix; subspaceConnectivity(label, subspace.interval); }); resultsTable = SharedTable.getTable(); reportUsage(); }  @Override void run(); }
ConnectivityWrapper extends BoneJCommand { @Override public void run() { statusService.showStatus("Connectivity: initialising"); final String name = inputImage.getName(); subspaces = find3DSubspaces(inputImage); determineResultUnit(); matchOps(subspaces.get(0).interval); subspaces.forEach(subspace -> { progress = 0; statusService.showProgress(progress, PROGRESS_STEPS); progress++; final String suffix = subspace.toString(); final String label = suffix.isEmpty() ? name : name + " " + suffix; subspaceConnectivity(label, subspace.interval); }); resultsTable = SharedTable.getTable(); reportUsage(); }  @Override void run();  }