diff --git a/src/main/java/net/preibisch/mvrecon/fiji/plugin/queryXML/GenericLoadParseQueryXML.java b/src/main/java/net/preibisch/mvrecon/fiji/plugin/queryXML/GenericLoadParseQueryXML.java index b97923e1..c81b7c3b 100644 --- a/src/main/java/net/preibisch/mvrecon/fiji/plugin/queryXML/GenericLoadParseQueryXML.java +++ b/src/main/java/net/preibisch/mvrecon/fiji/plugin/queryXML/GenericLoadParseQueryXML.java @@ -41,6 +41,7 @@ import java.util.HashSet; import java.util.List; +import bdv.img.n5.N5ImageLoader; import fiji.util.gui.GenericDialogPlus; import ij.gui.GenericDialog; import mpicbg.spim.data.SpimDataException; @@ -57,6 +58,7 @@ import mpicbg.spim.data.sequence.Angle; import mpicbg.spim.data.sequence.Channel; import mpicbg.spim.data.sequence.Illumination; +import mpicbg.spim.data.sequence.ImgLoader; import mpicbg.spim.data.sequence.Tile; import mpicbg.spim.data.sequence.TimePoint; import net.preibisch.legacy.io.IOFunctions; @@ -64,6 +66,7 @@ import net.preibisch.mvrecon.fiji.plugin.util.PluginHelper; import net.preibisch.mvrecon.fiji.spimdata.EmptyEntity; import net.preibisch.mvrecon.fiji.spimdata.NamePattern; +import net.preibisch.mvrecon.fiji.spimdata.imgloaders.splitting.SplitViewerImgLoader; import util.URITools; /** @@ -153,9 +156,32 @@ public GenericLoadParseQueryXML( final X io ) */ public AS getData() { - final URI uri = getXMLURI(); + final L loader = data.getSequenceDescription().getImgLoader(); - if ( !isPrefetched && ( URITools.isS3( uri ) || URITools.isGC( uri ) ) ) + final URI uri; + + if ( N5ImageLoader.class.isInstance( loader ) ) + { + uri = ((N5ImageLoader)loader).getN5URI(); + } + else if ( SplitViewerImgLoader.class.isInstance( loader ) ) + { + BasicImgLoader underlyingLoader = loader; + + while ( SplitViewerImgLoader.class.isInstance( underlyingLoader = ((SplitViewerImgLoader)underlyingLoader ).getUnderlyingImgLoader() ) ) {} + + + if ( N5ImageLoader.class.isInstance( underlyingLoader ) ) + uri = ((N5ImageLoader)underlyingLoader).getN5URI(); + else + uri = null; + } + else + { + uri = null; + } + + if ( uri != null && !isPrefetched && ( URITools.isS3( uri ) || URITools.isGC( uri ) ) ) { IOFunctions.println( "Setting cloud fetcher threads for '" + uri + "' to: " + URITools.cloudThreads ); URITools.setNumFetcherThreads( data.getSequenceDescription().getImgLoader(), URITools.cloudThreads ); diff --git a/src/main/java/net/preibisch/mvrecon/fiji/spimdata/imgloaders/splitting/SplitImgLoader.java b/src/main/java/net/preibisch/mvrecon/fiji/spimdata/imgloaders/splitting/SplitImgLoader.java index 67946455..ad049520 100644 --- a/src/main/java/net/preibisch/mvrecon/fiji/spimdata/imgloaders/splitting/SplitImgLoader.java +++ b/src/main/java/net/preibisch/mvrecon/fiji/spimdata/imgloaders/splitting/SplitImgLoader.java @@ -24,6 +24,7 @@ import java.util.HashMap; +import bdv.ViewerImgLoader; import mpicbg.spim.data.sequence.ImgLoader; import mpicbg.spim.data.sequence.SequenceDescription; import mpicbg.spim.data.sequence.SetupImgLoader; @@ -72,6 +73,11 @@ public SplitImgLoader( return getSplitSetupImgLoader( underlyingImgLoader, new2oldSetupId.get( setupId ), setupId, newSetupId2Interval.get( setupId ) ); } + public ImgLoader getUnderlyingImgLoader() + { + return underlyingImgLoader; + } + private final synchronized < T > SplitSetupImgLoader< ? > getSplitSetupImgLoader( final ImgLoader underlyingImgLoader, final int oldSetupId, final int newSetupId, final Interval interval ) { SplitSetupImgLoader< ? > sil = splitSetupImgLoaders.get( newSetupId ); diff --git a/src/main/java/net/preibisch/mvrecon/fiji/spimdata/imgloaders/splitting/SplitMultiResolutionImgLoader.java b/src/main/java/net/preibisch/mvrecon/fiji/spimdata/imgloaders/splitting/SplitMultiResolutionImgLoader.java index 9e821792..44838093 100644 --- a/src/main/java/net/preibisch/mvrecon/fiji/spimdata/imgloaders/splitting/SplitMultiResolutionImgLoader.java +++ b/src/main/java/net/preibisch/mvrecon/fiji/spimdata/imgloaders/splitting/SplitMultiResolutionImgLoader.java @@ -24,6 +24,7 @@ import java.util.HashMap; +import mpicbg.spim.data.sequence.ImgLoader; import mpicbg.spim.data.sequence.MultiResolutionImgLoader; import mpicbg.spim.data.sequence.MultiResolutionSetupImgLoader; import mpicbg.spim.data.sequence.SequenceDescription; @@ -72,6 +73,11 @@ public SplitMultiResolutionImgLoader( return getSplitSetupImgLoader( underlyingImgLoader, new2oldSetupId.get( setupId ), setupId, newSetupId2Interval.get( setupId ) ); } + public MultiResolutionImgLoader getUnderlyingImgLoader() + { + return underlyingImgLoader; + } + private final synchronized < T > SplitMultiResolutionSetupImgLoader< ? > getSplitSetupImgLoader( final MultiResolutionImgLoader underlyingImgLoader, final int oldSetupId, final int newSetupId, final Interval interval ) { SplitMultiResolutionSetupImgLoader< ? > sil = splitSetupImgLoaders.get( newSetupId ); diff --git a/src/main/java/net/preibisch/mvrecon/fiji/spimdata/imgloaders/splitting/SplitViewerImgLoader.java b/src/main/java/net/preibisch/mvrecon/fiji/spimdata/imgloaders/splitting/SplitViewerImgLoader.java index 0ce97ad2..308b7354 100644 --- a/src/main/java/net/preibisch/mvrecon/fiji/spimdata/imgloaders/splitting/SplitViewerImgLoader.java +++ b/src/main/java/net/preibisch/mvrecon/fiji/spimdata/imgloaders/splitting/SplitViewerImgLoader.java @@ -109,6 +109,11 @@ private final synchronized SplitViewerSetupImgLoader createNewSetupImgLoade return new SplitViewerSetupImgLoader<>( Cast.unchecked( setupImgLoader ), interval ); } + public ViewerImgLoader getUnderlyingImgLoader() + { + return underlyingImgLoader; + } + public Future< Void > prefetch( final int parallelism ) { if ( N5ImageLoader.class.isInstance( underlyingImgLoader ) )