MPE PROGRAMMING

Second Example - Plotting a Curve.

If you did the first example, and want to try more, here is a program to draw 2 regions of interest and plot their time activity curve.

Unfortunately, plotting a curve in MPE is not that simple, arrays and pointers have to be set up. I don't want to get into what a pointer is right now. Just accept that this is what needs to be done.

Here is the whole program.


Explanation:

The first lines set up the array of 150 REALs, ie the number of points on the X axis.

MACRO SECOND_prog;

TYPE

CurveArray = ARRAY[1..150] OF REAL;

CurveArrayPtr = ^ CurveArray;

CurveArrayPtr "points at" the curve array. This is used in the procedure to plot a curve.

Then set up the VARs we will be using:

VAR

MyXArray, MyYArray: CurveArrayPtr;
ResultPage,FrameNo,NPoints,Page,CurvePage,
ImageNo,NumOfImg,FirstFrame : Integer;

anImage,Composite,HFrame: Image;

aRegion,bRegion: Region;

aCurve, bCurve: Curve;
aGraph: Graph;
OK : Boolean;
allimages: imglist;

There are a few new types here. Note that MyXArray and MyYarray are of the type we defined as CurveArrayPtr, ie arrays of 150 REALs.

Next Page