[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: filtering problem

"Dave Brennan" <9147261b@clinmed.gla.ac.uk> wrote in message
> Although any value below the thershold should not be included in the
> statistics, pixels below the threshold should be corrected by the
> Therefore is it possible to change the code:
> pro thresh, a, n, t
>    m = a ge t
>    wh = where(m,cnt)
>    if cnt eq 0 then return
>    a[wh] = a[wh] * mean(a[wh]) * (smooth(float(m),n,/EDGE) / $
>     (smooth(a*m,n,/EDGE)+1.e-30))[wh]
> end
> to allow this.

If I understand you correctly, you want to correct the below-threshold
pixels by the factor calculated from the valid pixels surrounding it.
Couln't you just leave out some of the specific subscripting [wh] in the
final assignment?
  a = a * mean(a[wh]) * (smooth(float(m),n,/EDGE) / $
Correct me if I'm wrong here...


Jaco van Gorkom                    e-mail: gorkom@rijnh.nl
FOM-Instituut voor Plasmafysica "Rijnhuizen", The Netherlands