/* Method for reporting integrated intensity of traced cells. Tracings are stored in .zip files with same title as images. This particular version written for single image files, but could easily be adaptend to any filetype/organization. last tested on ImageJ 1.50i */ var tab = " \t "; var bg = 28; // or use rolling ball 50 and set to zero here macro "open metadata" { openPath = getDirectory("Choose a Directory"); fileList = getFileList(openPath); for (i=0; ibg; i--) { // only works for 8 bit images sumcount = sumcount + counts[i]; intden = intden + (counts[i] * (values[i]-bg)); if (i==255) outputstring = outputstring + sumcount + tab; // reports the number of saturated pixels if (i==180) outputstring = outputstring + intden + tab + sumcount + tab; // reports integrated density at threshhold 180 not including bg subtraction if (i==128) outputstring = outputstring + intden + tab + sumcount + tab; // reports integrated density at threshhold 128 not including bg subtraction if (i== 64) outputstring = outputstring + intden + tab + sumcount + tab; // reports integrated density at threshhold 64 not including bg subtraction } outputstring = outputstring + intden + tab + sumcount; close(); print(outputstring); selectWindow("Log"); // get results from this table and report them as area * mean } //==================================== // Use this function to strip any number of extensions // off images. // Returns the title without the extension. // new version uses an array //==================================== function getTitleStripExtension() { t = getTitle(); t = replace(t, ".tif", ""); t = replace(t, ".TIF", ""); t = replace(t, ".tiff", ""); t = replace(t, ".TIFF", ""); t = replace(t, ".lif", ""); t = replace(t, ".LIF", ""); t = replace(t, ".lsm", ""); t = replace(t, ".LSM", ""); t = replace(t, ".czi", ""); t = replace(t, ".CZI", ""); t = replace(t, ".nd2", ""); t = replace(t, ".ND2", ""); return t; }