public static FloatImagePlus<FloatType> wrapFloat( final ImagePlus imp ) { if ( imp.getType() != ImagePlus.GRAY32) return null; final FloatImagePlus<FloatType> container = new FloatImagePlus<FloatType>( imp ); // create a Type that is linked to the container final FloatType linkedType = new FloatType( container ); // pass it to the DirectAccessContainer container.setLinkedType( linkedType ); return container; }
final int offsetY = rectangle.y - extraSize/2; final int[] location = new int[ source.numDimensions() ]; offsetX + img.getDimension( 0 ) < source.dimension( 0 ) && offsetY + img.getDimension( 1 ) < source.dimension( 1 ) ) positionable = source.randomAccess();
@Override public NativeImg< T, FloatArray > createFloatInstance( long[] dimensions, final int entitiesPerPixel ) { if ( dimensions.length > 5 ) throw new RuntimeException( "Unsupported dimensionality: " + dimensions.length ); return new FloatImagePlus< T >( dimensions, entitiesPerPixel ); }
imp = source.getImagePlus();