// macros by Michael Cammer Nov 2014 // If images are published, please credit the Microscopy Core at NYU Langone. http://ocs.med.nyu.edu/microscopy // This is for opening an RGB file saved in .nd2 format taken with the inverted // Nikon microscope in Dept Path 5th floor MSB. // Brightfield or Phase Contrast images taken on this microscope in color // have three 12 bit channels. // This macro displays them, converts to 8 bits, and saves in the same folder. // File handling could be added to automatically process all files in a directory/folder. // Also, a pause could be added while the user adjusts the color balance. //============================================================= macro "16 bit RGB to 8 bit RGB" { requires("1.49k"); t = getTitle(); path = getInfo("image.directory"); t = replace(t , ".nd2", ""); t = replace(t , ".tif", ""); t = replace(t , ".TIF", ""); t = replace(t , ".ND2", ""); rename(t); Stack.setChannel(1); run("Red"); Stack.setChannel(2); run("Green"); Stack.setChannel(3); run("Blue"); Stack.setDisplayMode("composite"); Stack.setActiveChannels("1110"); run("RGB Color"); t2 = getTitle(); saveAs("Tiff", ""+path+t2); } // end