Hi everyone,
I'm working on a macro for colocalisation analysis and it's working OK except that I have to manually change the threshold values. Does anyone know if it's possible to add something into the macro that does a "refresh" of the threshold step so that each new image has a new automatic threshold set? I also thought of a "Wait for user" step so that the values could be changed as the macro progresses but that doesn't seem possible either. Cheers, Jacqui Jacqueline Ross Biomedical Imaging Microscopist Biomedical Imaging Research Unit (BIRU) School of Medical Sciences Faculty of Medical & Health Sciences The University of Auckland Private Bag 92019 Auckland 1142, NEW ZEALAND Telephone: Ext 87438; DDI: +64 9 923 7438 Website: http://www.auckland.ac.nz/biru -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
On Friday, 13 October 2017 02:51:22 BST [hidden email] wrote:
> Does anyone know if it's possible to add something into the macro that does > a "refresh" of the threshold step so that each new image has a new > automatic threshold set? > > I also thought of a "Wait for user" step so that the values could be changed > as the macro progresses but that doesn't seem possible either. Hi Jacqui, Would this work: selectImage(Your_image); setAutoThreshold("Default"); (or any other AutoThresh method)? Sorry if I misunderstood the question? Cheers Gabriel -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Gabriel,
Thanks for your reply. Thanks also to Volko who replied and has suggested a similar approach. The problem is that the JACOP plugin has its own automatic threshold built-in so I can't run the command separately. What I thought might work is to ask the JACOP window to close and then re-open for each image. However, I don't know how to do that and the macro code includes specific values for each image threshold. If I can determine values for all of the images, then it's OK because I just populate with that but it would be nice if I could have the automatic threshold applied. The upper limit is easy but it's the lower limit that I want the macro to automatically populate. This is the relevant line of code. run("JACoP ", "imga=[C1] imgb=[C3] thra=2591 thrb=912 pearson mm"); Cheers, Jacqui -----Original Message----- From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Gabriel Landini Sent: Friday, 13 October 2017 9:11 p.m. To: [hidden email] Subject: Re: JACOP - macro - changing thresholds On Friday, 13 October 2017 02:51:22 BST [hidden email] wrote: > Does anyone know if it's possible to add something into the macro that > does a "refresh" of the threshold step so that each new image has a > new automatic threshold set? > > I also thought of a "Wait for user" step so that the values could be > changed as the macro progresses but that doesn't seem possible either. Hi Jacqui, Would this work: selectImage(Your_image); setAutoThreshold("Default"); (or any other AutoThresh method)? Sorry if I misunderstood the question? Cheers Gabriel -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Jacqui
On 16/10/2017 0:02, Jacqui Ross wrote: > Hi Gabriel, > > Thanks for your reply. Thanks also to Volko who replied and has suggested a similar approach. > > The problem is that the JACOP plugin has its own automatic threshold built-in so I can't run the command separately. > > What I thought might work is to ask the JACOP window to close and then re-open for each image. However, I don't know how to do that and the macro code includes specific values for each image threshold. If I can determine values for all of the images, then it's OK because I just populate with that but it would be nice if I could have the automatic threshold applied. The upper limit is easy but it's the lower limit that I want the macro to automatically populate. > > This is the relevant line of code. > > run("JACoP ", "imga=[C1] imgb=[C3] thra=2591 thrb=912 pearson mm"); them in your cammand using either of two possibilities: 1. thra = 2591; thrb = 912; run("JACoP ", "imga=[C1] imgb=[C3] thra=&thra thrb=&thrb pearson mm"); or 2. thra = 2591; thrb = 912; run("JACoP ", "imga=[C1] imgb=[C3] thra="+d2s(thra,0)+" thrb="+d2s(thrb,0)+" pearson mm"); either way, the idea is to embed your value into the argument string. Hope that helps. --aryeh > Cheers, > > Jacqui > > -----Original Message----- > From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Gabriel Landini > Sent: Friday, 13 October 2017 9:11 p.m. > To: [hidden email] > Subject: Re: JACOP - macro - changing thresholds > > On Friday, 13 October 2017 02:51:22 BST [hidden email] wrote: >> Does anyone know if it's possible to add something into the macro that >> does a "refresh" of the threshold step so that each new image has a >> new automatic threshold set? >> >> I also thought of a "Wait for user" step so that the values could be >> changed as the macro progresses but that doesn't seem possible either. > Hi Jacqui, > > Would this work: > > selectImage(Your_image); > setAutoThreshold("Default"); > > (or any other AutoThresh method)? > Sorry if I misunderstood the question? > > Cheers > > Gabriel > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- Aryeh Weiss Faculty of Engineering Bar Ilan University Ramat Gan 52900 Israel Ph: 972-3-5317638 FAX: 972-3-7384051 -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Aryeh,
Thank you so much! The second suggestion is working! I am very happy. I just added in the getThreshold command and made thrb the lower one. This is the code in case someone else has the same issue. setAutoThreshold("Default dark"); getThreshold(lower,upper); thrb = (lower); run("JACoP ", "imga=[C1] imgb=[C3] thra="+d2s(thra,0)+" thrb="+d2s(thrb,0)+" pearson overlap mm"); Cheers, Jacqui Kind regards, Jacqui -----Original Message----- From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Aryeh Weiss Sent: Monday, 16 October 2017 3:22 p.m. To: [hidden email] Subject: Re: JACOP - macro - changing thresholds Hi Jacqui On 16/10/2017 0:02, Jacqui Ross wrote: > Hi Gabriel, > > Thanks for your reply. Thanks also to Volko who replied and has suggested a similar approach. > > The problem is that the JACOP plugin has its own automatic threshold built-in so I can't run the command separately. > > What I thought might work is to ask the JACOP window to close and then re-open for each image. However, I don't know how to do that and the macro code includes specific values for each image threshold. If I can determine values for all of the images, then it's OK because I just populate with that but it would be nice if I could have the automatic threshold applied. The upper limit is easy but it's the lower limit that I want the macro to automatically populate. > > This is the relevant line of code. > > run("JACoP ", "imga=[C1] imgb=[C3] thra=2591 thrb=912 pearson mm"); 1. thra = 2591; thrb = 912; run("JACoP ", "imga=[C1] imgb=[C3] thra=&thra thrb=&thrb pearson mm"); or 2. thra = 2591; thrb = 912; run("JACoP ", "imga=[C1] imgb=[C3] thra="+d2s(thra,0)+" thrb="+d2s(thrb,0)+" pearson mm"); either way, the idea is to embed your value into the argument string. Hope that helps. --aryeh > Cheers, > > Jacqui > > -----Original Message----- > From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Gabriel Landini > Sent: Friday, 13 October 2017 9:11 p.m. > To: [hidden email] > Subject: Re: JACOP - macro - changing thresholds > > On Friday, 13 October 2017 02:51:22 BST [hidden email] wrote: >> Does anyone know if it's possible to add something into the macro that >> does a "refresh" of the threshold step so that each new image has a >> new automatic threshold set? >> >> I also thought of a "Wait for user" step so that the values could be >> changed as the macro progresses but that doesn't seem possible either. > Hi Jacqui, > > Would this work: > > selectImage(Your_image); > setAutoThreshold("Default"); > > (or any other AutoThresh method)? > Sorry if I misunderstood the question? > > Cheers > > Gabriel > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- Aryeh Weiss Faculty of Engineering Bar Ilan University Ramat Gan 52900 Israel Ph: 972-3-5317638 FAX: 972-3-7384051 -- 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 |