Posted by
Eric BADEL on
Mar 12, 2008; 2:44pm
URL: http://imagej.273.s1.nabble.com/Macro-question-test-if-a-point-is-within-selection-ROI-tp3696899p3696902.html
Hi,
Batch is clearly possible with ImageJ. You just need to write a macro
that load all the image in a directory and perform your image
processing. Here is a simple stupid example that just load each image
image, resize it and then save the resulting image.
Good luck
Eric
macro "Batch resize" {
dir = getDirectory("Choose a Directory ");
resizeDir = dir+"resized"+File.separator;
File.makeDirectory(resizeDir);
if (!File.exists(resizeDir))
exit("Unable to create resized directory");
list = getFileList(dir);
setBatchMode(true);
for (i=0; i<list.length; i++) {
path = dir+list[i];
showProgress(i, list.length);
if (!endsWith(path,"/")) open(path);
if (nImages>=1) {
x=getWidth();
y=getHeight();
if(x>y){
run("Size...", "width=400 height=300 constrain interpolate");
}
if(y>x){
run("Size...", "width=300 height=400 constrain interpolate");
}
saveAs("jpeg", resizeDir+getTitle());
close();
}
}
}
/// end Batch resize.
///
chen li a écrit :
> Hi all,
>
> I am pretty new to ImageJ.
>
> Now I use WCIF ImageJ to do the nucleus counting after
> taking pictures from the cells under microscope. It
> works great. But I have a question: Since I am going
> to process many pictures in one experiment is it
> possible to do bacth analysis for all of them, instead
> of opening one picture at a time?
>
>
> Thanks,
>
> L