Description

Creates a copy of the AOI of this image with a different type.

Return Type

A McImage object.  

A new McImage.

Syntax

object.ConvertEx (vType, [ConversionFlags], [vSourceRange], [vDestinationRange], [ImageCreationFlags])

The ConvertEx Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McImage.
vTypeRequired. A Variant value.

This can be an instance of an McImageType interface or it can be a numeric value from mcImageQuickTypes.

ConversionFlagsOptional. A mcImageConversionFlags enumeration, as described in settings.
This must be a numeric value from
      McImageConversionFlags. Note that mcicfPrompt can be combined with one and only one
      of the other flags to request display of a dialog which allows the user to select and
      control the conversion parameters. The McImageConversionFlags are
          mcicfScale  = 1,        Pixel values are scaled to the destination image dynamic range.
          mcicfDirect = 2,        Pixel values are not scaled to the destination image dynamic range, but are simply copied.
          mcicfUser   = 3,        Advanced scaling from the user-defined input range to the user-defined output range.
          mcicfPrompt = 0x8000,   Prompt for the type of scaling desired. Can be combined with the other flags.
vSourceRangeOptional. A Variant value.

This range specifies the dynamic range to use for the input image during conversion. If it is not given, then the CastingSourceRange is used. See Remarks.

vDestinationRangeOptional. A Variant value.

This range specifies the dynamic range to use for the output image during conversion. See Remarks.

ImageCreationFlagsOptional. A mcImageCreateFlags enumeration, as described in settings.

Flag to pass to the McImages.Add method. See mcImageCreateFlags for the list of supported flags. You may also OR in mcImportPropertiesFlags to control which properties, if any are copied into the new image.

Settings

The settings for ConversionFlags are:

ConstantValueDescription
 mcicfScale1

Pixel values are scaled to the destination image dynamic range.

 mcicfDirect2

Pixel values are not scaled to the destination image dynamic range, but are simply copied.

 mcicfUser3

Advanced scaling from the user-defined input range to the user-defined output range.

The settings for ImageCreationFlags 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

The Convert method is a simpler version of this method. ConvertEx allows more control over the conversion.

If UseActiveFrameRange is TRUE, then any ActiveFrameRange is honored to decide which frames should be copied. At least one frame must be selected for copying.

If the image has an Aoi, then the converted image will be the size of the rectangular bounds of the Aoi, and only pixels which are foreground in the Aoi will be copied into the new, converted image.

The mcicfDirect conversion flag can be used to assure that values from the source image are copied directly to the destination image without any scaling (values outside the permissible intensity range will be clipped as necessary). The source and destination ranges can be used to map a specified dynamic range of the input intensity values to a specified dynamic range of the output image. Either or both may be specified - where omitted the CastingSourceRange is used for the source, and the native intensity range of the destination vType will be used.