Login  Register

Re: average above threshold

Posted by Gabriel Landini on Jan 27, 2010; 9:19pm
URL: http://imagej.273.s1.nabble.com/average-above-threshold-tp3689549p3689552.html

On Wednesday 27 January 2010 17:50:57 you wrote:
> I think the alternatives are to plot the integrated intensity profile of
>  the thresholded stack, or to create a single frame 3D Mean projection
>  limited to a threshold.

I think there is another way, but I have not tested it:
For each slice, you know if a pixel is above or below the threshold when you
threshold it. Let's say that the t=35 and so the pixels >=t are set to 255,
then if you divide the thresholded stack by 255, each thresholded pixel
becomes 1, add up the slices (z projection sum) and now you know how many
slices were >= t for each pixel.
The same thresholded stack (before dividing by 255) can be used to delete the
data from the original that is <=t (invert the thresholded stack and subtract
this from the original, so if <t then pixel = 0 ).
Now sum up the result. The pixels <t are set to 0 so they do not contribute to
the total sum.
Now divide by the sum of thresholded slices (that were divided by 255).
This could be all done with a macro.
Cheers

G.