// Kymo_Movie macro by Christophe Leterrier // 2016-ish // Generates a stack from an image by progressively copying it from the top // Useful to make a time-developping kymograph from a static one macro Kymo_Movie { setBatchMode(true); // Retrieves parameters of the input image Image_ID=getImageID(); Image_Title=getTitle(); Image_Bit=bitDepth(); if (Image_Bit == 24) Image_Bit = "RGB"; getDimensions(Image_Width, Image_Height, channels, slices, frames); // Create the dialog box Dialog.create("Kymo Movie parameters"); Dialog.addMessage("Total number of time points: " + Image_Height); Dialog.addChoice("Background: ", newArray("black", "white"), "white"); Dialog.show(); // Feed the variables with the dialog values BG = Dialog.getChoice(); // Creates the output stack newImage(Image_Title+"_Stack", Image_Bit + " " + BG, Image_Width, Image_Height, Image_Height); Stack_ID=getImageID(); // Loops on all output stack slices and paste the input image on each slice for (i = 0; i < Image_Height; i++) { // Copies the input image selectImage(Image_ID); makeRectangle(0, 0, Image_Width, i+1); run("Copy"); // Selects the output stack selectImage(Stack_ID); setSlice(i+1); makeRectangle(0, 0, Image_Width, i+1); run("Paste"); } run("Select None"); // Set the display contrast // resetMinAndMax; setBatchMode("exit and display"); showStatus("Kymo_Movie finished"); }