The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Accessing image data
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Frank_H

Germany
Posts

Posted - 04/06/2005 :  1:36:10 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

Frank_H

Germany
Posts

Posted - 04/07/2005 :  07:43:25 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 04/07/2005 :  9:30:50 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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


Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000