Skip to content
Snippets Groups Projects
Commit 7a7b85bd authored by Tobias Pietzsch's avatar Tobias Pietzsch
Browse files

bugfix in ImportPlugin: revised openAsVirtualStack logic when using monolithicImgLoader.

parent 7d4fa8d1
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,7 @@ import net.imglib2.RandomAccessibleInterval; ...@@ -27,6 +27,7 @@ import net.imglib2.RandomAccessibleInterval;
import net.imglib2.type.numeric.integer.UnsignedShortType; import net.imglib2.type.numeric.integer.UnsignedShortType;
import bdv.ViewerImgLoader; import bdv.ViewerImgLoader;
import bdv.img.hdf5.Hdf5ImageLoader; import bdv.img.hdf5.Hdf5ImageLoader;
import bdv.img.hdf5.MultiResolutionImgLoader;
import bdv.spimdata.SequenceDescriptionMinimal; import bdv.spimdata.SequenceDescriptionMinimal;
import bdv.spimdata.SpimDataMinimal; import bdv.spimdata.SpimDataMinimal;
import bdv.spimdata.XmlIoSpimDataMinimal; import bdv.spimdata.XmlIoSpimDataMinimal;
...@@ -170,22 +171,21 @@ public class ImportPlugIn implements PlugIn ...@@ -170,22 +171,21 @@ public class ImportPlugIn implements PlugIn
@SuppressWarnings( "unchecked" ) @SuppressWarnings( "unchecked" )
BasicImgLoader< UnsignedShortType > il = ( BasicImgLoader< UnsignedShortType > ) seq.getImgLoader(); BasicImgLoader< UnsignedShortType > il = ( BasicImgLoader< UnsignedShortType > ) seq.getImgLoader();
boolean duplicateImp = !openAsVirtualStack; final boolean duplicateImp = !openAsVirtualStack;
if ( !openAsVirtualStack && il instanceof Hdf5ImageLoader ) if ( !openAsVirtualStack && il instanceof Hdf5ImageLoader )
{ {
final Hdf5ImageLoader h5il = ( Hdf5ImageLoader ) il; final Hdf5ImageLoader h5il = ( Hdf5ImageLoader ) il;
il = h5il.getMonolithicImageLoader(); il = h5il.getMonolithicImageLoader();
duplicateImp = false;
} }
final RandomAccessibleInterval< UnsignedShortType > img; final RandomAccessibleInterval< UnsignedShortType > img;
if ( il instanceof ViewerImgLoader ) if ( il instanceof MultiResolutionImgLoader )
{ {
final ViewerImgLoader< UnsignedShortType, ? > vil = ( ViewerImgLoader< UnsignedShortType, ? > ) seq.getImgLoader(); final MultiResolutionImgLoader< UnsignedShortType > mil = ( MultiResolutionImgLoader< UnsignedShortType > ) il;
final int numMipmapLevels = vil.numMipmapLevels( setupId ); final int numMipmapLevels = mil.numMipmapLevels( setupId );
if ( mipmap >= numMipmapLevels ) if ( mipmap >= numMipmapLevels )
mipmap = numMipmapLevels - 1; mipmap = numMipmapLevels - 1;
img = vil.getImage( new ViewId( timepointId, setupId ), mipmap ); img = mil.getImage( new ViewId( timepointId, setupId ), mipmap );
} }
else else
img = il.getImage( new ViewId( timepointId, setupId ) ); img = il.getImage( new ViewId( timepointId, setupId ) );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment