cancel
Showing results for 
Search instead for 
Did you mean: 

Save HDF image in LabVIEW

SOLVED
Highlighted
pegli
Member
Solved!

Save HDF image in LabVIEW

Hi,

would like to store some image data from a 2D-Picture control to an HDF file using the marvelous Live HDF5 package. However, I was not able to save the data in such a way that HDFView recognizes them as "Image" datatype. I tried writing the attributes CLASS, IMAGE_VERSION, IMAGE_SUBCLASS etc along the 2D array of data but still it is only considered as a table in HDFView. How can I set the data type to be "Image"?

 

Thanks a lot

 

Peter

Tags (2)
7 REPLIES 7
Bob_Schor
Knight of NI

Re: Save HDF image in LabVIEW

The Picture data is a 2D array of something, right?  Simply "wrap" it in whatever the HDF5 format requires (or hand it to a routine that will do this wrapping for you) and you'll be done.  If you do a Web search for HDF5 LabVIEW, you might find some examples that purport to do this wrapping ...

 

Bob Schor

Darin.K
Trusted Enthusiast

Re: Save HDF image in LabVIEW

Message contains an image Message contains an attachment

I am not familiar with the HDF5 package you are using since I rolled my own a long time ago, but it does work with LV images pretty easily.  As long Live HDF5 includes both hdf5.dll and hdf5-hl.dll then just find the wrappers for the following functions.

 

Create24bitImageDataset.pngHDFView.png

Otherwise post your attempt at an HDF5 file and I will try to find what is missing.  You'll probably have to zip it.

pegli
Member

Re: Save HDF image in LabVIEW

Message contains an attachment

Thanks a lot. I tried to store the data as you suggested but the H5IMmake_... function always returns the -1 error. Attached you find my VI and the created hdf5 file. Any clue what I'm doing wrong?

Peter

Darin.K
Trusted Enthusiast

Re: Save HDF image in LabVIEW

My HDF5 code is in LV15, please save your VI for that version.

 

Also, post one of the files that HDFView shows as a table.

pegli
Member

Re: Save HDF image in LabVIEW

Message contains an attachment

I attached the LabVIEW-VI saved for LV15. Might it be that you are using an other version of the hdf5 dll set?

Peter

Darin.K
Trusted Enthusiast
Solution

Re: Save HDF image in LabVIEW

Message contains an image Message contains an attachment

As I suspected, just a couple of quick datatype tweaks on the CLFN, the width and height are U64 and the image data is [U8].

 

hdfview.png

pegli
Member

Re: Save HDF image in LabVIEW

Message contains an attachment

Darin, thank you so much for the fixed VI. It works perfectly!

Now, I changed the VI in such a way that it integrates with the file open/close stuff from Live HDF5 by UPVI and attached it to this post. Might be, that somebody wants to use it in conjunction with this specific HDF5 package as I do.

Peter