Hi Christophe,
How are you doing ?
Within the following macro code:
        lutB = getList("LUTs");
        lutA = Array.concat(lutB, lutB);
        lutA = Array.concat(lutB, getList("LUTs"));
        lutA = Array.concat(getList("LUTs"), lutB);
        Array.show(lutA);
The first line defining lutA is working as the two following ones will be 
falling.
So it is the getList("LUTs") that is not well interpreted.
Nevertheless the interpreter is correctly going up to this line:
        
https://github.com/imagej/ImageJ/blob/master/ij/macro/Functions.java#L4948
I checked this by adding an "IJ.log(array[i]);" just after this line.
But what is returned is thus not interpreted as an array.
In the same time I don't really understand the content of this last reached 
line which is:
        array[i] = new Variable(0, 0.0, list[i]);
and thus beyond my understanding.
Indeed, why not just return the "IJ.getLuts();" of line 4945?
Kindest 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 41

----- Mail original -----
De: "Christophe Leterrier" <[email protected]>
À: "imagej" <[email protected]>
Envoyé: Mardi 10 Septembre 2024 17:44:48
Objet: Concatenation of arrays in macro code - bug?

Hi,

Consider the following macro code:

lutB = getList("LUTs");
lutC=Array.concat(newArray("Null"),lutB);
Array.show(lutC);
lutA = Array.concat(newArray("Null"), getList("LUTs"));
Array.show(lutA);

The first part runs fine and displays the LUTs with an added "Null"
element. The second part fails with the error message:

Error: Array expected in line 5:
lutA = Array . concat ( newArray ( "Null" ) , <getList> ( "LUTs" ) ) ;

Is this behavior expected or is it a bug?

Thank you,

Christophe

--
Christophe Leterrier
NeuroCyto lab
INP CNRS UMR 7051
Aix Marseille University, France

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

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

Reply via email to