Does anyone have a plugin that display spectral plots, with Leica LIF
(or other) spectral stacks as input? That is, is there a plugin that reads the metadata, figures out that the images have a spectra dimension, and is capable of plotting a measurement against wavelength. I wrote something simple for XYlambda LIF files, which I am appending in case it can be of use to someone. However, I consider it likely that someone has already done this, and much better. --aryeh -- Aryeh Weiss Faculty of Engineering Bar Ilan University Ramat Gan 52900 Israel Ph: 972-3-5317638 FAX: 972-3-7384051 /* ------------------------------------cut here-------------------------------------- */ /* * This macro will produce a plot of mean intensity vs wavelength for Leica LIF spectral images * At present, it only handles XYlambda stacks. */ // if no images are open, prompt for a LIF image inputPath=""; if (nImages == 0) { // Input must be an LIF file inputPath = File.openDialog("choose a LIF image file"); if (inputPath == "") { exit("User canceled the dialog"); } inputName = File.getName(inputPath); inputDir = File.getParent(inputPath); print(inputPath); print(inputDir); print(inputName); inputPrefix = substring(inputName, 0, lastIndexOf(inputName, ".")); print(inputPrefix); run("Bio-Formats Importer", "open=&inputPath autoscale color_mode=Default view=Hyperstack stack_order=XYCZT series_1"); } inputImage = getTitle(); // find the appropriate metadata entries beginLeft = parseFloat(getInfo("HardwareSetting|ScannerSettingRecord|dblLambdaBeginLeft_0 #1")); beginRight = parseFloat(getInfo("HardwareSetting|ScannerSettingRecord|dblLambdaBeginRight_0 #1")); endLeft = parseFloat(getInfo("HardwareSetting|ScannerSettingRecord|dblLambdaEndLeft_0 #1")); endRight = parseFloat(getInfo("HardwareSetting|ScannerSettingRecord|dblLambdaEndRight_0 #1")); if (isNaN(beginLeft)) { exit("metadata not found. Probably not A LIF image"); } lambdaStart = beginLeft + (beginRight - beginLeft)/2; lambdaEnd = endLeft + (endRight-endLeft)/2; print(lambdaStart, lambdaEnd); waitForUser("create selection"); // selection in which measurements will be made // set up the arrays for plotting lambdaArray = newArray(nSlices); yArray = newArray(nSlices); for (i = 0; i<nSlices; i++) { setSlice(i+1); lambdaArray[i] = lambdaStart + (i*(lambdaEnd - lambdaStart)/nSlices); getStatistics(area, mean, min, max, std, histogram); yArray[i] = mean; print(round(lambdaArray[i]), yArray[i]); } Plot.create("INTENSITY vs WAVELENGTH", "LAMBDA, nm", "RELATIVE INTENSITY", lambdaArray, yArray); Plot.show(); /* --------------------------------------cut here----------------------------------- */ -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |