Skip to content

Commit

Permalink
Fix bug when showing SpimData that doesn't have a ViewerImgLoader
Browse files Browse the repository at this point in the history
  • Loading branch information
tpietzsch committed Jan 8, 2024
1 parent e390c4e commit 449a2ea
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/java/bdv/util/BdvFunctions.java
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,15 @@ public static < T > BdvStackSource< T > show(
final BdvOptions options )
{
final BdvHandle handle = getHandle( options );
WrapBasicImgLoader.wrapImgLoaderIfNecessary( spimData );

final AbstractSequenceDescription< ?, ?, ? > seq = spimData.getSequenceDescription();
final int numTimepoints = seq.getTimePoints().size();
final VolatileGlobalCellCache cache = ( VolatileGlobalCellCache ) ( ( ViewerImgLoader ) seq.getImgLoader() ).getCacheControl();
final CacheControl cache = ( ( ViewerImgLoader ) seq.getImgLoader() ).getCacheControl();
handle.getBdvHandle().getCacheControls().addCacheControl( cache );
cache.clearCache();
if ( cache instanceof VolatileGlobalCellCache )
( ( VolatileGlobalCellCache ) cache ).clearCache();

WrapBasicImgLoader.wrapImgLoaderIfNecessary( spimData );
final ArrayList< SourceAndConverter< ? > > sources = new ArrayList<>();
BigDataViewer.initSetups( spimData, new ArrayList<>(), sources );

Expand Down

0 comments on commit 449a2ea

Please sign in to comment.