// convert microscope images using LOCI bio-formats to tif-files // mainly written to convert Olympus FV1000 oib-files created // with the Multi-Area-Time-Lapse (MATL) // written by Stefan Terjung, ALMF@EMBL Heidelberg (stefan.terjung@embl.de) // based on "bfOpenAsHyperstack.txt" by Wayne Rasband // Last updated on 2008 September 8 v1.0 // modified by William Pu to assign colors to channels and optionally output single RGB. // run as a macro from ImageJ or FIJI requires("1.41c"); //requires ImageJ 1.41c or newer ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // requires LOCI bio-formats plugins (does not run with every LOCI bio-formats version, the one I tested // is available from http://www.embl.de/almf/html/oib_to_tiff.htm // I recommend to first try the newest "stable release" available from // http://www.loci.wisc.edu/ome/formats-download.html ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////// padwidth defines the number of digits for the counters in the filename (for t, z, c) padwidth = 4; ///////////// adjust to your needs inDir = getDirectory("Choose the Source Directory "); outDir = getDirectory("Choose the Destination Directory "); print("Source folder: "+inDir); print("Destination folder: "+outDir); Dialog.create("choose save options"); Dialog.addCheckbox("save single frames", false); Dialog.addCheckbox("save colored images of each timepoint", true); Dialog.show(); saveFrame = Dialog.getCheckbox(); saveStack = Dialog.getCheckbox(); if (saveStack) { // // Color mapping dialog // numchannel=5; labels = newArray(numchannel); labels[0]="Blue"; labels[1]="Green"; labels[2]="Red"; labels[3]="Grays"; labels[4]="Magenta"; default_label=newArray(numchannel); default_label[0]=0; default_label[1]=1; default_label[2]=2; default_label[3]=3; default_label[4]=4; channel_color=newArray(numchannel); Dialog.create("Choose Channel to Color Mapping"); for (i=0; i1) { Stack.setDimensions(sizeC, sizeZ, sizeT); if (sizeC>1) { run("Make Composite", "display=Composite"); // set colors according to channel choices for (i=0;i