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:

PartDescription
objectAn expression evaluating to an object of type McColorModel.
ChannelsOptional. A Variant value.
InterpretationOptional. 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.

FlagsOptional. A mcImageCreateFlags enumeration, as described in settings.
vSourceImgOptional. A Variant value.

Optional source image or McRegionAccess instance.

Settings

The settings for Interpretation are:

ConstantValueDescription
 mciAnyInterp0

current interpretation

 mciMonochrome1

only one channel

 mciIndexedColor2

8 bits per pixel, pseudo-colored

 mciGenericMultiBand3

multichannel, when needed, pixel luminance is averaged across the channels

 mciRGB4

normal color model, 3 channels arranged as “RGBRGBRGB...”

 mciBGR5

Similar to RGB, except the channels are reversed for DIBs as “BGRBGRBGR...”

 mciHSL6

Three channels, Hue, Saturation, and Luminance

 mciHSI7

Three channels, Hue, Saturation, and Intensity

 mciComplex8

Two channels, real and imaginary arranged as “RIRIRI...”, only supported with McFloat

 mciPolar9

Two channels, magnitude and phase arranged as “MPMPMP...”, only supported with McFloat

The settings for Flags are:

ConstantValueDescription
 mcicfDefault0
 mcicfContiguous1

If set, frames are allocated contiguously, and you cannot add to the FrameCount at a later time.

 mcicfNoInit2

Default is to initialize to 0 (black), this flag suppresses initialization.

 mcicfNoAddToCollection4

If set, the image is created, but not added to the collection (see Notes).

 mcicfNotVisible8

If set, the image is created, possibly added to collection (see above), but not made visible.

 mcipfNoImportProperties8388608

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.