Description
Extract channels from a color image into new images.
-
Return Type
-
A Variant value.
An array of Variants, each of which holds a new, monochrome IMcImage containing one of the requested channels.
-
Syntax
-
object.ExtractMultipleChannels ([Channels], [Interpretation], [Flags], [vSourceImg])
The ExtractMultipleChannels Method syntax has these parts: |
| object | An expression evaluating to an object of type McColorModel. | | Channels | Optional. A Variant value. | | Interpretation | Optional. A mcInterpretation enumeration, as described in settings. is used. The specified mcInterpretation must have the same NumberOfChannels as the source image's Interpretation (for example, the mciRGB, mciBGR, mciHSI and mciHSL interpretations all have 3 channels, but the mciPolar and mciComplex interpretations have 2 channels).
| eFlags |
Optional image creation flags for the new images. By default the value is zero, which creates a visible image that is part of the Images collection.
|
| | Flags | Optional. A mcImageCreateFlags enumeration, as described in settings. | | vSourceImg | Optional. A Variant value. Optional source image or McRegionAccess instance.
| Settings The settings for Interpretation are:
 | mciAnyInterp | 0 |
current interpretation
|
 | mciMonochrome | 1 |
only one channel
|
 | mciIndexedColor | 2 |
8 bits per pixel, pseudo-colored
|
 | mciGenericMultiBand | 3 |
multichannel, when needed, pixel luminance is averaged across the channels
|
 | mciRGB | 4 |
normal color model, 3 channels arranged as RGBRGBRGB...
|
 | mciBGR | 5 |
Similar to RGB, except the channels are reversed for DIBs as BGRBGRBGR...
|
 | mciHSL | 6 |
Three channels, Hue, Saturation, and Luminance
|
 | mciHSI | 7 |
Three channels, Hue, Saturation, and Intensity
|
 | mciComplex | 8 |
Two channels, real and imaginary arranged as RIRIRI..., only supported with McFloat
|
 | mciPolar | 9 |
Two channels, magnitude and phase arranged as MPMPMP..., only supported with McFloat
|
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 method may be used to extract multiple channels of a color image into new monochrome images. An optional Interpretation argument allows you to extract channels in the given Interpretation (e.g., you could extract the Hue channel of an mciRGB image by extracting Channel 0 with Interpretation given as mciHSI).
Only the portion of the source image bounding the Aoi is extracted. Unless a vSourceImg is supplied as an IMcRegionAccess instance, the Aoi is copied to the new image. The new image is given a name starting with the channel name followed by the source image name.
Notes
The ExtractChannel method allows you to extract just one channel without having to deal with a returned array.
|