Login  Register

macro to batch auto adjust levels

Posted by Uknalis, Joseph-2 on Apr 22, 2020; 2:09pm
URL: http://imagej.273.s1.nabble.com/macro-to-batch-auto-adjust-levels-tp5023255.html

Hey folks-

I'm trying to write this script but it does not work & I'm not versed enough to see the errors.

  dir1 = getDirectory("Choose Source Directory ");

  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]);
     close();
  }

// Resets the display range of the current
// image so it is the same is the pixel
// value range.
resetMinAndMax();
saveAs(<format>, dir2+list[i]);
close();
  }

or is there a way to add the desired macro to Process>BATCH> MACRO drop down list??

  thanks

Joe





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