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
 Labtalk or originC

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
ohm Posted - 04/26/2006 : 10:44:22 PM
Origin Version (7.0):
Operating System:xp
I want to ask, if it is possible to make script in Labtalk which open new matrix, import picture in that, make a countour plot - countour color fill, use the smooth function and export picture... is it even possible to make script like this and if it is possible is it better to make it in labtalk or in originC?
3   L A T E S T    R E P L I E S    (Newest First)
ohm Posted - 04/28/2006 : 2:21:50 PM
Hello,

i want to thank you so much for you help, this program is part of my BC. project it has to be done in Origin Proffesional but iam totaly new with this program so again thank you very much for your help.

greg Posted - 04/27/2006 : 6:05:48 PM
Instead of directly answering this post, I will take this opportunity to illustrate a nice feature in Origin:


  1. Open your Script Window. (Window : Script Window menu)

  2. Hold down a Shift and a Ctrl key while clicking the New Matrix tool.
    That types the following to your Script Window:
    Menu id=34008
    run.section(Standard,NewMatrix)

  3. Delete the line with the Menu id, position your cusrsor at the end of the run.section line and press Enter.

  4. Hold down a Shift and a Ctrl key while clicking the FIle : Import : Image menu option.
    That types the following to your Script Window:
    Menu id=34040
    run.section(imgfile,ImportImage)

  5. Delete the line with the Menu id, position your cusrsor at the end of the run.section line and press Enter. Browse to your image file.

  6. Hold down a Shift and a Ctrl key while clicking the Matrix : Smooth menu option.
    That types the following to your Script Window:
    Menu id=36056
    run.section(MATRIX,Smooth)

  7. Delete the line with the Menu id, position your cusrsor at the end of the run.section line and press Enter.

  8. Hold down a Shift and a Ctrl key while clicking the Plot : Contour Plot : Contour Color Fill menu option.
    That types the following to your Script Window:
    Menu id=35581
    run.section(Plot3D,ContourColor);

  9. Delete the line with the Menu id, position your cusrsor at the end of the run.section line and press Enter.

  10. Hold down a Shift and a Ctrl key while clicking the File : Export Page menu option.
    That types the following to your Script Window:
    Menu id=34018
    run.section(GraphExp,ExportPage);

  11. Delete the line with the Menu id, position your cusrsor at the end of the run.section line and press Enter.


What you are left with is a basic script that does what you suggested :
run.section(Standard,NewMatrix);
run.section(imgfile,ImportImage);
run.section(MATRIX,Smooth);
run.section(Plot3D,ContourColor);
run.section(GraphExp,ExportPage);

You can examine the code for ideas an how you might edit it for further automation. For example, look at GraphExp.OGS and examine the code in the [ ExportPage ] section to discover how to bypass the dialog.

Not all menu options run LabTalk code, but in this case every step could be captured by this simple method.

Mike Buess Posted - 04/27/2006 : 5:35:21 PM
This is possible in LabTalk and also in OriginC via LT_execute. Which is better depends on what you're more comfortable with. Here's a simple LabTalk script. Image format is not restricted to bmp (check out the image LabTalk object in the Programming Guide for details).

image.filename$=C:\Images\image1.bmp; // file path\name
win -t M; // open a new matrix window
image.import.matrix(%H); // import image
mat.matname$ = %H;
matrix -id; // convert to data mode
matrix -pg DIM nc nr; // get dimensions
// smooth
if(nc < 32 || nr < 32)
{
mat.expand(2,2);
mat.shrink(2,2);
}
else
{
mat.shrink(2,2);
mat.expand(2,2);
};
worksheet -p 226 contour; // create contour plot
image.filename$=C:\Images\image2.bmp; // file path\name
Image.Export.PageDPI( BMP, 96, 24, 0 ); // export image


Mike Buess
Origin WebRing Member

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