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 |
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 |
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 |
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 |
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 |
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 |
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 |
Sorry Lai
I am a little mixed up. Can you describe your issues more precise. What is roiIndx? Is that the array used in the roiManager command? Is it the same as roiIndex? What means "code chooses 2 Rois"? Why is the length of the array 5 while you only want to select two Rois? Does your code create an array roiIndex from roiIndx? What is the exact command you are using? Can you give a code example and a clear description what happens and what do you expect that should happen. What means "chosen"? Chosen in the list or in the image? In my test even roiManager("Select", newArray(1,2,0,0,0)); selects correctly Roi 0, Roi 1 and Roi 2 in the list and mark Roi 1 (the second Roi in the list) in the image. If you want to select only Roi 1 (second one in the list) and Roi 2 (third one in the list) in the list then you should use the command roiManager("Select", newArray(1,2)); Hope this helps Peter On 18.05.2016 18:58, Ding, Lai wrote: > 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 -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |