From 2ec16cbf21f3fbeb7b24cb65073e125bdd0191b0 Mon Sep 17 00:00:00 2001 From: Stefan Hahmann Date: Tue, 10 Oct 2023 10:30:28 +0200 Subject: [PATCH] Increase number of frames by one --- .../mamut/segment/SegmentUsingEllipsoidsController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/mastodon/mamut/segment/SegmentUsingEllipsoidsController.java b/src/main/java/org/mastodon/mamut/segment/SegmentUsingEllipsoidsController.java index d0663bc98..2c7be9e5b 100644 --- a/src/main/java/org/mastodon/mamut/segment/SegmentUsingEllipsoidsController.java +++ b/src/main/java/org/mastodon/mamut/segment/SegmentUsingEllipsoidsController.java @@ -110,7 +110,7 @@ public void saveEllipsoidSegmentationToFile( logger.info( "Save ellipsoid segmentation to file. Label options: {}, file: {}", labelOption, file.getAbsolutePath() ); long[] spatialDimensions = getDimensionsOfSource(); - int frames = timePoints.size() / frameRateReduction; + int frames = timePoints.size() / frameRateReduction + 1; logger.debug( "number of frames: {}", frames ); DiskCachedCellImg< IntType, ? > img = createCachedImage( spatialDimensions, frames ); @@ -124,6 +124,7 @@ public void saveEllipsoidSegmentationToFile( AffineTransform3D transform = new AffineTransform3D(); source.getSourceTransform( frameId, 0, transform ); int targetFrameId = frameId / frameRateReduction; + logger.trace( "frameId: {}, targetFrameId: {}", frameId, targetFrameId ); IntervalView< IntType > frame = Views.hyperSlice( img, 3, targetFrameId ); AbstractSource< IntType > frameSource = new RandomAccessibleIntervalSource<>( frame, new IntType(), transform, "Segmentation" ); final EllipsoidIterable< IntType > ellipsoidIterable = new EllipsoidIterable<>( frameSource );