| Author |
Topic  |
|
|
Frank_H
Germany
Posts |
Posted - 04/06/2005 : 1:36:10 PM
|
Hi!
I want to work with image data in OriginC. But one cannot attach a Matrix to an image (on an MatrixLayer), and there is also no image-object as an alternative. How do I access the image data from OriginC without creating the overhead to store image + additional matrix? I need some efficient method to copy image data to or from a matrix or vector.
Regards, Frank |
|
|
Leo_Li
China
Posts |
Posted - 04/07/2005 : 06:25:40 AM
|
Hi, Frank: Once you load your image into a Matrix window, you can acess the image data in Origin C:
// Matrix Layer (Window) MatrixLayer ml = Project.ActiveLayer();
// Matrix Object associated with the Layer MatrixObject mo = ml.MatrixObjects(0);
// Matrix Data (image data) Matrix& mat = mo.GetDataObject();
And you can also retrive the dimension of you image by calling:
int nRows = mo.GetNumRows(); int nCols = mo.GetNumCols();
Leo OriginLab
|
 |
|
|
Frank_H
Germany
Posts |
Posted - 04/07/2005 : 07:43:25 AM
|
Hi Leo
Thanks! That solves my problem!
I only think that it is a bit inconsistent to have a constructor Matrix mat(ml); working for all normal matrices but not for image matrices. Does it ever happen that there is more than on MatrixObject on a MatrixLayer? Speaking of consistency (just in case an OriginC programmer reads this :-) ) Its a bit irritating, that for MatrixLayer, MatrixObject etc one gets the internal data type by GetInternalData(), while for the matrixbase derived objects its GetInternalDataType().
Cheers, Frank |
 |
|
|
cpyang
USA
1406 Posts |
Posted - 04/07/2005 : 9:30:50 PM
|
quote:
Does it ever happen that there is more than on MatrixObject on a MatrixLayer?
Yes, MatrixPage can have multiple MatrixLayer and each MatrixLayer can have unlimited number of MatrixObject. In Origin7.5, there is no GUI to see these additional objects, but it is possible to create and access them.
CP
|
 |
|
| |
Topic  |
|
|
|