Description
Extracts the background from an image.
-
Return Type
-
A McImage object.
A new IMcImage.
-
Syntax
-
object.ExtractBackground (ObjectSize, [BrightOnDark], [Flags], [vSourceImg])
The ExtractBackground Method syntax has these parts: |
| object | An expression evaluating to an object of type McMorpho. | | ObjectSize | Required. A Long value. Approximate width (minimum diameter) of the object, in pixels.
| | BrightOnDark | Optional. A Boolean value. If True, the image instance has bright objects on a dark background. If False, the image instance has dark objects on a bright background.
| | Flags | Optional. A mcImageCreateFlags enumeration, as described in settings. A combination of mcImageCreateFlags used in creation of the output image
| | vSourceImg | Optional. A Variant value. Optional input IMcImage or IMcRegionAccess.
| Settings The settings for Flags are:
 | mcicfDefault | 0 | |
 | mcicfContiguous | 1 |
If set, frames are allocated contiguously, and you cannot add to the FrameCount at a later time.
|
 | mcicfNoInit | 2 |
Default is to initialize to 0 (black), this flag suppresses initialization.
|
 | mcicfNoAddToCollection | 4 |
If set, the image is created, but not added to the collection (see Notes).
|
 | mcicfNotVisible | 8 |
If set, the image is created, possibly added to collection (see above), but not made visible.
|
 | mcipfNoImportProperties | 8388608 |
Suppress ImportProperties for functions creating an image from another.
|
Remarks
This filter always creates a new image to store its results. ObjectSize should be large enough to represent the largest object. If the source image has multiple frames and has UseActiveFrameRange set, the result will also have multiple frames. This may be useful to check the result for the frame with the least structure. Alternatively, the best frame from which to extract the background can be predetermined, a region access opened on that single frame, and that region access passed in as vSourceImg.
Exceptions
The exception mceINVALIDARG (E_INVALIDARG) will be thrown if one of the parameters is invalid.
|