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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 matrix data type

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
chollinger Posted - 06/08/2002 : 4:34:22 PM
Does anyone know how i can set the matrix internal data type to double without prompting?

any help would be nice...

christoph

****Edit****

i tried code like:

.
.
.
win -t matrix MASTER;
Image.FileName$ = %A;
run.section(imgfile,LoadImageIntoMatrix);
win -r %H RealImage$(ii);
matrix -in
matrix -id;
set RealImage$(ii) -it 0;
.
.
.

what i get is that the data type is set to double but the data i just imported is gone...

any ideas?

greetings

christoph

Edited by - chollinger on 06/08/2002 18:06:40
2   L A T E S T    R E P L I E S    (Newest First)
chollinger Posted - 06/11/2002 : 10:15:03 AM
Thanks for the help!

it seems to work also with:

#include origin.h

int setMatDouble()
{
MatrixLayer mat = Project.ActiveLayer();

if(mat == NULL)
{
out_str("no valid matrix a active window");
return 0;
}
if(mat.GetInternalData() == FSI_DOUBLE)
{
out_str("already double, no need to set again");
return 0;
}

mat.SetInternalData(FSI_DOUBLE,1,0); // set matrix layer internal data type

return 0;
}


CU

Christoph
cpyang Posted - 06/10/2002 : 6:59:35 PM
When changing internal data type, original data is lost, so one has to backup and restore the data, as shown in the following Origin C program,

 
void setMatDouble()
{
MatrixLayer mat = Project.ActiveLayer();

if(mat == NULL)
{
out_str("no valid matrix a active window");
return;
}
if(mat.GetInternalData() == FSI_DOUBLE)
{
out_str("already double, no need to set again");
return;
}

Matrix<WORD> bb(mat); // assume you know the matrix data type

matrix temp; // both matrix and Matrix default is double

temp = bb; // store the Origin matrix into our temp double matrix

mat.SetInternalData(FSI_DOUBLE); // set matrix layer internal data type

Matrix aa(mat); // attach a double matrix object to the new matrix

aa = temp; // put original data back
}









The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000