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: |
| object | An expression evaluating to an object of type McImage. | | vType | Required. A Variant value. This can be an instance of an McImageType interface or it can be a numeric value from mcImageQuickTypes.
| | ConversionFlags | Optional. 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.
| | vSourceRange | Optional. 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.
| | vDestinationRange | Optional. A Variant value. This range specifies the dynamic range to use for the output image during conversion. See Remarks.
| | ImageCreationFlags | Optional. 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:
 | 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.
|
The settings for ImageCreationFlags 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
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.
|