// Plugins > Macros > Install... // Written for ImageJ 1.49m // This macro converts a folder of images that are not 8 bits to 8 bits using a chosen method of conversion. // User first chooses conversion method. // User then selects folder of files. // This version only opens files ending with the extension ".tif" and has only been tested with single image files. // RGB and 8 bit images are skipped. // The converted images are saved in the same folder as the original images but with "_8bit" added to the end of the file name. // This version has been only tested on Windows. The last time I wrote something like this for Mac, the files were saved // one folder higher than they should have. // 20141115 Michael.Cammer@med.nyu.edu // Let me know how this works, if you want changes, etc. // If you use this macro for data that are subsequently published, please acknowledge the OCS Microscopy Core at NYU Langone. // suggested changes for future: // work for single images, stacks, hyperstacks var options = newArray("Autocontrast", "12 bit linear max 4095", "14 bit linear max 16383", "16 bit linear max 65535"); var optionNum = newArray(-1, 4095, 16383, 65535); var openpath = ""; // where files will be opened from; global to avoid having to pass to functions //============================================================== macro "Make all 8 bit" { // requires ("v1.49m"); // commented out because as of 1.49k this command doesn't appear to work... max = getBitConversionMethod(); openPath = getDirectory("Choose a Directory"); fileList = getFileList(openPath); for (i=0; i