Weird naming behavior of the batchMode

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

Weird naming behavior of the batchMode

CARL Philippe (LBP)
Dear all,
In the case I launch the following macro:
        run("Blobs (25K)");
        run("Blobs (25K)");
        run("Blobs (25K)");
I will get 3 pictures named "blobs.gif", "blobs-1.gif" and "blobs-2.gif".
And "blobs-3.gif", "blobs-4.gif" and "blobs-5.gif" in the case I launch the code again.
But I the case I lauch the following macro code:
        setBatchMode(true);
        run("Blobs (25K)");
        run("Blobs (25K)");
        run("Blobs (25K)");
        setBatchMode("exit and display");
The 3 outputted pictures will all have the name "blobs.gif".
And in the case I launch the macro a second time, I get 1 picture named "blobs-1.gif" and 2 pictures named "blobs.gif".
And if I launch it a third time, I get 1 picture named "blobs-2.gif" and 2 pictures named "blobs.gif" and so on.
Have a nice end of week-end.
My best regards,
Philippe

Philippe CARL
Laboratoire de Bioimagerie et Pathologies
UMR 7021 CNRS - Université de Strasbourg
Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 42 89

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

Re: Weird naming behavior of the batchMode

Wayne Rasband-2
This is the expected behavior. Opened images with duplicate names are not renamed if they are not displayed. It is a good idea to avoid using image names to select images. Instead, use image IDs or image indexes. The following example macro opens and processes three copies of the blobs sample image.

-wayne

   close("*");
   setBatchMode(true);
   run("Blobs (25K)");
   run("Blobs (25K)");
   run("Blobs (25K)");
   for (i=1; i<=nImages; i++) {
      selectImage(i);
      run("Variance...", "radius=2");
   }
   setBatchMode("exit and display");
   run("Tile”);

> On May 2, 2021, at 1:47 PM, CARL Philippe (LBP) <[hidden email]> wrote:
>
> Dear all,
> In the case I launch the following macro:
> run("Blobs (25K)");
> run("Blobs (25K)");
> run("Blobs (25K)");
> I will get 3 pictures named "blobs.gif", "blobs-1.gif" and "blobs-2.gif".
> And "blobs-3.gif", "blobs-4.gif" and "blobs-5.gif" in the case I launch the code again.
> But I the case I lauch the following macro code:
> setBatchMode(true);
> run("Blobs (25K)");
> run("Blobs (25K)");
> run("Blobs (25K)");
> setBatchMode("exit and display");
> The 3 outputted pictures will all have the name "blobs.gif".
> And in the case I launch the macro a second time, I get 1 picture named "blobs-1.gif" and 2 pictures named "blobs.gif".
> And if I launch it a third time, I get 1 picture named "blobs-2.gif" and 2 pictures named "blobs.gif" and so on.
> Have a nice end of week-end.
> My best regards,
> Philippe

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