Login  Register

Re: average above threshold

Posted by Glen MacDonald-2 on Jan 29, 2010; 12:39am
URL: http://imagej.273.s1.nabble.com/average-above-threshold-tp3689549p3689553.html

Dear Gabriel,
This worked:
Duplicate stack
threshold, dark bg
make binary
divide by 255
multiply result with original to set pixels <t to 0
Z-axis projection to sum slices - automatically creates 32-bit result.  

The structure of interest in each stack is at an angle, and Plot Profile doesn't work with rectangular ROIs created with the Polygon tool.  Which means the final step is to draw a line along the structure's axis to set image rotation so we can use a rectangular ROI to get an averaged profile plot of the summed intensities.  

thanks for the concept.

Glen
Glen MacDonald
Core for Communication Research
Virginia Merrill Bloedel Hearing Research Center
Box 357923
University of Washington
Seattle, WA 98195-7923  USA
(206) 616-4156
[hidden email]








On Jan 27, 2010, at 1:19 PM, Gabriel Landini wrote:

> 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.