Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update scijava to 30.0.0 #283

Merged
merged 2 commits into from
Feb 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -171,63 +171,6 @@ public void testCompositeImageCancelsPlugin() throws Exception {
any());
}

@Test
public void testIntensityImageChannelsCancelPlugin() throws Exception {
final ImagePlus inputImage = IJ.createImage("test", 3, 3, 3, 8);
final String intensityPath =
"8bit-signed&pixelType=int8&planarDims=2&lengths=5,5,3&axes=X,Y,Channel.fake";
mockIntensityFileOpening(intensityPath);

// EXECUTE
final CommandModule module = command().run(
AnalyseSkeletonWrapper.class, true, "inputImage", inputImage,
"pruneCycleMethod", "Lowest intensity voxel").get();

// VERIFY
assertTrue(module.isCanceled());
assertEquals("The intensity image can't have a channel dimension", module
.getCancelReason());
}

@Test
public void testIntensityImageFramesCancelPlugin() throws Exception {
final ImagePlus inputImage = IJ.createImage("test", 3, 3, 3, 8);
final String intensityPath =
"8bit-signed&pixelType=int8&planarDims=2&lengths=5,5,3&axes=X,Y,Time.fake";
mockIntensityFileOpening(intensityPath);

// EXECUTE
final CommandModule module = command().run(
AnalyseSkeletonWrapper.class, true, "inputImage", inputImage,
"pruneCycleMethod", "Lowest intensity voxel").get();

// VERIFY
assertTrue(module.isCanceled());
assertEquals("The intensity image can't have a time dimension", module
.getCancelReason());
}

@Test
public void testIntensityImageMismatchingDimensionsCancelPlugin()
throws Exception
{
final ImagePlus inputImage = IJ.createImage("test", 3, 3, 1, 8);
final String intensityPath =
"8bit-signed&pixelType=int8&planarDims=2&lengths=5,5,3&axes=X,Y,Z.fake";
mockIntensityFileOpening(intensityPath);

// EXECUTE
final CommandModule module = command().run(
AnalyseSkeletonWrapper.class, true, "inputImage", inputImage,
"pruneCycleMethod", "Lowest intensity voxel").get();

// VERIFY
assertTrue(module.isCanceled());
assertEquals(
"The intensity image should match the dimensionality of the input image",
module.getCancelReason());
}

/**
* Test that no skeleton image pops open, when the input is already a skeleton
* (or skeletonisation didn't change it)
Expand Down Expand Up @@ -275,25 +218,6 @@ public void testNonBinaryImageCancelsPlugin() {
AnalyseSkeletonWrapper.class);
}

@Test
public void testNot8BitIntensityImageCancelsPlugin() throws Exception {
// SETUP
final ImagePlus inputImage = IJ.createImage("test", 3, 3, 3, 8);
final String intensityPath =
"16bit-unsigned&pixelType=uint16&planarDims=2&lengths=10,11,3&axes=X,Y,Z.fake";
mockIntensityFileOpening(intensityPath);

// EXECUTE
final CommandModule module = command().run(
AnalyseSkeletonWrapper.class, true, "inputImage", inputImage,
"pruneCycleMethod", "Lowest intensity voxel").get();

// VERIFY
assertTrue(module.isCanceled());
assertEquals("The intensity image needs to be 8-bit greyscale", module
.getCancelReason());
}

@Test
public void testNullImageCancelsPlugin() {
CommonWrapperTests.testNullImageCancelsPlugin(imageJ(),
Expand Down Expand Up @@ -489,11 +413,4 @@ public void testSuccessfulRunReports() throws ExecutionException,
assertFalse("Sanity check failed: method cancelled", module.isCanceled());
verify(MOCK_REPORTER, timeout(1000)).reportEvent(anyString());
}

private void mockIntensityFileOpening(final String path) {
final File intensityFile = mock(File.class);
when(intensityFile.getAbsolutePath()).thenReturn(path);
when(MOCK_UI.chooseFile(any(File.class), anyString())).thenReturn(
intensityFile);
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.scijava</groupId>
<artifactId>pom-scijava</artifactId>
<version>29.2.1</version>
<version>30.0.0</version>
<relativePath />
</parent>

Expand Down