stalling macro

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

stalling macro

Paul Batty
g'day folks,

I have modified the 'Batchmeasure' macro to suit my images. In place of the measure function I have replaced it with 'analyse particles', however when I run the macro all appears to work as required but after 10 images a page opens up saying "Plugin not found: ZVI_Reade" could anyone off some assistance as how to rectify this?

A second problem is keeping the link going, I have tried several versions " for (i=0; i<list.length; i++) {"  from the macro code all of which comes back with an error in the same line of code. Any help on this would be appreciated as well.

Thanks in advance
Paul.

My macro code is:

macro "Batch Measure" {
    requires("1.33n");
    dir = getDirectory("Choose a Directory ");
    list = getFileList(dir);
    start = getTime();
    setBatchMode(true); // runs up to 6 times faster
    for (i=0; i<list.length; i++) {
        path = dir+list[i];
        showProgress(i, list.length);
        if (!endsWith(path,"/")) open(path);
        if (nImages>=1) {
            run("Set Scale...", "distance=16 known=1 pixel=1 unit=mm global");
            run("8-bit");
            run("Threshold");
            run("Analyze Particles...", "size=0-Infinity circularity=0.00-1.00 show=Masks summarize");
            close();
        }
    }
  //print((getTime()-start)/1000);
}
Reply | Threaded
Open this post in threaded view
|

Re: stalling macro

Wayne Rasband
On Dec 14, 2006, at 10:02 AM, Paul Batty wrote:

> g'day folks,
>
> I have modified the 'Batchmeasure' macro to suit my images. In place
> of the measure function I have replaced it with 'analyse particles',
> however when I run the macro all appears to work as required but after
> 10 images a page opens up saying "Plugin not found: ZVI_Reade" could
> anyone off some assistance as how to rectify this?

Upgrade to the latest version of ImageJ. Version 1.37t fixed a bug that
caused ImageJ to attempt to open the invisible "Thumbs.db" files that
Microsoft puts in image directories using the ZVI_Reader plugin. It
turns out that Zeiss ZVI files and Thumbs.db files have the same "magic
number" (<http://en.wikipedia.org/wiki/Magic_number_(programming)>).

>  A second problem is keeping the link going, I have tried several
> versions " for (i=0; i<list.length; i++) {"  from the macro code all
> of which comes back with an error in the same line of code. Any help
> on this would be appreciated as well.

What do you mean by "keeping the link going"? What is the error message?

-wayne

> Thanks in advance
> Paul.
>
> My macro code is:
>
> macro "Batch Measure" {
>     requires("1.33n");
>     dir = getDirectory("Choose a Directory ");
>     list = getFileList(dir);
>     start = getTime();
>     setBatchMode(true); // runs up to 6 times faster
>     for (i=0; i<list.length; i++) {
>         path = dir+list[i];
>         showProgress(i, list.length);
>         if (!endsWith(path,"/")) open(path);
>         if (nImages>=1) {
>             run("Set Scale...", "distance=16 known=1 pixel=1 unit=mm
> global");
>             run("8-bit");
>             run("Threshold");
>             run("Analyze Particles...", "size=0-Infinity
> circularity=0.00-1.00 show=Masks summarize");
>             close();
>         }
>     }
>   //print((getTime()-start)/1000);
> }
>
Reply | Threaded
Open this post in threaded view
|

Re: stalling macro

Paul Batty
In reply to this post by Paul Batty
Wayne,

Many thanks for your reply. Overnight I managed to get the macro running, by rewriting the code (with a minor change of a single space), and updating the imageJ version. This fixed the problem. It has been a steep learning curve as I am new to writing code and imageJ.

By  "keeping the link going" I meant that each image would be processed with the results text remaining open (to be recorded) and the macro moving onto the next image for processing without any input from myself.

Many thanks for your help.

Best regards

Paul.

>>> [hidden email] 14/12/2006 22:16 >>>
On Dec 14, 2006, at 10:02 AM, Paul Batty wrote:

> g'day folks,
>
> I have modified the 'Batchmeasure' macro to suit my images. In place
> of the measure function I have replaced it with 'analyse particles',
> however when I run the macro all appears to work as required but after
> 10 images a page opens up saying "Plugin not found: ZVI_Reade" could
> anyone off some assistance as how to rectify this?

Upgrade to the latest version of ImageJ. Version 1.37t fixed a bug that
caused ImageJ to attempt to open the invisible "Thumbs.db" files that
Microsoft puts in image directories using the ZVI_Reader plugin. It
turns out that Zeiss ZVI files and Thumbs.db files have the same "magic
number" (<http://en.wikipedia.org/wiki/Magic_number_(programming)>).

>  A second problem is keeping the link going, I have tried several
> versions " for (i=0; i<list.length; i++) {"  from the macro code all
> of which comes back with an error in the same line of code. Any help
> on this would be appreciated as well.

What do you mean by "keeping the link going"? What is the error message?

-wayne

> Thanks in advance
> Paul.
>
> My macro code is:
>
> macro "Batch Measure" {
>     requires("1.33n");
>     dir = getDirectory("Choose a Directory ");
>     list = getFileList(dir);
>     start = getTime();
>     setBatchMode(true); // runs up to 6 times faster
>     for (i=0; i<list.length; i++) {
>         path = dir+list[i];
>         showProgress(i, list.length);
>         if (!endsWith(path,"/")) open(path);
>         if (nImages>=1) {
>             run("Set Scale...", "distance=16 known=1 pixel=1 unit=mm
> global");
>             run("8-bit");
>             run("Threshold");
>             run("Analyze Particles...", "size=0-Infinity
> circularity=0.00-1.00 show=Masks summarize");
>             close();
>         }
>     }
>   //print((getTime()-start)/1000);
> }
>