Hi Michel,
I had a look at your query today and I have a solution for you to try.
It's working on my Zeiss .lsm files. It's actually a modification of a
macro written by Ved Sharma last year.
I have attached it here but also put the text below. It creates a folder
for you called Max Projections. You don't need to use the Process -
Batch command since the directory is already written in. Just save the
file into your macros folder, then go to Plugins - Macros - Install. If
you want to, you can rename it with an underscore at the beginning of
the name and put it in your Plugins folder. It will then show up in your
Plugins list whenever you launch Fiji (or ImageJ). You need to have the
Bioformats plugin (LOCI) installed.
Someone else may be able to further modify it to make it more elegant.
path = getDirectory("Choose a Directory");
filename = getFileList(path);
newDir = path + "Max Projections" + File.separator;
if (File.exists(newDir))
exit("Destination directory already exists; remove it and then run
this macro again");
File.makeDirectory(newDir);
for (i=0; i<filename.length; i++) {
if(endsWith(filename[i], ".lsm")) {
open(path+filename[i]);
run("Z Project...", "projection=[Max Intensity]");
run("Channels Tool... ");
Stack.setDisplayMode("composite");
run("Stack to RGB");
saveAs("tiff", newDir + getTitle);
close(); close();close();
}
}
Good luck!
Kind regards,
Jacqui
Jacqueline Ross
Biomedical Imaging Microscopist
Biomedical Imaging Research Unit
School of Medical Sciences
Faculty of Medical & Health Sciences
The University of Auckland
Private Bag 92019
Auckland, NEW ZEALAND
Tel: 64 9 373 7599 Ext 87438
Fax: 64 9 373 7484
http://www.fmhs.auckland.ac.nz/sms/biru/-----Original Message-----
From: ImageJ Interest Group [mailto:
[hidden email]] On Behalf Of
Michel Herde
Sent: Tuesday, 15 February 2011 11:32 a.m.
To:
[hidden email]
Subject: batch macro only opens files
Hi,
I just recorded my own macro to make a maximal projection of a stack and
then merge the channels.
run("Make Composite");
run("Z Project...", "start=1 stop=100 projection=[Max Intensity]");
run("Flatten");
I want to batch process a whole folder with stacks in lsm format.
However, when I run the batch, it actually only opens the stacks, but
doesn't do anything to them. What am I doing wrong?
thanks a lot!
FIJI beginner Michel