Skip to content

Commit

Permalink
Increase number of frames by one
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanhahmann committed Oct 10, 2023
1 parent f2f9f7e commit 2ec16cb
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand All @@ -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 );
Expand Down

0 comments on commit 2ec16cb

Please sign in to comment.