07-03-2009 04:55 AM
I would like to pick-up Altenbachs first idea to use a mask and my suggestion to reduce computing effort using a subarray from the input data (image). Please find attached a LV 8.5 Version. I guess it will also solve indrajits question.
Compared to Altenbachs my VI hasn't such a nice GUI. You have to type in some coordinates on the front panel. Ellipses and rectangle are defined by two opposite corners (for ellipses i.e. the corners of the smallest rectangle enclosing the ellipse).
In principle also abitrary masks can be processed.
Some explanation:
Block diagram:
- in the upper case structure the type of ROI is selected. The meaning of the coordinates can be different for each ROI type.
- below the case structure all coordnates are scanned for minimum and maximum value for x and y-direction. These values define a bounding rectangle which cut the Raw Data.
Regards, Jörn
07-03-2009 11:05 AM - edited 07-03-2009 11:06 AM
Here's a quick draft. Since we are indexing over the subarray, we need to also check that we are in range. A simple range check on the indices would do, or we can do something like in the attached.
Your image is RGB, so you need to decide how to deal with the three color components. For simplicity, I only used the R here.
You could also use an image indicator for interaction and selection, it's probably easier.
(Or you could use "plot images" overlay to draw the circle on the main graph. )
07-08-2009 11:50 PM - edited 07-08-2009 11:54 PM
Nicely DONE
Asuming, [ Ah, ... Certainment!,] that you haven't relegated me to the "class"of posters that claim "'Minor points' of "Math" (like the trivial, but demonstarable, difference between mu and Bar over Chi)'" are without defense.
Good Lord--- My "Lovely Wife" has a Masters degree in "English" ((please help me???)) I cannot punctuate without refering to J. Swift's "G*'s 'Travaille's"
Honey-----Is this a run-on sentance?--- OK, can you ask C. S. Lewis if I should set (this) phrase off with parenthesises?
LOL (seams a lot simpler don't it?)
{Honey?.... Honey... did your heart skip a beat when you read "don't it"?}
07-09-2009 05:41 AM
To altenbach:
Have you noticed, that in your solution the selected pixels shown in the Subset-Intensity Graph are not always regularly shaped?
E. g. a radius of 2.7933 or 5,02793 are not symmetrical in vertical and horizontal direction. Or look at 11,7318 where it seems as if some additional pixels should belong to the select area.
In one of your former posted VIs I found that the cursor is not sitting exactly in the center of the selected pixels. It is half a pixel off.
From the ImageVision point of view I would expect that the selected area is always symmetrical as the pixels positions are discrete (integers) with no in between (like with floats).
Regards, Jörn
07-09-2009 09:33 AM
Jörn wrote:To altenbach:
Have you noticed, that in your solution the selected pixels shown in the Subset-Intensity Graph are not always regularly shaped?
E. g. a radius of 2.7933 or 5,02793 are not symmetrical in vertical and horizontal direction. Or look at 11,7318 where it seems as if some additional pixels should belong to the select area.
My post was just a crude draft. I am sure you can tweak it to your exact needs if things like that matter. Of course a noninteger radius seems a bit overkill. 😉
If you are really worried about subpixel resolution, you could average partial pixels along the edges using bilinear interpolation, for example. 😄
07-09-2009 01:28 PM - edited 07-09-2009 01:30 PM
Typically, it would be simpler to use an image indicator for user interactions. Here's a quick example.
It's probably buggy and needs to tweaked for the exact desired behavior. 🙂
07-09-2009 01:46 PM - edited 07-09-2009 01:55 PM
altenbach wrote:It's probably buggy and needs to tweaked for the exact desired behavior. 🙂
Sorry, I attached the wrong subVI to draw the decorations (Orignally, I allowed elliptical areas, that why I did a polygon). All we need is draw three circles, of course.
(Of course, it could all be done in a single loop with a single draw circle instance, but it would complicate other data structures. Modify as needed.)
07-09-2009 02:59 PM
07-10-2009 01:38 AM
Altenbach
thanks , for the above work.. but i am not using a image. i just want to use a 103 X 103 sized (dbl )matrix which is having some data which i used to plot using intensity graph. where the a simallar circle has to move over the intensity graph..not over the picture.
07-10-2009 02:16 AM
(That was only code I needed for my own work and I thought I share it.)
You can always display your 2D data as an image, it makes the interactive selection code a bit simpler. We have already posted how to do it with an intensity graph. You could combine the two and draw the circle using "plot images". Same difference. 😉
With an intensity graph you need to ensure that the pixels are square, i.e. the x and y axes should be of equal lenght, else the circle would turn into an ellipse. 😉