path = File.openDialog("Select a File"); //open(path); // open the file dir = File.getParent(path); name = File.getName(path); origdir=dir; dir=dir+"\\unmixed_tifs\\RGB\\"; list=getFileList(dir); path=dir + list[1]; //print( getImageID()); print (path) run("Image Sequence...", "open=[path] sort"); //print( getImageID()); run("Make Composite"); //waitForUser("Sorry. I'm Lazy","Click the window named RGB that just opened then press ok"); //print( getImageID()); selectWindow("RGB") //run("Brightness/Contrast..."); //run("Channels Tool..."); wait(100); var min=3; var max=15; Stack.setChannel(1); setMinAndMax(min, max); Stack.setChannel(2); setMinAndMax(min, max); Stack.setChannel(3); run("Cyan"); setMinAndMax(min, max); //print( getImageID()); rename(substring(name,0,indexOf(name, "_V"))); //print( getImageID()); dir = File.getParent(origdir)+"\\"+substring(name,0,indexOf(name, "_V"))+".tif"; print(dir); saveAs("Tiff", dir );