From 4298babe999772b25983f9d6d824ed32b0696ba4 Mon Sep 17 00:00:00 2001 From: Stephan Preibisch Date: Sat, 14 Sep 2024 10:34:48 -0400 Subject: [PATCH] small adjustments in code --- .../plugin/resave/ParametersResaveN5Api.java | 20 +++++++++---------- .../fiji/plugin/resave/Resave_N5Api.java | 3 ++- .../{ExportN5API.java => ExportN5Api.java} | 0 3 files changed, 12 insertions(+), 11 deletions(-) rename src/main/java/net/preibisch/mvrecon/process/export/{ExportN5API.java => ExportN5Api.java} (100%) diff --git a/src/main/java/net/preibisch/mvrecon/fiji/plugin/resave/ParametersResaveN5Api.java b/src/main/java/net/preibisch/mvrecon/fiji/plugin/resave/ParametersResaveN5Api.java index 07a3ff14..15169007 100644 --- a/src/main/java/net/preibisch/mvrecon/fiji/plugin/resave/ParametersResaveN5Api.java +++ b/src/main/java/net/preibisch/mvrecon/fiji/plugin/resave/ParametersResaveN5Api.java @@ -129,7 +129,13 @@ public static ParametersResaveN5Api getParamtersIJ( final GenericDialogPlus gdp = new GenericDialogPlus( "Options" ); - gdp.addMessage( "N5 saving options", new Font( Font.SANS_SERIF, Font.BOLD, 13 ) ); + gdp.addMessage( "N5 API saving options", new Font( Font.SANS_SERIF, Font.BOLD, 13 ) ); + + if ( askForFormat ) + { + final String[] options = new String[] { "N5", "HDF5" }; + gdp.addChoice( "Format for raw data", options, options[ 0 ] ); + } gdp.addChoice( "Compression", compressions, compressions[ defaultCompression ] ); gdp.addStringField( "Downsampling_factors", ProposeMipmaps.getArrayString( autoMipmapSettings.getExportResolutions() ), 40 ); @@ -149,17 +155,14 @@ public static ParametersResaveN5Api getParamtersIJ( gdp.addDirectoryField( "N5_path", n5URI.toString(), 65 ); } - if ( askForFormat ) - { - final String[] options = new String[] { "N5", "HDF5" }; - gdp.addChoice( "Format for raw data", options, options[ 0 ] ); - } - gdp.showDialog(); if (gdp.wasCanceled()) return null; + if ( askForFormat ) + n5params.format = gdp.getNextChoiceIndex(); + final int compression = defaultCompression = gdp.getNextChoiceIndex(); final String subsampling = gdp.getNextString(); @@ -194,9 +197,6 @@ public static ParametersResaveN5Api getParamtersIJ( n5params.n5URI = n5URI; } - if ( askForFormat ) - n5params.format = gdp.getNextChoiceIndex(); - if ( compression == 0 ) // "Bzip2", "Gzip", "Lz4", "Raw (no compression)", "Xz" n5params.compression = new Bzip2Compression(); else if ( compression == 1 ) diff --git a/src/main/java/net/preibisch/mvrecon/fiji/plugin/resave/Resave_N5Api.java b/src/main/java/net/preibisch/mvrecon/fiji/plugin/resave/Resave_N5Api.java index 915adff9..1d96d554 100644 --- a/src/main/java/net/preibisch/mvrecon/fiji/plugin/resave/Resave_N5Api.java +++ b/src/main/java/net/preibisch/mvrecon/fiji/plugin/resave/Resave_N5Api.java @@ -72,7 +72,8 @@ public void run(String arg) if ( !xml.queryXML( "Resaving as N5", "Resave", true, true, true, true, true ) ) return; - final ParametersResaveN5Api n5params = ParametersResaveN5Api.getParamtersIJ( xml.getXMLURI(), xml.getViewSetupsToProcess(), true ); + final ParametersResaveN5Api n5params = + ParametersResaveN5Api.getParamtersIJ( xml.getXMLURI(), xml.getViewSetupsToProcess(), true ); if ( n5params == null ) return; diff --git a/src/main/java/net/preibisch/mvrecon/process/export/ExportN5API.java b/src/main/java/net/preibisch/mvrecon/process/export/ExportN5Api.java similarity index 100% rename from src/main/java/net/preibisch/mvrecon/process/export/ExportN5API.java rename to src/main/java/net/preibisch/mvrecon/process/export/ExportN5Api.java