@SuppressWarnings({ "unchecked", "rawtypes" }) public static < T extends RealType< T > > RandomAccessibleInterval< T > getImage( final T type, ImgLoader imgLoader, final ViewId view, final boolean normalize ) { if ( (RealType)type instanceof FloatType ) return (RandomAccessibleInterval)imgLoader.getSetupImgLoader( view.getViewSetupId() ).getFloatImage( view.getTimePointId(), normalize, LOAD_COMPLETELY ); else if ( (RealType)type instanceof UnsignedShortType ) return (RandomAccessibleInterval)imgLoader.getSetupImgLoader( view.getViewSetupId() ).getImage( view.getTimePointId(), LOAD_COMPLETELY ); else return null; }
RandomAccessibleInterval< FloatType > img = spimData.getSequenceDescription().getImgLoader().getSetupImgLoader( vd.getViewSetupId() ).getFloatImage( vd.getTimePointId(), false );
public static RandomAccessibleInterval< FloatType > openAtLowestLevelFloat( final ImgLoader imgLoader, final ViewId view, final AffineTransform3D t ) { final RandomAccessibleInterval< FloatType > input; if ( MultiResolutionImgLoader.class.isInstance( imgLoader ) ) { final MultiResolutionImgLoader mrImgLoader = ( MultiResolutionImgLoader ) imgLoader; final double[][] mipmapResolutions = mrImgLoader.getSetupImgLoader( view.getViewSetupId() ).getMipmapResolutions(); final int bestLevel = findLowestResolutionLevel( mrImgLoader, view ); IOFunctions.println( "(" + new Date(System.currentTimeMillis()) + "): Loading level " + Util.printCoordinates( mipmapResolutions[ bestLevel ] ) ); input = mrImgLoader.getSetupImgLoader( view.getViewSetupId() ).getFloatImage( view.getTimePointId(), bestLevel, false ); if ( t != null ) t.set( mrImgLoader.getSetupImgLoader( view.getViewSetupId() ).getMipmapTransforms()[ bestLevel ] ); } else { IOFunctions.println( "(" + new Date(System.currentTimeMillis()) + "): Loading full-resolution images :( " ); input = imgLoader.getSetupImgLoader( view.getViewSetupId() ).getFloatImage( view.getTimePointId(), false ); if ( t != null ) t.identity(); } return input; }
input = imgLoader.getSetupImgLoader( vd.getViewSetupId() ).getFloatImage( vd.getTimePointId(), false, LOAD_COMPLETELY ); else input = imgLoader.getSetupImgLoader( vd.getViewSetupId() ).getFloatImage( vd.getTimePointId(), false );
public static void main(String[] args) { GenericLoadParseQueryXML< SpimData2, SequenceDescription, ViewSetup, ViewDescription, ImgLoader, XmlIoSpimData2 > lpq = new GenericLoadParseQueryXML<>( new XmlIoSpimData2( "" ) ); lpq.queryXML(); SpimData2 data = lpq.getData(); ImgLoader il = data.getSequenceDescription().getImgLoader(); DefaultFlatfieldCorrectionWrappedImgLoader ffcil = new DefaultFlatfieldCorrectionWrappedImgLoader( il ); ffcil.setDarkImage( new ViewId( 0, 0 ), new File( "/Users/david/desktop/ff.tif" ) ); data.getSequenceDescription().setImgLoader( ffcil ); new ImageJ(); RandomAccessibleInterval< FloatType > image = data.getSequenceDescription().getImgLoader() .getSetupImgLoader( 0 ).getFloatImage( 0, false ); RandomAccessibleInterval< FloatType > downsampleBlock = MultiResolutionFlatfieldCorrectionWrappedImgLoader .downsampleHDF5( image, new int[] { 3, 3, 2 } ); ImageJFunctions.show( downsampleBlock, "" ); }
export.exportImage( ((ImgLoader)spimData.getSequenceDescription().getImgLoader()).getSetupImgLoader( viewId.getViewSetupId() ).getFloatImage( viewId.getTimePointId(), false ), name ); else
return (RandomAccessibleInterval< FloatType >) wrappedImgLoader.getSetupImgLoader( setupId ).getFloatImage( timepointId, false, hints );