home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-08 | 3.4 KB | 172 lines | [TEXT/MSWD] |
- macro 'Measure All';
- {Measures all currently open images using the current selection. There is}
- {an implied "Select All" if the active image doesn't have a selection.}
- var
- i,left,top,width,height:integer;
- begin
- ResetCounters;
- for i:=1 to nPics do begin
- SelectPic(i);
- RestoreROI;
- Measure;
- end;
- end;
-
-
- macro 'Measure All from Disk';
- {
- Reads from disk and measures a set of images too large to simultaneously
- fit in memory. The image names names must be in the form '01', '02', etc.
- Before starting, open and outline the first image('01').
- }
- var
- i,width,height:integer;
- begin
- GetPicSize(width,height);
- if width=0 then begin
- PutMessage('Before running this macro, open and outline the first image("01") in the series.');
- exit;
- end;
- ResetCounters;
- Measure;
- close;
- for i:=2 to 1000 do begin
- open(i:2);
- RestoreROI;
- Measure;
- close;
- end;
- end;
-
-
- macro 'Paste Results [P]'
- {Use the Measure command, the ruler tool, or the pointing tool to}
- {make up to about 10 measurements, then use this macro to paste}
- {the results into the upper left corner of the window.}
- begin
- SetFont('Monaco');
- SetFontSize(9);
- SetText('Plain');
- SetOption; {Copy headings}
- CopyResults;
- MakeRoi(-10,0,200,200);
- Paste;
- KillRoi;
- ResetCounters;
- end;
-
-
- macro 'Measure Redirected'
- begin
- Redirect(true);
- Measure;
- Redirect(false);
- MarkSelection;
- RestoreRoi;
- end;
-
-
- macro 'Analyze Non-rectangular'
- {Lets you use Analyze Particles}
- {with nonrectangular selection.}
- begin
- Copy;
- SelectAll;
- Clear;
- RestoreRoi;
- Paste;
- KillRoi;
- AnalyzeParticles;
- end;
-
-
- macro 'Reset Analysis Options';
- {Resets the Options dialog box in the Analyze menu to the default settings.}
- begin
- MeasureArea(true);
- MeasureDensity(true);
- MeasureStandardDeviation(false);
- MeasureXY(false);
- MeasureMode(false);
- MeasurePerimeter(false);
- MeasureMajorAxis(false);
- MeasureMinorAxis(false);
- MeasureAngle(false);
- MeasureIntegratedDensity(false);
- Redirect(false);
- LabelParticles(true);
- OutlineParticles(false);
- IgnoreParticlesTouchingEdge(false);
- IncludeInteriorHoles(false);
- WandAutoMeasure(false);
- AdjustAreas(false);
- SetParticleSize(1,999999);
- SetPrecision(2);
- end;
-
-
- macro 'Set Threshold';
- var
- lower,upper:integer;
- begin
- lower:=GetNumber('Lower:',1);
- upper:=GetNumber('Upper:',254);
- SetDensitySlice(lower,upper);
- end;
-
-
- macro 'Measure Accumulated Perimeter[A]';
- {
- Measures perimeter and computes accumulated perimeter,
- storing it in the Major Axis column.
- }
- var
- i:integer;
- TotalPerimeter:real;
- begin
- MeasurePerimter(true);
- SetMajorLabel('Total');
- Measure;
- TotalPerimeter:=0;
- for i:=1 to rCount do TotalPerimeter:=TotalPerimeter+rLength[i];
- rMajor[rCount]:=TotalPerimeter;
- UpdateResults;
- end;
-
- macro 'Count Black and White Pixels [B]';
- {
- Counts the number of black and white pixels in the current
- selection and stores the counts in the Major and Minor Axis columns.
- }
- begin
- SetMajorLabel('Black');
- SetMinorLabel('White');
- Measure;
- rMajor[rCount]:=histogram[255];
- rMinor[rCount]:=histogram[0];
- UpdateResults;
- end;
-
-
- macro 'Compute Average and Total Area [T]';
- {
- Computes average and accumulated area and stores
- the them in the Major and Minor Axis columns.
- }
- var
- i:integer;
- TotalArea:real;
- begin
- SetMajorLabel('Average');
- SetMinorLabel('Total');
- Measure;
- TotalArea:=0;
- for i:=1 to rCount do TotalArea:=TotalArea+rArea[i];
- rMajor[rCount]:=TotalArea/rCount;;
- rMinor[rCount]:=TotalArea;
- UpdateResults;
- end;
-
-
-
-