From 7fe0642353de52975b9973e674431c74d19e5ba9 Mon Sep 17 00:00:00 2001 From: Stephan Preibisch Date: Thu, 7 Nov 2024 15:10:24 -0500 Subject: [PATCH] fix re-saving question, do not save before resaving --- .../spimdata/explorer/popup/ResavePopup.java | 32 +++++-------------- 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/src/main/java/net/preibisch/mvrecon/fiji/spimdata/explorer/popup/ResavePopup.java b/src/main/java/net/preibisch/mvrecon/fiji/spimdata/explorer/popup/ResavePopup.java index 7f247d6b..8da6eedf 100644 --- a/src/main/java/net/preibisch/mvrecon/fiji/spimdata/explorer/popup/ResavePopup.java +++ b/src/main/java/net/preibisch/mvrecon/fiji/spimdata/explorer/popup/ResavePopup.java @@ -126,27 +126,23 @@ public void run() final SpimData2 data = panel.getSpimData(); final List< ViewId > viewIds = ApplyTransformationPopup.getSelectedViews( panel ); - String question; - final boolean notAllSelected = viewIds.size() < data.getSequenceDescription().getViewDescriptions().size(); // user has not selected all views (or not all views are selectable at once) // ask them whether they want to expand selection to all views in SpimData if ( notAllSelected ) { - question = - "You have only selected " + viewIds.size() + " of " + - data.getSequenceDescription().getViewDescriptions().size() + " views for export.\n" + - "(the rest will not be visible in the new dataset - except they are missing)\n"; - - final int choice = JOptionPane.showConfirmDialog( null, - question + "Note: this will first save the current state of the open XML.\n" - + "Do you wish to expand the selection to the whole dataset before continuing?", + final int choice = JOptionPane.showConfirmDialog( null, + "You have only selected " + viewIds.size() + " of " + + data.getSequenceDescription().getViewDescriptions().size() + " views for export.\n" + + "Do you wish to expand the selection to the whole dataset before continuing?", "Warning", JOptionPane.YES_NO_CANCEL_OPTION ); if (choice == JOptionPane.CANCEL_OPTION) + { return; + } else if (choice == JOptionPane.YES_OPTION) { IOFunctions.println( "OK, saving ALL " + data.getSequenceDescription().getViewDescriptions().size() + "views." ); @@ -158,18 +154,6 @@ else if (choice == JOptionPane.YES_OPTION) IOFunctions.println( "Saving " + viewIds.size() + " of " + data.getSequenceDescription().getViewDescriptions().size() + " views."); } } - // all views in SpimData have been selected, ask user for confirmation before starting resave. - else - { - question = "Resaving all (except missing) views of the current dataset.\n"; - - if ( JOptionPane.showConfirmDialog( - null, - question + "Note: this will first save the current state of the open XML. Proceed?", - "Warning", - JOptionPane.YES_NO_OPTION ) == JOptionPane.NO_OPTION ) - return; - } // filter not present ViewIds final List< ViewId > removed = SpimData2.filterMissingViews( panel.getSpimData(), viewIds ); @@ -220,7 +204,7 @@ else if ( index == 2 || index == 3 ) // HDF5, compressed HDF5 // load all dimensions if they are not known (required for estimating the mipmap layout) Resave_HDF5.loadDimensions( data, setups ); - panel.saveXML(); + //panel.saveXML(); final Map< Integer, ExportMipmapInfo > perSetupExportMipmapInfo = Resave_HDF5.proposeMipmaps( setups ); final int firstviewSetupId = setups.get( 0 ).getId(); @@ -285,7 +269,7 @@ else if ( index == 2 || index == 3 ) // HDF5, compressed HDF5 // --- N5 --- else if (index == 4 || index == 5) // 4 == in-place, 5 == choose path { - panel.saveXML(); + //panel.saveXML(); final URI n5DatasetURI = ParametersResaveN5Api.createN5URIfromXMLURI( panel.xml() );