The search in a table 2d-coordinates for the point of click

I'm doing a VI that creates a layer of 2d points on an image imported (as pictured). These points are generated by a Subvi, which simply draws points over and over again (based on the 3 selections of initial angle). All the coordinates of the points are stored in a data feed that is sent to a registry change for other future functions. Each coordinate corresponds to an electrode, labeled 0-255, goes into the lines first (although that could change, but I guess it would be easy to change). Labels are created through 2 loops (as seen in diagram 1).

I would now like to click on a particular point and put it out in a different color, but also an indicator show me what electrode I clicked. I seem to be at a loss on how to do it! I need explore a table 2d-2 groups of the element, where she looks for the line first, then the corresponding column (or vice versa, it is not serious, but just for ease of understanding, let's say she is looking X first, where the columns first) and compare them to 2 elements (the mouse click coordinates).

Here's what I've done so far. I need to search for the function in the following way; If find X, look no further columns and select that particular column where the X was found and begins to look for the values Y and and then stops when the value of Y is. Once the two values are found, take these out of the loops and throw them in a cluster and the function of drawing lots.

Thank you!

p.s. in case anyone is wondering why I have the function "in the range" in there, it's so that the user does not have to be exact pixel this allows the user to click within 2 pixels of the coordinate of the point.

Hi Daniel!

What do you think of this approach?

We subtract just the mouse coordinates in the coordinated range 2D (Array stores the coordinates of the points on the image), the absolute value and look for the minimum. X and y the selected point index is returned in minutes or the index. You can replicate the fuction "in range" by ensuring min value is not too high.

With regard to:

Andrew Valko

NOR Hungary

Tags: NI Software

Similar Questions

  • Problem when creating objects to the point user clicks on the screen

    I'll sometimes have a problem when clicking on the screen and have an object at this time created. 95% of the time it works properly, but sometimes, the object is created in a different area of the screen.

    Everyone comes across something similar? Or is it likely to be just a problem with the Simulator?

    Thank you very much for any help offered.

    If you want a "newLabel" to appear in the contact details of your mouseEvent, but only if details of mouseEvent are lower on the screen (having a higher value) at the height of your textButton.

    If your TextButton object does not touch the top of the stage (y = 0), you'll want to write this instead:

    if (event.localY > textButton.y + textButton.height)
    

    It may be a good idea to write it anyway, just in case you want to change the position of the TextButton.

    In addition, localX and localY properties of your mouseEvent are compared to the event containing sprite.  for example, if you have a canvas Sprite that is a parent of your textButton and is tuned for the mouseEvent.  otherwise, if there is no sprite contains (second phase) for your event, you'll want to use stageX and stageY instead.

    I guess since I can't be sure of your intentions here, but try this instead:

    private function createItem(event:MouseEvent):void
         {
         if (event.stageY > textButton.y + textButton.height)
            {
            var newLabel:TextField = new TextField();
            newLabel.x = event.stageX;
            newLabel.y = event.stageY;
            newLabel.text = "test";
            newLabel.setTextFormat(userTextFormat);
    
            addChild(newLabel);
            }
         }
    
  • When I use the Brush tool and click anywhere... I find this line comes from point unspecified downwards at the point I clicked...!

    Untitled.png

    Note: This problem occurred with Tablet Genius... not with the mouse...

    Thanks in advance,

    Hello

    This problem is reproducible on some specific devices only and is currently being studied and followed internally. No progress on this will be provided.

    Meanwhile, if it only once is could not a problem for you you please uninstall the driver for Tablet and Flash (cleaning use CC tool) and re-install the latest version of drivers for your tablet, and also Flash Pro CC 2014 creative cloud. Restart the system and check if the problem occurs? Because most of the time the driver update has helped solve the problems associated with the brush.

    Thank you

    Sangeeta

  • How can I change the "subject: House ' of the search engine home page and logo for Bing?

    I do not use Google as my engine of search if Firefox, so I went and changed the search engine of the Isard to Bing bar, but I can't change the "subject: House" of the Bing search engine. I would like for my Firefox display the logo of Bing and Bing instead of Google search. Thank you.

    See:

    You can find the image data to Bing in this post on the forum.

    Paste this code into Notepad (Web Developer > Notepad;) SHIFT + F4) and use of Execute > run

    SearchEngines = {Bing: {"name": "Bing", "searchUrl": "http://www.bing.com/search?q=_searchTerms_","image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEYAAAAcCAMAAADr5TknAAAAFXRFWHRDcmVhdGlvbiBUaW1lAAfbBw0SIi8yp62WAAAAB3RJTUUH2wcNEjEMJC5+BgAAAAlwSFlzAAAOwwAADsMBx2+oZAAAAwBQTFRFG2rRHGrRHGvSHWvSHWzSHmzSH23SIG3SIG7SIW7SIW7TIW/TIm7TJG/TI3DTJHDTJXDTJXHTJnDTJ3HTJHLUJ3HUKHLUKHPUKXPUKnPUKnTULHXVLXbVLnbVLnfWMHbVMHjWMXjWMXnWM3jVMnjWMnnWM3nWM3rWNHrWN3zXOHvWOH3XOn3XPH/XO3/YPH7YPYDYPoDYQIHYQoLZQ4TZRYXZRYXaRoXaR4baSYfaSonbS4nbTIrbTYrbTYvbTorbTovbUIzcUI3cU43cU4/dVY/cVZDdVZHdVpDdWZHdWJLeWpLdW5TeXJPeXJTeXZXeXZXfXpXeX5bfYZjfYpjfZJjfY5ngZpzgaJzhaZ3ga57hbZ/hbqDhb6DhbqDicKHicaLicqTjdKPidKTjd6TjdKXkeabjeKfkeqfkeKjke6jkfKrlfqnk+qQd+qYj+qYl+qsv+q42+rE/+rJEga3mgK/mgq3mg6/mh6/mhbDnhrDniLHni7TnjLPnj7TnibPoirTojLPojLTojrTojrbokLfpkbfokrbokrjpk7rqlbrqlrrqnb/rnr7rnsDrn8DrnsDsocHsosHsosLspMPspMTspsTspsXtpsbtp8btqMftqMfuqsftqsnurcjurcrursruscvvsc3vs83vtM3vts7vss3wss7wt8/wt9DwudHwvNPxvtLxv9Xy/NCM/NGR/NWY/NWbwtfyxNjyxNnzxdnzx9rzytv0ytz0zN30zt/1z970z9/10N/1z+D10OD10OH10eD10eH10eP20uH20+L10+L21eP21uP21eX32OX32eb32+b33Of32+j33Oj32+j43Oj43On43en43un43+r4/u/b4Or44ez54uz54+z55O355e755u756O/65/D66PD66vD66/L67PL77vP77vT77/X7/vXo8PX78fX88vb88/f89Pf89Pj89Pj99fj89vn99/r9+Pr9+fv9+vv9+vz9+vz++/z+/vz5/P3+/f3+/f7+/v38/v79/v7+////f00bOgAAAwdJREFUeNqt1AdQE1EQBuD4J7mIEEYsCILGAvYGdsGugL2LvXfFig3sqESxISCCil3svYsNFUewoafYwAiiElQQlXhE7rzkvHCZjIwG32Qm8/btfZfdfRMR81+WKNTPL9Ukmn981sxjP/+F8YI00ST6fpqPz9SnRWbyT8yYfvTHXwE0TQuYr6qEuNukOs80T5MWfz327gdK+OhH8tb1+DcahiLDRnhu/Pzohp7JPTPMxU4MyJzcVifrE5MfPnmm+9YmzG/kwJ5IFS1WvKI55OuBnjVkgNi+qX9nawDzKNUdlhEvay6Vug5fsy1icTdb2E1IY9ODi5eYzb71cT8r2HfyDwvz87JB2dEq3S+JaS6RuE4MjljevTRrWCmqBnJFscvlYC73JtVkORpcZBmAZU47wtZfxdWRNFqGugkMfaQcym/9rg898AR6ZVN5POORZihbu1cG5xcck1UDdjG0oSE7CXTUvK4Oy0N8TO0OcSg/KVRKEbYvCOhD6Zn9wCTBibYvZDfXitDLIDMngZoanvE1mszbCpCTemYJECk88YMofAywqCCSCsjTeWa38YAbotg5PTMWiBaeLAWUgcDQgkgsoMjRM95AiBGTUx/iy3pmpCmz4j47yzg+8K03EMD1JpLtsEaYHGOJmuo/MnS4BVzParnyxwFtMjkmswlkUQVNY7Ja6br/R4ah9jhAPjDq9t3DC2tDPPgtdyRi4tnd+hx+TkmekEyhCmEY5o2ysaVIBPaDdr8VlmEedRGj5RZVbh6VdW28IxyDNEyhDDuFh9EblJv3DSoOlzgDw3zb1b4EbBR1apUnJE6TknQVhhAEOymCMGICCEIp3FPb5XB+bmDYm5W8w7e/R9cRq85ncxkZJJnGpJKkWvhYOkmmGw2VmQt4Cxhz1xPA/lPRmRSg1DtzmOyrV2JzDbsIwF1rDvOlLSQr+f/Ie5Vhccq83jxvBmJIooZmaHVwNZRcR5vHMBlz7GDtNmpCjyqQtr7w+/6b0WL65aYB9cpYV+yw4BJ/+Ys4KcP6T8wvpGsPkU7iDDwAAAAASUVORK5CYII="}}
    
    localStorage["search-engine"] = JSON.stringify(SearchEngines["Bing"]);
    
    document.location.reload();
  • removed from dregol through the commands, programs and regedit; search for dregol still 1 click

    running Win7. Firefox 38.0.1. used 2 programs to remove dregol:Control sign & Advanced Uninstaller Pro. Use regedit to remove all references to dregol. Apparently not in Chrome. He removed the default search. However, he is still there as a 1-click search engine and sometimes used as search engine.

  • When I go to a web page, I can not select the button bar, tab or search on the page, type or select the place where I want to go? The pointer seems to be disabled for these functions.

    If Firefox blocks a page, I can't click on the allow button appears because the pointer of the mouse is disabled...

    Hello

    You should check with the Support of FireFox and their forums.

    Support for Firefox
    http://support.Mozilla.com/en-us/KB/

    Firefox - community and live Chat
    http://support.Mozilla.com/en-us/KB/ask

    Firefox - Forums
    http://support.Mozilla.com/en-us/questions

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

  • Search in a table by a negative number and replace it with a zero

    Hello

    I want to search in a table (dual 64 - bit) for a negative/s number and replace it with a zero.

    BR

    Probably the fastest option in this case

  • How to get out a subset in front and behind a number that your search in a table.

    Hello

    A search gives me nothing so I apologize if it's there somewhere and I'm not.  I'm using LabVIEW 7.1 and seeks an array for a given value.  Once I found this value in the table, I want to take the 51 values with the one I found in the research at the Center. Is there an easy way to do this?  The current way I'm doing it is by using the table search and seizure then the index in the array with a length of 51 subset function.  Of course, I want to get the points of 25 data before and 25 after what I searched, and not 50 after.  What is the most effective way to do it?  I should fork by the index of my result of research into two table vi.  One being the 25 index and the index and then set the length of these two sub-tableau at 25?  Thanks for any advice regarding the case.  Sam

    Why don't you just subtract 25 from the index that your value is found and use it as an index for the subset of the table starts?  You will have to do the situation where your desired value is less than 25 points, but that should be fairly easy depending on how you want to manage.

  • Open with options: I want to add a new application to the list right click on file-&gt; open with and rearrange the list so my search app is first. I know that I can use open with-&gt; other and select any application, but it takes too much time since I u

    I want to add a new application to the list right click on file-> open with

    and also reorder the list so my search app is first / top of the list.

    I know that I can use open with-> other and select any application, but it takes too long I should use my intended application in this way several times a day.

    Basically, I'm looking for a configurable way configure open with, something more to send to Windows.

    Thank you very much for all the advice offered.

    The operating system, not you, not control that open with the menu command.

  • Effective Int32 table in table of Boolean for table Int16

    Have a wide range of Int32 (~ 500 000 elements).

    Each Int32 must be analyzed in two Int16 tables: table 1 the first 12 bits of the Int32, Array 2 is the second 12 bits of the Int32.

    The method I use (see table) works fine but it takes a long time to run (on a relatively slow processor, embedded).

    Does anyone have an idea how to make it run faster?

    Boolean operations on numbers using seems to be quite a bit faster: 42 ms vs ms 280 for 1000000 point tables.  See the image below.

    Also, when I duplicated the code on the image I don't have results you described in your post.  Please post images as .png files.  They can be shipped rigtht in depth with the Insert/edit image button (it looks like a tree).

    Lynn

  • Dial the node library with cluster table feature using the pointer of table data

    Hi all.

    I am writing a wrapper of LabVIEW for an existing DLL function.

    The service was, as one of its parameters, an array of structures.  The structure is very simple, containing two integers.  I use the call library function node to access.

    In Labview, I created an array of clusters, when the cluster has two integers of 32 bits as members.  So far so good.

    Now, I have to pass this in the node library function call.  I use here in trouble.

    I used the LAVA so the topic in the knowledge base as my main sources of information, although I read a lot of topics in the forum on the subject too.

    I don't understand I could write a new function that takes as a parameter a struct with the size as the first member and an array as the second, and I might just do this and do call the regular service, but I was hoping to do more simply.

    The file function C LabVIEW generates for me the COLD Lake when I choose "To adapt to the Type" and "Data in the table pointer", the prototype he expects is:

    int32_t myFunc (handful of uint32_t, uint16_t channel,
    int32_t FIFOnumber, Sub data [], int32_t numWords, int32_t * actualLoaded,.
    int32_t * actualStartIndex);

    And the prototype of the function in my DLL is

    int myFunc borland_dll (DWORD channel, channel of Sina,)
    FIFOnumber int, struct mStruct * data, int, int numWords * actualLoaded, int * actualStartIndex);

    It sounds like a match for me, but it doesn't work (I get garbage in the data).  The topic referenced above LAVA, I realized it would work.  This isn't.

    If I have to cast the data to the pointer-to-pointer I get when I generate c code in my wiring to a CIN struct and by generating, then I seem to get what I expect. But it seems to work when I choose "pointers to handles" too, and I'm expecting data table pointer to give a different result.

    Is it possible to get it works directly, or I have to create a wrapper?  (I am currently using LabVIEW 2011, but we have customers using 2009 and 2012, if not other versions as well).

    Thank you.

    Batya


  • decimal coordinates for blackberry Show map

    Hi guys I need to implement decimal coordinates for blackberry or equivalent to it in degrees um by using the following code

            super(FullScreen.DEFAULT_CLOSE | FullScreen.DEFAULT_MENU);
            MapView mapView = new MapView();
            String document = "";
    
            Invoke.invokeApplication(Invoke.APP_TYPE_MAPS, new MapsArguments(
                    MapsArguments.ARG_LOCATION_DOCUMENT, document));
    

    When I change the values of lat, and lo in decimal or degrees, it shows the default location, please help

    What I did...

    MapView mapView = new MapView();
    mapView.setLatitude ((int) (YOUR VALUE * 100000));
    mapView.setLongitude ((int) (YOURVALUE * 100000));
    mapView.setZoom (3);

    Invoke.invokeApplication (Invoke.APP_TYPE_MAPS, new MapsArguments (mapView));

  • How to find the coordinates of the screen control clicks?

    I would like to find the screen coordinates of the place a click / tap event occurs. So, for example, if a button is clicked, is it possible to find the x / place on screen? Or at least the command position?

    It seems to be difficult scpecially if the controls are in a ListView. The onClicked: event there is no provided location information. And if I try to join a TapHandler to the ListView it seems fire on areas non-zero.

    You can use the onTouch() signal to get the coordinates compared to itself or on the window...

    http://developer.BlackBerry.com/native/reference/Cascades/bb__cascades__visualnode.html#function-TOU...

    http://developer.BlackBerry.com/native/reference/Cascades/bb__cascades__touchevent.html

  • I bought the last 13 items for download, but I clicked on the link Windows, I own a Mac, how can I change the Mac platform? The Adobe site suggests what it automatically detect that I won a Mac and a change of the platform is so?

    I bought the last 13 items for download, but I clicked on the link Windows by mistake when I bought it, I own a Mac, how can I change the Mac platform? The Adobe site seems to indicate that it automatically detect that I own a Mac and change the platform, what then? I can't find anything (probably to the search in the wrong place) on Returns or cancel my order. Any suggestion would be great, thanks.

    Since this is an open forum, not Adobe support... you must contact Adobe personnel to help

    Chat/phone: Mon - Fri 05:00-19:00 (US Pacific Time)

    Get help with orders, refunds and exchanges (non - CC)

    http://helpx.Adobe.com/x-productkb/global/service-b.html

  • How to set a variable in a table to grid 'for' loop

    I'm afraid I'm stuck again!

    The next step in the animation I'm working on, is to set up a Boolean value, 'pierced = false', so that all instances of the attachMovie ("openCircle") have a Boolean "drilled = false' associated with them." Then when someone clicks on one of the instances of the attachMovie ("openCircle"), the Boolean value becomes "pierced = true', but only for that instance was clicked."

    What I've done is to set the (Boolean) variable (highlighted in bold below) in the two 'for' loops through the table in the grid, but it returns an undefined value. Do I need to configure a separate table? (see code below):-

    set up the grid for solid table

    spacing: var number = 5.75;

    Var CDL: number = 20; the number of columns in the grid

    var rows: number = 20; number of grid lines

    var leftMargin:Number = 154;

    var topMargin:Number = 169;

    depth: var number = 100; starting point for the depth

    var drilled: Boolean;

    for (i = 1; I < = lines; i ++) {}

    for (j = 1; j < = cols; j ++) {}

    drilled [rows, cols] = false;

    trace (drilled);

    current = attachMovie ("openCircle_mc", "openCircle_mc" + i + "_" + j, depth ++);

    Current._x = leftMargin + ((i-1) * (spacing + current._width));

    Current._y = topMargin + ((j-1) * (spacing + current._height));

    Current.Row = i;

    Current.Col = j;

    Current.Oil = Math.floor (Math.random () * 1.1);  about 1/10 objects have oil = 1, 9/10 oil = 0

    Open the circle initially invisible, visible on rollover

    Current._alpha = 0;

    {current.onRelease = function ()}

    trace (this.row + "" + this.col);

    current.drilled = true;

    }

    current.onRollOver = function() {}

    This ._alpha = 100;

    }

    current.onRollOut = function() {}

    This ._alpha = 0;

    }

    }

    }

    I would be grateful for any help. Thank you.

    Then, create a two dimension table named drilled so that it exists when you try to fill...

    var drilled: Array = new Array (new Array();

    There might be a problem that you're missing setting the values of the [0, #] components of the table - paintings begin with an index of 0.

Maybe you are looking for