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
 Origin Forum
 Loop Minitool Integration over Worksheet

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
lillt91 Posted - 06/11/2018 : 10:38:22 AM
Origin Ver. and Service Release (Select Help-->About Origin): 2018b
Operating System: Windows 10

Hi, I'd like to run the Minitool Integration over a whole worksheet. I tried doing it with the integ1 function but without finding the right solution.

My data of every column is shaped like a cubic curve. Its cut in half, so that you have a left site, from X=1 to X of Y_Max and a right site from X of Y_Max to X=22.

I want to get the size of the left area and the size of the right area. Like on the screenshot I added but given out as a new workbook or worksheet:
https://my.originlab.com/ftp/forum_and_kbase/Images/Minitool Integration.PNG

1   L A T E S T    R E P L I E S    (Newest First)
Hideo Fujii Posted - 06/11/2018 : 5:54:27 PM
Hi lillt91,

You can invoke Integrate gadget from the script as described at:
https://www.originlab.com/doc/LabTalk/ref/Gadget-obj

Assuming your data is sorted by X values, and there is no rectangle object (thus newly
created ROI boxes are named as rect and rect1), the following snippet does something
similar to your sample screenshot:
////////////////////////////////////////////////////////////////
///Calculation of ROI positions
sum(%C);    //Calculate max Y and its row number(imax) of the plot
x1From=xof(%C)[1];  //X of 1st data point
pkindex=sum.imax;   //Index of Peak
pky=sum.max;        //Peak height
xPeak=xof(%C)[sum.imax]; //X of the peak
range rg=1;         //1st plot in the graph
xLastTo=xof(%C)[rg.getSize()];  //X of the last point
xWidth1=xPeak-x1From;           //Width of 1st half
xCenter1=(xPeak+x1From)/2;      //Center of 1st half
xWidth2=xLastTo-xPeak;          //Width of 2nd half
xCenter2=(xPeak+xLastTo)/2;     //Center of 2nd half
///1st ROI
addtool_curve_integ;	//Create gadget
gadget gg = rect;	//1st rectangle for ROI
gg.dx=xWidth1;          //Set the ROI width
gg.x=xCenter1;          //Set the ROI center
///2nd ROI
addtool_curve_integ;	//Create gadget
gadget gg2 = rect1;	//1st rectangle for ROI
gg2.dx=xWidth2;         //Set the ROI width
gg2.x=xCenter2;         //Set the ROI center
Label  -s Peak %C[$(pkindex)]: ($(xPeak,.3), $(pky,.3));  //Put a label
////////////////////////////////////////////////////////////////


Hope this helps.

--Hideo Fujii
OriginLab

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