Two Dimensional Arrays
Posted by David Sykes-2 on Sep 22, 2005; 11:19pm
URL: http://imagej.273.s1.nabble.com/Two-Dimensional-Arrays-tp3704799.html
I have a text file containing 2,408,448 ascii floating-point values separated by spaces.
These represent height values of my local area (North Wales) arranged as 1344 rows wach containing 1792 columns.
I am trying to read these into a two-dimensional array that can then be easily 'cutup' into smaller tiles, at the
smallest level 1024 tiles 56x42 in size.
ImageJ accepted the following JavaScript statements :-
var DEM = newArray(numColumns); // DEM = 'digital elevation model'
for(i=0;i<numColumns;i++)
{
DEM[i] = newArray(numColumns); // this should create a 2D array
}
Attempts to fill the array so created (if it was) with this failed :-
DEM[row][column] = some value.
Is there an alternative way of doing this ?
David Sykes
Wales, UK