Login  Register

Re: average above threshold

Posted by Pablo Manuel Jais on Jan 27, 2010; 5:26pm
URL: http://imagej.273.s1.nabble.com/average-above-threshold-tp3689549p3689550.html

Glen MacDonald wrote:
> Hello,
> Is it possible in ImageJ to create an Average projection over the z-axis
> that only includes pixel intensities above threshold?  We would like to
> get an average intensity plot along a structure but the tissue section is
> not completely flat.
>
> thanks,
> Glen

I'm far from being an expert here, but I don't think there's an easy way
to do that. If I understand correctly, you want the Z projection to
average each column of pixels, but only taking into account those values
that are above the threshold. That is, if a column has the values
10,20,30,40,50 and your threshold is 35, you want to get (40+50)/2, right?

I just tried thresholding an image and using Process->Math->NaN
Background. This takes all pixels below the threshold to NaN. My idea was
that maybe the Z projection ignored the NaN values when calculating the
average. However, it doesn't, the average results to NaN too (I think this
is on purpose, though).

You might need to hack the Z projection function to make a new kind of
average. Check the source if you feel confident, or ask for help. Maybe
someone can give you further advice.

Hope this helps,
  Pablo