fn_clip

Contents

Syntax

[x clip] = fn_clip(x[,clipflag][,outflag][,nanvalue])

Description

Rescale and restrict to a specific range ("clip") the data in an array.
Make a color image if requested.
Input:
- x           array (any dimension)
- clipflag    clipping mode:
              [a b]                   define manually min and max value
              'fit','mM' or 'minmax'  use minimum and maximum [default]
              'Xstd'                  use mean and X times standard deviation
              'prcA-B'                use percentiles (if B is omitted,
                                      use B = 100-A)
              add '[value]' at the end (e.g. 'fit[0]') to center the
              clipping range on the specified value
- outflag     output format
              [a b]       define minimum and maximum value [default, with
                          a=0 and b=1]
              n           integer values between 1 and n
              'uint8', 'uint16', ..   integer values between 0 and max
              nx3 array   returns a (n+1)-dimensional array using this
                          colormap
              char array  use this colormap (for example 'jet' -> use
                          jet(256))
              'scaleonly' rescale data but do not coerce within the range
              'getrange'  output not the cliped data, but the calculated
                          clipping range (can be useful for 'std' and
                          'prc' clipping calculations)
- nanvalue    value to give to NaNs
Output:
- x           the clipped image (or the clipping range if outflag is
              'getrange')
- clip        the clipping range

Source

Thomas Deneux

Copyright 2007-2017