diff --git a/src/main/java/org/mastodon/mamut/io/importer/labelimage/LabelImageUtils.java b/src/main/java/org/mastodon/mamut/io/importer/labelimage/LabelImageUtils.java index daefebd1f..c41a7e188 100644 --- a/src/main/java/org/mastodon/mamut/io/importer/labelimage/LabelImageUtils.java +++ b/src/main/java/org/mastodon/mamut/io/importer/labelimage/LabelImageUtils.java @@ -64,13 +64,14 @@ static void createSpotsFromLabelImage( final IntFunction< RandomAccessibleInterv try { int numTimepoints = frames.size(); - for ( TimePoint frame : frames ) + for ( int i = 0; i < numTimepoints; i++ ) { + TimePoint frame = frames.get( i ); int frameId = frame.getId(); final RandomAccessibleInterval< RealType< ? > > rai = frameProvider.apply( frameId ); count += createSpotsForFrame( graph, rai, frameId, voxelDimensions, sigma ); if ( statusService != null ) - statusService.showProgress( frameId + 1, numTimepoints ); + statusService.showProgress( i + 1, numTimepoints ); } model.setUndoPoint(); }