@Override public NativeImg< T, IntArray > createIntInstance( long[] dimensions, final int entitiesPerPixel ) { if ( dimensions.length > 5 ) throw new RuntimeException( "Unsupported dimensionality: " + dimensions.length ); return new IntImagePlus< T >( dimensions, entitiesPerPixel ); }
public static IntImagePlus<ARGBType> wrapRGBA( final ImagePlus imp ) { if ( imp.getType() != ImagePlus.COLOR_RGB) return null; final IntImagePlus< ARGBType > container = new IntImagePlus< ARGBType >( imp ); // create a Type that is linked to the container final ARGBType linkedType = new ARGBType( container ); // pass it to the DirectAccessContainer container.setLinkedType( linkedType ); return container; }