scenerygraphics / sciview

sciview is a tool for visualization and interaction with ND image and mesh data
BSD 2-Clause "Simplified" License
68 stars 17 forks source link

Support rendering for LimeSeg #193

Open kephale opened 5 years ago

kephale commented 5 years ago

Linking to https://github.com/NicoKiaru/LimeSeg/issues/6

kephale commented 1 year ago

@NicoKiaru I'm bringing this up again because we have a hackathon going this week. Would LimeSeg be a good demo for 1.0.0?

NicoKiaru commented 1 year ago

Man. I wish, but no time... Maybe I find a bit of time to look at it mid July. I need to have sciview working in intellij. Is there a simple kind of sciview scijava plugin demo project that I can clone and test ?

kephale commented 1 year ago

@NicoKiaru yes, but wait for ~1-2 weeks (I'll try to remember to re-ping you).

We just solved/closed ~30% of all open sciview issues (and still going) at the current sciview hackathon. We're aiming for the 1.0.0 release soon.

kephale commented 5 months ago

Well @NicoKiaru its almost July 🤣 I'll just link the example project while i'm here: https://github.com/scenerygraphics/minimal-sciview-example-project

NicoKiaru commented 5 months ago

Awesome!

I don't know when I've have time to check this, but at least I wanted to give a short try at building it.

I chose gradle. I'll let you know how that goes.

NicoKiaru commented 5 months ago

i think I need a jdk21 because of this message:

C:\Users\chiarutt\Dropbox\BIOP\my-first-sciview-project\src\main\java\sc\iview\minimal\MyDemo.java:31: error: cannot access Sphere
import graphics.scenery.Sphere;
                       ^
  bad class file: C:\Users\chiarutt\.gradle\caches\modules-2\files-2.1\graphics.scenery\scenery\0.11.0\8aea34f37cc2e9aee5b856cb890258e94f844846\scenery-0.11.0.jar(/graphics/scenery/Sphere.class)
    class file has wrong version 65.0, should be 60.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.

And I've set it as the jdk to choose in intellij, but it still seems to give errors.

NicoKiaru commented 5 months ago

Ok here's what I get, I don't know what's going on:

(base) PS C:\Users\chiarutt\Dropbox\BIOP\my-first-sciview-project> ./gradlew run --scan                                                                                                                                                 

> Task :compileJava
C:\Users\chiarutt\Dropbox\BIOP\my-first-sciview-project\src\main\java\sc\iview\minimal\MyDemo.java:31: error: cannot access Sphere
import graphics.scenery.Sphere;
                       ^
  bad class file: C:\Users\chiarutt\.gradle\caches\modules-2\files-2.1\graphics.scenery\scenery\0.11.0\8aea34f37cc2e9aee5b856cb890258e94f844846\scenery-0.11.0.jar(/graphics/scenery/Sphere.class)
    class file has wrong version 65.0, should be 60.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
C:\Users\chiarutt\Dropbox\BIOP\my-first-sciview-project\src\main\java\sc\iview\minimal\MyDemo.java:32: error: cannot access TextBoard
import graphics.scenery.primitives.TextBoard;
                                  ^
  bad class file: C:\Users\chiarutt\.gradle\caches\modules-2\files-2.1\graphics.scenery\scenery\0.11.0\8aea34f37cc2e9aee5b856cb890258e94f844846\scenery-0.11.0.jar(/graphics/scenery/primitives/TextBoard.class)
    class file has wrong version 65.0, should be 60.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
C:\Users\chiarutt\Dropbox\BIOP\my-first-sciview-project\src\main\java\sc\iview\minimal\MyDemo.java:40: error: cannot access SciView
import sc.iview.SciView;
               ^
  bad class file: C:\Users\chiarutt\.gradle\caches\modules-2\files-2.1\sc.iview\sciview\0.4.0\34eb15f5bc01b72eab5767ab3d511029bddbd71\sciview-0.4.0.jar(/sc/iview/SciView.class)
    class file has wrong version 65.0, should be 60.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
C:\Users\chiarutt\Dropbox\BIOP\my-first-sciview-project\src\main\java\sc\iview\minimal\MyDemo.java:42: error: cannot access MenuWeights
import static sc.iview.commands.MenuWeights.DEMO;
                               ^
  bad class file: C:\Users\chiarutt\.gradle\caches\modules-2\files-2.1\sc.iview\sciview\0.4.0\34eb15f5bc01b72eab5767ab3d511029bddbd71\sciview-0.4.0.jar(/sc/iview/commands/MenuWeights.class)
    class file has wrong version 65.0, should be 60.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
C:\Users\chiarutt\Dropbox\BIOP\my-first-sciview-project\src\main\java\sc\iview\minimal\MyDemo.java:42: error: static import only from classes and interfaces
import static sc.iview.commands.MenuWeights.DEMO;
^
C:\Users\chiarutt\Dropbox\BIOP\my-first-sciview-project\src\main\java\sc\iview\minimal\MyDemo.java:59: error: cannot find symbol
    private SciView sciView;
            ^
  symbol:   class SciView
  location: class MyDemo
C:\Users\chiarutt\Dropbox\BIOP\my-first-sciview-project\src\main\java\sc\iview\minimal\MyDemo.java:52: error: cannot find symbol
        menu = { @Menu(label = "Demo", weight = DEMO), //
                                                ^
  symbol: variable DEMO
C:\Users\chiarutt\Dropbox\BIOP\my-first-sciview-project\src\main\java\sc\iview\minimal\MyDemo.java:68: error: cannot find symbol
        final TextBoard board = new TextBoard("SourceSansPro-Regular.ttf", false);
              ^
  symbol:   class TextBoard
  location: class MyDemo
C:\Users\chiarutt\Dropbox\BIOP\my-first-sciview-project\src\main\java\sc\iview\minimal\MyDemo.java:68: error: cannot find symbol
        final TextBoard board = new TextBoard("SourceSansPro-Regular.ttf", false);
                                    ^
  symbol:   class TextBoard
  location: class MyDemo
C:\Users\chiarutt\Dropbox\BIOP\my-first-sciview-project\src\main\java\sc\iview\minimal\MyDemo.java:82: error: cannot find symbol
        final Sphere sphere = sciView.addSphere();
              ^
  symbol:   class Sphere
  location: class MyDemo
C:\Users\chiarutt\Dropbox\BIOP\my-first-sciview-project\src\main\java\sc\iview\minimal\MyDemo.java:94: error: cannot find symbol
                SciView sv = SciView.create();
                ^
  symbol:   class SciView
  location: class MyDemo
C:\Users\chiarutt\Dropbox\BIOP\my-first-sciview-project\src\main\java\sc\iview\minimal\MyDemo.java:94: error: cannot find symbol
                SciView sv = SciView.create();
                             ^
  symbol:   variable SciView
  location: class MyDemo
12 errors

> Task :compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
> Run with --info option to get more log output.

BUILD FAILED in 15s
2 actionable tasks: 2 executed
kephale commented 5 months ago

@skalarproduktraum i have to call for reinforcements on this. i've gotten stuck with the java21 upgrade on a couple of machines.

@NicoKiaru it does still look like a java version issue with your gradle commands...

NicoKiaru commented 5 months ago

Yep, I think so as well, the problem I guess is that I'm setting up the jdk in intellij, but gradle is probably ignoring that.

image

skalarproduktraum commented 5 months ago

@NicoKiaru Your guess is correct - but the culprit is not Gradle, but the Powershell you're running it from. You'd need to set the environment variable JAVA_HOME to the Java 21 JDK, then run ./gradlew. That ought to solve your issue 👍

skalarproduktraum commented 5 months ago

(Side note: When you install a new JDK on Windows, the installer usually gives you the option to set JAVA_HOME globally as well)

NicoKiaru commented 5 months ago

I'm trying this:

image

because for some reason I can't make the shell swallow anythin env variable. I don't know why and this is driving me crazy

NicoKiaru commented 5 months ago

Tadaa!!!

image

skalarproduktraum commented 5 months ago

Apparently, in Powershell, you do $env:JAVA_HOME="C:\path\to\jdk". But great to see it works for you from IntelliJ 👍

NicoKiaru commented 5 months ago

Any way I can run things with the LegacyService ? I'm getting this message:

Caused by: java.lang.RuntimeException: No _hooks field found in ij.IJ

I also tried to add

static {
        net.imagej.patcher.LegacyInjector.preinit();
    }

but it didn't solve the issue

NicoKiaru commented 5 months ago

I added this in vm options and now it works fine:

"--add-opens=java.base/java.lang=ALL-UNNAMED", "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED", "--add-opens=java.base/java.net=ALL-UNNAMED", "--add-opens=java.base/java.nio=ALL-UNNAMED", "--add-opens=java.base/java.time=ALL-UNNAMED", "--add-opens=java.base/java.util=ALL-UNNAMED", "--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED", "--add-opens=java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens=java.base/sun.util.calendar=ALL-UNNAMED"

NicoKiaru commented 5 months ago

Also: how can I choose the GPU used for sciview ? I have an integrated graphics card and a nvidia gpu, and I d like to use the nvidia card.

NicoKiaru commented 5 months ago

I occasionally get this message:

Caused by: java.lang.IllegalArgumentException: Color parameter outside of expected range: Red Green Blue

NicoKiaru commented 5 months ago

It looks like the commands that I define in the repo are not added into Fiji's menu. I'll need to confirm though

NicoKiaru commented 5 months ago

Last feedback from today: I couldn't get a SourceAndConverter to be displayed. I tried in BigVolumeViewer in the same repo, but I get this error:

Caused by: java.lang.ClassNotFoundException: com.jogamp.opengl.GLEventListener