0

I have a kind of basic (but still unresolved) problem. I'm building a program in LabView in which I gather a large amount of measurements into a n x m matrix, and I need to convert that matrix into an image to be processed/analyzed with ImageJ. Due to resolution and the kind of analysis I need, this has to be a 16-bit grayscale image.

Now, the problems I'm facing are the following: LabView does not have (on the basic package) any VI to transform data into 16-bit grayscale, only 8-bit, which kills my dynamic range. I've read around that the Vision and Image toolboxes of LabView might have more options in that sense, but for company-related reasons I cannot access these toolboxes (i.e. I have to make do with the Full Developer version only).

My reaction at the moment is to try and build on my own a VI to build a 16-bit grayscale image, whether by using standard LabView functions, entirely with C code, or mixtures of both. However, I haven't found any clear-enough information on the web regarding how a 16-bit grayscale is structured, what data is needed, etc.

So, my question is twofold: does anyone have a better way of creating this 16-bit grayscale image (some LabView VI I've skipped, external software I can invoke, etc.)? If not, does anyone have detailed information or code useful to generating such an image from scratch?

Any help will be really useful! Thanks!

JasonBourne
  • 165
  • 1
  • 3
  • 14
  • There just is no wide-spread support or standardization for 48bpp image formats given the special hardware required to view them. Work backwards and focus on the needs of the app that processes the images. Usually something medical, DICOM is common. Look at LeadTools for library support. – Hans Passant Jun 19 '12 at 13:42
  • I'll be using ImageJ for the processing/analysis of images and it seems it can support 16bit grayscale images. I'm not sure why you mentioned 48 bpp images...I just need 16bpp, since I'll be using grayscale and not RGB – JasonBourne Jun 19 '12 at 14:52

3 Answers3

1

Install IMAQ module (different than the vision toolbox), it is free and has basic image management capabilities. I use it for creating 16 bit grayscale images.

Creating 16bit grayscale image

Find IMAQ driver here (4.6.4 as of June 2012).

CharlesB
  • 86,532
  • 28
  • 194
  • 218
  • Hi CharlesB, good to hear that this could be a solution...however the link is not working (at least to me). I downloaded a Vision Acquisition Software while searching for the one you mentioned, but it's asking me to activate it. Any ideas? – JasonBourne Jun 20 '12 at 14:42
  • I fixed the link, can you try again? – CharlesB Jun 20 '12 at 14:43
  • IMAQ is a free driver for image acquisition, which is free, while Vision Acquisition software is an expansive addon to LabVIEW – CharlesB Jun 20 '12 at 14:44
  • 1
    It works!!!! Thanks a lot man, you save me a lot of time and pain. The IMAQ driver is exactly what I needed. Although images still look 8-bit because of how Windows displays them, ImageJ recognizes it as a 16-bit grayscale image, which is what I needed for the analysis. – JasonBourne Jun 20 '12 at 16:19
0

Since you mention 16-bit grayscale, I interpret that to mean that you need 16 bits of precision per pixel.

So, if you're failing to create that directly as grayscale, perhaps you can create it as a true-color image, and simply encode your sixteen bits by splitting them into e.g. the red and green components?

So for every 16-bit pixel value x, you would set red = x / 256;, green = x % 256; and blue = 0;.

unwind
  • 391,730
  • 64
  • 469
  • 606
  • I considered that at some point, but the reason I need it in grayscale is because of the kind of processing I need to do later (e.g. particle analysis), which requires images to be in "shades of gray" format. I think that encoding my 16 bits into two of the RGB colors could work for creating an image, but would be problematic for this analysis. – JasonBourne Jun 19 '12 at 14:13
0

Did you already try posting this question to the NI Forums as well? There may be some other LabVIEW developers who have tried to accomplish the same thing you're tackling here. Hopefully you won't have to start from scratch. https://bit.ly/NIForums

Have you checked to see if you can get your hands on any trial versions of the LabVIEW vision toolkits/addons?

And if your company has a SSP (paid support option although you typically get one year free when you buy LabVIEW), I'd also suggest you give the support engineers a call. They can coach you through some in's and out's of getting around some of the current limitations.

Jon Lin
  • 142,182
  • 29
  • 220
  • 220
  • Yes, I've posted in there as well, for the moment it looks like the Full Developer version has no built-in function that might be of help. I'm still looking around to see if the toolboxes are even able as well – JasonBourne Jun 19 '12 at 21:14