saveContourOverlayBitmap(outputFileName,
backgroundImageData,
cutLevels,
size,
colorMapName,
contourImageData,
contourSmoothFactor,
contourLevels,
contourColor,
contourWidth)
| source code
|
Makes a bitmap image from an image array, with a set of contours
generated from a second image array overlaid. The image format is
specified by the file extension (e.g. ".jpg"=JPEG,
".png"=PNG). The image array from which the contours are to be
generated can optionally be pre-smoothed using a Gaussian filter.
- Parameters:
outputFileName (string) - filename of output bitmap image
backgroundImageData (numpy array) - background image data array
cutLevels (list) - sets the image scaling - available options:
-
pixel values: cutLevels=[low value, high value].
-
histogram equalisation: cutLevels=["histEq",
number of bins ( e.g. 1024)]
-
relative: cutLevels=["relative", cut per cent
level (e.g. 99.5)]
-
smart: cutLevels=["smart", cut per cent level
(e.g. 99.5)]
["smart", 99.5] seems to provide good scaling over a
range of different images.
size (int) - size of output image in pixels
colorMapName (string) - name of a standard matplotlib colormap, e.g. "hot",
"cool", "gray" etc. (do
"help(pylab.colormaps)" in the Python interpreter to
see available options)
contourImageData (numpy array) - image data array from which contours are to be generated
contourSmoothFactor (float) - standard deviation (in pixels) of Gaussian filter for
pre-smoothing of contour image data (set to 0 for no
smoothing)
contourLevels (list) - sets the contour levels - available options:
-
values: contourLevels=[list of values specifying each
level]
-
linear spacing: contourLevels=['linear', min level value,
max level value, number of levels]
-
log spacing: contourLevels=['log', min level value, max
level value, number of levels]
For linear and log spacing, the minimum contour level can
either be set explicitly or have one of the following special
values:
-
'min': sets the minimum level automatically to the minimum
value in contourImageData
-
['mean', x]: sets the minimum level to x*the mean value of
contourImageData
-
['median', x]: sets the minimum level to x*the median
value of contourImageData
-
['mode', x]: sets the minimum level x*the mode value of
the contourImageData (note that the mode is estimated using
mode=3*median-2*mode: if mode<0 and log scaling is set,
defaults to using x*median as the minimum contour level.)
Likewise, the maximum contour level can either be set
explicitly or have the following special value:
-
'max': sets the maximum level automatically to the maximum
value of contourImageData
contourColor (string) - color of the overlaid contours, specified by the name of a
standard matplotlib color, e.g., "black",
"white", "cyan" etc. (do
"help(pylab.colors)" in the Python interpreter to see
available options)
contourWidth (int) - width of the overlaid contours
|