#@ String file_message (value="
Plot foci over time
", visibility="MESSAGE") #@ Integer fociChannel (label = "Foci channel", value=2, min=1); #@ Integer smoothTracesStep (label = "Smooth traces with (radius)", value=0, min=0); Table.create("Foci counts over time"); Plot.create("Foci counts", "time (frames)", "foci count"); cellIDData = Table.getColumn("Cell ID", "Results"); focicountData = Table.getColumn("Foci count ch"+fociChannel, "Results"); timeData = Table.getColumn("filename", "Results"); cellIDs = uniqueValuesInArray(cellIDData); uniqueNrCells = cellIDs.length; setBatchMode(true); //Get the Glasbey LUT from a random image newImage("Untitled", "8-bit black", 32, 32, 1); run("glasbey_on_dark"); getLut(reds, greens, blues); close(); for (i = 0; i < uniqueNrCells; i++) { fociTrace = lookup(cellIDData, i, focicountData); timeTraceString = lookup(cellIDData, i, timeData); timeTrace = newArray(timeTraceString.length); for (k = 0; k < timeTraceString.length; k++) { timeTrace[k] = substring(timeTraceString[k], indexOf(timeTraceString[k], "__t=")+4,indexOf(timeTraceString[k], "__t=")+7); } Table.setColumn("Cell "+cellIDs[i], fociTrace, "Foci counts over time"); color = getLabelColor(i, cellIDs.length); Plot.setColor(color); fociTraceSmoothed = smoothArray(fociTrace, smoothTracesStep); Plot.add("line", timeTrace, fociTraceSmoothed); Array.print(timeTrace); } Table.update; Plot.show(); Plot.setLimits(0, NaN, NaN, NaN) setBatchMode("show"); //Returns, as array, all values in the array return_array at the same indices as lookup_value in the ref_array function lookup(ref_array, lookup_value, return_array) { indices = indexOfArray(ref_array, lookup_value); return_values = newArray(indices.length); for (i=0; i