Posted by
CARL Philippe (LBP) on
Apr 22, 2020; 3:52pm
URL: http://imagej.273.s1.nabble.com/macro-to-batch-auto-adjust-levels-tp5023255p5023257.html
Dear Joseph,
Give a try to the following modified macro code:
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]);
resetMinAndMax();
saveAs("tiff", dir2+list[i]);
close();
}
I didn't try it (thus there may be some typo errors), but I think it will be doing what you were looking for.
My best regards,
Philippe
Philippe CARL
Laboratoire de Bioimagerie et Pathologies
UMR 7021 CNRS - Université de Strasbourg
Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 42 89
----- Le 22 Avr 20, à 16:09, Uknalis, Joseph
[hidden email] a écrit :
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--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html