2D arrays in macro

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

2D arrays in macro

CARL Philippe (LBP)
Dear all,

For playing with 2D arrays within macros it is usually recommended to use a
picture object of given width and height and given types.

But this little trick doesn’t apply in the case of the string type.

So is there another solution that could be used for 2D arrays of string
types besides the solution of having a linear array and dealing myself with
the 2 dimensions?

I thank you very much in advance for your lightings.

My best regards,

Philippe

 

Philippe CARL

Laboratoire de Bioimagerie et Pathologies

UMR 7021 CNRS - Université de Strasbourg

Faculté de Pharmacie

74 route du Rhin

67401 ILLKIRCH

Tel : +33(0)3 68 85 41 84

 


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: 2D arrays in macro

Herbie
Good day Philippe,

AFAIK not for the macro-language!

Would using tables help?

Regards

Herbie

:::::::::::::::::::::::::::::::::::::::::::
Am 10.04.19 um 15:31 schrieb Philippe CARL:

> Dear all,
>
> For playing with 2D arrays within macros it is usually recommended to use a
> picture object of given width and height and given types.
>
> But this little trick doesn’t apply in the case of the string type.
>
> So is there another solution that could be used for 2D arrays of string
> types besides the solution of having a linear array and dealing myself with
> the 2 dimensions?
>
> I thank you very much in advance for your lightings.
>
> My best regards,
>
> Philippe
>
>  
>
> Philippe CARL
>
> Laboratoire de Bioimagerie et Pathologies
>
> UMR 7021 CNRS - Université de Strasbourg
>
> Faculté de Pharmacie
>
> 74 route du Rhin
>
> 67401 ILLKIRCH
>
> Tel : +33(0)3 68 85 41 84
>
>  
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: 2D arrays in macro

Fred Damen
In reply to this post by CARL Philippe (LBP)
Greetings,

There are two general schemes for dealing with multidimentional arrays in a 1D
array language:
a) Arrays of arrays - which require language support and extra overhead.
b) compute the 1D index from the dimensions and nD indices.

for(x=0; x<nx; x++)
   for(y=0; y<ny; y++)
      op(array[x+y*nx]);

Enjoy,

Fred

On Wed, April 10, 2019 8:31 am, Philippe CARL wrote:

> Dear all,
>
> For playing with 2D arrays within macros it is usually recommended to use a
> picture object of given width and height and given types.
>
> But this little trick doesn’t apply in the case of the string type.
>
> So is there another solution that could be used for 2D arrays of string
> types besides the solution of having a linear array and dealing myself with
> the 2 dimensions?
>
> I thank you very much in advance for your lightings.
>
> My best regards,
>
> Philippe
>
>
>
> Philippe CARL
>
> Laboratoire de Bioimagerie et Pathologies
>
> UMR 7021 CNRS - Université de Strasbourg
>
> Faculté de Pharmacie
>
> 74 route du Rhin
>
> 67401 ILLKIRCH
>
> Tel : +33(0)3 68 85 41 84
>
>
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html