==== Convert selected channels from LSM files to RGB ==== LSM files should open as composite images or hyperstacks. That is usually the most convenient formats, but in some rare cases it might be necessary to convert them to RGB images. (example: the Puncta_Analyzer plugin requires RGB input images.) The following macro allows assigning lsm channels to channels of an RGB image. === Installation === * Download {{:macro:lsm_to_rgb.txt|this file}} and put it in the plugins/macros/ folder. * Restart ImageJ. * Open an LSM file. * Choose Plugins->Macros->LSM to RGB === User interface === {{:macro:lsm2rgb.jpg|}} === Code === // converts selected lsm channels // to an RGB image. // jm,2013-02-10. requires("1.47"); var ac=""; t = getTitle(); lsm=getImageID; setBatchMode(true); run("Duplicate...", "title=temp duplicate"); Stack.getDimensions(width, height, channels, slices, frames); if (bitDepth>8) exit(''+bitDepth+'-bit LSM images cannot be safely cast to RGB'); if (Stack.isHyperstack&&((slices>1)||(frames>1))) run("Reduce Dimensionality...", "channels keep"); c = newArray(channels+1); for (i=0;i