Programmatically Access Metadata From a .TIFF File with LabVIEW

Updated Apr 5, 2023

Reported In

Software

  • LabVIEW

Programming Language

  • C# .NET

Issue Details

I need to be able to read the metadata in my TIFF images. I can't seem to find any VIs which will read the TIFF header text. Is there any workaround to accomplish this?

Solution

It is possible to access this information by making use of .NET library functions, the process to achieve this is the following:

  1. Create a reference to the FileStream .NET class.
  2. Use a static .NET Property to reference the BitmapFrame class.
  3. Reference the Metadata property of the BitmapFrame class, this results in a ImageMetadata reference.
  4. Use the To More Specific Class function to reference the BitmapMetadata class from the reference obtained before for ImageMetadata.
  5. Reference the desired properties with the BitmapMetadata property node.

NET.png

 Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.