// Get_Chroma_Coefs macro by Christophe Leterrier // 27-01-2014 // last version 15-04-2021 // // Processes a folder full of multichannel tif, register each channel relative to the first one using the Image Stabilzer plugin; // (requires Image Stabilizer plugin, with the 2010 bug patch for Log Applier batch run) // http://www.kangli.org/code/Image_Stabilizer.html // then generates TransformJ matrices from the shifts stored in the Image Stabilizer log // // Correction of stacks is then made using the Correct_STORM or Correct_Apo macros, applying the TrasnformJ matrices to each channel macro "Get_Chroma_Coefs" { // IN_PATH = "/Volumes/Bushwick/Unison/Data Raw/140203 Etalonnage/Tetraspeck (chroma correction)/040X_1.00X_4c_10f/040X_1.00X_4c_10f.tif - T=0.tif"; // IN_NAME = File.getName(IN_PATH); CORR_MODE = "Translation"; // CORR_MODE = "Affine"; // channel number as reference (1 = channel 0, etc.) REF_CHANNEL = 1; INPUT_DIR=getDirectory("Select the input stacks directory"); ALL_NAMES=getFileList(INPUT_DIR); Array.sort(ALL_NAMES); print("\n\n\n*** Get_Chroma_Coefs Log ***"); print(""); print("INPUT_DIR :"+INPUT_DIR); // Stack counter for average f = 0; // Loop on tif images for (n=0; n 0) index = minOf(tifindex, zviindex); else index = tifindex; short = substring(Name, 0, index); // print(short); return short; }