Here you can find the source of pixels2Molecules(float[] pixels, int width, int height)
public static float[][] pixels2Molecules(float[] pixels, int width, int height)
//package com.java2s; /******************************************************************************* * Copyright (c) 2013 Jay Unruh, Stowers Institute for Medical Research. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Public License v2.0 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html ******************************************************************************/ public class Main { public static float[][] pixels2Molecules(float[] pixels, int width, int height) { float[][] mols = new float[width][height - 1]; for (int i = 0; i < (height - 1); i++) { for (int j = 0; j < width; j++) { mols[j][i] = pixels[j + (i + 1) * width]; }/*from w w w . ja v a2s. co m*/ } return mols; } }