// Importing High Speed Hyperspectral Raman Timeseries data into hyperstacks // 1) Get image directories list (locate, list folders, import CARS&SRS, // rename appropriately) // 2) Make blank hyperstack // 3) Import each timeseries into respective hyperstacks (CARS & SRS) // Locate image directories dirpar = getDirectory("Choose a Directory"); // parent folder directory print("START LOADING:: "+dirpar) dirlist = getFileList(dirpar) //List of subdirectories containing all images filename = File.getName(dirpar) // Make file name title of the parent directory folder //Array.print(dirlist) print("list length = "+dirlist.length) length = dirlist.length; //Number of files in directory firstimg = "ChanA_0001_0001_0001_0001.tif" //Every MANTIS image is named like this print("List[0] = "+dirlist[0]) firststack = dirpar+dirlist[0]+firstimg // Import first image stack (c=0, t = 0-249 frames) run("Bio-Formats Importer", "open=[&firststack] color_mode=Default rois_import=[ROI manager] split_channels view=[Standard ImageJ] stack_order=Default"); selectWindow("ChanA_0001_0001_0001_0001.tif - C=0") rename(filename+"_CARS") CARSstack = getTitle() //Channel C=0 is PMT channel (usually CARS) selectWindow("ChanA_0001_0001_0001_0001.tif - C=1") rename(filename+"_SRS") SRSstack = getTitle() // Channel C=1 is the Photodiode channel (Always SRS) // Loop through file folders. Append to respective stacks for (i = 0; i