Skip to content

Commit 0d53f95

Browse files
committed
Improve UX integration of big-data viewers/commands
1 parent 82ddf6c commit 0d53f95

6 files changed

Lines changed: 17 additions & 12 deletions

File tree

‎src/main/java/sc/fiji/snt/SNTUI.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,7 @@ private void setEnabledImagePlusCanvasControls(final boolean enable) {
11861186

11871187
@Override
11881188
public void enter() {
1189-
updateStatusText("Experimental big-data tracing mode");
1189+
updateStatusText("Big-Data Tracing Mode (Experimental)");
11901190
showStatus("In-core image not available...", false);
11911191
setEnableAutoTracingComponents(false, false); // currently controlled in Bvv panel
11921192
disableImageDependentComponents(); // Bvv is not currently aware of these
@@ -5177,6 +5177,7 @@ private String getState(final int state) {
51775177
case EDITING -> "EDITING_MODE";
51785178
case SNT_PAUSED -> "PAUSED";
51795179
case TRACING_PAUSED -> "ANALYSIS_MODE";
5180+
case BVV_TRACING -> "BVV_TRACING";
51805181
default -> "UNKNOWN";
51815182
};
51825183
}

‎src/main/java/sc/fiji/snt/gui/cmds/BvvCmd.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
*
6868
* @author Tiago Ferreira
6969
*/
70-
@Plugin(type = Command.class, label = "BDV/BVV")
70+
@Plugin(type = Command.class, label = "Big Data")
7171
public class BvvCmd extends ContextCommand {
7272

7373
private static final String TOOLTIP =

‎src/main/java/sc/fiji/snt/gui/cmds/SNTLoaderCmd.java‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,15 +339,16 @@ private void initPlugin(final SNT snt)
339339
}
340340
catch (final OutOfMemoryError error) {
341341
final StringBuilder sb = new StringBuilder(
342-
"Out of Memory: There is not enough RAM to load SNT under current options.\n");
342+
"Out of Memory: There is not enough RAM to load SNT under current options.\n");
343343
sb.append("Please allocate more memory to IJ or ");
344344
if (uiChoice.equals(UI_SIMPLE)) {
345345
sb.append("choose a smaller ").append((sourceImp == null) ? "file."
346-
: "image.");
346+
: "image.");
347347
}
348348
else {
349349
sb.append("select the \"").append(UI_SIMPLE).append("\" interface.");
350350
}
351+
sb.append("\n \nAlternatively, consider using one of the Big Data... options.");
351352
exit(sb.toString());
352353
GuiUtils.restoreLookAndFeel();
353354
} finally {

‎src/main/java/sc/fiji/snt/gui/cmds/ShortcutWindowCmd.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public class ShortcutWindowCmd extends ContextCommand implements PlugIn {
8080

8181
private JPanel getPanel() {
8282
final ArrayList<Shortcut> shortcuts = new ArrayList<>();
83-
shortcuts.add(new Shortcut("SNT...", SNTLoaderCmd.class,
83+
shortcuts.add(new Shortcut("Startup...", SNTLoaderCmd.class,
8484
"Initialize the complete SNT frontend. For tracing start here."));
8585
shortcuts.add(null);
8686
shortcuts.add(new Shortcut("Big Data...", BvvCmd.class,
@@ -271,7 +271,7 @@ private void makeSmallerButton(final JButton button) {
271271

272272
private JFrame getFrame() {
273273
if (frame == null) {
274-
frame = new JFrame("Neuroanatomy Commands");
274+
frame = new JFrame("SNT Commands");
275275
frame.getRootPane().putClientProperty("Window.style", "small");
276276
}
277277
return frame;

‎src/main/java/sc/fiji/snt/viewer/Bdv.java‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ public <T extends RealType<T> & NativeType<T>> BdvStackSource<?> show(
271271
*/
272272
public List<BdvStackSource<?>> show(final AbstractSpimData<?> spimData) {
273273
final BdvOptions opts = (bdvHandle == null)
274-
? BdvOptions.options()
274+
? baseOpts()
275275
: BdvOptions.options().addTo(bdvHandle);
276276
final List<BdvStackSource<?>> sources = BdvFunctions.show(spimData, opts);
277277
if (sources.isEmpty()) return sources;
@@ -329,7 +329,7 @@ public List<BdvStackSource<?>> show(final AbstractSpimData<?> spimData, final St
329329
*/
330330
public List<BdvStackSource<?>> show(final SpimDataUtils.N5Sources n5Sources) {
331331
final BdvOptions opts = (bdvHandle == null)
332-
? BdvOptions.options()
332+
? baseOpts()
333333
: BdvOptions.options().addTo(bdvHandle);
334334
final List<BdvStackSource<?>> sources = new ArrayList<>();
335335
for (final SourceAndConverter<?> soc : n5Sources.sources)
@@ -569,7 +569,8 @@ private void initializeOverlays() {
569569

570570
/** Returns the base BdvOptions: either a fresh instance or addTo existing handle. */
571571
private BdvOptions baseOpts() {
572-
return bdvHandle == null ? BdvOptions.options() : BdvOptions.options().addTo(bdvHandle);
572+
final BdvOptions opts = (bdvHandle == null) ? BdvOptions.options() : BdvOptions.options().addTo(bdvHandle);
573+
return opts.frameTitle("SNT BDV");
573574
}
574575

575576
/**

‎src/main/java/sc/fiji/snt/viewer/Bvv.java‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ public Bvv(final SNT snt) {
142142
options = bvv.vistools.Bvv.options();
143143
options.preferredSize(BvvUtils.DEFAULT_WINDOW_SIZE, BvvUtils.DEFAULT_WINDOW_SIZE);
144144
options.frameTitle("SNT BVV");
145+
options.frameTitle((snt != null) ? "SNT Big Data Tracer" : "SNT BVV");
145146
options.cacheBlockSize(32); // GPU cache tile size
146147
options.maxCacheSizeInMB(BvvUtils.DEFAULT_CACHE_SIZE_MB);
147148
options.ditherWidth(1); // dither window. 1 = full resolution; 8 = coarsest resolution
@@ -1096,7 +1097,7 @@ private BvvOptions configureBvvOptionsForImage(final long nSlices, final int nCh
10961097
nSlices, nChannels, blockSize, renderW, renderH, maxMillis, maxStep));
10971098
return bvv.vistools.Bvv.options()
10981099
.preferredSize(BvvUtils.DEFAULT_WINDOW_SIZE, BvvUtils.DEFAULT_WINDOW_SIZE)
1099-
.frameTitle("SNT BVV")
1100+
.frameTitle((snt != null) ? "SNT Big Data Tracer" : "SNT BVV")
11001101
.maxCacheSizeInMB(BvvUtils.DEFAULT_CACHE_SIZE_MB)
11011102
.ditherWidth(1)
11021103
.cacheBlockSize(blockSize)
@@ -3184,9 +3185,9 @@ public void mouseClicked(final MouseEvent e) {
31843185
// find the nearest node to this cursor position see InteractiveTracingCanvas#mouseMoved
31853186
// Pick radius is defined in screen pixels (see pickRadiusWorld()) rather than a fixed
31863187
// world-space distance, so "close enough to fork" stays consistent across zoom levels
3187-
// TODO: This is a deviation from tracing on ImagePlus: There we look for a nearest point in selected paths only
3188+
// This is a (minor!?) deviation from tracing on ImagePlus: There we look for a nearest point in selected paths only
31883189
final double pickRadius = pickRadiusWorld(FORK_POINT_PICK_RADIUS_SCREEN_PX);
3189-
showViewerMessage("Forking path...");
3190+
showViewerMessage("Forking...");
31903191
final NearPoint nearPoint = snt.getPathAndFillManager().nearestPointOnAnyPath(cc1[0], cc1[1], cc1[2], pickRadius);
31913192
previousForkPoint = (nearPoint == null) ? null : nearPoint.getNode();
31923193
if (previousForkPoint == null) {
@@ -3264,6 +3265,7 @@ private void finishPath() {
32643265
syncPathManagerList();
32653266
tempPath = null;
32663267
previousNode = null;
3268+
showViewerMessage("Path finished");
32673269
}
32683270

32693271
/**

0 commit comments

Comments
 (0)