Columns.CopyTo() functionality - how to perform operation?

Discuss questions and projects related to processing of imaging data here
Post Reply
user-64
Posts: 22
Joined: Thu Jan 01, 1970 1:00 am

Columns.CopyTo() functionality - how to perform operation?

Post by user-64 »

Hello Folks,

I would like to perform basic math functions on columns of data resulting from image analysis.

At the moment I am copying the column to a list or array using a loop, like this;

for i in range (0, channelTable.RowCount, 1):
meanList.append(channelTable.GetValue(i,3))

This list can then be used to perform the basic math functions.

I would like to use instead use the Columns.CopyTo() capability, but cannot figure out the proper formatting of the arguments (array, index). The receiving array always has some error returning. I don't see any use of this in the OAD forum as an example unfortunately, or the GitHub page.

Has anyone used this successfully and have an example that I can follow?

Regards,

Dan
user-4
Posts: 397
Joined: Thu Jan 01, 1970 1:00 am

Post by user-4 »

Data​Column​Collection.​Copy​To(DataColumn[], Int32) Method
Hello Dan,

when you have a ZenTable like channelTable then ZenTable.Columns returns a Data​Column​Collection.
Therefore Columns.CopyTo(...) is a function of Data​Column​Collection.

The Data​Column​Collection.CopyTo(...) command is part of .Net and described here

It says:
Copies the entire collection (of columns!) into an existing array (of DataColumn!), starting at a specified index within the array.

Do you really want to copy the columns? (A column is defined by its Name, data type, etc.)

As said before, CopyTo belongs to the .Net Framework and thus there are no examples in the OAD forum or on the GitHub page.
Post Reply