Skip to content

Commit

Permalink
small adjustments in code
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanPreibisch committed Sep 14, 2024
1 parent 9f9b00a commit 4298bab
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -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();
Expand Down Expand Up @@ -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 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4298bab

Please sign in to comment.