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
 Origin Forum
 Loop Minitool Integration over Worksheet
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

lillt91

Germany
14 Posts

Posted - 06/11/2018 :  10:38:22 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Hideo Fujii

USA
1582 Posts

Posted - 06/11/2018 :  5:54:27 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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

Edited by - Hideo Fujii on 06/11/2018 5:57:19 PM
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