Commit 597dcec0 authored by pietzsch's avatar pietzsch
Browse files

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

parent 3b8e1125
......@@ -77,6 +77,9 @@ public class OpenImagePlusPlugIn implements Command
return;
}
ArrayList< ImagePlus > inputImgList = new ArrayList<>();
if ( nImages > 1 )
{
final int[] idList = WindowManager.getIDList();
final String[] nameList = new String[ nImages ];
GenericDialog gd = new GenericDialog( "Images to open" );
......@@ -91,6 +94,19 @@ public class OpenImagePlusPlugIn implements Command
if ( gd.wasCanceled() )
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< SourceAndConverter< ? > > sources = new ArrayList<>();
......@@ -99,12 +115,8 @@ public class OpenImagePlusPlugIn implements Command
int nTimepoints = 1;
int setup_id_offset = 0;
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 );
if ( spimData != null )
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment