Description

Replaces one or more Channels in a new or existing color image from an array of monochrome images.

Return Type

A McImage object.  

The destination merged image. If the image was created as part of the operation it is given a name starting with the interpretation name followed by “Merged”.

Syntax

object.MergeMultipleChannels (vChannelImgs, [Channels], [Interpretation], [Flags], [vSourceImg])

The MergeMultipleChannels Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McColorModel.
vChannelImgsRequired. A Variant value.
ChannelsOptional. A Variant value.

A “selector” giving the the zero-based indices of the channels to merge (e.g., zero is the Red channel of mciRGB Interpretations). If this argument is missing (or empty) or is a scalar -1, then all channels are merged in the order channel 0 up to the NumberOfChannels for the source image Type. Otherwise, you may specify a single scalar channel index or an array of such indices. There must be one vChannelImg supplied for each selected channel.

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).

FlagsOptional. A mcImageCreateFlags enumeration, as described in settings.

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.

vSourceImgOptional. A Variant value.

Optional source image, operator applies to parent image when parameter is omitted. If neither a parent or vSourceImg is given, then a new image is created from the given Interpretation type, using the bit depth and Aoi of the first vChannelImg in the array. Although the Aoi is taken from the first vChannelImg in the array, the new image will only be as large as the smallest Aoi in all of the source images. Furthermore, the new image will only have as many frames as the source image with the fewest frames in its ActiveFrameRange.

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 operation is restricted to and masked by the destiation image's Aoi.

The MergeChannel method is a simpler version of this method. It will merge a single channels into an existing image.