// LAG SIM tools // // This is a handy set of tools to help with reconstruction of SIM data. It is // specifically set up to work with the LAG SIM developed by the Laser Analytics // Group at the University of Cambridge. // // For suggestions or bugs please contact Marcus, at mjf74@cam.ac.uk // Marcus Fantham, 2018 // Set up SIM menu var simCmds = newMenu("LAG SIM Menu Tool", newArray("1-channel widefield", "2-channel widefield", "3-channel widefield", "2-channel split", "3-channel split", "LAG fairSIM", "Help!")); // Tool menu with symbol macro "LAG SIM Menu Tool - Ce90T0710LC282T4710AC728Tb710GC059T0f10STbf10MC933T8f10I"{ cmd = getArgument(); if (cmd == "LAG fairSIM"){ // Run LAG fairSIM plugin run("LAG fairSIM"); } else if (cmd == "Help!"){ // Show help dialog box dlgStr = "LAG SIM Help\n" + "-------------------\n \n" + "#-channel widefield: produces a widefield preview of the active SIM image. \n" + "#-channel split: splits the active SIM image into separate colour channels, \nready for " + "reconsturction with fairSIM. \n" + "LAG fairSIM: runs fairSIM automatically setting the correct beam/phase/angle \n" + "parameters for the LAG SIM. Note that you should run #-channel split first, since \n" + "fairSIM does not support multiple colour channels. \n \n" + "Marcus Fantham, 2018"; Dialog.create("LAG SIM Help"); Dialog.addMessage(dlgStr); Dialog.show(); } else { // Calculate number of channels and slices in image var channels = parseInt(substring(cmd,0,1)); slices = nSlices / 9.0 / channels; run("Stack to Hyperstack...", "order=xytcz channels="+ channels +" slices=" + slices + " frames=9 display=Color"); run("Re-order Hyperstack ...", "channels=[Channels (c)] slices=[Frames (t)] frames=[Slices (z)]"); if (substring(cmd, 10, 15) == "widef"){ // Use z-projection to create widefield preview run("Z Project...", "projection=[Average Intensity] all"); if (channels != 1){ run("Make Composite"); } } if (substring(cmd, 10, 15) == "split"){ // Use split-channels for use with fairSIM run("Split Channels"); } } }