Demonstration of transport of a patterned electron beam produced by diamond pyramid cathode in an rf gun