Table Of Contents

Cast Image 2 (G Dataflow)

Last Modified: October 3, 2018

Converts the current image type to the image type specified by Image Type. For 16-bit to 8-bit conversions, Method specifies the casting method to be used. The Method input is valid only for 16-bit to 8-bit conversions.

connector_pane_image
datatype_icon

Method

Specifies the casting method using which the input image is converted. This is valid only for 16-bit to 8-bit conversions.

Name Value Description
Use Bit Depth 0

Uses the bit depth information to cast. This is the default option. If the bit depth is not set, the bit depth is assumed to be 15 for converting an I16 image to a U8 image and 16 for converting a U16 image to a U8 image.

Shift 1

Uses the Number of Shifts input to cast the image. If a 16-bit image is being converted to an 8-bit image using this method, the VI executes this conversion by shifting the 16-bit pixel values to the right by the specified number of shift operations and then truncating to get an 8-bit value. If the value for Number of Shifts is 0, the pixel values are shifted by 0.

Use Lookup Table 2

Uses the Lookup Table to perform casting. The Lookup Table cannot be empty when this option is selected.

datatype_icon

image src

Reference to the source image.

datatype_icon

image dst

Reference to the destination image.

datatype_icon

image type

Type of the image.

Choose from the following values:

Name Value Description
Grayscale (U8) 0

8 bits per pixel (unsigned, standard monochrome)

Grayscale (16) 1

16 bits per pixel (signed)

Grayscale (SGL) 2

32 bits per pixel (floating point)

Complex (CSG) 3

2 × 32 bits per pixel (floating point)

RGB (U32) 4

32 bits per pixel (red, green, blue, alpha)

HSL (U32) 5

32 bits per pixel (hue, saturation, luminance, alpha)

RGB (U64) 6

64 bits per pixel (red, green, blue, alpha)

Grayscale (U16) 7

16 bits per pixel (unsigned)

datatype_icon

lookup table

Array containing a maximum of 256 elements if image src is an 8-bit image or a maximum of 65,536 elements if image src is a 16-bit image.

The array contains values equal to the index if there are fewer than the amount determined by the image type in image src. You can use lookup table to calculate a node that gives a relation between a gray-level value and a user value. This input is valid only when converting from an 8-bit image to a 16-bit image, from a 16-bit image to an 8-bit image, or from an 8-bit or 16-bit image to a 32-bit floating-point image.

After converting image src into a floating-point type image, you can quantify the image or regions in the image using nodes capable of analyzing floating-point type images.

datatype_icon

error in

error in describes the error status before this VI or function runs. The default is no error. If an error occurred before this VI or function runs, the VI or function passes the error in value to error out. This VI or function runs normally only if no error occurred before this VI or function runs. If an error occurs while this VI or function runs, it runs normally and sets its own error status in error out. Use the Simple Error Handler or General Error Handler VIs to display the description of the error code. Use error in and error out to check errors and to specify execution order by wiring error out from one node to error in of the next node.

datatype_icon

status

status is TRUE (X) if an error occurred before this VI or function ran or FALSE (checkmark) to indicate a warning or that no error occurred before this VI or function ran. The default is FALSE.

datatype_icon

code

code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.

datatype_icon

source

source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.

datatype_icon

Number of Shifts

Specifies the number of right shifts by which each pixel value in the input image is shifted. This is valid only when converting from a 16-bit image to an 8-bit image. The VI executes this conversion by shifting the 16-bit pixel values to the right by the specified number of shift operations, up to a maximum of 8 shift operations, and then truncating to get an 8-bit value. This is valid only when Shift is selected for the Method input.

datatype_icon

image dst out

Reference to the destination image.

If image dst is connected, image dst out is the same as image dst. Otherwise, image dst out refers to the image referenced by image src.

datatype_icon

error out

error out contains error information. If error in indicates that an error occurred before this VI or function ran, error out contains the same error information. Otherwise, it describes the error status that this VI or function produces. Right-click the error out indicator on the front panel and select Explain Error from the shortcut menu for more information about the error.

datatype_icon

status

status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred.

datatype_icon

code

code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.

datatype_icon

source

source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.

Where This Node Can Run:

Desktop OS: Windows

FPGA:

Web Server: Not supported in VIs that run in a web application


Recently Viewed Topics