IntensityGraph data to image dysplay
#1
Posted 26 June 2012 - 12:28 PM
I would like to cast a intensity graph data type to a Image display.ctl. I am adding some funcionality to an old program, and it would be really usefull have the ROI tools that it control offers, but the ascii file I have as source contains an intensity graph data tpe, and I am not able to cenvert it. I read about Lookup tables, but I don't know which parameters should I use, also tried the predefined ones, without success.
I can see something in "Binary" mode, but too bad.
Do you know how can I cast these types?
Thanks in advance!
#2
Posted 26 June 2012 - 08:27 PM
Hi !!
I would like to cast a intensity graph data type to a Image display.ctl. I am adding some funcionality to an old program, and it would be really usefull have the ROI tools that it control offers, but the ascii file I have as source contains an intensity graph data tpe, and I am not able to cenvert it. I read about Lookup tables, but I don't know which parameters should I use, also tried the predefined ones, without success.
I can see something in "Binary" mode, but too bad.
I only understand chinese here. Sorry but what are you trying to do here??? An ASCII file that contains the source to an intensity graph? Typecasting Intensity Graph to a Image Display.ctl?? That are two entirely different types of data, the Intensity graph being a 2D array of numbers being displayed in a particular way, while the Image Display.ctl is the IMAQ control to display bitmap data. Typecasting only works for data that is interchangable from one format to the other without changing the memory content, but that is not a possibility between these two data types.
Most likely what you want to do is to take your Intensity Display 2D data and display it in the IMAQ display in a similar way. But that requires a conversion, not a typecast. One possibility for this would be to use the IMAQ ArrayToImage.vi function from the IMAQ Toolkit. I would assume that you have that Toolkit installed if you have the Image Display.ctl in your palettes.
Rolf Kalbermatter
CIT Engineering Netherlands
A division of Test & Measurement Solutions
#3
Posted 27 June 2012 - 10:16 AM
I have an ASCII file comming from an atomic force microscope which represents an image which is now displayed in an intensity graph, I would like to show it in an Image display.ctl, in order to use the ROI tools to select specific zones that in the intensity graph you can only use the area among two cursors.
I have tried yet ArrayToImaq.vi but it displays a black image or if I change the palette to binari I'm able to see the main shapes of the image in red but too unfocused.
Thanks.
#4
Posted 27 June 2012 - 10:35 AM
I have tried yet ArrayToImaq.vi but it displays a black image or if I change the palette to binari I'm able to see the main shapes of the image in red but too unfocused.
Well the IMAQ ArrayToImage.vi of course has several inputs. Depending on the input you use, you may need to scale the intensity data to get a reasonable result. Not having seen the data in your ASCII file yet I can't really say much as to what scaling you may need. But assuming that you have for instance integer values between 0-255 you should connect the array to U8 input, for value between 0 to 65635 you should connect it to the U16 array input and so on. This VI will only create monochrome images but I assume that is all that you need, since the intensity graph only really displays single plane data too.
Rolf Kalbermatter
CIT Engineering Netherlands
A division of Test & Measurement Solutions
#5
Posted 27 June 2012 - 12:32 PM
#6
Posted 27 June 2012 - 01:06 PM
Yes, I tried all the different inputs, and also apply to the data a Lookup table, but I haven't got a reasonable image.I would say the values are between 0 and 255, I wanted to upload the ASCII file but I'm not allowed to upload that kind of file to the forum. It has a header and after it the Image information, I have a SubVi which extracts the image information only.
Of course you should also select a compatible Image Type for the IMAQ Create.vi. If your statement is true that the values would be between 0 and 255, I would expect that the image type Grayscale (U8) should be working.
Rolf Kalbermatter
CIT Engineering Netherlands
A division of Test & Measurement Solutions
#7
Posted 27 June 2012 - 01:37 PM
I atach the code and the images I get, as you can see it is visible an image in binary mode in the Imaq display ctl, but is too poor and I just realized that is rotated!!
#8
Posted 27 June 2012 - 02:04 PM
And if you create an U8 greyscale IMAQ image, you better connect an U8 data array to the U8 input of your IMAQ ArryaToImage function. But why did you say your numeric values are integers between 0 and 255? The Z value in the intensity graph only shows a 0 and 1 in the cursor display. So I really very much doubt that your values are between 0 and 255 and they are definitely not U8 but rather floating point values.
So what is the minimum and maximum value in your 2D array?
Rolf Kalbermatter
CIT Engineering Netherlands
A division of Test & Measurement Solutions
#9
Posted 27 June 2012 - 03:05 PM
http://dl.dropbox.co...40236/ImageFile
Here you have two examples of diferent image files, ImageFile is the one of the screens I post before, and it has 1.76859 Z amplitude, and the second one has a 23 Z amplitude. I don't know exactly the minimun and maximun possible because I am not the one who generates the source file it comes from an external company and they don't say anything about it in the format specifications. I do not know if have a look into this files will be helpfull.
#10
Posted 27 June 2012 - 03:17 PM
Multiply your array values by 255/Z Amplitude for displaying. [e.g Value * Round(255/1.76859)]http://dl.dropbox.co...o%201%2C15nm_10
http://dl.dropbox.co...40236/ImageFile
Here you have two examples of diferent image files, ImageFile is the one of the screens I post before, and it has 1.76859 Z amplitude, and the second one has a 23 Z amplitude. I don't know exactly the minimun and maximun possible because I am not the one who generates the source file it comes from an external company and they don't say anything about it in the format specifications. I do not know if have a look into this files will be helpfull.
Edited by ShaunR, 27 June 2012 - 03:21 PM.
Founder and general mischief maker on www.labview-tools.com.
SQlite aficionado and websocket zealot.
If it 'aint in LabVIEW, then you 'aint got a clue!
#13
Posted 27 June 2012 - 05:04 PM
Well. To be fair, Rolf was on the trail with a lot less info than I (gotta be worth a "like" or two).. His next post would have been the same once he saw your files.It worked perfectly. Thanks a lot ShaunR !!
Founder and general mischief maker on www.labview-tools.com.
SQlite aficionado and websocket zealot.
If it 'aint in LabVIEW, then you 'aint got a clue!
#14
Posted 28 June 2012 - 06:12 AM












