Login  Register

Re: using BAR Distribution plotter in a macro script

Posted by Krs5 on Jun 22, 2020; 5:11pm
URL: http://imagej.273.s1.nabble.com/using-BAR-Distribution-plotter-in-a-macro-script-tp5023555p5023562.html

Dear Aryeh

The macro code below works fine on my Windows10 system

-----------------------------
run("Set Measurements...", "area mean standard min limit redirect=None decimal=3");
run("Blobs (25K)");
setAutoThreshold("Default");
run("Analyze Particles...", "display");
run("Distribution Plotter", "parameter=Mean tabulate=[Number of values] automatic=[Specify manually below:] bins=50");
--------------------------------------------

Best wishes

Kees


Advanced Imaging Facility

University of Leicester
www.le.ac.uk/advanced-imaging-facility<http://www.le.ac.uk/advanced-imaging-facility>


________________________________
From: Aryeh Weiss <[hidden email]>
Sent: 22 June 2020 15:13
Subject: using BAR Distribution plotter in a macro script

I am trying to use the distribution plotter in a macro script. Here is
what the macro recorder provides me:

run("Distribution Plotter", "parameter=Mean tabulate=[Number of values]
automatic=[Specify manually below:] bins=50");

However, if I run this, is tells me "Automatic binning could not be
performed. Re-check settings or specify bins manually."

I looked at the source code here:
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftferr%2FScripts%2Fblob%2Fmaster%2FBAR%2Fsrc%2Fmain%2Fresources%2Fscripts%2FBAR%2FData_Analysis%2FDistribution_Plotter.ijm&amp;data=02%7C01%7Ckrs5%40leicester.ac.uk%7Ccc0518724efb4fc084ca08d816b788f8%7Caebecd6a31d44b0195ce8274afe853d9%7C0%7C0%7C637284324825936320&amp;sdata=7gPg%2FScv8NARdEYv9dxefFQKQQTuB4qnhgoNyKmu4qw%3D&amp;reserved=0

and found that this message will happen with max-min is 0. This should
not be the case assuming I have a results table open, and it does not
happen when I run the script manually.

So i tried to use a local copy of the script (copied from github and
saved locally) so that i could add some print statements and try to
figure out what is happening.
The command I tried is
run("script:/home/amw/Desktop/83411LightMicroscopyData/studentDataSets/distPlot.ijm",
"parameter=Mean tabulate=[Number of values] automatic=[Specify manually
below:] bins=415");

However, this returns :

     ---
     <Error: java.io.FileNotFoundException:
https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwsr.imagej.net%2Fdownload%2FExamples%2FMacro%2Fscript%3A%2Fhome%2Famw%2FDesktop%2F83411LightMicroscopyData%2FstudentDataSets%2FdistPlot.ijm&amp;data=02%7C01%7Ckrs5%40leicester.ac.uk%7Ccc0518724efb4fc084ca08d816b788f8%7Caebecd6a31d44b0195ce8274afe853d9%7C0%7C0%7C637284324825936320&amp;sdata=vjG6m0z%2BXgfoqb1xjrzE2eWCeVfNIaAlqQqu6BL85M0%3D&amp;reserved=0>
in line 1:

     var ; initializeSciJavaParameters ( ) ; run (
"script:/home/amw/Desktop/83411LightMicroscopyData/studentDataSets/distPl...

So I have two questions:

1. How do I run the Distribution plotter from a macro?

2. How so I run any macro that is in a file from a macro?

I have a feeling that this second question maybe related to the use of
BARlib, which I have not succeeded in figuring out -- I am missing some
understanding of how that works. Maybe someone has a really simple
example of how to use that.

Thanks in advance\
--aryeh

--
Aryeh Weiss
Faculty of Engineering
Bar Ilan University
Ramat Gan 52900 Israel

Ph:  972-3-5317638
FAX: 972-3-7384051


--
ImageJ mailing list: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fimagej.nih.gov%2Fij%2Flist.html&amp;data=02%7C01%7Ckrs5%40leicester.ac.uk%7Ccc0518724efb4fc084ca08d816b788f8%7Caebecd6a31d44b0195ce8274afe853d9%7C0%7C0%7C637284324825936320&amp;sdata=FN%2F4AA96hGwKlxlzjLg4N1%2Fcbm8xiHDhokoYNsVb4wA%3D&amp;reserved=0

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