File tree Expand file tree Collapse file tree
src/main/java/sc/fiji/snt Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -633,13 +633,7 @@ private void nullifyCanvases(final boolean disposeXY) {
633633 }
634634
635635 public boolean accessToValidImageData () {
636- // NB: Currently we are assuming that image data comes from an ImagePlus. This
637- // needs to be changed when ImagePlus requirements are lift. Note that xy may
638- // be null (e.g., image has been manually closed), but its cached data ctSlice3d
639- // may still be available. Return ctSlice3d != null is problematic on its own,
640- // because there are several calls to this method that happen _before_ ctSlice3d
641- // has been assembled, but _after_ an image has been specified
642- return getImagePlus () != null && !isDisplayCanvas (xy );
636+ return (getImagePlus () != null && !isDisplayCanvas (xy )) || ctSlice3d != null ;
643637 }
644638
645639 private void setIsDisplayCanvas (final ImagePlus imp ) {
@@ -839,7 +833,7 @@ public void rebuildZYXZpanes() {
839833 if (!xz .isVisible ()) xz .show ();
840834 }
841835
842- @ SuppressWarnings ("unchecked" )
836+ @ SuppressWarnings ("unchecked" )
843837 private void loadDatasetFromImagePlus (final ImagePlus imp ) {
844838 statusService .showStatus ("Loading data..." );
845839 this .ctSlice3d = ImgUtils .getCtSlice3d (imp , channel - 1 , frame - 1 );
Original file line number Diff line number Diff line change 2222
2323package sc .fiji .snt .hyperpanes ;
2424
25- import java .awt .Color ;
25+ import java .awt .* ;
2626import java .awt .image .ColorModel ;
2727
2828import ij .ImagePlus ;
@@ -664,6 +664,7 @@ private void initialize(final int frame) {
664664 }
665665
666666 private void initCanvasesAndWindows () {
667+ if (GraphicsEnvironment .isHeadless ()) return ;
667668 xy_canvas = createCanvas (xy , XY_PLANE );
668669 if (isDummy ()) {
669670 xy_window = null ;
You can’t perform that action at this time.
0 commit comments