Posted by
Aryeh Weiss on
Oct 16, 2017; 2:22am
URL: http://imagej.273.s1.nabble.com/JACOP-macro-changing-thresholds-tp5019529p5019535.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");
I you determine the parameters externally, you should be able to include
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