/** * Kymograph Tool * Collaborators: * Sara Salinas * * Display a kymogram of a time series stack for given selection (2D or 1D) * * (c) 2012, INSERM * written by Volker Baecker at Montpellier RIO Imaging (www.mri.cnrs.fr) * */ var Z_PROJECT = true; var helpURL = "http://dev.mri.cnrs.fr/projects/imagej-macros/wiki/Kymograph"; macro "Kymograph Action Tool - C037T4d14k" { setBatchMode(true); title = getTitle(); hasSelection = false; if (selectionType() != -1) hasSelection=true; isHyperstack = Stack.isHyperstack; if (isHyperstack) { run("Reduce Dimensionality...", " frames keep"); if (hasSelection) run("Restore Selection"); tmp = getTitle(); } run("Reslice [/]...", "output=0.000 start=Top avoid"); slices = nSlices; rename("kymogram of " + title); if (isHyperstack) { selectWindow(tmp); close(); } selectWindow("kymogram of " + title); if (slices>1 && Z_PROJECT) { run("Z Project...", "start=1 stop="+slices+" projection=[Max Intensity]"); selectWindow("kymogram of " + title); close(); selectWindow("MAX_kymogram of " + title); rename("kymogram of " + title); } setBatchMode("exit and display"); } macro "Kymograph Action Tool Options" { Dialog.create("Kymograph Help"); Dialog.addMessage("The Kymograph Tool displays a kymogram of a time-series \nstack for a given line or area selection. \nThe tool should work with all time-series images."); Dialog.addMessage("Press the help button below to open the online help!"); Dialog.addHelp(helpURL); Dialog.show(); }