@@ -708,7 +708,7 @@ public void runSecondaryLayerWizard() {
708708 private void runSecondaryLayerWizard (final boolean autoCTwarning ) {
709709 if (!okToReplaceSecLayer ())
710710 return ;
711- if (! plugin . accessToValidImageData ()) {
711+ if (accessToValidImagePlus ()) { // wizard requires image to be open
712712 noValidImageDataError ();
713713 return ;
714714 }
@@ -1524,7 +1524,7 @@ private JPanel viewsPanel() {
15241524 }
15251525
15261526 String msg = "" ;
1527- if (plugin . accessToValidImageData ()) {
1527+ if (accessToValidImagePlus ()) {
15281528 msg = "Replace current image with a display canvas and " ;
15291529 } else if (plugin .getPrefs ().getTemp (SNTPrefs .NO_IMAGE_ASSOCIATED_DATA , false )) {
15301530 msg = "You have loaded paths without loading an image." ;
@@ -1534,14 +1534,15 @@ private JPanel viewsPanel() {
15341534 resetPathSpacings (msg );
15351535 }
15361536
1537- if (! plugin . accessToValidImageData ()) {
1537+ if (accessToValidImagePlus ()) {
15381538 // depending on what the user chose in the resetPathSpacings() prompt
15391539 // we need to check again if the plugin has access to a valid image
15401540 changeState (LOADING );
15411541 showStatus ("Resizing Canvas..." , false );
15421542 updateSinglePaneFlag ();
15431543 if (plugin .isUnsavedChanges ())
15441544 plugin .getPathAndFillManager ().getBoundingBox (true );
1545+ plugin .closeAndResetAllPanes (); // flush cashed data as needed
15451546 plugin .rebuildDisplayCanvases (); // will change UI state
15461547 arrangeCanvases (false );
15471548 showStatus ("Canvas rebuilt..." , true );
@@ -1609,7 +1610,7 @@ private void validateImgDimensions() {
16091610 if (plugin .accessToValidImageData ()) {
16101611 type = "image" ;
16111612 sb .append ("<li>Use IJ's command Image→Adjust→Canvas Size... and press <i>Reload</i> in the Data Source widget of the Options pane</li>" );
1612- sb .append ("<li>Close the current image and create a Display Canvas using the <i>Create Canvas</i> command in the Options pane</li>" );
1613+ sb .append ("<li>Close the current image and create a Display Canvas using <i>Create Canvas</i> in the Options pane</li>" );
16131614 }
16141615 else {
16151616 sb .append ("<li>Use the <i>Create/Resize Canvas</i> commands in the Options pane</li>" );
@@ -2472,7 +2473,11 @@ private void initializeBvvFromPrompt() {
24722473 bvvSNT = new Bvv (plugin );
24732474 try {
24742475 if (choices [0 ].equals (choice )) {
2475- bvvSNT .show (plugin .getImagePlus ());
2476+ final ImagePlus imp = plugin .getImagePlus ();
2477+ if (imp == null )
2478+ noValidImageDataError ();
2479+ else
2480+ bvvSNT .show (imp );
24762481 } else if (choices [1 ].equals (choice )) {
24772482 bvvSNT .showLoadedData ();
24782483 } else if (plugin .isSecondaryDataAvailable ()) {
0 commit comments