@Test public void testMismatchingCalibrationsShowsWarningDialog() throws Exception { final String unit = "mm"; final DefaultLinearAxis xAxis = new DefaultLinearAxis(Axes.X, unit, 0.5); final DefaultLinearAxis yAxis = new DefaultLinearAxis(Axes.Y, unit, 0.6); final DefaultLinearAxis zAxis = new DefaultLinearAxis(Axes.Z, unit, 0.6); final DefaultLinearAxis tAxis = new DefaultLinearAxis(Axes.TIME); final Img<BitType> img = ArrayImgs.bits(1, 1, 1, 1); final ImgPlus<BitType> imgPlus = new ImgPlus<>(img, "Test image", xAxis, yAxis, zAxis, tAxis); final SwingDialogPrompt mockPrompt = mock(SwingDialogPrompt.class); when(MOCK_UI.dialogPrompt(eq(SurfaceAreaWrapper.BAD_SCALING), anyString(), eq( WARNING_MESSAGE), any())).thenReturn(mockPrompt); command().run(SurfaceAreaWrapper.class, true, "inputImage", imgPlus, "exportSTL", false).get(); verify(MOCK_UI, timeout(1000).times(1)).dialogPrompt(eq( SurfaceAreaWrapper.BAD_SCALING), anyString(), eq(WARNING_MESSAGE), any()); }
@Override public void run() { statusService.showStatus("Surface area: initialising"); subspaces = find3DSubspaces(inputImage); matchOps(subspaces.get(0).interval); prepareResults(); final Map<String, Mesh> meshes = createMeshes(subspaces); if (exportSTL) { if (!getFileName()) { return; } saveMeshes(meshes); } calculateAreas(meshes); resultsTable = SharedTable.getTable(); reportUsage(); }
SurfaceAreaWrapper extends BoneJCommand { @Override public void run() { statusService.showStatus("Surface area: initialising"); subspaces = find3DSubspaces(inputImage); matchOps(subspaces.get(0).interval); prepareResults(); final Map<String, Mesh> meshes = createMeshes(subspaces); if (exportSTL) { if (!getFileName()) { return; } saveMeshes(meshes); } calculateAreas(meshes); resultsTable = SharedTable.getTable(); reportUsage(); } }
SurfaceAreaWrapper extends BoneJCommand { @Override public void run() { statusService.showStatus("Surface area: initialising"); subspaces = find3DSubspaces(inputImage); matchOps(subspaces.get(0).interval); prepareResults(); final Map<String, Mesh> meshes = createMeshes(subspaces); if (exportSTL) { if (!getFileName()) { return; } saveMeshes(meshes); } calculateAreas(meshes); resultsTable = SharedTable.getTable(); reportUsage(); }  }
SurfaceAreaWrapper extends BoneJCommand { @Override public void run() { statusService.showStatus("Surface area: initialising"); subspaces = find3DSubspaces(inputImage); matchOps(subspaces.get(0).interval); prepareResults(); final Map<String, Mesh> meshes = createMeshes(subspaces); if (exportSTL) { if (!getFileName()) { return; } saveMeshes(meshes); } calculateAreas(meshes); resultsTable = SharedTable.getTable(); reportUsage(); }  @Override void run(); }
SurfaceAreaWrapper extends BoneJCommand { @Override public void run() { statusService.showStatus("Surface area: initialising"); subspaces = find3DSubspaces(inputImage); matchOps(subspaces.get(0).interval); prepareResults(); final Map<String, Mesh> meshes = createMeshes(subspaces); if (exportSTL) { if (!getFileName()) { return; } saveMeshes(meshes); } calculateAreas(meshes); resultsTable = SharedTable.getTable(); reportUsage(); }  @Override void run();  }