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

Updates for latest sciview #6

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
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
48 changes: 33 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<parent>
<groupId>org.scijava</groupId>
<artifactId>pom-scijava</artifactId>
<version>29.0.0-beta-2</version>
<version>37.0.0</version>
<relativePath />
</parent>


<groupId>org.morphonets</groupId>
<artifactId>cx3d</artifactId>
<version>0.0.4-SNAPSHOT</version>
<version>0.1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>cx3d</name>
Expand Down Expand Up @@ -102,25 +102,19 @@
<!-- NB: Deploy releases to the SciJava Maven repository. -->
<releaseProfiles>deploy-to-scijava</releaseProfiles>

<bigdataviewer-core.version>7.0.0</bigdataviewer-core.version>
<scenery.version>0.10.1</scenery.version>
<sciview.version>0.3.0</sciview.version>
<snt.version>4.2.2-SNAPSHOT</snt.version>

<sciview.version>9a71de9</sciview.version>
<scenery.version>f55e46b</scenery.version>
<snt.version>2d8af5b6a0</snt.version>
<flatlaf.version>3.1.1</flatlaf.version>
<flatlaf-jide-oss.version>${flatlaf.version}</flatlaf-jide-oss.version>

<joml.version>1.9.22</joml.version>
<kotlin.version>1.4-M1</kotlin.version>
<jogl.version>2.4.0</jogl.version>

<grneat.version>a322110ac4</grneat.version>
<cleargl.version>2.2.10</cleargl.version>
<lwjgl.version>3.2.3</lwjgl.version>
</properties>

<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<repository>
<id>scijava.public</id>
<url>https://maven.scijava.org/content/groups/public</url>
Expand All @@ -133,6 +127,10 @@
<artifactId>grneat</artifactId>
<version>${grneat.version}</version>
</dependency>
<dependency>
<groupId>com.formdev</groupId>
<artifactId>flatlaf</artifactId>
</dependency>
<dependency>
<groupId>sc.iview</groupId>
<artifactId>sciview</artifactId>
Expand All @@ -142,7 +140,27 @@
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
</exclusions>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.biojava</groupId>
<artifactId>biojava-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.biojava</groupId>
<artifactId>biojava-structure</artifactId>
</exclusion>
<exclusion>
<groupId>org.biojava</groupId>
<artifactId>biojava-modfinder</artifactId>
</exclusion>
<exclusion>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.morphonets</groupId>
Expand Down
34 changes: 22 additions & 12 deletions src/main/java/sc/iview/cx3d/SciViewCX3D.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
package sc.iview.cx3d;

import graphics.scenery.*;
import graphics.scenery.DefaultNode;
import graphics.scenery.Group;
import graphics.scenery.Node;
import graphics.scenery.Sphere;
import graphics.scenery.Icosphere;
import graphics.scenery.attribute.material.DefaultMaterial;
import graphics.scenery.attribute.material.Material;
import graphics.scenery.primitives.Cylinder;
import org.joml.Vector3f;
import org.scijava.Context;
import org.scijava.ui.UIService;
import sc.iview.SciView;
import sc.iview.cx3d.physics.IntracellularSubstance;
import sc.iview.cx3d.physics.PhysicalCylinder;
Expand All @@ -28,7 +34,6 @@ public SciView getSciView() {
}

private Context context;
private UIService ui;
private SciView sciView;
private ECM ecm;

Expand All @@ -45,9 +50,8 @@ public Node getCx3dGroup() {
private HashMap<Integer, Node> scNodes;
private HashMap<Substance, Node> volumes;

public SciViewCX3D(Context context, UIService ui, SciView sciView, ECM ecm) {
public SciViewCX3D(Context context, SciView sciView, ECM ecm) {
this.context = context;
this.ui = ui;
this.sciView = sciView;
this.ecm = ecm;

Expand All @@ -72,7 +76,7 @@ public void clear() {
}

public void addNewChemical(Substance substance) {
chemicals.put(substance, new Node());
chemicals.put(substance, new DefaultNode());
}


Expand All @@ -86,7 +90,13 @@ public void syncCX3D() {
// Loop through all Cylinders
paintPhysicalCylinders();

// Loop through all PhysicalNodes FIXME currently this is done externally
try {
Thread.sleep(10);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}

// Loop through all PhysicalNodes FIXME currently this is done externally
//paintPhysicalNodes();
}

Expand Down Expand Up @@ -154,7 +164,7 @@ private void paintPhysicalCylinders() {
svCylinder.orientBetweenPoints(myNeuriteDistalEnd, myNeuriteProximalEnd, true, true);
} else {
svCylinder = Cylinder.betweenPoints(myNeuriteDistalEnd, myNeuriteProximalEnd, (float)aCylinder.getDiameter() * scaleFactor, 1f, 12);
Material mat = new Material();
Material mat = new DefaultMaterial();
Vector3f col = new Vector3f(c.getRed() / 255.0f, c.getGreen() / 255.0f, c.getBlue() / 255.0f);
// mat.setAmbient(new GLVector(0.1f, 0f, 0f));
// mat.setDiffuse(new GLVector(0.8f, 0.7f, 0.7f));
Expand All @@ -178,8 +188,8 @@ private void paintPhysicalCylinders() {
svSphere.setVisible(true);
svSphere.setPosition(myNeuriteProximalEnd);
} else {
svSphere = new Sphere((float)aCylinder.getDiameter() * scaleFactor, 12);
Material mat = new Material();
svSphere = new Sphere((float)aCylinder.getDiameter() * scaleFactor, 12, false);
Material mat = new DefaultMaterial();
Vector3f col = new Vector3f(c.getRed() / 255.0f, c.getGreen() / 255.0f, c.getBlue() / 255.0f);
// mat.setAmbient(new GLVector(0.1f, 0f, 0f));
// mat.setDiffuse(new GLVector(0.8f, 0.7f, 0.7f));
Expand Down Expand Up @@ -258,9 +268,9 @@ private void paintPhysicalSpheres() {
svSphere.setVisible(true);
svSphere.setPosition(mySomaMassLocation);
} else {
svSphere = new Icosphere(sphereRadius, 2);
svSphere = new Icosphere(sphereRadius, 2, false);
svSphere.setVisible(false);
Material mat = new Material();
Material mat = new DefaultMaterial();
Vector3f col = new Vector3f(c.getRed() / 255.0f, c.getGreen() / 255.0f, c.getBlue() / 255.0f);
mat.setAmbient(col);
mat.setDiffuse(col);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
import sc.iview.cx3d.utilities.ConvertUtils;

import static sc.iview.commands.MenuWeights.DEMO;
import static sc.iview.commands.MenuWeights.DEMO_LINES;
import static sc.iview.commands.MenuWeights.DEMO_BASIC_LINES;
import static sc.iview.cx3d.utilities.Matrix.randomNoise;

/**
Expand All @@ -69,7 +69,7 @@
@Plugin(type = Command.class, label = "Random Branching", menuRoot = "SciView", //
menu = { @Menu(label = "Demo", weight = DEMO), //
@Menu(label = "Cx3D", weight = DEMO), //
@Menu(label = "Random Branching", weight = DEMO_LINES) })
@Menu(label = "Random Branching", weight = DEMO_BASIC_LINES) })
public class DendriteShaftWithSpines implements Command {

@Parameter
Expand Down Expand Up @@ -139,7 +139,7 @@ public void run() {
public static void main( String... args ) {
SciView sciView = null;
try {
sciView = SciView.createSciView();
sciView = SciView.create();
} catch (Exception e) {
e.printStackTrace();
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/sc/iview/cx3d/commands/GRNBranchingSWC.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
import java.util.function.Predicate;

import static sc.iview.commands.MenuWeights.DEMO;
import static sc.iview.commands.MenuWeights.DEMO_LINES;
import static sc.iview.commands.MenuWeights.DEMO_BASIC_LINES;
import static sc.iview.cx3d.utilities.Matrix.randomNoise;

/**
Expand All @@ -78,7 +78,7 @@
@Plugin(type = Command.class, label = "Genetically-regulated Branching (SWC output)", menuRoot = "SciView", //
menu = { @Menu(label = "Demo", weight = DEMO), //
@Menu(label = "Cx3D", weight = DEMO), //
@Menu(label = "Genetically-regulated Branching (SWC output)", weight = DEMO_LINES) })
@Menu(label = "Genetically-regulated Branching (SWC output)", weight = DEMO_BASIC_LINES) })
public class GRNBranchingSWC implements Command {

@Parameter
Expand Down Expand Up @@ -266,7 +266,7 @@ public static void main( String... args ) {
if( useSciview ) {
SciView sciView = null;
try {
sciView = SciView.createSciView();
sciView = SciView.create();
} catch (Exception e) {
e.printStackTrace();
}
Expand Down
Loading