Login  Register

Re: Batch processing Macro Help

Posted by Kenton Arkill on Jun 02, 2014; 7:55am
URL: http://imagej.273.s1.nabble.com/Batch-processing-Macro-Help-tp5007975p5007978.html

Hi
I think the main function you want are getFileList(). You can also create
folders (look up the functions with the help and note you may need to add
file separators) and such if you really need to for your work. What I mean
is you might be able to do all the transforms etc you want to do in one go.
Or rename the NO ones to XXXXNO.tif.

Not sure if it helps but I use the following for a similar problem with
.dm3 files where I want to make jpg mini versions for people (I've taken
out the size change bit):
dir = getDirectory("Choose a Directory");
list = getFileList(dir);
setBatchMode(true);
showStatus("Running...");
for (i=0; i<list.length; i++) {
path = dir+list[i];
if(endsWith(path, ".dm3")){// MAYBE if(list[i]==list[i-1]) TYPE LOOP HERE
open(path);   // OR OTHER IMPORT PLUGGIN
run("Enhance Contrast", "saturated=3"); // Change the 0.35 to a higher
number if jpgs too gray eg 2 or 5
// OR OTHER TRANSFORMATIONS
dotIndex = lastIndexOf(path, ".");
if (dotIndex!=-1){
path = substring(path, 0, dotIndex); // remove extension
save(path+".jpg"); // may want a different path here
}
close();
}
}
showStatus("Done");


On 1 June 2014 19:31, jarboe3142 <[hidden email]> wrote:

> I am requesting help on an image analysis macro.  I am not a programmer and
> could use any help you can afford.
> I would like to batch process hundreds of images in a single directory
> where
> the tool would analyze two images in a file name series and if something is
> different, make a copy in another directory.  Ideally I would have a
> threshold adjustment tool that I could adjust.
>
> Example:
> Img2 = Img1 –  YES, do nothing and move to next batch process
> Img3 = Img2 – NO, Make copy of Img3 in new directory and move to next batch
> process
> Img4 = Img3 - YES do nothing and move to next batch process
> Etc…
> Do anyone have a tool like this or can point me in the right direction.
>
> Thank you,
> Jeff
>
>
>
> --
> View this message in context:
> http://imagej.1557.x6.nabble.com/Batch-processing-Macro-Help-tp5007975.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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