s=File.separator; w=1; h=1; c=1; slc=1; f=1; Dialog.create("Bruker Data Manager"); Dialog.addCheckbox("Input Directory = Output Directory", false); Dialog.addMessage("Image Extraction from Raw Data:"); Dialog.addCheckbox("Extract Files from RAW Data", false); Dialog.addMessage("(Make sure there are no RAWDATA Folders!)"); Dialog.addMessage("Delete Files:"); Dialog.addCheckbox("Delete Extracted Files", false); Dialog.show(); inDisOutD=Dialog.getCheckbox(); Extr=Dialog.getCheckbox(); DelExtr=Dialog.getCheckbox(); inDir=getDirectory("Choose the Raw Data Containing Folder"); if (inDisOutD==true) { outDir=inDir; } else { outDir=getDirectory("Choose Output Folder"); if ((inDir==outDir) || (startsWith(outDir, inDir))) { exit("Input folder must be different from and not within output folder!"); } } inDir1=inDir; setBatchMode(true); if (Extr==true) { ExtractFiles(inDir); } if (DelExtr==true) { DeleteFiles(outDir); } setBatchMode(false); function ExtractFiles(inDir) { list = getFileList(inDir); for (i=0; i1) { Stack.setChannel(1); resetMinAndMax(); Stack.setChannel(2); resetMinAndMax(); saveAs("tiff", replace(ExtractedFilePath, ".xml", "_Stack_Extr.tif")); } else { saveAs("tiff", replace(ExtractedFilePath, ".xml", "_Extr.tif")); } run("Close All"); run("Collect Garbage"); close("Log"); } } } } function DeleteFiles(outDir) { list = getFileList(outDir); for (i=0; i