home *** CD-ROM | disk | FTP | other *** search
- macro 'Subtract Background [S]';
- var
- i:integer;
- begin
- if nPics<>1 then begin
- PutMessage('Exactly one window must be open.');
- exit;
- end;
- SelectAll;
- Duplicate('Background Corrected'); {id=2}
- Duplicate('Background'); {id=3}
- ScaleSelection(.25,.25);
- RestoreRoi;
- for i:=1 to 10 do begin
- SetOption; Smooth;
- end;
- ScaleSelection(4,4);
- SelectAll;
- Copy;
- SelectPic(2);
- Paste;
- Subtract;
- ResetGrayMap;
- SelectPic(3);
- Dispose;
- end;
-
-
- macro 'Clear Outside and set Threshold [C]';
- {Erase region outside current selection to background color.}
- var
- i,PixelCount,mean,mode,min,max,RoiLeft,RoiTop,RoiWidth,RoiHeight:integer;
- begin
- GetRoi(RoiLeft,RoiTop,RoiWidth,RoiHeight);
- if RoiWidth=0 then begin
- PutMessage('Define region of interest first.');
- exit;
- end;
- Copy;
- SelectAll;
- Clear;
- RestoreRoi;
- Paste;
- KillRoi;
- RestoreRoi;
- Redirect(false);
- Measure;
- GetResults(PixelCount,mean,mode,min,max);
- SetDensitySlice(mean,mean+40);
- {
- MoveTo(20,20);
- DrawNumber(mean);
- DrawNumber(mean+40);
- }
- end;
-
-
- macro 'Binary Filtering [B]';
- var
- i:integer;
- begin
- KillRoi;
- MakeBinary;
- For i:=1 to 3 do Erode;
- for i:=1 to 3 do dilate;
- KillRoi;
- end;
-
-
- macro 'Paste Background [P]';
- {Paste binary filtered image to orignalimage}
- begin
- SelectPic(2);
- SetThreshold(192);
- MakeBinary;
- SelectAll;
- Copy;
- SelectPic(1);
- SetForegroundColor(0);
- Paste;
- DoOr;
- ShowPasteControl;
- end;
-
-
- macro 'Make Hardcopy [H]';
- begin
- SelectAll;
- Print;
- end;
-
-
- macro 'Analyze Particles [A]';
- {Analyze Particles, measure area size}
- begin
- Redirect(true);
- LabelParticles(true);
- OutlineParticles(true);
- IgnoreParticlesTouchingEdge(true);
- MeasureArea(true);
- MeasureDensity(true);
- SetParticleSize(200,99999);
- AnalyzeParticles;
- end;
-
-
- macro 'Dispose Background [D]';
- begin
- SelectPic(3);
- Dispose;
- end;