Search in sources :

Example 1 with Workspaces

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);
}
Also used : Workspaces(io.github.mianalysis.mia.object.Workspaces)

Example 2 with Workspaces

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));
}
Also used : Workspaces(io.github.mianalysis.mia.object.Workspaces)

Example 3 with Workspaces

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);
}
Also used : Modules(io.github.mianalysis.mia.module.Modules) Workspaces(io.github.mianalysis.mia.object.Workspaces) Image(io.github.mianalysis.mia.object.Image) ImagePlus(ij.ImagePlus) Workspace(io.github.mianalysis.mia.object.Workspace) Test(org.junit.jupiter.api.Test) ModuleTest(io.github.mianalysis.mia.module.ModuleTest)

Example 4 with Workspaces

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);
}
Also used : Modules(io.github.mianalysis.mia.module.Modules) Workspaces(io.github.mianalysis.mia.object.Workspaces) Image(io.github.mianalysis.mia.object.Image) ImagePlus(ij.ImagePlus) Workspace(io.github.mianalysis.mia.object.Workspace) Test(org.junit.jupiter.api.Test) ModuleTest(io.github.mianalysis.mia.module.ModuleTest)

Example 5 with Workspaces

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);
}
Also used : Modules(io.github.mianalysis.mia.module.Modules) Workspaces(io.github.mianalysis.mia.object.Workspaces) Image(io.github.mianalysis.mia.object.Image) ImagePlus(ij.ImagePlus) Workspace(io.github.mianalysis.mia.object.Workspace) Test(org.junit.jupiter.api.Test) ModuleTest(io.github.mianalysis.mia.module.ModuleTest)

Aggregations

Workspaces (io.github.mianalysis.mia.object.Workspaces)421 Workspace (io.github.mianalysis.mia.object.Workspace)418 Image (io.github.mianalysis.mia.object.Image)341 ImagePlus (ij.ImagePlus)323 ModuleTest (io.github.mianalysis.mia.module.ModuleTest)304 Test (org.junit.jupiter.api.Test)304 Modules (io.github.mianalysis.mia.module.Modules)233 Objs (io.github.mianalysis.mia.object.Objs)112 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)112 EnumSource (org.junit.jupiter.params.provider.EnumSource)112 Obj (io.github.mianalysis.mia.object.Obj)108 Objects3D (io.github.mianalysis.mia.expectedobjects.Objects3D)79 Parameters (io.github.mianalysis.mia.object.parameters.Parameters)36 File (java.io.File)26 SpatCal (io.github.sjcross.common.object.volume.SpatCal)23 Disabled (org.junit.jupiter.api.Disabled)19 CropImage (io.github.mianalysis.mia.module.images.transform.CropImage)18 Status (io.github.mianalysis.mia.object.Status)13 CalculateNearestNeighbour (io.github.mianalysis.mia.module.objects.measure.spatial.CalculateNearestNeighbour)10 Objects2D (io.github.mianalysis.mia.expectedobjects.Objects2D)7