LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I programmatically modify array element sizes?

Solved!
Go to solution

Hi All,

 

I have a quick question about modifying the size of array elements. Hopefully someone can help, because I am at a dead end!

 

I am logging some intensities from a Fibre Array using a camera. For calibration of the system, I acquire an image from the camera, click points on the image to divide it into areas of interest. I overlay my image with a grid showing the regions of interst - for example a 4x6 array. I then have to select the fibres - or ROIs - I want to log from.

 

I have a cluster type-def ( a number and a boolean) to specify the fibre number and to turn logging from that fibre on/off. I overlay an (transparent) array of this typedef over my image to correspond with the regions of interest. So here's my problem - I want to modify the dimensions of the array so each control matches my ROI. I can resize the elements by rightclicking on the elements on the frontpanel, but can't find a way to do it programmatically. The Array Property Node>>Array Element>>Bounds won't 'change to write'...thats the first thing I tried.

 

Its really only important that the elements align with my ROIs - so programmatically adding in gaps/spacings would also work for me...but again I can't figure out how to do this! I've attached a screenshot of part of my image with array overlaid to show you all exactly what my problem is.

 

Thanks in advance for you help,

Dave

 

PS I am running Labview 8.6 without the vision add on.

0 Kudos
Message 1 of 6
(3,789 Views)
As you noticed, the Bounds property is read only, but almost all classes (including the Cluster class) have another property which allows you to set the size of the object. If the property node doesn't include the properties you need, you can either right click the cluster to create a reference to it or get the reference to the array element and then use To More Specific Class to cast the reference to the Cluster class.

___________________
Try to take over the world!
0 Kudos
Message 2 of 6
(3,769 Views)
Solution
Accepted by topic author DeltaJ
Here's my cheat (and cheap?) way 🙂 If you want to get fancy and center the numeric and boolean indicators, you could add spacers on the north and west sides, too.
Message 3 of 6
(3,751 Views)
Hmm, for some reason I was sure I remembered seeing sizing properties for clusters. Anyway, you should note that to get the posted example to work you need to set the cluster sizing to Size to Fit.

___________________
Try to take over the world!
0 Kudos
Message 4 of 6
(3,723 Views)
That approach ye outlined will certainly get me out of trouble - really nice way to get around the problem -  thanks a mill....and hopefully in v8.7 they'll let us write to bounds!
0 Kudos
Message 5 of 6
(3,709 Views)

Yes, I forgot to mention that you need to select size to fit for the cluster. Thanks.

Message 6 of 6
(3,689 Views)