03-15-2012 01:18 PM
I am working on the state machine like you suggested, currently I am trying to just make a boolean cluster of all selected/deselected rois, then I will use a for loop to find the centroid in each roi. I have yet to relate the subarray of rois to the original image to find the 'true' coordinates of the indexed roi.
I will post some code soon.
03-26-2012 11:13 AM
I am having trouble with state machines as well as the centroid finding. Using the build_subimages .vi as a template, the value of the centroids are the same in all case since each sub roi is a new image. Is there a way to find the global centroids then send them to the array?
03-27-2012 02:54 PM
Hi dbrittain,
I've also used the build_subimages VI as a template. Take a look at the attached VI. If you want to continue with the method started in build_subimages, one way to accomplish your goal would be to create a 2D array that contains the coordinates for each subimage. I did this by creating a cluster containing each array of points (top, left, bottom, right), then letting the for loops in the "generate subs" event create a 2D array of these clusters so each would correspond to the correct subimage. Then, in the mouse down event, the actual coordinates of the sub image can be used with the location of the centroid in each subimage to find the actual centroid location and build an array containing all the chosen centroids. Notice the indicator for the array of selected centroids is located below the two image indicators on the front panel. I hope you can use this as an example and keep moving forward with your project.
Best,