//Macro to stictch a DV-collected panel data set. //Chris Gell 11-07-2018 //Version 1 //open a series from a .dv file, save them out so sinple Fiji stitching works. //currently only supports single channels. setBatchMode(true); open(); //get the size of the panel in tiles xsize=getNumber("Enter the number of columns", 17); ysize=getNumber("Enter the number of columns", 31); //see if any images are open. if (nImages<=1) { // Dialog.create(""); Dialog.addMessage("Too few images open, open at least 2 images."); Dialog.show(); exit; } //where to save everything dir = getDirectory("Choose a Directory for saving"); //create an array with a list of open window names n = nImages; setBatchMode(true); for (i=1; i<=n; i++) { selectImage(i); rename("tile_"+i); title = getTitle; saveAs("tiff", dir+title); } setBatchMode(false); //edit the grid size in this line run("Grid/Collection stitching", "type=[Grid: snake by rows] order=[Right & Down ] grid_size_x="+xsize+" grid_size_y="+ysize+" tile_overlap=1 first_file_index_i=1 directory="+dir+" file_names=tile_{i}.tif output_textfile_name=TileConfiguration.txt fusion_method=[Linear Blending] regression_threshold=0.30 max/avg_displacement_threshold=2.50 absolute_displacement_threshold=3.50 computation_parameters=[Save memory (but be slower)] image_output=[Fuse and display]");