Table Of Contents

Read Image File (G Dataflow)

Last Modified: October 24, 2017

Reads an image file.

The file format can be a standard format (BMP, TIFF, JPEG, JPEG2000, PNG, and AIPD) or a nonstandard format known to the user.

In all cases, the read pixels are converted automatically into the image type passed by image in.

connector_pane_image
datatype_icon

image in

Image reference to which data from the image file is applied.

datatype_icon

file path

Path name, including drive, directory, and filename, of the file to read.

datatype_icon

load color palette

Parameter that determines whether to load the color table present in the file, if the color table exists.

If loaded, this table is read and returned by the output color palette.

True Loads the color table in the file.
False Does not load the color table in the file, or the color table does not exist.

Default: False

datatype_icon

file options

Cluster of user-optional values that you can use to read nonstandard file formats.

The structure must be known to the user.

This cluster consists of the following elements:

datatype_icon

Read Raw File

Parameter that indicates whether the file to be read has a nonstandard file format. If so, the remaining options in this cluster describe how to read the data.

If you are reading a nonstandard file format, you must set the size of image in to match the contents of the file before using this node.

If you specify an unsigned 16-bit integer for file data type and image in is a signed 16-bit integer, all values greater than 32,767 are truncated to 32,767.

Name Value Description
Don't Read Raw File 0

Specifies that the file to be read has a standard file format.

Read Raw File 1

Specifies that the file to be read has a nonstandard file format.

datatype_icon

File Data Type

Parameter that indicates how the image file is encoded.

datatype_icon

Offset to Data

Size, in bytes, of the file header.

This part of the file is not taken into account when read. The pixel values are read from the byte immediately after the offset size.

Default: 0

datatype_icon

Use Min Max

Parameter that indicates if the user is using a predetermined minimum and maximum.

The technique to determine this minimum and maximum depends on the following input values:

Name Description
Don't use min max Minimum and maximum are dependent on the type of image. For an 8-bit image, min = 0 and max = 255.
Use file values Pixel values from the file are scanned one time to determine the minimum and maximum, and a linear interpolation is performed before loading the image.
Use optional values Uses the optional values optional min value and optional max value.
datatype_icon

Optional Min Value

Minimum value of the pixels if use min max is set to use optional values.

In this case, pixels with a smaller value are altered to match the chosen minimum.

Default: 0

datatype_icon

Optional Max Value

Maximum value of the pixels if use min max is set to use optional values.

In this case, pixels with a greater value are truncated to match the chosen maximum.

Default: 255

datatype_icon

Byte Order

Determines if the byte weight is to be swapped (Intel or Motorola).

This input is useful only if the pixels are encoded with more than 8 bits.

True Specifies little-endian (Intel).
False Specifies big-endian (Motorola).

Default: False

datatype_icon

error in

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Default: No error

datatype_icon

image 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

file type

Parameter that indicates the file type that is read.

This string returns an identifier of the file format, which can be BMP, TIFF, JPEG, PNG, or AIPD (internal file format). file type returns xxx if the file format is unknown.

datatype_icon

color palette

Palette that contains the RGB color table (if the file has one) read from the file when the user passes the value TRUE for the input Load Color Palette? (No).

datatype_icon

Red

Value of the red color plane.

datatype_icon

Green

Value of the green color plane.

datatype_icon

Blue

Value of the blue color plane.

datatype_icon

file data type

Pixel size defined in the header for standard image file types.

file options are not necessary for reading standard image files. For other types of image files, the returned values are passed from file options/file data type.

datatype_icon

error out

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported

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


Recently Viewed Topics