Batch macro

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

Batch macro

ERIC
Hi all,
I am trying to use the Batch macro function with this line of code :
run("Z Project...", "start=1 stop=9 projection=[Max Intensity]");
Output format is tiff
The files are saved in the correct folder but still as stacks and not as
projections.
Any comments ?


--

Eric Denarier
Grenoble Institut des Neurosciences
Inserm U836
Chemin Fortuné Ferrini
38700 La Tronche
France


Tél :33 (0)4 56 52 05 38
Fax :33 (0)4 56 52 06 57

http://neurosciences.ujf-grenoble.fr/

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

Re: Batch macro

Gabriel Landini
On Wednesday 03 Oct 2012 11:03:06 you wrote:
> Hi all,
> I am trying to use the Batch macro function with this line of code :
> run("Z Project...", "start=1 stop=9 projection=[Max Intensity]");
> Output format is tiff
> The files are saved in the correct folder but still as stacks and not as
> projections.
> Any comments ?

Probably because you have not "selected" the image to save, so it saves the
one which is currently selected.

Cheers
Gabriel

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

Re: Batch macro

Kota Miura
On Wed, Oct 3, 2012 at 12:19 PM, Gabriel Landini <[hidden email]>wrote:

> On Wednesday 03 Oct 2012 11:03:06 you wrote:
> > Hi all,
> > I am trying to use the Batch macro function with this line of code :
> > run("Z Project...", "start=1 stop=9 projection=[Max Intensity]");
> > Output format is tiff
> > The files are saved in the correct folder but still as stacks and not as
> > projections.
> > Any comments ?
>
> Probably because you have not "selected" the image to save, so it saves the
> one which is currently selected.
>
> Cheers
> Gabriel
>

... which would look something like

orgID = getImageID();
run("Z Project...", "start=1 stop=72 projection=[Max Intensity]");
projID = getImageID();
selectImage(orgID);
close();
selectImage(projID);

Kota




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



--

-------------------------------------------------------------*Dr. Kota Miura*

Scientist & IT Engineer
Centre for Molecular and Cellular Imaging,
European Molecular Biology Laboratory
Meyerhofstr. 1
69117 Heidelberg
GERMANY

Tel +49 6221 387 404

Mobile +49 160 95001177

Fax +49 6221 387 512

http://cmci.embl.de
-------------------------------------------------------------

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

Re: Batch macro

ERIC
In reply to this post by Gabriel Landini
I tried Kota's code (see below). It doesn't work.
A precision maybe : I am working with composite stacks (2 channels, 9 z)
I tried with 1 channel stack and it does the same.

orgID = getImageID();
run("Z Project...", "start=1 stop=9 projection=[Max Intensity]");
projID = getImageID();
selectImage(orgID);
close();
selectImage(projID);


Eric Denarier
Grenoble Institut des Neurosciences
Inserm U836
Chemin Fortuné Ferrini
38700 La Tronche
France


Tél :33 (0)4 56 52 05 38
Fax :33 (0)4 56 52 06 57

http://neurosciences.ujf-grenoble.fr/

Le 03/10/2012 12:19, Gabriel Landini a écrit :

> On Wednesday 03 Oct 2012 11:03:06 you wrote:
>> Hi all,
>> I am trying to use the Batch macro function with this line of code :
>> run("Z Project...", "start=1 stop=9 projection=[Max Intensity]");
>> Output format is tiff
>> The files are saved in the correct folder but still as stacks and not as
>> projections.
>> Any comments ?
> Probably because you have not "selected" the image to save, so it saves the
> one which is currently selected.
>
> Cheers
> Gabriel
>
> --
> 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
|

Re: Batch macro

dscho
Hi Eric,

On Wed, 3 Oct 2012, Eric Denarier wrote:

> I tried Kota's code (see below). It doesn't work.
> A precision maybe : I am working with composite stacks (2 channels, 9 z)
> I tried with 1 channel stack and it does the same.
>
> orgID = getImageID();
> run("Z Project...", "start=1 stop=9 projection=[Max Intensity]");
> projID = getImageID();
> selectImage(orgID);
> close();
> selectImage(projID);

Rather than letting Kota and Gabriel guess, why not making available your
macro and some example files? It takes such a needlessly long time to try
to reproduce problems...

Ciao,
Johannes

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

Re: Batch macro

ERIC
In reply to this post by Kota Miura
To clarify : the problem is only when I use the Process/Batch/macro.
If I use the macro directly on one stack it works great.
Maybe I do not use the function Process/Batch/macro correctly.
In the Batch Process windows output format is : tif
and Add Macro Code is : [Select from list]
I join a stack (reduced in size)
I upgraded imageJ to 1.47c : it is still not working

Here is the macro I used

original = getTitle();
run("Z Project...", "start=1 stop=9 projection=[Max Intensity]");
proj = getTitle();
selectImage(original);
close();
selectImage(proj);

Eric Denarier
Grenoble Institut des Neurosciences
Inserm U836
Chemin Fortuné Ferrini
38700 La Tronche
France


Tél :33 (0)4 56 52 05 38
Fax :33 (0)4 56 52 06 57

http://neurosciences.ujf-grenoble.fr/

Le 03/10/2012 12:25, Kota Miura a écrit :

>
>
> On Wed, Oct 3, 2012 at 12:19 PM, Gabriel Landini <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     On Wednesday 03 Oct 2012 11:03:06 you wrote:
>     > Hi all,
>     > I am trying to use the Batch macro function with this line of code :
>     > run("Z Project...", "start=1 stop=9 projection=[Max Intensity]");
>     > Output format is tiff
>     > The files are saved in the correct folder but still as stacks
>     and not as
>     > projections.
>     > Any comments ?
>
>     Probably because you have not "selected" the image to save, so it
>     saves the
>     one which is currently selected.
>
>     Cheers
>     Gabriel
>
>
> ... which would look something like
>
> orgID = getImageID();
> run("Z Project...", "start=1 stop=72 projection=[Max Intensity]");
> projID = getImageID();
> selectImage(orgID);
> close();
> selectImage(projID);
>
> Kota
>
>
>
>     --
>     ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
>
>
>
> --
> -------------------------------------------------------------
> *Dr. Kota Miura*
>
> Scientist & IT Engineer
> Centre for Molecular and Cellular Imaging,
> European Molecular Biology Laboratory
> Meyerhofstr. 1
> 69117 Heidelberg
> GERMANY
>
> Tel +49 6221 387 404
> Mobile +49 160 95001177
> Fax +49 6221 387 512
> http://cmci.embl.de  <http://cmci.embl.de/>
> -------------------------------------------------------------
>

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

composite_KarGTubC_6CMET-5_w21GFP_t1-1.tif (721K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Batch macro

Kota Miura
Hi Eric,

I reproduced your problem here.
I think you better write a full macro for that.

In the macro textbook I wrote,

http://cmci.embl.de/documents/ijcourses#macro_programming_in_imagej

you could refer to

p68. 2.5.2 Batch Processing of Files

and modify the code 23 in p71 to do your job.

Cheers,
Kota

On Wed, Oct 3, 2012 at 4:51 PM, Eric Denarier <[hidden email]
> wrote:

> To clarify : the problem is only when I use the Process/Batch/macro.
> If I use the macro directly on one stack it works great.
> Maybe I do not use the function Process/Batch/macro correctly.
> In the Batch Process windows output format is : tif
> and Add Macro Code is : [Select from list]
> I join a stack (reduced in size)
> I upgraded imageJ to 1.47c : it is still not working
>
> Here is the macro I used
>
> original = getTitle();
>
> run("Z Project...", "start=1 stop=9 projection=[Max Intensity]");
> proj = getTitle();
> selectImage(original);
> close();
> selectImage(proj);
>
>
> Eric Denarier
> Grenoble Institut des Neurosciences
> Inserm U836
> Chemin Fortuné Ferrini
> 38700 La Tronche
> France
>
>
> Tél :33 (0)4 56 52 05 38
> Fax :33 (0)4 56 52 06 57
>
> http://neurosciences.ujf-**grenoble.fr/<http://neurosciences.ujf-grenoble.fr/>
>
> Le 03/10/2012 12:25, Kota Miura a écrit :
>
>>
>>
>> On Wed, Oct 3, 2012 at 12:19 PM, Gabriel Landini <[hidden email]<mailto:
>> [hidden email]>> wrote:
>>
>>     On Wednesday 03 Oct 2012 11:03:06 you wrote:
>>     > Hi all,
>>     > I am trying to use the Batch macro function with this line of code :
>>     > run("Z Project...", "start=1 stop=9 projection=[Max Intensity]");
>>     > Output format is tiff
>>     > The files are saved in the correct folder but still as stacks
>>     and not as
>>     > projections.
>>     > Any comments ?
>>
>>     Probably because you have not "selected" the image to save, so it
>>     saves the
>>     one which is currently selected.
>>
>>     Cheers
>>     Gabriel
>>
>>
>> ... which would look something like
>>
>> orgID = getImageID();
>> run("Z Project...", "start=1 stop=72 projection=[Max Intensity]");
>> projID = getImageID();
>> selectImage(orgID);
>> close();
>> selectImage(projID);
>>
>> Kota
>>
>>
>>
>>     --
>>     ImageJ mailing list: http://imagej.nih.gov/ij/list.**html<http://imagej.nih.gov/ij/list.html>
>>
>>
>>
>>
>> --
>> ------------------------------**------------------------------**-
>> *Dr. Kota Miura*
>>
>>
>> Scientist & IT Engineer
>> Centre for Molecular and Cellular Imaging,
>> European Molecular Biology Laboratory
>> Meyerhofstr. 1
>> 69117 Heidelberg
>> GERMANY
>>
>> Tel +49 6221 387 404
>> Mobile +49 160 95001177
>> Fax +49 6221 387 512
>> http://cmci.embl.de  <http://cmci.embl.de/>
>> ------------------------------**------------------------------**-
>>
>>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.**html<http://imagej.nih.gov/ij/list.html>
>



--

-------------------------------------------------------------*Dr. Kota Miura*

Scientist & IT Engineer
Centre for Molecular and Cellular Imaging,
European Molecular Biology Laboratory
Meyerhofstr. 1
69117 Heidelberg
GERMANY

Tel +49 6221 387 404

Mobile +49 160 95001177

Fax +49 6221 387 512

http://cmci.embl.de
-------------------------------------------------------------

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

Re: Batch macro

Rasband, Wayne (NIH/NIMH) [E]
In reply to this post by ERIC
On Oct 3, 2012, at 6:03 AM, Eric Denarier wrote:

> Hi all,
> I am trying to use the Batch macro function with this line of code :
> run("Z Project...", "start=1 stop=9 projection=[Max Intensity]");
> Output format is tiff
> The files are saved in the correct folder but still as stacks and not as
> projections.
> Any comments ?

Upgrade to the ImageJ 1.47d daily build and this line of macro code will work as expected using the Process>Batch>Macro command. Change the code to

    run("Z Project...", "projection=[Max Intensity]");

and it will work with stacks of any size.

-wayne

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

Re: Batch macro

ERIC
Thanks Wayne,
It works nicely !!!

Eric Denarier
Grenoble Institut des Neurosciences
Inserm U836
Chemin Fortuné Ferrini
38700 La Tronche
France


Tél :33 (0)4 56 52 05 38
Fax :33 (0)4 56 52 06 57

http://neurosciences.ujf-grenoble.fr/

Le 05/10/2012 04:41, Rasband, Wayne (NIH/NIMH) [E] a écrit :

> On Oct 3, 2012, at 6:03 AM, Eric Denarier wrote:
>
>> Hi all,
>> I am trying to use the Batch macro function with this line of code :
>> run("Z Project...", "start=1 stop=9 projection=[Max Intensity]");
>> Output format is tiff
>> The files are saved in the correct folder but still as stacks and not as
>> projections.
>> Any comments ?
> Upgrade to the ImageJ 1.47d daily build and this line of macro code will work as expected using the Process>Batch>Macro command. Change the code to
>
>      run("Z Project...", "projection=[Max Intensity]");
>
> and it will work with stacks of any size.
>
> -wayne
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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