Running batch files

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Running batch files

Rosemary, Kevin
I am trying to measure individual particles from saved images.  I created a macro using the "record" feature which seemed to work fine.  However when I try to batch process it tells me "no images are open".   What I need is to have one window that gives me the number or particles in each image along with the size of the total area and another window that gives me individual measurements of each particle.  I attached the macro I created with the "record" feature.  Thanks for your help!


Kevin Rosemary
Maryland DNR Natural Resources Biologist
Cooperative Oxford Lab
904 South Morris Street
Oxford, MD 21654
Phone #: 410-226-5193 x131
Fax #: 410-226-0120
E-mail: [hidden email]<mailto:[hidden email]>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Running batch files

Krs5
Dear Kevin,

Your attached macro code did not make it to the list. Can you copy your code in an email so we can have a look at it?

Best wishes

Kees


Dr Ir K.R. Straatman
Senior Experimental Officer
Advanced Imaging Facility
Centre for Core Biotechnology Services
University of Leicester
http://www2.le.ac.uk/colleges/medbiopsych/facilities-and-services/cbs/lite/aif


-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Rosemary, Kevin
Sent: 16 May 2014 20:56
To: [hidden email]
Subject: Running batch files

I am trying to measure individual particles from saved images.  I created a macro using the "record" feature which seemed to work fine.  However when I try to batch process it tells me "no images are open".   What I need is to have one window that gives me the number or particles in each image along with the size of the total area and another window that gives me individual measurements of each particle.  I attached the macro I created with the "record" feature.  Thanks for your help!


Kevin Rosemary
Maryland DNR Natural Resources Biologist Cooperative Oxford Lab
904 South Morris Street
Oxford, MD 21654
Phone #: 410-226-5193 x131
Fax #: 410-226-0120
E-mail: [hidden email]<mailto:[hidden email]>

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

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Strange jython scripts behavior

Leon Espinosa-3
Dear developers, I have note this in FIJI : If you have a simple jython script like :

test_.py
IJ.showMessage("test")

And you put in the plugins folder and try to run it from the plugins menu (after re-start FIJI), it says :

"Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'IJ' is not defined"

But if you open the script editor, open the script (or any .py script) and run from the script editor , then all the .py scripts present in the plugins menu become available. Even if the script editor is closed.
Is there a possibility to start the jython interpreter automatically when you open the program ? It would it make easy to distribute simple .py scripts...

Thank you for your help... !

Leon

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Strange jython scripts behavior

dscho
Hi Leon,

please understand that by replying to Kees, you made your completely
unrelated question part of his thread.

On Mon, 19 May 2014, Leon Espinosa wrote:

> [if you put a .py script] in the plugins folder and try to run it from
> the plugins menu (after re-start FIJI), it says :
>
> "Traceback (most recent call last):
>   File "<string>", line 1, in <module>
> NameError: name 'IJ' is not defined"
>
> But if you open the script editor, open the script (or any .py script)
> and run from the script editor , then all the .py scripts present in the
> plugins menu become available.

This is a feature of the Script editor that Albert Cardona wanted a long
time ago: the editor auto-imports ImageJ 1.x' core classes. This is true
*only* for the editor.

Now, in hindsight (which is 20/20), it seems like a bad idea altogether:
it does not work for classes which differ only in their package names
(there are two Resizer classes, one in ij.plugin and one in
ij.plugin.filter, and that is *just* an example how fragile the
auto-import feature is), it is limited to ImageJ 1.x classes, and it
encourages sloppy programming comparable to .* imports in Java.

The fix is easy: just put

        from ij import IJ

into your .py script.

For your interest: the auto-import feature will be deprecated very soon,
therefore it is a good idea to switch your scripts to proper importing.

Ciao,
Johannes

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