Example Code

Save Image With ROI Description Data

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • Vision Development Module
  • LabVIEW

Code and Documents

Attachment

Overview

This example demonstrates how to save the ROI (Region Of Interest) with an image and restore the ROI from the image later. 

 

Description

It is sometimes useful to store additional information in an image, which are not visible for the user. This can be archived with the custom data provided by the PNG file format.
The custom data are non-visible if you open the PNG file for display. You can write the custom data with the IMAQ Write Custom Data VI or read it with IMAQ Read Custom Data VI.
This VI demonstrates how to use both functions. It stores the information for a Region of Interest (ROI) inside the custom data and restores the data later.
This concept is not limited to the ROI information and can be used to store every kind of information. Only the PNG file format provides the ability to store custom data. Conversion or editing the image can destroy the custom data.

 

Requirements

 Software

  • LabVIEW Base Development System 2012 (or compatible)
  • NI Vision Development Module 2012 (or compatible)
  • If running in a Real-Time context, you will need the LabVIEW Real-Time Module 2012 (or compatible)

 Hardware

  • No hardware is necessary to use this example VI

 

Steps to Implement or Execute Code

  1. Download and open the attached ZIP-file
  2. Open the VI and follow the instructions on the Front Panel

 

Additional Information or References

Save Image With ROI Description Data LV2012 NIVerified - Front Panel.png

 

Save Image With ROI Description Data LV2012 NIVerified - Block Diagram.png

 

**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text ‘NIVerified’. Read here for more information about the new Example Guidelines and Community Platform.**
Marti C
Applications Engineer
National Instruments
NI Medical

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.