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
 LabTalk Forum
 converting matrix image to 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

tinkusch

Germany
94 Posts

Posted - 01/05/2005 :  06:47:04 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version: (v7.5870) Test Version
Operating System: XP

Hi,
after import of a *.tif picture into a matrix, the command
matrix -in;
should then convert the matrix image into data.

This works fine in v7.0, the internal data type changes automatically from char to short and the numerical values are accessible.

The command fails in the above test version, the data type remains char() and the numerical values of the matrix cells are not accessible by other routines.

Why is this so and is there a workaround?

Thanks

Stefan


Edited by - tinkusch on 01/05/2005 07:48:45 AM

eparent

118 Posts

Posted - 01/05/2005 :  11:10:23 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I am unable to reproduce the problem.
The following steps were used:
- Run Origin 7.5870
- Create new matrix. Data type defaults to double(8).
- Import TIFF image. Data type changed to short(2) unsigned.
- Execute "matrix -in". Data type still short(2) unsigned.
- Execute "cell(1,1)=". Value appears.

The above steps were tested using 4 different TIFF images. An 8-bit gray, 16-bit gray, 8-bit color, and 24-bit color. The 2 gray scale images gave the results described above.
The 24-bit color image caused the matrix data type to change to "int(4) unsigned" after import and changed to "short(2) unsigned" after executing "matrix -in".
The 8-bit color image caused the matrix data type to change to "char(1) unsigned" after import and did not change after executing "matrix -in".
In all 4 cases I was able to access the data.

Can you please send your TIFF image to tech support so I may test with your image?


Edited by - eparent on 01/05/2005 11:22:59 AM
Go to Top of Page

tinkusch

Germany
94 Posts

Posted - 01/06/2005 :  03:48:24 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,
I have sent an example tiff image to tech support.
As I could not reproduce the problem with other tiff images I now belive, it is a problem of the tiff images created by the HP-scanner software I used.

In Origin7.5 I was able to solve the problem with this function:
void SetMatToShort()
{
MatrixLayer mm("Matrix1");
mm.SetInternalData(FSI_USHORT);
}


bye
Stefan

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