Maite Posted June 26, 2012 Report Share Posted June 26, 2012 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. Do you know how can I cast these types? Thanks in advance! Quote Link to comment
Rolf Kalbermatter Posted June 26, 2012 Report Share Posted June 26, 2012 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. Quote Link to comment
Maite Posted June 27, 2012 Author Report Share Posted June 27, 2012 Sorry If I didn't use the proper words, english is not my mother tongue. You are right guessing my intentions. 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. Quote Link to comment
Rolf Kalbermatter Posted June 27, 2012 Report Share Posted June 27, 2012 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. Quote Link to comment
Maite Posted June 27, 2012 Author Report Share Posted June 27, 2012 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. Quote Link to comment
Rolf Kalbermatter Posted June 27, 2012 Report Share Posted June 27, 2012 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. Quote Link to comment
Maite Posted June 27, 2012 Author Report Share Posted June 27, 2012 I check it twice, I think is ok both things. 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!! Quote Link to comment
Rolf Kalbermatter Posted June 27, 2012 Report Share Posted June 27, 2012 Well the rotation can be handled by some Transpose Array I would assume. It's not a big problem right now. 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? 1 Quote Link to comment
Maite Posted June 27, 2012 Author Report Share Posted June 27, 2012 http://dl.dropbox.com/u/17940236/Cilindro%201%2C15nm_10 http://dl.dropbox.com/u/17940236/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. Quote Link to comment
ShaunR Posted June 27, 2012 Report Share Posted June 27, 2012 (edited) 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. Multiply your array values by 255/Z Amplitude for displaying. [e.g Value * Round(255/1.76859)] Edited June 27, 2012 by ShaunR 1 Quote Link to comment
Maite Posted June 27, 2012 Author Report Share Posted June 27, 2012 Thanks i will try!! Quote Link to comment
Maite Posted June 27, 2012 Author Report Share Posted June 27, 2012 It worked perfectly. Thanks a lot ShaunR !! Quote Link to comment
ShaunR Posted June 27, 2012 Report Share Posted June 27, 2012 It worked perfectly. Thanks a lot ShaunR !! 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. Quote Link to comment
Maite Posted June 28, 2012 Author Report Share Posted June 28, 2012 You are rigth, I was bad-mannered, Thanks both of you, for show me the way. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.