rimadoma / bonej-sandbox Goto Github PK
View Code? Open in Web Editor NEWA messy personal repo for refactoring old code and trying out new ideas.
A messy personal repo for refactoring old code and trying out new ideas.
Tests in the datasetCheck
package crash when run with other tests classes, but pass when run by themselves. This is somehow related to the incompatibility issues between ImageJ1 and ImageJ2. All test cases crash with:
java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.junit.runners.BlockJUnit4ClassRunner.createTest(BlockJUnit4ClassRunner.java:217)
at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:266)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: java.lang.IllegalArgumentException: Invalid service: net.imagej.legacy.LegacyConsoleService
at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:280)
at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:231)
at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:194)
at org.scijava.service.ServiceHelper.loadServices(ServiceHelper.java:166)
at org.scijava.Context.<init>(Context.java:277)
at org.scijava.Context.<init>(Context.java:234)
at org.scijava.Context.<init>(Context.java:174)
at org.scijava.Context.<init>(Context.java:160)
at net.imagej.ImageJ.<init>(ImageJ.java:79)
at protoOps.datasetCheck.TestDatasetIs3D.<clinit>(TestDatasetIs3D.java:20)
... 33 more
Caused by: java.lang.IllegalArgumentException: Invalid service: net.imagej.legacy.LegacyService
at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:280)
at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:231)
at org.scijava.service.ServiceHelper.createServiceRecursively(ServiceHelper.java:340)
at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:269)
... 42 more
Caused by: java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at org.scijava.service.ServiceHelper.createServiceRecursively(ServiceHelper.java:302)
at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:269)
... 45 more
Caused by: java.lang.RuntimeException: No _hooks field found in ij.IJ
It appears that this class was already defined in the class loader!
Please make sure that you initialize the LegacyService before using
any ImageJ 1.x class. You can do that by adding this static initializer:
static {
LegacyInjector.preinit();
}
To debug this issue, start the JVM with the option:
-javaagent:/home/rdom/.m2/repository/net/imagej/ij1-patcher/0.12.3/ij1-patcher-0.12.3.jar
To enforce pre-initialization, start the JVM with the option:
-javaagent:/home/rdom/.m2/repository/net/imagej/ij1-patcher/0.12.3/ij1-patcher-0.12.3.jar=init
at net.imagej.patcher.CodeHacker.javaAgentHint(CodeHacker.java:828)
at net.imagej.patcher.LegacyInjector.alreadyPatched(LegacyInjector.java:433)
at net.imagej.patcher.LegacyInjector.preinit(LegacyInjector.java:380)
at net.imagej.patcher.LegacyInjector.preinit(LegacyInjector.java:376)
at net.imagej.legacy.LegacyService.<clinit>(LegacyService.java:133)
... 52 more
Caused by: java.lang.NoSuchFieldException: _hooks
at java.lang.Class.getField(Class.java:1703)
at net.imagej.patcher.LegacyInjector.alreadyPatched(LegacyInjector.java:424)
... 55 more
All of the test image creator ops (crossed circle, cuboid, wire frame cuboid) when instantiated and run from Java. They need to inherit AbstractContextual.setContext to work properly. Also document to the class files how they can be run from Java and an opService.
VolumeFractionSurface returns the following results when run with a ROIManager:
Bone volume: 0.000 Total volume: 0.000 Ratio: NaN
The ROIManager contains one rectangular roi (0, 0, w, h) on slice number 1.
At a similar setup BoneJ1 produces the results:
Bone volume: 0.002 Total volume: 0.017 Ratio: 0.109
Test image used: binary_trabeculae_small.tif
Resampling: 6
The accuracy of the surface volume measurement could be possibly improved by ignoring mesh faces which intersect the stack edges. The reason for this is that samples are often cut from larger objects. This cutting creates cross-sectional faces, which in reality are not part of the surface area of the whole object.
The surface algorithm reports that the volume fraction for every image is 1.0, e.g. bone volume equals total volume. This may have something to do with the fact that the implementation of MCTriangulator and/or CustomTriangleMesh has changed. The drawing of the surface masks seems to work.
CuboidCreator and WireFrameCuboidCreator both create black images if depth == 1 and padding == 0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.