LabVIEW Biomedical Toolkit API Reference

Write Image Express VI

  • Updated2023-02-21
  • 4 minute(s) read

Owning Palette: Biomedical File I/O Express VIs

Requires: Biomedical Toolkit

Writes image data to different file types, such as BMP, JPEG, PNG, and DICOM.

Examples

Dialog Box Options
Block Diagram Inputs
Block Diagram Outputs

Dialog Box Options

ParameterDescription
Write ActionSpecifies to write image data to one file or to multiple files.
  • Write single/multiframe image file—Specifies to write image data to one file.
  • Write multiple image files—Specifies to write image data to multiple files.
File Path ConfigurationSpecifies settings for file type, color space, file path, folder path, and filenames.
  • File type—Specifies the format of file to which this Express VI writes image data. You can choose from the following options:
    • BMP (default)
    • JPEG
    • PNG
    • DICOM
  • Color space—Specifies the color space of the input image data. You can choose from the following options:
    • GRAYSCALE (default)
    • RGB
    • PALETTE COLOR
  • File path—Specifies the path to the file to which you want to write image data. This option is available only when you select Write single image file in Write Action.
  • Folder path—Specifies the path to the folder in which you want to write image data to multiple files. This option is available only when you select Write multiple image files in Write Action.
  • Image Name Format—Specifies the format of the image filenames. The options in Image Name Format are available only when you select Write multiple image files in Write Action.
    • String prefix—Specifies the string prefix of image filenames. For example, if brain_001 is the image filename, brain_ is the string prefix.
    • Number suffix width—Specifies the width of number suffix for image filenames. For example, if brain_001 is the filename, 001 is the number suffix and the width of number suffix is 3.
  • Image Index—Specifies the start and end indexes of a series of image files that you want to write. The options in Image Index are available only when you select Write multiple image files in Write Action.
    • Start—Specifies the first number of the image index.
    • End—Specifies the last number of the image index.
  • File path preview—Displays a preview of the path to the files, to which you want to write image data.
Input Data TypeSpecifies the data type of the image data that you want to write to file(s). This VI automatically specifies to use 2D array for writing images to one file and use 3D array for writing images to multiple files.
  • Input data type—Specifies the data type of the image data that you want to write to file(s). You can choose between the following data types:
    • 2D Array (I32)
    • 2D Array (U64)
    • 3D Array (I32)
    • 3D Array (U64)

    The following data types are available depending on which Write action, File type, and Color space you select:

    Write Action GRAYSCALE or PALETTE COLOR Data Types RGB Data Types
    Single Image File (BMP, JPG, or PNG file type) 2D Array (I32) 2D Array (I32)
    Single Image File (DICOM file type) 2D Array (I32) or 3D Array (I32) 2D Array (I32), 2D Array (U64), 3D Array (I32), or 3D Array (U64)
    Multiple Image Files (BMP, JPG, or PNG file type) 3D Array (I32) 3D Array (I32)
    Multiple Image Files (DICOM file type) 3D Array (I32) 3D Array (I32) or 3D Array (U64)
Input DICOM TagsSpecifies the attributes for DICOM files. This option is available only when you select DICOM (.dcm) in File Type. Contains the following options:
  • X pixel spacing—Specifies the spacing between two adjacent pixels on the x-axis, in millimeters. The default is 1.
  • Y pixel spacing—Specifies the spacing between two adjacent pixels on the y-axis, in millimeters. The default is 1.
  • Slice thickness—Specifies the thickness between two adjacent slices on the z-axis, in millimeters. The default is 1.
  • Window center—Specifies the intensity value of window center for displaying. For example, if the intensity value range is [0,255], then the window center is 127.5. The default is 0.
  • Window length—Specifies the length of window intensity range for displaying. For example, if the intensity value range is [0,255], then the window length is 255. The default is 0.
  • More Tags …—Specifies additional attributes for DICOM files. This option displays the Edit DICOM Tags dialog box.
If A File Already ExistsSpecifies how this Express VI write image data to an existing file.
  • Rename existing file—Specifies to rename the existing file.
  • Overwrite file—Specifies to overwrite the existing file.

Block Diagram Inputs

ParameterDescription
2D array (I32)Specifies I32 as the data type for the output array for a single image.
2D array (U64)Specifies U64 as the data type for the output array for a single image.
3D array (I32)Specifies I32 as the data type for the output array for multiple image files.
3D array (U64)Specifies U64 as the data type for the output array for multiple image files.
file path inSpecifies the path to the file to which you want to write image data.
folder path inSpecifies the path to the folder in which you want to write image data to multiple files.
error in (no error)Describes error conditions that occur before this node runs.
DICOM tags inSpecifies the DICOM information to write to the DICOM files. This terminal is available only when you select DICOM as the File type, 2D array as the Input Data Type, and Write single image file as the Write Action in the Configure Write Image dialog box.
multiple DICOM tags inSpecifies the DICOM information to write to the DICOM files. This terminal is available only when you select DICOM as the File type, 3D array as the Input data type, and Write multiple image files as the Write Action in the Configure Write Image dialog box.

Block Diagram Outputs

ParameterDescription
file path outReturn the path to the file to which this VI writes image data.
folder path outReturn the path to the folder in which this VI writes image data to multiple files.
error outContains error information. This output provides standard error out functionality.

Examples

Refer to the following VIs for examples of using the Write Image VI:

  • Medical Image File Format Converter VI: labview\examples\Biomedical\Medical Image
  • Write and Read DICOM Tags VI: labview\examples\Biomedical\Medical Image

Log in to get a better experience