/*** * * MRI Growth Cone Visualization * * Make a montage in which each image contains the overlay of all rois in a zip-file. * The orientation is normalized according to the line formed by the first two points of * the selection. * * (c) 2021, INSERM * * written by Nicolas Nafati and Volker Baecker * at Montpellier Ressources Imagerie, * Biocampus Montpellier, INSERM, CNRS, * University of Montpellier (www.mri.cnrs.fr) * **/ //***************************************************************global variables initilization ******************************// var COLUMNS = 3; var ROWS = 1; var BORDER_WIDTH = 30; var IMAGE_WIDTH = 300; var IMAGE_HEIGHT = 290; var STROKE_WIDTH = 1; var MONTAGE_BORDER = 0; var TMP_IMAGE_PREFIX = "xxxTMP"; var TMP_IMAGE_SIZE = 5000; var DRAW_LINE = true; var helpURL = "https://github.com/MontpellierRessourcesImagerie/imagej_macros_and_scripts/wiki/Growth_Cone_Visualizer"; // var COLOR_SCHEMES = newArray("default", "linear-distributed", "12 colors","RGB colors"); var COLOR_SCHEMES = newArray("default", "linear-distributed", "12 colors","RGB colors", "RGB_LUT_Linear","RGB_LUT_non-Linear"); var COLOR_SCHEME = "RGB colors"; var TWELVE_COLORS = newArray("black", "blue", "cyan", "darkGray", "gray", "green", "lightGray", "magenta", "orange", "pink", "red", "yellow"); var LOOKUPTABLE_LIST_PARAM = getList("LUTs"); var LOOKUPTABLE="glasbey inverted"; var STRETCH_LUT = false; var STRETCH_LUT_Linear = false; batchDrawGrowthCones(); exit(); //******************************************************* Program end ******************************************************// //***************************************************************************************************************************// macro "Visualize Growth Cones Help (f4) Action Tool-C000T4b12?" { help(); } macro "Visualize Growth Cones Help [f4]" { help(); } function help() { run('URL...', 'url='+helpURL); } function Choice= init_LookUpTable() { run('URL...', 'url='+helpURL); } macro "draw growth cones (f5) Action Tool-C000T4b12d" { drawRois("Growth Cones"); } macro "draw growth cones (f5) Action Tool Options" { Dialog.create("Growth Cones Visualizer Options"); Dialog.addNumber("columns: ", COLUMNS); Dialog.addNumber("rows: ", ROWS); Dialog.addNumber("border width: ", BORDER_WIDTH); Dialog.addNumber("image width: ", IMAGE_WIDTH); Dialog.addNumber("image height: ", IMAGE_HEIGHT); Dialog.addNumber("stroke width: ", STROKE_WIDTH); Dialog.addNumber("montage border width: ", MONTAGE_BORDER); Dialog.addCheckbox("draw base-line", DRAW_LINE); Dialog.addChoice("color scheme: ", COLOR_SCHEMES, COLOR_SCHEME); Dialog.addChoice("LookUpTable: ", LOOKUPTABLE_LIST_PARAM, LOOKUPTABLE); Dialog.show(); COLUMNS = Dialog.getNumber(); ROWS = Dialog.getNumber(); BORDER_WIDTH = Dialog.getNumber(); IMAGE_WIDTH = Dialog.getNumber(); IMAGE_HEIGHT = Dialog.getNumber(); STROKE_WIDTH = Dialog.getNumber(); MONTAGE_BORDER = Dialog.getNumber(); DRAW_LINE = Dialog.getCheckbox(); COLOR_SCHEME = Dialog.getChoice(); LOOKUPTABLE = Dialog.getChoice(); } macro "draw growth cones [f5]" { drawRois("Growth Cones"); } macro "batch draw growth cones [f6]" { batchDrawGrowthCones(); } macro "batch draw growth cones (f6) Action Tool-C000T4b12b" { batchDrawGrowthCones(); } function batchDrawGrowthCones() { dir = getDir("Please select the input folder!"); setBatchMode(true); createImagesFromRoiZipFiles(dir); run("Images to Stack", "name=Stack title=["+TMP_IMAGE_PREFIX+"] use"); makeMontage(); setBatchMode("exit and display"); } function createImagesFromRoiZipFiles(dir) { files = getFileList(dir); zipFiles = filterZIPFiles(files); print("\\Clear"); if (zipFiles.length < 1) { exit("Error Message : No File Zip"); } for (i = 0; i