FUNCTION Histo_opt, image, cutoff, ix, top_only=top, bot_only=bot ;+ ; NAME: ; HISTO_OPT ; PURPOSE: ; Clip image values which are the CUTOFF brightest or darkest, ; resp. ; CATEGORY: ; ; CALLING SEQUENCE: ; CLIP_IMAGE = HISTO_OPT ( IMAGE [, CUTOFF [, IX]] [,]) ; INPUTS: ; IMAGE : Array with data. may be 1 to 3dim ; OPTIONAL PARAMETERS: ; IX : (Output) Contains indices of the clipped values ; KEYWORDS: ; TOP_ONLY : (Flag) Clip only the upper values ; BOT_ONLY : (Flag) " " " lower " ; OUTPUTS: ; CLIP_IMAGE : Image with the CUTOFF fraction lowest and highest ; values set to the value of the next highest/lowest ; point. ; RESTRICTIONS: ; Maybe this should be a procedure, as it uses a lot of memory ; for big arrays. OTOH it is used mainly for displaying, so you ; wouldn't want to change the real data. ; PROCEDURE: ; Compute histogram, evaluate the boundaries and return ; IMAGE>LOW cmin $ ELSE $ return, image > cmin < cmax END