Defining and using a 2D array (=matrix)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Defining and using a 2D array (=matrix)

Rafael Carazo-Salas
Hi all I have a kind of basic question :  how does one define a 2D array
(2D matrix) in ImageJ ?  I know that for a normal 1D array it is name =
newArray(size) .  Thanks in advance !





Rafael


_____________________________________________________________________

Rafael Edgardo Carazo Salas, Ph.D.
Cell Cycle Laboratory
Cancer Research UK, London Research Institute
44 Lincoln's Inn Fields
London WC2A 3PX, UNITED KINGDOM
Tel ::: +44 (0) 20 7269 3471
Fax ::: +44 (0) 20 7269 3258
_____________________________________________________________________
Reply | Threaded
Open this post in threaded view
|

Re: Defining and using a 2D array (=matrix)

Wayne Rasband
> Hi all I have a kind of basic question :  how does one define a
> 2D array (2D matrix) in ImageJ ?  I know that for a normal
> 1D array it is name = newArray(size) .  Thanks in advance !

The ImageJ macro language does not directly support 2D arrays. You have
to is either create an image and use getPixel() and setPixel(), or
create a 1D array using a = newArray(xmax*ymax) and do your own
indexing (e.g., value = a[x + y*xmax]).

-wayne
Reply | Threaded
Open this post in threaded view
|

Re: Defining and using a 2D array (=matrix)

Rafael Carazo-Salas
Hi Wayne thank you for the advice it works !   Kind regards ,





RECS




On Fri, 4 Nov 2005, Wayne Rasband wrote:

> > Hi all I have a kind of basic question :  how does one define a
> > 2D array (2D matrix) in ImageJ ?  I know that for a normal
> > 1D array it is name = newArray(size) .  Thanks in advance !
>
> The ImageJ macro language does not directly support 2D arrays. You have
> to is either create an image and use getPixel() and setPixel(), or
> create a 1D array using a = newArray(xmax*ymax) and do your own
> indexing (e.g., value = a[x + y*xmax]).
>
> -wayne
>