macro "Tiff Converter Plus" { s = File.separator; lsm = false; lif = false; tree = false; //DIALOG rows = 3; columns = 2; n = rows*columns; labels = newArray("Z-Project","Composite","RGB-Comp","Brightness/contrast(manual)","Scale bar");//,"blank","blank"); defaults = newArray(0,0,0,0,0); Dialog.create("options"); Dialog.addMessage("-----------------------------------------------------------------------------------"); Dialog.addChoice("Which image types should be affected?", newArray(".lsm", ".lif", "both")); Dialog.addChoice("Where should the processed images be saved?", newArray("input = output", "all in one Folder", "copy Tree")); Dialog.addCheckbox("Overwrite already processed Images? (checked for every processing step)", 1) Dialog.addMessage("-----------------------------------------------------------------------------------"); Dialog.addMessage("Processing: "); Dialog.addCheckboxGroup(rows,columns,labels,defaults); Dialog.addMessage("-----------------------------------------------------------------------------------"); Dialog.addCheckbox("keep Log?", 1); Dialog.addCheckbox("save Log?", 0); Dialog.show(); //DIALOG VALUES type = Dialog.getChoice(); sav = Dialog.getChoice(); over = Dialog.getCheckbox(); zpro = Dialog.getCheckbox(); comp = Dialog.getCheckbox(); Rcom = Dialog.getCheckbox(); InCo = Dialog.getCheckbox(); sbar = Dialog.getCheckbox(); //blan = Dialog.getCheckbox(); //bla2 = Dialog.getCheckbox(); lg = Dialog.getCheckbox(); ls = Dialog.getCheckbox(); //Z- PRojection Intensity if (zpro) { Dialog.create("Z- Projection"); Dialog.addChoice("Intensity:", newArray("Max Intensity", "Average Intensity")); Dialog.show(); t= Dialog.getChoice(); if (t=="Max Intensity") protype = "projection=[Max Intensity]"; if (t=="Average Intensity") protype = "projection=[Average Intensity]"; } //SCALE BAR if (sbar) { Dialog.create("Scale Bar"); Dialog.addNumber("Width:", 25); Dialog.addCheckbox("Overlay?", 1); wi= Dialog.getNumber(); ov = Dialog.getCheckbox(); if (ov) overlay = "overlay"; else overlay = ""; } dir = getDirectory("Choose a Directory"); print("image types: "+type); print("save Folder: "+sav); print("Overwrite? "+over); print("-----Processing-----"); print("Z-Project: "+zpro); if (zpro) print("Intensity: "+protype); print("Composite: "+comp); print("RGB-composite: "+Rcom); print("Intensitie/Contrast: "+InCo); print("----------------------------------------"); if(type==".lsm") lsm = true; if(type==".lif") lif = true; if(type=="both"){ lsm = true; lif = true; } if (sav=="all in one Folder") { trgt = getDirectory("Choose a target"); } if (sav=="copy Tree") { tree = getDirectory("Choose a target for first Folder"); clean = tree; } searchFolder(dir,tree); if (sav=="copy Tree") { print("cleanup"); cleanup(clean); } print("All done"); if (ls) { selectWindow("Log"); getDateAndTime(year, month, dayOfWeek, dayOfMonth, hour, minute, second, msec); saveAs("Text", dir+s+"Fiji_Log_"+dayOfMonth+"-"+month+1+"-"+year+" Time_"+hour+"-"+minute+"-"+second); } if (!lg) { wait(2000); close("Log"); } function searchFolder(directory,tree){ list = getFileList(directory); for (i=0; i