Skip to content
Snippets Groups Projects
Commit 597dcec0 authored by pietzsch's avatar pietzsch
Browse files

Don't show image selection dialog if only one image is open

parent 3b8e1125
Branches
No related tags found
No related merge requests found
...@@ -77,6 +77,9 @@ public class OpenImagePlusPlugIn implements Command ...@@ -77,6 +77,9 @@ public class OpenImagePlusPlugIn implements Command
return; return;
} }
ArrayList< ImagePlus > inputImgList = new ArrayList<>();
if ( nImages > 1 )
{
final int[] idList = WindowManager.getIDList(); final int[] idList = WindowManager.getIDList();
final String[] nameList = new String[ nImages ]; final String[] nameList = new String[ nImages ];
GenericDialog gd = new GenericDialog( "Images to open" ); GenericDialog gd = new GenericDialog( "Images to open" );
...@@ -91,6 +94,19 @@ public class OpenImagePlusPlugIn implements Command ...@@ -91,6 +94,19 @@ public class OpenImagePlusPlugIn implements Command
if ( gd.wasCanceled() ) if ( gd.wasCanceled() )
return; return;
for ( int i = 0; i < nImages; i++ )
{
if ( !gd.getNextBoolean() )
continue;
ImagePlus imp = WindowManager.getImage( idList[ i ] );
inputImgList.add( imp );
}
}
else
{
inputImgList.add( curr );
}
final ArrayList< ConverterSetup > converterSetups = new ArrayList<>(); final ArrayList< ConverterSetup > converterSetups = new ArrayList<>();
final ArrayList< SourceAndConverter< ? > > sources = new ArrayList<>(); final ArrayList< SourceAndConverter< ? > > sources = new ArrayList<>();
...@@ -99,12 +115,8 @@ public class OpenImagePlusPlugIn implements Command ...@@ -99,12 +115,8 @@ public class OpenImagePlusPlugIn implements Command
int nTimepoints = 1; int nTimepoints = 1;
int setup_id_offset = 0; int setup_id_offset = 0;
ArrayList< ImagePlus > imgList = new ArrayList<>(); ArrayList< ImagePlus > imgList = new ArrayList<>();
for ( int i = 0; i < nImages; i++ ) for ( ImagePlus imp : inputImgList )
{ {
if ( !gd.getNextBoolean() )
continue;
ImagePlus imp = WindowManager.getImage( idList[ i ] );
spimData = load( imp, converterSetups, sources, setup_id_offset ); spimData = load( imp, converterSetups, sources, setup_id_offset );
if ( spimData != null ) if ( spimData != null )
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment