// author: Matthias Muelke; Institut für Experimentelle Unfallchirurgie Gießen dir1=getDirectory("Input"); dir2=getDirectory("Working directory"); Dialog.create("settings"); Dialog.addNumber("scale [pixels/µm] (microscope)", 1.55); Dialog.addNumber("downsizing", 0.25); Dialog.addMessage(""); Dialog.addCheckbox("Thickness", true); Dialog.addCheckbox("Separation", true); Dialog.addCheckbox("Area", true); Dialog.show(); scale = Dialog.getNumber(); downsizing = Dialog.getNumber();; mode_Th = Dialog.getCheckbox();;; mode_Sep = Dialog.getCheckbox();;;; mode_Area = Dialog.getCheckbox();;;;; s=scale*downsizing ; if(File.exists(dir2+"Thickness")) { print("folder already exists"); }else{ myDir3=dir2+"Thickness"+File.separator; File.makeDirectory(myDir3); print("new folder created"); } dir3=dir2+"Thickness\\"; if(File.exists(dir2+"Separation")) { print("folder already exists"); }else{ myDir4=dir2+"Separation"+File.separator; File.makeDirectory(myDir4); print("new folder created"); } dir4=dir2+"Separation\\"; setBatchMode(false); list = getFileList(dir1); for (j=0; j0) { selectImage(nImages); close(); } } MonthNames = newArray("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"); DayNames = newArray("Sun", "Mon","Tue","Wed","Thu","Fri","Sat"); getDateAndTime(year, month, dayOfWeek, dayOfMonth, hour, minute, second, msec); TimeString =DayNames[dayOfWeek]+"_"; if (dayOfMonth<10) {TimeString = TimeString+"0";} TimeString = TimeString+dayOfMonth+"-"+MonthNames[month]+"-"+year+"_"; if (hour<10) {TimeString = TimeString+"0";} TimeString = TimeString+hour+"-"; if (minute<10) {TimeString = TimeString+"0";} TimeString = TimeString+minute+"-"; if (second<10) {TimeString = TimeString+"0";} TimeString = TimeString+second; if (mode_Sep==0 && mode_Th==0) { }else{ if (mode_Sep==1 && mode_Th==1) { saveAs("Results", dir2+"Results_Thickness+Separation_"+TimeString+".xls"); }else{ if (mode_Th==1) { saveAs("Results", dir2+"Results_Thickness_"+TimeString+".xls"); } if (mode_Sep==1) { saveAs("Results", dir2+"Results_Separation_"+TimeString+".xls"); } } selectWindow("Results"); run("Close"); if (mode_Sep==1) { selectWindow("ROI Manager"); run("Close"); } } if (mode_Area==1) { list = getFileList(dir1); setBatchMode( true ); run("Set Measurements...", "area area_fraction redirect=None decimal=3"); for (j=0; j