docs/examples/ImageData.java
/**
     * Plot Data
     *
     * @param dataArray data array
     */
Plot Data
@param dataArray data array
Plot Data @param dataArray data array
private static void plotData(DataArray dataArray) {
        byte[] img_data = new byte[(int) dataArray.getDataExtent().getElementsProduct()];
        dataArray.getData(img_data, dataArray.getDataExtent(), new NDSize());
        try {
            BufferedImage img = ImageIO.read(new ByteArrayInputStream(img_data));
            ImageIO.write(img, "png", new java.io.File("image_data_output.png"));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
private static void plotData ( DataArray dataArray ) { byte [ ] img_data = new byte [ ( int ) dataArray . getDataExtent ( ) . getElementsProduct ( ) ] ; dataArray . getData ( img_data , dataArray . getDataExtent ( ) , new NDSize ( ) ) ; try { BufferedImage img = ImageIO . read ( new ByteArrayInputStream ( img_data ) ) ; ImageIO . write ( img , "png" , new java . io . File ( "image_data_output.png" ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } }
Plot Data
 @param dataArray data array
Plot Data @param dataArray data array
// get image bytes // create image from bytes // write to file