http://imagej.273.s1.nabble.com/ImageJ-macro-question-tp5016450p5016464.html
I am a little mixed up.
Can you describe your issues more precise.
what do you expect that should happen.
second Roi in the list) in the image.
> I mean the first ROI in the ROI Manager, not the first identified by roiIndex array.
>
> If roiIndx length is 5, code chooses 2 ROIs, the second one the third one. the array will be something like (1,2,0,0,0)
>
> The first one (index of 0) is always chosen.
>
> Best
> Lai
>
> -----Original Message-----
> From: ImageJ Interest Group [mailto:
[hidden email]] On Behalf Of Peter Haub
> Sent: Wednesday, May 18, 2016 12:35 PM
> To:
[hidden email]
> Subject: Re: ImageJ macro question.
>
> Hello Lai,
>
> the first index in the array is always marked in the image.
> All indices in the array are selected in the list.
>
> newArray(0,3,5) will mark the first list Roi in the image.
> newArray(3,0,5) will mark the fourth list Roi in the image.
>
> What exactly do you want to work around?
>
> Have you check the 'Show all' option?
>
> Regards,
>
> Peter
>
>
> On 18.05.2016 17:52, Ding, Lai wrote:
>> It works. Thanks. Should try this before.
>>
>> Only a minor problem, the first ROIs is always selected, since the size of the roiIndex is set bigger than the selected ROI number. But I can work around it.
>>
>> Thanks
>> Lai
>>
>> -----Original Message-----
>> From: ImageJ Interest Group [mailto:
[hidden email]] On Behalf Of
>> Peter Haub
>> Sent: Wednesday, May 18, 2016 11:44 AM
>> To:
[hidden email]
>> Subject: Re: ImageJ macro question.
>>
>> Have you tried
>>
>> roiManager("Select", roiIndex);
>>
>> ?
>>
>> On 18.05.2016 15:25, Ding, Lai wrote:
>>> Thanks Peter.
>>>
>>> I guess I didn't state my question right.
>>>
>>> The selected ROIs can be (0,3,5), or (2,4), or (1,2,3,4,5). The code I have will generate the list base on other calculations.
>>> This list is saved in an array named "roiIndex"
>>>
>>> For instance, in case of (0,3,5) roiIndx[0]=0, roiIndex[1]=3,
>>> roiIndex[2]=5 in case of (1,2,3,4,5) roiIndx[0]=1, roiIndex[1]=2,
>>> roiIndex[2]=3, roiIndex[3]=4, roiIndex[4]=5,
>>>
>>> Then I need to incorporate the roiIndex array into the roiManager("Select", newArray(...)) function to select those ROIs.
>>>
>>> How should I do that?
>>>
>>> Thanks
>>> Lai
>>>
>>>
>>> -----Original Message-----
>>> From: ImageJ Interest Group [mailto:
[hidden email]] On Behalf Of
>>> Peter Haub
>>> Sent: Tuesday, May 17, 2016 5:26 PM
>>> To:
[hidden email]
>>> Subject: Re: ImageJ macro question.
>>>
>>> Hello Lai,
>>>
>>> your tmp must be an array of numbers - not a string.
>>> Omit the quotation marks in your second example:
>>>
>>> tmp = newArray(0,3,5);
>>> roiManager("Select", tmp);
>>>
>>> Peter
>>>
>>> On 17.05.2016 22:59, Lai Ding wrote:
>>>> Hello Everyone,
>>>>
>>>> I have a question regarding the macro programming on roiManager function.
>>>>
>>>> if I wan to select specific group of ROIs in the roiManager, I
>>>> can use line below
>>>>
>>>> roiManager("Select", newArray(0,3,5));
>>>>
>>>> this selects the 1st, 4th and 6th ROIs in the roiManager.
>>>>
>>>> however if I want to generate the specific groups through other functions, I don't know how to do it.
>>>>
>>>> I tried use lines below
>>>>
>>>> tmp = "newArray(0,3,5)";
>>>> roiManager("Select", tmp);
>>>>
>>>> it doesn't work.
>>>>
>>>> Thanks
>>>> Lai
>>>>
>>>> --
>>>> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>>> --
>>> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>>>
>>> --
>>> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>> --
>> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>>
>> --
>> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html