Description

Transform a color image into a new image with a different color interpetation.

Return Type

A McImage object.  

A new IMcImage instance in the specified color Interpretation.

Syntax

object.Transform (Interpretation, [Flags], [vSourceImg])

The Transform Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McColorModel.
InterpretationRequired. A mcInterpretation enumeration, as described in settings.

Interpretation for the source image. 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). If mciAnyInterp, then the current source image Type Interpretation is used, though this just results in a copy of the source image.

FlagsOptional. A mcImageCreateFlags enumeration, as described in settings.

Optional image creation flags for the new image. 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 or IMcRegionAccess 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

Only the portion of the source image bounding the Aoi is transformed. 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 interpretation name followed by the source image name.

Notes

The ExtractMultpleChannels method allows you to extract more than one channel in a single operation.