use of io.github.mianalysis.mia.object.Workspaces in project mia by mianalysis.
the class Exporter method exportResults.
public void exportResults(Workspace workspace, Analysis analysis, String name) throws IOException {
Workspaces currentWorkspaces = new Workspaces();
currentWorkspaces.add(workspace);
export(currentWorkspaces, analysis, name);
}
use of io.github.mianalysis.mia.object.Workspaces in project mia by mianalysis.
the class GUI method updateProgressBar.
public static synchronized void updateProgressBar() {
Workspaces workspaces = analysisRunner.getWorkspaces();
updateProgressBar((int) Math.round(workspaces.getOverallProgress() * 100));
}
use of io.github.mianalysis.mia.object.Workspaces in project mia by mianalysis.
the class NormaliseIntensityTest method testNormaliseIntensity8bit2D.
@Test
public void testNormaliseIntensity8bit2D() throws Exception {
// Creating a new workspace
Workspaces workspaces = new Workspaces();
Workspace workspace = workspaces.getNewWorkspace(null, 1);
// Loading the test image and adding to workspace
String pathToImage = URLDecoder.decode(this.getClass().getResource("/images/normaliseintensity/DarkNoisyGradient2D_8bit.zip").getPath(), "UTF-8");
ImagePlus ipl = IJ.openImage(pathToImage);
Image image = new Image("Test_image", ipl);
workspace.addImage(image);
pathToImage = URLDecoder.decode(this.getClass().getResource("/images/normaliseintensity/DarkNoisyGradientNormalised2D_8bit.zip").getPath(), "UTF-8");
Image expectedImage = new Image("Expected", IJ.openImage(pathToImage));
// Initialising BinaryOperations
NormaliseIntensity normaliseIntensity = new NormaliseIntensity(new Modules());
normaliseIntensity.updateParameterValue(NormaliseIntensity.INPUT_IMAGE, "Test_image");
normaliseIntensity.updateParameterValue(NormaliseIntensity.APPLY_TO_INPUT, false);
normaliseIntensity.updateParameterValue(NormaliseIntensity.OUTPUT_IMAGE, "Test_output");
// Running NormaliseIntensity
normaliseIntensity.execute(workspace);
// Checking the images in the workspace
assertEquals(2, workspace.getImages().size());
assertNotNull(workspace.getImage("Test_image"));
assertNotNull(workspace.getImage("Test_output"));
// Checking the output image has the expected calibration
Image outputImage = workspace.getImage("Test_output");
assertEquals(expectedImage, outputImage);
}
use of io.github.mianalysis.mia.object.Workspaces in project mia by mianalysis.
the class NormaliseIntensityTest method testNormaliseIntensity16bit3D.
@Test
public void testNormaliseIntensity16bit3D() throws Exception {
// Creating a new workspace
Workspaces workspaces = new Workspaces();
Workspace workspace = workspaces.getNewWorkspace(null, 1);
// Loading the test image and adding to workspace
String pathToImage = URLDecoder.decode(this.getClass().getResource("/images/normaliseintensity/DarkNoisyGradient3D_16bit.zip").getPath(), "UTF-8");
ImagePlus ipl = IJ.openImage(pathToImage);
Image image = new Image("Test_image", ipl);
workspace.addImage(image);
pathToImage = URLDecoder.decode(this.getClass().getResource("/images/normaliseintensity/DarkNoisyGradientNormalised3D_16bit.zip").getPath(), "UTF-8");
Image expectedImage = new Image("Expected", IJ.openImage(pathToImage));
// Initialising BinaryOperations
NormaliseIntensity normaliseIntensity = new NormaliseIntensity(new Modules());
normaliseIntensity.updateParameterValue(NormaliseIntensity.INPUT_IMAGE, "Test_image");
normaliseIntensity.updateParameterValue(NormaliseIntensity.APPLY_TO_INPUT, false);
normaliseIntensity.updateParameterValue(NormaliseIntensity.OUTPUT_IMAGE, "Test_output");
// Running NormaliseIntensity
normaliseIntensity.execute(workspace);
// Checking the images in the workspace
assertEquals(2, workspace.getImages().size());
assertNotNull(workspace.getImage("Test_image"));
assertNotNull(workspace.getImage("Test_output"));
// Checking the output image has the expected calibration
Image outputImage = workspace.getImage("Test_output");
assertEquals(expectedImage, outputImage);
}
use of io.github.mianalysis.mia.object.Workspaces in project mia by mianalysis.
the class NormaliseIntensityTest method testNormaliseIntensity32bitUnderOne3D.
@Test
public void testNormaliseIntensity32bitUnderOne3D() throws Exception {
// Creating a new workspace
Workspaces workspaces = new Workspaces();
Workspace workspace = workspaces.getNewWorkspace(null, 1);
// Loading the test image and adding to workspace
String pathToImage = URLDecoder.decode(this.getClass().getResource("/images/normaliseintensity/DarkNoisyGradient3D_32bit.zip").getPath(), "UTF-8");
ImagePlus ipl = IJ.openImage(pathToImage);
Image image = new Image("Test_image", ipl);
workspace.addImage(image);
pathToImage = URLDecoder.decode(this.getClass().getResource("/images/normaliseintensity/DarkNoisyGradientNormalised3D_32bit.zip").getPath(), "UTF-8");
Image expectedImage = new Image("Expected", IJ.openImage(pathToImage));
// Initialising BinaryOperations
NormaliseIntensity normaliseIntensity = new NormaliseIntensity(new Modules());
normaliseIntensity.updateParameterValue(NormaliseIntensity.INPUT_IMAGE, "Test_image");
normaliseIntensity.updateParameterValue(NormaliseIntensity.APPLY_TO_INPUT, false);
normaliseIntensity.updateParameterValue(NormaliseIntensity.OUTPUT_IMAGE, "Test_output");
// Running NormaliseIntensity
normaliseIntensity.execute(workspace);
// Checking the images in the workspace
assertEquals(2, workspace.getImages().size());
assertNotNull(workspace.getImage("Test_image"));
assertNotNull(workspace.getImage("Test_output"));
// Checking the output image has the expected calibration
Image outputImage = workspace.getImage("Test_output");
assertEquals(expectedImage, outputImage);
}
Aggregations