LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Output a ROI Descriptor to a file

Solved!
Go to solution

What is the best way to export an ROI Descriptor to a file such that it can be read at a later time during a test.  I would like to export a number of ROI descriptors to say a txt file, excel file, or some other choice if there is a better option.

 

Thanks,

Wade

0 Kudos
Message 1 of 7
(3,065 Views)

Fastest is to export to datalog file - assuming you will only store the ROI cluster and not want to change this in the near term -this takes only 2 dunctions but is also not human readable.

you can also roll your own txt or xml file or use the labview XML schema (although I find this a little awkward to read).

 

The 2 most important questions are

1.  Do you need to edit this offline (ie human readable)

2.  will you store anything other than an array or single element roi?

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 7
(3,061 Views)

The preference would be human readable, thus allowing us to edit it in some cases.  XML might make sense.

0 Kudos
Message 3 of 7
(3,058 Views)

I did this in a recent project using my own XML utilities

 

The file looked like:

 

 

     <ROI_List>

          <ROI>

               <GlobalRect>

                      <Left>0<\Left>

                      <Right>0<\Right>

                      <Top>0<\Top>

                      <Bottom>0<\Bottom>

              <\GlobalRect>

             <Contours>

                  <Contour>

                        <Type>....

                        <ID>.....

                        <Coordinates>  0, 1, 2.......

                 <\Contour>

             <\Contours>

         <\ROI>

       <\ROI_List>

 

This worked great for me, I used my own schema but it did require a moderate amount of work.

XML captured the nested nature of the data nicely.

 

I would start with the ni schema, much less readaable but no work to implement.

There are some free and for pay toolkits but I wrote my own and like it so I have not explored the other options out there.

 

 

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 4 of 7
(3,055 Views)

So there are no simple export options for the ROI Descriptors except to the datalog which is not human readable?

 

Thanks,

Wade

0 Kudos
Message 5 of 7
(3,053 Views)
Solution
Accepted by topic author wthorson

There are numerious options, each with their own pros and cons:

 

for human readable, use write toXML/ read to XML, the only con is that you have to use NI's schema.  If you dont like their schema you can make your own with a little work.  Or you can explore some of the open source or buy packages for converting a cluster to XML.

A straight up string could work but would not be as extensible for nested structures such as ROIs which consist of sub clusters and arrays and enumerated types.

 

Give the NI schema a try and see if it works for you, it will only taka a few minutes to implement.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 6 of 7
(3,047 Views)

Thanks, that makes sense.  I will start with the XML output for the standard NI Schema, and then if we see a need to make changes to the schema we can.

 

Thanks for the suggestion.

0 Kudos
Message 7 of 7
(3,044 Views)