Fast intensity graph possible ???

I want to display some images (echographic images for information) in a 1st intensity graph, extract a given column and display it in a 2nd intensity graph.
I have already seen that I have to use the 3Dgraphs. But It seems to be "very slow". Every code line as "m_MyGraph3.Plot3DSimpleSurface(MyMatrixData)" takes between 50 and 60 ms !!!
My images size is approximately 300*300 pixels.
I have also a 2nd question concerning the cast that I have to perform on the raw data acquired by our device in order to display it. For 2D graph with vector of data I use the following "single line" declaration code:
"CNiReal64Vector DataNi(vectorsize, RawDataPointer)"
Can I perform same thing for 3D graph/matrix of data ???
Thank you in advance.

The best way to do this is using the background image of a 2D Scattergraph. Each pixel in the bitmap is a data point. It is really fast. I can do a 3200X1024 bitmap each second without any noticable flicker. Here's some C# code on how to do it.
Note I'm using a gray scale bitmap which is a byte array and a certain PixelFormat. Just use an int array for the bitmap and specify a PixelFormat of color (32bit RGB).
There you have it.
Scott
private void ShowBlockOfData()
int width = _EqualizedData[0].Length;
int height = _EqualizedData.Length;
scatterGraph1.PlotAreaImageAlignment = ImageAlignment.Center;
PrepareBitmap(width, height );
// Now create a dummy bitmap. Use the LockBits method to lock the data in
// memory. This is much faster than SetPixel (I'm not sure you
// can use SetPixel with an Indexed type image. )
Rectangle rec = new Rectangle(0, 0, _Plot.Width, _Plot.Height);
BitmapData bmd = _Plot.LockBits( rec, System.Drawing.Imaging.ImageLockMode.ReadWrite, _Plot.PixelFormat);
unsafe
for(int y=0; y < bmd.Height; y++)
byte* row= (byte*)bmd.Scan0.ToPointer()+(y*bmd.Stride);
for(int x=0; x < bmd.Width; x++ )
row[x] = _EqualizedData[y][x];
_Plot.UnlockBits(bmd);
scatterGraph1.PlotAreaImage = _Plot;
private void PrepareBitmap(int width, int height )
// Create a new bitmap the first time, otherwise use the old one
// to create a new one. Hopefully, this will save us resources.
if ( _Plot == null )
_Plot = new Bitmap(width, height, PixelFormat.Format8bppIndexed );
AssignPalette( );
/// If the palette is null, create it and preserve it internally
/// Set the images palette to our ColorPalette member.
private void AssignPalette()
if ( _palette == null )
// Get the color palette from the image. You can't
// create one from scratch.
_palette = _Plot.Palette;
// Create a grayscale palette by changing this one.
for ( int i = 0; i < _palette.Entries.Length; i++ )
int c = 255-i;
_palette.Entries[i] = Color.FromArgb( c,c,c );
_Plot.Palette = _palette;

Similar Messages

  • Cannot make vertical axis of intensity graph logarithmic

    Has anyone else noticed that that the vertical axis on intensity charts cannot be made logarithmic? Labview gives you the option, but doesn't do anything when you try and check the box. Property nodes don't seem to work either. Tried this in LabVIEW 2011 SP1 and 2013. Am I doing something wrong or is this just a feature that isn't avaiable? I am just wondering if its my install or something that is really an issue.
    My application is to plot the power spectrum of sound on a intensity chart to show history of sound recorded by a microphone in real time. Really good to pin point source frequencies of feedback.
    Amit

    Hi Amit,
    This is a documented problem with LabVIEW and it is currently being worked on. Here are a couple other Forums that discuss it and offer workarounds for this issue.
    Log scale in an Intensity graph
    Possible bug in Intensity Graph while using interpolate colors on a Log scale
    Intensity Graph - Mapping Mode
    As shown in the 'Possible Bug' link above, a Corrective Action Request has been filed under the number 453407 as soon as a couple of weeks ago. To fully answer your question, it is not your install or anything like that, just an issue NI knows about and will be working on for future releases.
    Douglas C.
    Applications Engineer
    National Instruments

  • Possible to put limit lines on an intensity graph?

    Hi,
    I have LV8.5 and was wondering if there is a way to put limit lines on an intensity graph. Something line an unfilled rectangle or circle that sits on top of the intensity graph.
    Thanks,
    --Ryan

    You can use the "PlotImages.Front" property to apply any picture function over the graph area.
    Check e.g. the example program "Graph Plot Area Images". While it uses an XY graph, the intensity graph would work the same. See how far you get.
    LabVIEW Champion . Do more with less code and in less time .

  • Change colors of individual pixels on intensity graph?

    I would like to be able to change the color of a set of individual pixels within an intensity graph, to blue for example, while leaving the color table otherwise as is, for example, gray scale.  The change to blue would be based on location, not on current gray value.  I think I can accomplish this using the mask fx with picture controls, and then convert to intensity graph.  Is there a more direct way?  A good example to demonstrate this capability would be just using a 'mouse down' event on an intensity graph to change the color at the mouse location.  Any thoughts are appreciated.
    Sincerely,
    Don

    Yes, seems to work fine .
    If you have LabVIEW 8.0, there is another possibility. There is a new property that allows drawing any pictures or picture elements on your graph area. Of course you could draw individual pixels, but nothing prevents you from e.g. drawing circles, squares, odd shaped areas, arrows or event text. ... Anything you could do with a plain picture indicator. One example that ships with LabVIEW 8.0 is Envelope.vi, see image.
    Message Edited by altenbach on 06-12-2006 07:31 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    envelope.png ‏32 KB

  • Fade colors of intensity graph

    Hi everyone,
    I've made a program where I read an 2D-array and plot this array in a intensity graph.
    I was wondering if the colors in the graph can fade in each other, preferably in vertical position (columns). The idea is that the numeric data becomes visualized like a DNA profile.
    I've added a image of the plotted graph.
    Thanks.
    Solved!
    Go to Solution.
    Attachments:
    Intensity graph plot major.PNG ‏48 KB
    Intensity graph plot minor.PNG ‏35 KB

    Without manipulating the array, no it's not possible.  I made an idea on the Idea exchange to fix this, I recommend you vote for it.  Anti-Alias or Smooth Intensity Plot
    Like the idea says, see this post for workarounds.
    Tim Elsey
    LabVIEW 2010, 2012
    Certified LabVIEW Architect

  • Export high resolution intensity Graph

    Hi,
    I want to export the intensity graph to a high resolution image. Now i've got an image with a resolution of 72 dpi.
    Is it possible to set the export resolution?
    Regards, 
    Bjorn
    Attachments:
    export graph image.vi ‏406 KB

    Seems the image indicator/clipboard method from the previous post has some limitations for larger sizes.
    In this case, it works fine if you save to a file, e.g. as follows. (see attached 8x image). (No image container needed).
    Message Edited by altenbach on 07-06-2009 04:54 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    export_graph_imageMOD2.vi ‏399 KB
    8xsize.png ‏209 KB
    8xDiagram.png ‏10 KB

  • Programmin​g intensity graph cursor to move automatica​lly

    Hi Everyone!
    I want to program the 2 cursors(horizontal and vertical) in the intensity graph(Bright spot.png) to move to the bright spot in the middle of the intensity graph(live video feed from a CCD camera) automatically without dragging the cursor manually to the bright spot, is it possible?
    I've attached part of my block diagram which involves the graph but i'm unable to attach the whole VI because it has some hardware dll in it.(you guys can ignore the formula part of the block diagram, it's not important)
    Attachments:
    Bright spot.png ‏118 KB
    block diagram.png ‏45 KB

    Use "Array Max&Min" to find the peak coordinates, translate them to x and y values, and change your cursor position property node to write and write these values.
    I am actually not sure why you have two cursors. A single cursor with a horizontal and vertical line seems sufficient.
    LabVIEW Champion . Do more with less code and in less time .

  • Fix axes in intensity graph with cursor

    Hi all,
    I try to use the intensity graph as an xy-input device. The user should be allowed to drag the cursor to enter the value. However, the user can always move the cursor outside the plot area, which causes the corresponding axis to rescale. I want to have strictly fixed upper and lower limits. Is there any way to achieve this? One possible solution would be to reset the min/max values every time the cursor was moved (and coerce the cursor position back into the range). A simpler approach would be appreciated!
    Regards,
    Matthias

    > I try to use the intensity graph as an xy-input device. The user
    > should be allowed to drag the cursor to enter the value. However, the
    > user can always move the cursor outside the plot area, which causes
    > the corresponding axis to rescale. I want to have strictly fixed upper
    > and lower limits. Is there any way to achieve this? One possible
    > solution would be to reset the min/max values every time the cursor
    > was moved (and coerce the cursor position back into the range). A
    > simpler approach would be appreciated!
    >
    You don't say what version of LV you are using, but if it is relatively
    recent, right click on the graph and go to Advanced and uncheck the
    option to have Cursors Scroll Graph. The user can still drag and
    release the cursor und
    er the edge of the graph, but this will not change
    the scales. You can pretty easily filter cursor points that are out of
    range and even write back to the cursor value if you need to. I believe
    that if there is data in the plot and the cursor is set to lock to the
    plot, then it cannot be dragged outside the data either, and that is
    another solution.
    Greg McKaskle

  • How to determine the coordinate (intensity graph)

    Hallo all,
    is there a tool in labview, which enables me to determine the coordinates of a point in an intensity Graph? i mean, is it possible to determine these coordinates just by clicking on the desired point?
    thanks

    See the following code.
    Ton
    Message Edited by TonP on 09-25-2008 03:56 PM
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!
    Attachments:
    GetCoords.png ‏6 KB

  • Intensity graphs in diadem

    Can you make intensity graphs in diadem like in labview. For example I
    have data that is in one channel group, that has about 100 channels.
    Each channel has a 1d array of data points which have about 50 points
    each. Is it possible to plot this 100 by 50 array in diadem as a
    intensity graph, and how would it be done?
    Thank you

    Hi Timothy 123,
    You can achieve intensity-chart-like behavior in DIAdem by using a 3D surface graph. Please refer to the following tutorial for one such implementation:
    Joint Time Frequency and Order Analysis Tool for DIAdem
    Regards,

  • Open 32-bit jpeg & convert to intensity graph form (LV8.5 & Vision 8.5)

    I will cross-post this in the Machine Vision forum as
    well.  I have an LLB to open images with IMAQ vision utilities, and
    then attempt to convert to intensity graph format. I obtain the color
    table of the image from a Vision utility, and subsequently apply to the
    intensity graph in hopes of duplicating the vision container contents. 
    I  am unsuccessful in converting 32-bit jpeg and was hoping for some
    help.  Please let me know if this in fact is even possible to do. 
    Attached is an example jpeg image file.
    Sincerely,
    Don
    Attachments:
    open_image_file_and_convert_to_intensity_graph1.llb ‏207 KB
    Photo_111107_0021.jpg ‏240 KB

    DonRoth wrote:
    Hi George:
    Yes - I understand I am getting only one color plane. 
    With LabVIEW / Vision only, can this jpeg image be displayed in an intensity graph with the proper (original) color information? You say the LabVIEW Read Jpeg File.vi reads this image fine - but how do you display the output of this fx in an intensity graph with the original / proper color information (again using only LabVIEW / Vision, or maybe your toolkit)?
    Unless it is an 8 bit color image already you can always down sample it to 8 bit. I think the IMAQ Cast function should do that, otherwise there is for sure some function to change color depth. Colors will of course change slightly as it is very unlikely that a 24bit image especially if it is a photo, has only 256 unique colors used.
    Once you converted your IMAQ image into an 8 bit image extracting the bitmap and color dtable is easy and then applying it to an intensity graph of course too. Remains the question why you wouldn't want to use the IMAQ control. If it is about IMAQ license costs then of course you won't be able to use other IMAQ functions either so this advice won't help then.
    Rolf Kalbemratter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How to read out the scale values of an intensity graph?

    My aim is to read OUT the scale ranges (Max and min values DISPLAYED) of an intensity graph.
    I want to do a scan of an area, display the result in the graph, graphically zoom in on something interesting and then use the zoom coordinates to define the area for the next scan.
    Is that possible, and how?
    If impossible, is there a work-around?
    Solved!
    Go to Solution.

    Use the "XScale.Range" and "YScale.Range" property nodes. 
    www.movimed.com - Custom Imaging Solutions
    Attachments:
    Scale Ranges.vi ‏13 KB

  • Double clicking an intensity graph to call an event

    I am trying to make a certain sequence of events happen if a user double clicks an intensity graph. I didn't notice a 'double click event' just mouse up and downs. Is there a way to recognize a double click if it occurs within a pixel range or on an intensity graph?

    Hi.
    Indeed, there is no built in event to catch a double click, but you can use any of the "single click" events to build yourself your own double-click detector, as shown in the attached VI. What I do there is set the value of a shift register to 1 when there is a mouse down? event and the shift register had a value of 0 (first click). If there is another mouse down? event before the timeout (which you can set to whatever you want), I consider that a double click, and execute whatever code you want for a double click. If the timeout passes, the user didn't click twice on the graph fast enough to be considered a double click, so the shift register is set back to 0.
    Attachments:
    DetectDoubleClick.vi ‏35 KB

  • I want to select a specific rectangular position from intensity graph to extract the x and y values

    I want to select specfic rectangular postion from an intensity graph to extract the X and Y values at that specific position.
    Is this possible using LabVIEW?
    @nk

    Hi nk,
    Is this possible using LabVIEW?
    Yes.
    I want to select specfic rectangular postion from an intensity graph to extract the X and Y values at that specific position.
    Just select the positions! What's your problem in doing so?
    Btw. when you select positions you already know their XY values!? I don't get the point of your task...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Image processing from .txt file onto an intensity graph

    I am doing a mini project in my class and I was wondering if anyone could help me. It about image processing but I am bit stuck.
    Heres the idea:
    "An image is really nothing more than a 2D array of data. The value of every element in the array corresponds to the brightness of the image at that point.
    In this project you will create a VI which loads a 2D array of data and then displays it on the screen using the Intensity Graph. Three example files (boats.txt, gordon.txt and parrot.txt) are available on the module webpage that you can use. However, you can also use any other black and white image you like, but will need to convert it to a “text image” first. To do this you can use some software called “ImageJ” which is available on the computers and is free to download.
    You can vary the brightness of an image by adding the same value to every element in the array.
    The contrast of an image is adjusted by multiplying every element in the array by the same value. Using numerical controls and simple array mathematics, you should adjust the brightness and contrast of your displayed image.
    Some other ideas that you could try with image manipulation are:
    o Invert an image (change black to white and white to black)"
    First I am having problems putting my picture onto the graph. It is in the write file but the colours are not correct and the image has rotated 90 degrees. I will upload my VI so far when I get back onto my computer.
    Would really appricate the help! Thank you for reading

    Hi charlthedancer,
    Here is an example to get you started.
    Kind regards,
    GajanS
    Attachments:
    Test.vi ‏14 KB

Maybe you are looking for