Skip to content

Commit

Permalink
Code cleanup and minor fixes
Browse files Browse the repository at this point in the history
- Cleanup pom
- DemoRunner: Remove unimplemented code
- SigmaPalette: Workaround startup NPE on MacOS
- PathManagerUI: Remove legacy option
- Jython Template: Ensure imported classes appear in Ctrl+Space auto-completion
- Script: Remove outdated LUT option
  • Loading branch information
tferr committed Oct 25, 2023
1 parent 372bfc4 commit aaf65ed
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 43 deletions.
17 changes: 6 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -143,22 +143,18 @@
<sciview.version>906892d</sciview.version>
<scenery.version>db26f01</scenery.version>
<font-awesome.version>6.4.2</font-awesome.version>
<flatlaf.version>3.2.1</flatlaf.version>
<flatlaf-jide-oss.version>3.2.2</flatlaf-jide-oss.version>
<log4j.version>2.20.0</log4j.version>
<smile-core.version>3.0.2</smile-core.version>
<flatlaf.version>3.2.5</flatlaf.version>
<flatlaf-jide-oss.version>${flatlaf.version}</flatlaf-jide-oss.version>
<log4j.version>2.21.0</log4j.version>
<jide-oss.version>3.7.14</jide-oss.version>
<annotations.version>13.0</annotations.version>
<annotations.version>24.0.1</annotations.version>
<fastutil-core.version>8.5.12</fastutil-core.version>
<jheaps.version>0.14</jheaps.version>
<jide-oss.version>3.7.12</jide-oss.version>
<log4j.version>2.19.0</log4j.version>
<log4j-api.version>${log4j.version}</log4j-api.version>
<log4j-core.version>${log4j.version}</log4j-core.version>
<scenery.version>0.8.0</scenery.version>
<sciview.version>ba959ae644</sciview.version>
<smile.version>3.0.0</smile.version>
<smile-base.version>3.0.2</smile-base.version>
<smile.version>3.0.2</smile.version>
<smile-base.version>${smile.version}</smile-base.version>
<smile-core.version>${smile.version}</smile-core.version>

<!-- NB: Deploy releases to the SciJava Maven repository. -->
Expand Down Expand Up @@ -453,7 +449,6 @@
<dependency>
<groupId>org.jheaps</groupId>
<artifactId>jheaps</artifactId>
<version>${jheaps.version}</version>
</dependency>
<dependency>
<groupId>sc.iview</groupId>
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/sc/fiji/snt/PathManagerUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -2114,9 +2114,6 @@ private void runDistributionAnalysisCmd(final Collection<Tree> trees, final Stri
input.put("calledFromPathManagerUI", true);
if (metric != null) input.put("measurementChoice", metric);
if (polar != null) input.put("polar", polar);
if (trees.size() == 1) {
input.put("onlyConnectivitySafeMetrics", false);
}
cmdService.run(DistributionCPCmd.class, true, input);
}

Expand Down
53 changes: 27 additions & 26 deletions src/main/java/sc/fiji/snt/gui/DemoRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,16 @@ public DemoRunner(final SNTUI ui, final SNT snt) {
entries.add(demo7());
entries.add(demo8());
entries.add(demo9());
entries.add(demo10());
//entries.add(demo10());
}

private Demo demo1() {
final Demo entry = new Demo(1, "Drosophila ddaC neuron (Autotrace demo)") {
@Override
public ImagePlus getImage() {
final ImagePlus imp = sntService.demoImage("ddaC");
imp.setRoi(320, 380, 20, 20); // mark soma
if (imp != null)
imp.setRoi(320, 380, 20, 20); // mark soma
return imp;
}

Expand Down Expand Up @@ -254,30 +255,30 @@ public void load() {
return entry;
}

private Demo demo10() {
final Demo entry = new Demo(10, "Segmented astrocyte (2D image)") {
@Override
public ImagePlus getImage() {
final ImagePlus imp = ij.IJ.openImage("http://wsr.imagej.net/images/mitosis.tif");
imp.setPosition(2, 4, 31); // k-fibers channel, mid Z-range, traced time point
return imp;
}

@Override
public void load() {
super.load();
// apply tags
ui.getPathManager().applyDefaultTags("Traced Channel");
ui.getPathManager().applyDefaultTags("Traced Frame");
}
};
entry.summary = "Downloads a Drosophila S2 cell undergoing mitosis in which K-fibers were traced during anaphase.";
entry.data = "Image (5D; 2-channel, 3D timelapse, 33MB)";
entry.source = "ImageJ sample image, PMID 19720876";
entry.online = true;
entry.tracingsURL = "https://raw.githubusercontent.com/morphonets/SNTmanuscript/718e4b90fb4bb61f382edcf467173b53045b25e0/FigS3_5D-Tracing/traces/mitosis.traces";
return entry;
}
// private Demo demo10() {
// final Demo entry = new Demo(10, "Segmented astrocyte (2D image)") {
// @Override
// public ImagePlus getImage() {
// final ImagePlus imp = ij.IJ.openImage("http://wsr.imagej.net/images/mitosis.tif");
// imp.setPosition(2, 4, 31); // k-fibers channel, mid Z-range, traced time point
// return imp;
// }
//
// @Override
// public void load() {
// super.load();
// // apply tags
// ui.getPathManager().applyDefaultTags("Traced Channel");
// ui.getPathManager().applyDefaultTags("Traced Frame");
// }
// };
// entry.summary = "Downloads a Drosophila S2 cell undergoing mitosis in which K-fibers were traced during anaphase.";
// entry.data = "Image (5D; 2-channel, 3D timelapse, 33MB)";
// entry.source = "ImageJ sample image, PMID 19720876";
// entry.online = true;
// entry.tracingsURL = "https://raw.githubusercontent.com/morphonets/SNTmanuscript/718e4b90fb4bb61f382edcf467173b53045b25e0/FigS3_5D-Tracing/traces/mitosis.traces";
// return entry;
// }

private void error(final Throwable ex) {
ui.error("Loading of data failed (" + ex.getMessage() + " error). See Console for details.");
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/sc/fiji/snt/gui/SigmaPalette.java
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,8 @@ private void updateSigmaFromMouseEvent(final MouseEvent e) {
}
}
updateOverlayLabels();
paletteWindow.repaint(); // call createSubtitle()
if (paletteWindow != null)
paletteWindow.repaint(); // call createSubtitle()
mouseMovedAcceptedSigmaIndex = -1;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"""

from sc.fiji.snt import Path, PathAndFillManager, SNT, SNTUI, Tree
from sc.fiji.snt.analysis import *
from sc.fiji.snt.analysis import GroupedTreeStatistics, MultiTreeStatistics, NodeStatistics, TreeStatistics,\
ConvexHullAnalyzer, PersistenceAnalyzer, ShollAnalyzer, StrahlerAnalyzer, NodeColorMapper,\
TreeColorMapper, PathProfiler, PathStraightener, RoiConverter, SkeletonConverter, SNTChart, SNTTable
from sc.fiji.snt.analysis.graph import DirectedWeightedGraph
from sc.fiji.snt.analysis.sholl.parsers import TreeParser
from sc.fiji.snt.annotation import AllenCompartment, AllenUtils, VFBUtils, ZBAtlasUtils
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#@ int (label="Number of columns", value=0) columns
#@ int (label="Number of rows", value=0) rows
#@ Float (label="Scale factor for reconstructions", value=1.0) scale
#@ String (label="Color mapping:", choices={"Ice.lut", "mpl-viridis.lut", "glasbey_on_dark.lut"}, value="glasbey_on_dark.lut") lutName
#@ String (label="Color mapping:", choices={"mpl-viridis.lut", "glasbey_on_dark.lut"}, value="glasbey_on_dark.lut") lutName
#@ SNTService snt

/**
Expand Down

0 comments on commit aaf65ed

Please sign in to comment.