LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Line by line intensity image generation

I am in need of creating a 256x256 pixel intensity image which updates continuously line-by-line.  I tried using the "Create IntGraph Color Table.vi" example however the intensity image is displayed after the entire chart is processed.  How would I go about modifying the .vi (or create a new one if it's not possible with this one) such that the intensity graph would be processed through 256 individual lines rather than the entire chart at once?  Each line needs to be processed 1/256 seconds so the entire image can be displayed in 1 second.  This is to be used for scanning and imaging of biological tissues so we need to constantly move the sample in order to center our display.  Waiting for the entire image to display would be too time consuming for us to center our samples.
0 Kudos
Message 1 of 11
(4,682 Views)
If you want the graph to update after each line, you need to place the indicator inside the loop. The attached shows a simplified example using an intensity graph and some simulated data. (LabVIEW 7.0).
 
If you want more specific help, please attach a simplified version of your VI. 🙂
0 Kudos
Message 2 of 11
(4,672 Views)
Attached is the .vi that we will be using for our analysis.  It is setup so you can specify the dimensions of the intensity image to be generated (we will be using 256x256).  Right now we are just using random numbers until the intensity plot can be displayed how we want it.  The graph updates each time the entire signal is processed.  We want it to update line-by-line, from either top to bottom or left to right.  The .vi you attached is very close to what we're looking for, however it refreshes the entire image during each update.  We want our image to hold on screen and updated accordingly as each line is processed.  Thanks for your help.
0 Kudos
Message 3 of 11
(4,659 Views)


@AntLee29 wrote:
We want it to update line-by-line, from either top to bottom or left to right. 

You cannot do that with an intensity graph. (You could also try a picture indicator but I doubt it will be faster. WIth a picture indicator you can disable "erase first", thus the new data is added to the existing picture. I have no idea if this would speed it up.)

The update of the intensity graph is not syncronous by default and it will not update faster than reasonable. The redrawing speed will not block the code execution. To further speed up things, you could place your indicator inside a case structure, and update it only every n'th line. You just need to find the right balance.

Message Edited by altenbach on 07-22-2005 01:22 PM

0 Kudos
Message 4 of 11
(4,653 Views)

Here are a few suggestion, some already mentioned.

You should really use an event structure. (I hate 1000ms loop delays and case structures with only one case containing code.) 😉

What is the resolution of Z? Maybe you can rescale it to integers for efficiency (demo uses I8). To lower the update rate of the indicator, the example updates every 8th line only. Modify as needed. 🙂

0 Kudos
Message 5 of 11
(4,642 Views)
Hmm but isn't that what the vi you attached essentially does?  It appears to be a 128x128 intensity image that updates from left to right.  We basically want something like that but also holds the previous image in place and overwrites each line as it's updated rather than erasing and redrawing.  The timing does not need to be perfectly synchronized.  We simply chose 1 second because it is a reasonable limit for our design.
0 Kudos
Message 6 of 11
(4,637 Views)
Oops I replied before seeing your second response.  Thanks for the input.
0 Kudos
Message 7 of 11
(4,634 Views)
Our Z values are integers and can be as low as 0 and as high as 65535.
0 Kudos
Message 8 of 11
(4,630 Views)
To overwrite the lines as you go, just retain the old picture in a shift register of the outer loop. Now you also need a special event to reinitialize the array if the desired size changes.
It seems your Y data should be scaled as U16 integer.
 
See attached modification. I added a small delay to the display loop to demonstrate the updating. I also enlarged the display area to be 256x256. it does not make much sense to draw such an area in 25% of the pixels. If you want to use a smaller indicator, reduce the array size. 😉
0 Kudos
Message 9 of 11
(4,627 Views)
Thank you very much.  You have been a big help.  There's one final change that we want.  When the "Recalculate Data" button is switched, we want the intensity graph to continuously update.  How would we go about modifying the event structure to continuously run when the button is switched.  It seems to only want to update for a single cycle every time it is clicked.  I know how to do this with case structures, but I'm less familiar with event structures.  Thanks again.
0 Kudos
Message 10 of 11
(4,598 Views)