// channelExtended4RGB.txt macro for ImageJ // // This macro batch processes a folder of images including the sub-directory. // All the images must be in stack TIFF format, which means having z-stack on each channel. // This macro utilizes Extended Depth of Focus ImageJ plugin to combine z-stack images, // which need you to click the Fusion button when needed. // Process steps: // 1. stack deinterleave according to the channel number; // 2. use Extended Depth of Focus plugin generate fusion-view of each channel; // 3. merge the first channel to red, second to green, third to blue of one RGB file. // // This macro will generate the RGB merge file. // The outputs start with M#-, which will be treated differently with original files, // and will be over-written when you re-run the macro. // // Author: cail @ cail.cn Jun 3 2005 requires("1.34m"); var channelnumber = 2; var pxperfityum = 1259; run("Extended Depth of Focus..."); Dialog.create("Use channelExtended macro"); Dialog.addMessage("The selected directory should contain the z-scan files having the same number of channels."); Dialog.addMessage("Just hit the FUSION button when you need, since the Extended Depth of Focus plugin do not have command form."); Dialog.addMessage("The output history is written to the Log."); Dialog.addMessage(""); Dialog.addChoice(" Channel Number:", newArray("2", "3")); Dialog.addNumber(" Pixels per 50 microns:", 1259); Dialog.show(); channelnumber = Dialog.getChoice(); pxperfityum = Dialog.getNumber(); dir = getDirectory("Choose the directory containing images"); listFiles(dir); function listFiles(dir) { list = getFileList(dir); for (i=0; i