Login  Register

batch adjust levels

Posted by Uknalis, Joseph-2 on Feb 03, 2020; 7:08pm
URL: http://imagej.273.s1.nabble.com/batch-adjust-levels-tp5022910.html

Hiya, I'm trying to create a macro that will AUTO adjust all the images in one folder and place them in another.

So far I can select the folders but it barfs on the function.
Is resetMandMax another function call I have to write in?

  Thanks

Joe


dir1 = getDirectory("Choose Source Directory ");format = getFormat();
dir2 = getDirectory("Choose Destination Directory ");list = getFileList(dir1);
setBatchMode(true);
for (i=0; i<list.length; i++) {
showProgress(i+1, list.length);
open(dir1+list[i]);

// Resets the display range of the current
// image so it is the same is the pixel
// value range.
macro "Reset Display Range"
{ resetMinAndMax();
saveAs(format, dir2+list[i]);
close();}





This electronic message contains information generated by the USDA solely for the intended recipients. Any unauthorized interception of this message or the use or disclosure of the information it contains may violate the law and subject the violator to civil or criminal penalties. If you believe you have received this message in error, please notify the sender and delete the email immediately.

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