protected static < T extends Type< T > > Img< FloatType > convertToFloat( final Img< T > input, final Converter< T, FloatType > c ) { final ImagePlusImg< FloatType, ? > output = new ImagePlusImgFactory< FloatType >().create( input, new FloatType() ); final Cursor< T > in = input.cursor(); final Cursor< FloatType > out = output.cursor(); while ( in.hasNext() ) { in.fwd(); out.fwd(); c.convert(in.get(), out.get()); } return output; } }