Here you can find the source of sortPixels(double[] data, int numPixel)
public static double[][] sortPixels(double[] data, int numPixel)
//package com.java2s; //License from project: Open Source License public class Main { /**//w w w . ja v a2 s . c o m * Return a 2D array */ public static double[][] sortPixels(double[] data, int numPixel) { int roi = data.length / numPixel; double[][] pixels = new double[numPixel][roi]; for (int pix = 0; pix < numPixel; pix++) { for (int slice = 0; slice < roi; slice++) { int pixId = pix * roi + slice; double value = data[pixId]; pixels[pix][slice] = value; } } return pixels; } }