Sunteți pe pagina 1din 404

microGOP 2000/S

Software Version 3.0

User’s Guide
Revision 5
December 1998

ContextVision AB
Storgatan 24
SE-582 23 Linköping
Sweden

Phone +46 13 35 85 50
Fax +46 13 10 42 82

Email
info@contextvision.se
Website
http://www.contextvision.se
microGOP 2000/S User’s Guide
microGOP 2000/S User’s Guide Table of Contents

Table of Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P-1
The User’s Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P-1
Instructions for reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P-2
Conventions used in this User’s Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P-2

1: The microGOP 2000/S Workstation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1


1.1 System configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1
1.2 Logging in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
1.3 Window based User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
1.4 Starting microGOP 2000/S in OpenWindows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
1.5 Getting help in microGOP 2000/S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
1.6 Image types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
1.7 Display types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
1.8 Unix - Multiuser and multiprocess environment . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5

2: Using the microGOP 2000/S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1


2.1 The microGOP base window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1
2.2 Images in microGOP 2000/S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6
2.3 Image size and system resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7
2.4 The Image Tool window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7
2.5 The Image Processing window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10
2.6 The Image Overview Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11
2.7 The Image Sequence window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-13
2.8 The Image Information window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14
2.9 The Image Display window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-15
The SID planes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-15
The SID menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16
Tools menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16
Brightness/Contrast Control tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-17
Zoom/Pan tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-18
Zoom tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20
Pixel Value tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-24
Paint tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-26
Overlay Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-28
Rubber Band Box tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-29
Rubber Band Circle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-30
Rubber Band Line tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-30

microGOP 2000/S User’s Guide i


Table of Contents

Outline tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-31


Draw tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-31
Tool Properties Menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-38
Colors Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-38
Color Table... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-38
Map... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-39
Slicing... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-44
Pseudo Colors... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-46
Color Table Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-47
Overlays Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-48
Fit Window Menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-49
Save From Display Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-49
Properties Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-50
2.10 A sample session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-51
2.11 How to make a program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-56

3: Functions in microGOP 2000/S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1-1


3.1 The microGOP 2000/S function groups. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1-1
3.2 The Image function group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2-1
To Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2-2
From Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2-3
Video. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2-4
Load Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2-5
Save Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2-8
Show Image Info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2-9
Display Label. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2-10
RGB Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2-11
Hardcopy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2-12
Copy Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2-13
Crop Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2-15
Clear Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2-17
To Dcp (Together with DCP option only). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2-18
From Dcp (Together with DCP option only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2-19
Color Convert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2-20
Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2-21
3.3 The Etc function group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3-1
Set Scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3-2
Define Scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3-3
Measure Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3-4
Measure Circle. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3-5

ii microGOP 2000/S User’s Guide


Table of Contents

Show Measure Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-3-6


Measure Area Mask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-3-7
Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-3-8
Grey16Range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-3-9
Affine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3-10
Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3-11
The Geometry Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3-12
Perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3-14
Rotate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3-16
DCP Command (Together with DCP option only) . . . . . . . . . . . . . . . . . . . . . . . . . 3-3-17
3.4 The Scanstage function group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-1
Calibrate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-4-2
Define Slide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-4-3
Set Slide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-4-5
Set Position. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-4-6
Set Z Position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-4-7
Show Position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-4-8
Scan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-4-9
Autofocus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-10
Synchronize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4-12
3.5 The Program function group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-1
Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-5-2
Slide Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-5-3
Frame Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-5-4
End Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-5-5
Label . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-5-6
Goto. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-5-7
Stop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-5-8
Subroutine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-5-9
Return . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-10
If Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-11
If External . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-13
If Expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-14
If Feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-15
Shell. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-16
Notice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-17
Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-19
Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-20
Present . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-21
Timer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-25

microGOP 2000/S User’s Guide iii


Table of Contents

Pause. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-26
Comment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5-27
3.6 The Gop function group. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6-1
3.7 The Grey function group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7-1
Grey operations that use the GOP or MIP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7-1
Shading. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7-3
Thresh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7-4
Stretch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7-5
Average . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7-7
Median . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7-8
Rank . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7-9
Sobel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7-10
Prewitt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7-11
Laplace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7-12
Conv 3×3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7-13
Calculate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7-14
Mask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7-15
Or. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7-16
Invert. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7-17
3.8 The Binary function group. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8-1
Erode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8-3
Dilate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8-4
Point Erode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8-5
Skeleton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8-6
Line Ends . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8-7
Line Ends 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8-8
Open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8-9
Close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8-10
Separate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8-11
Fill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8-12
Hull . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8-13
Touch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8-14
Match . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8-15
Not . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8-16
And . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8-17
Or. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8-18
Exor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8-19
Sub. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8-20
Chaincode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8-21
Distance Map. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8-22

iv microGOP 2000/S User’s Guide


Table of Contents

3.9 The Morphology function group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9-1


Morphological Gradient . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-9-2
Black Top Hat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-9-3
White Top Hat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-9-4
Grey Erode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-9-5
Grey Dilate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-9-6
Grey Open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-9-7
Grey Close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-9-8
Watershed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-9-9
3.10 The Measure function group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10-1
Measure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10-2
Classify . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10-5
The Point Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10-6
Create Binary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10-7
Histogram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10-8
List. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-10-12
Basics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-10-14
Scattergram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-10-15
Area Fraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-10-17
Dump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-10-20
Retrieve. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-10-21
Grey Histogram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-10-22
3.11 The Stereology function group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11-1
Intercept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11-2
Volume Weighted Mean Volume. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11-7
Surface Area per Unit Volume . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-11-10
Mean Surface to Volume Ratio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-11-13
3.12 The FFT function group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12-1
FFT (Fast Fourier Transform) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12-3
Inverse FFT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12-4
Convolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12-5
Correlation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12-6
BT PSD (Blackman-Tukey Power Spectral Density estimation) . . . . . . . . . . . . . . 3-12-7
Radial PSD (Power Spectral Density) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12-9
Richardsson-Lucy Restoration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-12-10
Normalized Averaging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-12-12
Calculate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-12-13
Wiener filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-12-14
Equalizer filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-12-15
Gauss filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-12-16

microGOP 2000/S User’s Guide v


Table of Contents

Exponential filter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-12-17


Defocus filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-12-18
Motion filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-12-19
Butterworth filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-12-20
Applicability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-12-21
3.13 The Classify function group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13-1
Supervised Statistical Image Classification. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13-1
Feature values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13-2
The feature space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13-2
Classification rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13-3
Train & Gather Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13-4
Classical non-contextual methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13-5
Contextual methods. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13-6
Classification Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13-9
ImClassify . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-13-10
The Train window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-13-12
To edit a train image using the SID Train Tool . . . . . . . . . . . . . . . . . . . . . . .3-13-18
DisplayClass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-13-21

4: Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
4.1 Variable types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
4.2 Definition of variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
4.3 Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5
4.4 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
4.5 The continuing statement character . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
4.6 System variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
4.7 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13
Math functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13
The timer function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-14
String functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-14
String to value functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-19
String to vector function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-19
Vector functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-20
Reading external data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-24
Image size function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25
Image Access functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25
Functions to erase the contents of image buffers. . . . . . . . . . . . . . . . . . . . . . . . 4-25
Functions to get pixel data from image buffers . . . . . . . . . . . . . . . . . . . . . . . . . 4-26
Functions to set pixels in image buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-26
Writing external image files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-28

vi microGOP 2000/S User’s Guide


Table of Contents

If expression. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-29
While expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-30
Message Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-31
Write and writeln statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-32
The file() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-33
Object Measurement Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-33
Feature Classification function - ObjectKeep . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-33
Intensity Measurement function - GetIntensity. . . . . . . . . . . . . . . . . . . . . . . . . 4-34
Functions to set the active SID tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-35
To set the Slice Color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-37
To copy the XImage from the SID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-37
Functions that draw graphics in the SID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-38
4.8 Include files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-45
4.9 Creating User Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-46
4.10 Binding variables to function parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-51

Appendix A: OPEN LOOK concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-1

Appendix B: Starting the microGOP 2000/S. . . . . . . . . . . . . . . . . . . . . . . . B-1


B.1 Starting the X server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-1
B.2 Starting microGOP 2000/S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-1
B.3 Setting the license key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-2
B.4 The Setup Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-3
B.5 Error messages from microGOP 2000/S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-5

Appendix C: Configuring the microGOP 2000/S . . . . . . . . . . . . . . . . . . . C-1


C.1 The README file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-1
C.2 Essential environment variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-2
Example of environment variable setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-3
The IMGPATH environment variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-3
The EDITOR environment variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-4
The DISPLAY environment variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-4
C.3 Using a license key file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-5
C.4 The command line options to smicro. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-6
C.5 How to enable microGOP options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-7
C.6 Files used by microGOP 2000/S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-8
Image buffer files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-8
The microloadprogram file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-9
The microimagetype file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-10
The microimagesize file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-12
The microvideounit file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-13

microGOP 2000/S User’s Guide vii


Table of Contents

The .microgeoscale file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-20


The microprofile file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-21
The microdcpmenu file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-28
Temporary files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-28
Postscript files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-28

Appendix D: Image copy rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-1


D.1 How are grey scale and binary images copied ? . . . . . . . . . . . . . . . . . . . . . . . . . . . .D-1
D.2 How are Gop images copied ? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .D-1
D.3 How are c32 images copied ? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .D-2

viii microGOP 2000/S User’s Guide


Preface

Preface
The microGOP 2000/S is a complete application for image processing
and quantitative image analysis. This application will also be referred to
as the microGOP for ease of reading.

The User’s Guide


The microGOP 2000/S User’s Guide is intended as the first document to
study for new users of microGOP 2000/S. It is both a tutorial and a
manual.
The main purpose is to get you started and to make you feel familiar
with the microGOP user interface. The User’s Guide also contains a
reference part for describing functions and variables, as well as
instructions for setting up a comfortable environment on your system.
The user interface of microGOP is based on windows, buttons and
menus. This makes microGOP easy to explore by just browsing around
using the mouse. The User’s Guide is there to answer the questions that
come up during this learning phase.
Chapter 1: The microGOP 2000/S Workstation presents a brief description
of the microGOP workstation.
Chapter 2: Using the microGOP 2000/S describes the fundamental
windows and their items. The chapter also contains a step-by-step
example of both interactive use and programming in microGOP .
Chapter 3: Functions in microGOP 2000/S gives a full description of all the
Image Processing functions in microGOP .
Chapter 4: Variables describes the use of variables and how to create your
own user interfaces (UI).
Appendix A: OPEN LOOK concepts gives an introduction to OPEN LOOK
concepts, i.e. how to interact with the windows and items of the user
interface.
Appendix B: Starting the microGOP 2000/S describes how to start the
microGOP in different ways.
Appendix C: Configuring the microGOP 2000/S describes how to set up
your own environment and how to change setup files.
Appendix D: Image copy rules presents the image copy rules used in
microGOP.

microGOP 2000/S User’s Guide P-1


Preface

Instructions for reading


If you are a novice on microGOP read chapter 1 and appendix A. Then
work through the examples in chapter 2. Leave the variables in chapter 4
until later.
When you feel more confident with microGOP use chapters 3 and 4 as a
reference manual.
Appendix C describes how to setup your own environment and
customize the microGOP.

Conventions used in this User’s Guide


This User’s Guide uses a few conventions when referring to the
microGOP and the user interaction.
• Unix command line interaction is printed in Courier font.
Commands typed by the user are underlined.
% openwin
• microGOP function names are printed in bold typeface.
• Button labels and other text items that can be found in microGOP
are printed in bold typeface.
• A button label followed by ... implies that a pop-up window will
appear if that button is selected.
• Unix program names are printed in bold typeface.
• Referring manuals and books are printed in italic typeface.
• Directory and file names are printed in italic typeface.

☞ Many of the illustrations in this User’s Guide are “snapshots” taken


directly from an actual microGOP display. Some of the windows and
icons however do not print very well in this manual.

P-2 microGOP 2000/S User’s Guide


The microGOP 2000/S Workstation 1

1 The microGOP 2000/S Workstation


1.1 System configuration
The microGOP 2000/S workstation consists of:
• A Sun SPARCstation with a powerful microprocessor and a high
resolution color monitor. The SPARCstations are available in
different models and configurations.
• Optional hardware:
GOP General Operator Processor for advanced structure and tex-
ture image processing operations, e.g. local orientation.

MIP A newer version of the GOP processor. This processor is a 2


slot Sbus based processor that fits into any SPARCstation
with 2 free Sbus slots. This processor has the same function-
ality as the GOP.

DCP Display Control Processor is an optional image display unit.

Scan stage and scan stage controller


This option enables automatic analysis of many image fields
in a microscope.

• Optional equipment, e.g. printers, cameras, scanners, storage


devices, etc.

microGOP 2000/S User’s Guide 1-1


1 The microGOP 2000/S Workstation

1.2 Logging in
Before you can start to work with microGOP you have to identify
yourself to the system. This is done by logging in.
The following instructions assume that the SPARCstation is up and
running. You should have a login: prompt on the display. A prompt is
a text or a symbol showing that the system is ready to take a new
command.
login: my-user-name <Return>
password: <does-not-show-when-typed> <Return>
Now you have logged in. The OpenWindows window system might
now be started by your login file. If you only get a prompt like this:
my-user-name@host-name-51:
you have to start OpenWindows yourself:
my-user-name@host-name-51: openwin <Return>
In subsequent examples your prompt will be symbolized by % for ease
of reading. Also the carriage return key <Return> will not be printed.
If OpenWindows fails to start, contact your System Manager.

1.3 Window based User Interface


The user interface of the microGOP is built on the X Window System and
it adheres to the OPEN LOOK§* Graphical User Interface Guidelines
regarding how windows, buttons, scrolling lists etc. should look and
feel. A three button mouse is used for all selections in buttons, menus
and windows.
For further information on the fundamentals of windows, the mouse
and OPEN LOOK, see Appendix A: OPEN LOOK concepts and also the
Solaris on-line tutorial. We recommend that you go through the on-line
tutorial if you have not used window based applications before.

§ OPEN LOOK is TM of AT&T


* See also OPEN LOOK Graphical User Interface Application Style Guidelines, Addison-Wesley, ISBN
0-201-25364-7

1-2 microGOP 2000/S User’s Guide


The microGOP 2000/S Workstation 1

1.4 Starting microGOP 2000/S in


OpenWindows
When OpenWindows has started, and you press the MENU (usually
right-most) button on the mouse while the cursor is in the background
of the display (the workspace area), the Workspace menu will appear.
1. Press the MENU mouse button to display the Workspace menu.
2. Move down in this menu (MENU button still pressed down) to the
line microGOP 2000/S. This menu choice might be in another
submenu.
3. Release the MENU button and the microGOP will start initiating.
During the initialization the microGOP base window appears on
the display. The cursor will take the shape of a clock when moved
inside the microGOP base window. This indicates that the
microGOP is “busy”. The microGOP is ready when the cursor
changes back to the arrow shape.
☞ A new instance of the microGOP is started every time you release
the mouse button above the microGOP 2000/S menu alternative.
This can cause your system to run out of swap space. Usually you
should only start one microGOP.

If the microGOP does not start or if it issues error messages, see Appendix
B: Starting the microGOP 2000/S or Appendix C: Configuring the microGOP
2000/S for help.

microGOP 2000/S User’s Guide 1-3


1 The microGOP 2000/S Workstation

1.5 Getting help in microGOP 2000/S


On-line help is available everywhere in microGOP. Position the cursor
on the item for which you want help and press the Help key on the
keyboard. A window with the help text will appear.

☞ The help text can be very long for some functions in the microGOP
which makes it difficult to find the wanted information in the small help
window. Pressing Help on the same function twice will bring up the
help text in a text editor which makes it easier to find specific
information. The editor will be textedit unless the EDITOR
environment variable specifies another editor (e.g. emacs).

1.6 Image types


The microGOP handles 8-bit greyscale images, 16-bit greyscale images,
1-bit binary images, 8+8-bit GOP format images and 32+32 bit complex
float images. The images can be of any size.

1.7 Display types


The Sun SPARCstations come with 1-bit, 8-bit, 24-bit (etc.) displays. The
microGOP will run on 8-bit or 24-bit displays with an X server that has
either an 8-bit PseudoColor default visual or a 24-bit TrueColor default
visual.
Running the microGOP on a 24-bit display with a 24-bit TrueColor
default visual will enable display of color images in true color (not
dithered), and so called GOP images are displayed with true
quantization.
To select the default visual when starting the X-server, see Starting the X
server, page B-1.

1-4 microGOP 2000/S User’s Guide


The microGOP 2000/S Workstation 1

1.8 Unix - Multiuser and multiprocess


environment
The Unix operating system allows multiple users to be logged in
simultaneously and multiple processes (= programs) to be active at the
same time. Several users can be logged in to the Sun workstation on
terminals plugged directly into the workstation or via the built-in
Ethernet interface. At the same time you could be using the microGOP
on the workstation display.
The multiprocessing capability is very powerful combined with a
window based user interface. You can have several application
programs running at the same time and select in which application you
want to work by just placing the cursor within that application.
If you have many applications active at the same time you might end up
with a lot of windows on your screen. The iconify capability that most
applications have allows you to temporarily hide all the windows
belonging to that application. The only trace of the application is a small
icon or symbol on the screen. Use the iconify capability to keep your
screen clean. See Appendix A: OPEN LOOK concepts for details on icons.
The figure below shows an example of what the display might look like
after the microGOP has been started.

microGOP 2000/S User’s Guide 1-5


1 The microGOP 2000/S Workstation

1-6 microGOP 2000/S User’s Guide


Using the microGOP 2000/S 2

2 Using the microGOP 2000/S


2.1 The microGOP base window
The microGOP base window is the first window that appears when the
microGOP starts.

The upper part of the base window contains some buttons and menu
buttons. The rest of the window is used to display different kind of
information, like the current directory, current scale factor, etc. The
small icon in the upper right corner is the drop zone for microGOP
programs.
The File menu
The File menu is used to load and save microGOP programs.
Load >
A submenu is connected with the Load menu choice. The first choice
in this submenu (Load...) pops up a file browser which is used to find
microGOP programs that are stored on file.
The rest of the choices in the submenu are
configured by the microGOP user. The
choices are defined in the file
.microloadprogram on the users home
directory. See the README file on the
release directory or The microloadprogram
file, page C-9. A microGOP program is
loaded and started when one of these user
defined choices is selected.

microGOP 2000/S User’s Guide 2-1


2 Using the microGOP 2000/S

New
This menu choice deletes the loaded program. The function is useful
when a new program is going to be created.
Insert...
This menu choice pops up a file browser where a microGOP
program can be selected and inserted into the currently loaded
microGOP program. The program is inserted at the position of the
insert arrow in the program area of the Image Processing window.
Save As >
A submenu is connected with the Save
As menu choice. This submenu has two
alternatives:

Save As...
This menu choice pops up a file browser where a file name can
be selected for the program that shall be saved.

☞ A quick way to save a microGOP program (with the same


name as last time it was saved) is to press <Ctrl-S> on the
keyboard while the cursor is inside the program list (the
program area of the Image Processing window).
Save Confidential As...
This menu choice also pops up a file browser where a file name
can be selected for the program that shall be saved. The program
will be saved as a “confidential program”, which means that the
program can not be edited or even inspected when loaded again.
This makes it possible to give microGOP programs away
without revealing the functions used in them.

☞ It is extremely important to also save the program with Save


As... (using another name) to be able to make changes in the
program in the future.
Quit
This menu choice is used to quit the microGOP. A notice window
will appear where this action can be confirmed or canceled.

2-2 microGOP 2000/S User’s Guide


Using the microGOP 2000/S 2

The View menu


The View menu is used to display different windows.
These windows are thoroughly described later in this
chapter.

Image Processing...
The Image Processing window is the largest and most important
window in microGOP. All interactive image processing and
programming is performed from this window. All programmable
microGOP functions are grouped together into several function
groups. Throughout this manual, a function is referred to by its
name together with its corresponding function group.
Image Tool...
The Image Tool window is used to keep track of the images
currently loaded in the microGOP image buffers.
Image Display...
The Image Display window is used to display images.
Image Overview...
The Image Overview window displays an overview of image files
stored on disk. The image files are displayed as small image icons.
Image Sequence...
The Image Sequence window controls the display of image
sequences.
Image Information...
The Image Information window displays information about the
latest loaded image. Its main purpose is to display information about
radiology images (MR images, CT images, and such).
Defined Variables...
The defined microGOP variables are displayed in this window. The
variables are used when creating microGOP programs. See the
function Variable in section 3.5 - The Program function group and ,
seechapter 4 Variables.
Geometry Tool...
The Geometry Tool window is described together with the
Geometry function, see section 3.3 - The Etc function group.

microGOP 2000/S User’s Guide 2-3


2 Using the microGOP 2000/S

About microGOP...
The About microGOP window displays information about the
microGOP version as well as the address and telephone numbers to
ContextVision AB.

The Properties menu


The Properties menu contains two menu choices.
Settings
This menu choice behaves as a shortcut to the Settings function, see
section 3.3 - The Etc function group.
Grey16Range
This menu choice behaves as a shortcut to the Grey16Range
function, see section 3.3 - The Etc function group.
The Run button
Starts the currently loaded microGOP program. The execution always
starts from the first program line, even if the program has been stopped
previously.
The Continue button
Continues execution at the selected program line.
The Step button
Executes the selected program line.
The Stop button
Stops the program execution. The program will stop when the current
function is ready.

2-4 microGOP 2000/S User’s Guide


Using the microGOP 2000/S 2

The Dcp menu (only together with DCP option)


This menu contains functions to control the DCP. The
default contents of this menu can be changed by
creating the file .microdcpmenu on the users home
directory. (The easiest way is to make a copy of the
microdcpmenu file on the release directory.) The
default choices are described below.
Mouse to DCP
Transfers the mouse movements to the DCP
cursor. This requires a hardware connection
between the computer and the DCP.
UnZoom
Sets the zoom factor in the DCP to 1 (unzoomed).
Foreground Off / Foreground On
Switches the DCP foreground plane off or on.
Background Off / Background On
Switches the DCP background plane off or on.
Clear Image/Clear Foreground/Clear Background
Clears the image, background or foreground plane in the DCP.
Clear Header
Writes an empty string in the header above the image.
B/W Color Table/ARG Color Table/GOP Color Table
Sets a B/W magnitude, a B/W argument, or a GOP color table.
Boot standard DCP
Boots the DCP with the standard DCP program.

microGOP 2000/S User’s Guide 2-5


2 Using the microGOP 2000/S

2.2 Images in microGOP 2000/S


The microGOP maintains a number of image buffer files (image buffers).
The image processing functions take the input images from the image
buffers and they write the result images back to the image buffers.
Images can be captured with the Video function or loaded from file with
the Load Image function, both found in the Image function group.
Images can also be dragged and dropped into the image buffers from the
Image Overview window or from the OpenWindows file manager.
The image buffer formats currently supported are:
Binary images
These images are represented with 1 bit per pixel. A set pixel (=1) is
white and an unset pixel (=0) is black. White pixels are also called
object pixels.
8-bit Grey scale images
These images are represented with 8 bits per pixel (= 256 intensity
levels ). The value 0 is black and the value 255 is white.
16-bit Grey scale images
These images are represented with 16 bits per pixel. The maximum
dynamic range is -32768 to 32767 but any subrange can be used. See
the Grey16Range function in section 3.3 - The Etc function group.
GOP images
These images are represented with 8+8 bits per pixel. The first 8 bits
are called the magnitude and the second 8 bits the argument. These
images are often the result of a texture (GOP) operation.
Complex c32 images
These images are represented with 32+32 bit float values per pixel.
The FFT functions use this image format.
There are 7 buffers of each format available, called Channel and 1-6.
The images in the image buffers have all the same size. The default size
is 512x512 pixels but it can be set to any size ≥ 16x16.
The image size can be set at start-up time (see Appendix C: Configuring the
microGOP 2000/S), or changed at any time from the Load Image function
(Image group) or from the Settings function (Etc group).

2-6 microGOP 2000/S User’s Guide


Using the microGOP 2000/S 2

☞ Old image buffers may become visible when the image size changes.
This happens if the new image size matches the size of any old image
buffer. The rest of the image buffers will be regarded as empty (black).

☞ RGB color images can be displayed by using three 8-bit grey scale
image buffers. See the Image Tool window below, and the function
RGB Display in section 3.2 - The Image function group.

2.3 Image size and system resources


The images in the image buffers are stored on file. The microGOP also
uses internal memory buffers. The size of these buffers are proportional
to the current image size. The user should be aware of that the system
load from the microGOP in terms of memory, disk space, swap space,
and processing speed is proportional to the current image size.
The larger the images, the slower the performance of the microGOP will
be. Large images can cause the system to run out of system resources,
like disk space or swap space. Contact your system administrator if this
happens.

2.4 The Image Tool window


The Image Tool window is used to interactively display image buffers
and to interactively load images from file into the buffers. It also
presents an overview of the contents of the image buffers. The figure
below shows how the Image Tool window may look like when binary
images, 8-bit grey scale images and GOP images are used.

microGOP 2000/S User’s Guide 2-7


2 Using the microGOP 2000/S

Images can be dragged and dropped into the Image Tool from the
OpenWindows file manager or from the Image Overview window.
When an image file is dropped into the Image Tool the corresponding
image in the image buffer is overwritten.
The first image buffer is called Channel and is often used as the default
input source and the default output destination for all image processing
functions. The other buffers are numbered from 1 to 6. (The name
Channel has historical reasons. There is no difference between the
Channel buffer and the 1-6 buffers.)
The image buffers are used as temporary storage while running image
processing functions. The image processing functions take their input
images from the image buffers and they write back the result images
into the image buffers.

How to display images using the Image Tool window


The Image Tool can be used to display images in the Image Display
window. Just click SELECT on an image in the Image Tool and it is
displayed in the Image Display. It is also possible to drag and drop an
image from the Image Tool into the Image Display. A binary image can
be displayed in the background or foreground overlay plane in the
Image Display window by using the ADJUST (affects the background)
or the MENU (affects the foreground) mouse button.

☞ Three consecutive 8-bit grey scale images can be displayed as an


RGB color image by pressing ADJUST, MENU and SELECT at the same
time while pointing at the first (the red band) image of the three. See also
the RGB Display function in section 3.2 - The Image function group.

How to copy images from the Image Display to the


Image Tool
The use of the <Shift> key on the keyboard + a mouse button will copy
images from the Image Display window into an image buffer. First,
position the cursor on the image buffer which the image shall be copied
to. <Shift> + SELECT will copy the image plane, <Shift> + ADJUST will
copy the background overlay plane, and <Shift> + MENU will copy the
foreground overlay plane.
The <Control> key on the keyboard can be used to clear (erase) an image
buffer. Position the cursor on the image buffer which is going to be
erased. <Control> + SELECT will erase the image buffer.

2-8 microGOP 2000/S User’s Guide


Using the microGOP 2000/S 2

Other functions in the Image Tool window


Redisplay images
When this button is selected, the Image Tool window is refreshed in
order to reflect the current state of the microGOP image buffers. The
Image Tool can be set up to update its contents as soon as an image
has changed in one of the image buffers. This is the default. See the
Settings function in section 3.3 - The Etc function group.
Compare
This button repeats the second last action performed in the Image
Tool window. This function can be used to compare two images in
the Image Display window.
Example: How to compare Grey image 1 and 2; Display Grey 1 and
then Grey 2. To toggle between the two images, click the Compare
button.
Clear All
This button clears (erases) all image buffers.
Display: in window/on DCP
This choice (only available together with the
DCP option) selects whether the Image
Display window or the DCP should be used to display images.
As mentioned before, images can also be loaded into the image buffers
by using drag and drop from the OpenWindows file manager or from
the Image Overview window. If multiple images are selected and
dropped in the Image Tool window, they are loaded in consecutive
image buffers.

☞ There are some implicit image copy rules that are used when images
are copied between different image formats. These rules are described in
Appendix D: Image copy rules.

☞ The Image Tool displays a resampled version of the images in the


image buffers, i.e. they are forced to fit into the square icons of the Image
Tool.

☞ Only image files that have the ContextVision imf image format can
be dragged and dropped into the image buffers. Images of other formats
must be loaded with the Load Image function (Image group).

☞ The size of the image icons in the Image Tool window can be
changed. See The command line options to smicro, page C-6 or type
smicro -help in a UNIX terminal window for help.

microGOP 2000/S User’s Guide 2-9


2 Using the microGOP 2000/S

2.5 The Image Processing window


This window displays when the Image Processing... menu choice in the
View menu is selected. This window is where all interactive image
processing and also microGOP programming takes place.

Function group selector

Insert arrow

Function group area

Program list

Function parameter area

All microGOP functions are grouped together into different function


groups. Each group has its own color in order to make programs easier
to read. When one of the function groups in the “function group
selector” to the left is selected, all functions in the selected group are
displayed in the “function group area”. Each microGOP function has a
set of parameters that are displayed in the “function parameter area”
when that particular function is selected. The selected function in the
“function group area” is marked with a thicker border.
The parameters for the selected function can be adjusted, and the
function is executed when the Perform button is selected. Clicking the
function icon to the right of the Perform button also executes the
function. The function can also be entered into a microGOP program by
selecting Program in the Perform menu, or by dragging and dropping
its icon into the program list.
The use of the Image Processing window is described in section 2.10 - A
sample session later in this chapter.
All function groups and all their functions are described in chapter 3.1:
The microGOP 2000/S function groups.
2-10 microGOP 2000/S User’s Guide
Using the microGOP 2000/S 2

2.6 The Image Overview Window


This window is used to view images that are stored on file (not the image
buffers). The Image Browser is used to locate the directory that shall be
inspected in the Image Overview window. The Display Overview
button in the Image Overview window displays the images that are
currently listed in the Image Browser as small icons.

☞ No icons are displayed for images that are not using ContextVision
imf image format.

These two windows display when the Image Overview... menu choice
in the View menu is selected. It is also possible to access the Image
Overview from the Load Image function (Image group).
One image is selected by clicking SELECT on it. A selected image icon is
marked with a border. Several images can be selected by using the
ADJUST button. It is also possible to select a range of images by clicking
SELECT on the first image and then <Shift> key + ADJUST on the last
image. All the images from the first to the last are selected.
The size of the Image Overview window can be changed by using its
resize corners. A larger size makes it possible to show more images at
the same time. The Image Overview splits up the images in pages if
there are too many icons to be displayed in the window at the same time.
The Page menu or the +/- buttons can be used to jump between the
different pages.
The update of the image icons can be slow if there are many or large
images. The update can also be slow if the inspected directory is in a
slow file system (floppy, networking, etc.).
The Stop button can be used to interrupt the update of the image icons.
This is useful if the user does not want to wait for the whole update. The
image file names are displayed instead.

microGOP 2000/S User’s Guide 2-11


2 Using the microGOP 2000/S

☞ If the <Shift> key is pressed when using the + and - buttons, the
image icons are prevented from being generated.
The Load Sequence... button is used to load a number of selected images
(≥ 2) as an image sequence. The Image Sequence window is displayed
when the images have been loaded.
The Image Overview window can also be used to display images in the
Image Display window. Clicking SELECT on a selected image icon
displays the image in the Image Display window (it is not loaded into
any image buffers). It is also possible to use drag and drop.
It is also possible to drag one or more images to the Image Tool and
hence be loaded into the image buffer(s).

☞ The images are normally resampled to the current image size used
by microGOP when displayed or loaded from the Image Overview
window.

☞ If the <Shift> key is pressed while dragging and dropping an image


into the Image Tool, the current image size used by microGOP will be
reset to the size of this image. This is called loading an image using
adapt mode.

☞ The Image Overview displays a resampled version of the images in


the image buffers, i.e. they are forced to fit into the square icons of the
Image Overview.

☞ The size and format of a selected image is displayed in the window


footer.

☞ The image icon size can be changed in the Icon Size submenu in the
Page menu.

2-12 microGOP 2000/S User’s Guide


Using the microGOP 2000/S 2

2.7 The Image Sequence window


This window is used to control the display of image sequences.

The sequence of images (≥ 2) are selected and loaded from the Image
Overview window.
The playback of images is started by selecting the forward or backward
Play button. The playback stops when the first/last image has been
displayed unless Autoreverse or Autoreturn has been selected.
The Step buttons are used to jump one image forward or backward.
The Flip button makes it possible to toggle between two adjacent
images.
The slider can be used to quickly scan through the image sequence.
The time delay (in ms) between the display of images can be selected
with Frame Delay. The Faster/Slower buttons can also be used to
increase or decrease the speed of displaying images.
The Max Speed choice disables the update of the Image Sequence
window which increases the speed of the image display.
The Display mapped images checkbox enables the display of pre-
mapped images created from the Save From Display menu in the Image
Display window, or with the SidSaveXImage() function in the Variable
function (Program group). These kind of images can be displayed with
a higher speed than non-mapped images.

☞ The images are resampled to fit the current image size used by
microGOP, unless Display mapped images is used (in this case the
current image size used by microGOP will be reset to the size of the pre-
mapped images, so called adapt mode).

microGOP 2000/S User’s Guide 2-13


2 Using the microGOP 2000/S

☞ The maximum possible speed of the image display depends on the


image size. Smaller images and shorter sequences give higher speed.
The Frame Delay value is not necessarily the true time delay between
images. A delay value shorter than the time it takes to display an image
will not increase the speed of the image display.

☞ The number of frames per second is displayed in the footer of the


window.

2.8 The Image Information window


This window displays when the Image Information... menu choice in
the View menu is selected, or when the function Show Image Info
(Image group) is performed.
Image information is usually attached to medical MR and CT images.
The Image Information window is used to display such image
information that is attached to a ContextVision imf format image. The
image information is only displayed for the image that was most
recently loaded into an image buffer.

Only image size and type will be displayed for images that does not
contain any image information.
It is possible to change or add the information displayed to the left in the
window.
The Reset button undoes any changes that has been made to the image
information. The Apply changes button applies any changes to the
current image information.
The information can be stored with an image when saving it to file using
the Save Image function in the Image function group.

2-14 microGOP 2000/S User’s Guide


Using the microGOP 2000/S - Image Display 2

2.9 The Image Display window


This window displays when the Image Display... menu choice in the
View menu is selected. The Image Display window will automatically
be displayed whenever an image is about to be displayed.
The Image Display window will often be referred to as the SID (Soft
Image Display).
The SID scrollbars are used to
see parts of images that are too
large to fit inside the window.
The resize corners can be used
to change the size of the SID
window.
When an image is dragged and
dropped into the SID (from the
Image Tool, Image Overview,
or the OpenWindows file
manager) it can be dropped in
the middle of the display or in
one of its four quadrants. An
image which is dropped in a
quadrant is resampled to fit the
quadrant.

The SID planes


The Image Display consists of the
image plane, two overlay planes
and a graphics plane. The overlay
planes are called the background
(BG) and the foreground (FG).
The image plane is where an image
is normally displayed.

The overlay planes can be used for painting, marking, drawing, or


display of binary images. Both overlay planes overlay the image plane.
The overlay planes can be made invisible, and the colors can be changed.
The graphics plane is used for drawing graphics and text. See Draw tool,
page 2-31.

microGOP 2000/S User’s Guide 2-15


2 Using the microGOP 2000/S - Image Display

The SID menu


The functionality within the SID is controlled by the
menu items of the SID menu. The SID menu is
displayed when you click MENU inside the Image
Display. This menu can be pinned and contains the
following menu items:
• Tools
• Tool Properties
• Colors
• Color Table
• Overlays
• Viewports (Not used in microGOP yet)
• Fit Window
• Save From Display
• Properties

Tools menu
The Tools submenu can be pinned and contains the SID tools which are
the following:
• Brightness/Contrast Control
• Zoom/Pan
• Zoom (in separate window)
• Pixel Value
• Paint
• Rubber Band Box
• Rubber Band Circle
• Rubber Band Line
• Outline
• Draw
The SID tools have in common that the control of the specific tool is
made interactively with a combination of mouse movements and mouse
buttons.

☞ Only one tool is active at a time.


☞ The cursor inside the SID shows the active tool.

2-16 microGOP 2000/S User’s Guide


Using the microGOP 2000/S - Image Display 2

Brightness/Contrast Control tool


When the Brightness/Contrast Control tool is active, and you drag
SELECT inside the SID image area or the Zoom window, you will alter
the brightness and contrast of the displayed image. Left-right mouse
movements affect the brightness, and up-down mouse movements
affect the contrast. The image will be brighter if you DRAG to the right
and darker if you DRAG to the left. The image will be shown with a
higher contrast if you DRAG upwards and the contrast will be lower if
you DRAG downwards, i.e.
• Drag SELECT left Darker
• Drag SELECT right Brighter
• Drag SELECT upwards Higher contrast
• Drag SELECT downwards Lower contrast
If you click ADJUST inside the SID or the Zoom window, you will reset
the image brightness and contrast to the default.
If you hold down the <Control> key and click ADJUST at the same time,
a stretch function will be performed on the image. See The Stretch
function, page 2-43.

microGOP 2000/S User’s Guide 2-17


2 Using the microGOP 2000/S - Image Display

Zoom/Pan tool
When you select the Zoom/Pan tool, it is possible to enlarge/reduce the
displayed image. An enlarged image will have a zoom factor larger than
100 %. A reduced image will have a zoom factor less than 100 %.

To use the zoom function interactively


In the Zoom/Pan control window, the zoom choice should be
selected. If you drag SELECT inside the SID, you will change the
zoom factor continuously. Only up-down mouse movements will
affect the zoom factor.
If you drag SELECT upwards, you will enlarge the image
continuously and the zoom factor will increase. If you drag
downwards, you will reduce the image continuously and the zoom
factor will decrease. The zoom factor (in percent) is always displayed
in the Zoom/Pan control window.
To use the pan function
In the Zoom/Pan control window, the pan choice (the hand) should
be selected. If you drag SELECT inside the SID, you will move
around the image within the SID continuously.

2-18 microGOP 2000/S User’s Guide


Using the microGOP 2000/S - Image Display 2

To choose the zoom factor


The zoom factor can be chosen with the Scale [%] menu items.
Fit To Viewport
If this menu item is selected, the zoom factor will be chosen so
that the whole image will fit inside the active viewport of the
SID. Default zoom factor is 100 %. Fit To Viewport is the default
menu item of the Scale [%] menu.
25, 50, 100, 200, 400, 800, 1600
If you select one of these menu items, that zoom factor is chosen
while the zoom centre of the displayed image is retained.
The Active checkbox
The Active checkbox indicates if the Zoom/Pan tool is active or not.
The Zoom/Pan tool is made active by selecting Zoom/Pan in the
Tools menu or by checking the Active checkbox in the Zoom/Pan
control window. If you uncheck the checkbox, the Brightness/
Contrast Control tool is activated instead.
Accelerator keys
If you click ADJUST inside SID, the zoom factor will be chosen so
that the whole image will fit inside the active viewport of the SID (Fit
To Viewport). Default zoom factor is 100 %.
If you hold down the <Control> key and click ADJUST inside the SID
at the same time, you will switch between the zoom and the pan
functions.

microGOP 2000/S User’s Guide 2-19


2 Using the microGOP 2000/S - Image Display

Zoom tool
When you select the Zoom tool, the Zoom window will be displayed.
The image within the rectangular area outlined in the SID, called the
zoom area, is shown enlarged (or reduced) in the Zoom window. An
enlarged image will have a zoom factor larger than 100 %. A reduced
image will have a zoom factor less than 100 %.

The Zoom function can be controlled both from the SID and the Zoom
window (which always has an adjustable size with the use of the resize
corners).

Zoom control in the SID image area


To position the zoom area
If you click SELECT inside the SID, the zoom area will be
repositioned with its centre around the pixel where you clicked.
If you drag SELECT, the centre of the zoom area will follow the zoom
cursor. This is also called panning or movement of field-in-view.
This function will not affect the zoom factor.

2-20 microGOP 2000/S User’s Guide


Using the microGOP 2000/S - Image Display 2

To change the size of the zoom area


If you click ADJUST inside the SID, the side of the zoom area which
is closest to the cursor will be moved to this new position, while
leaving the centre of the zoom area unaffected. I.e. if you click
ADJUST outside the zoom area, the area will become larger and the
zoom factor will decrease. If you click ADJUST inside the zoom area,
it will become smaller and the zoom factor will increase.
If you drag ADJUST, the nearest side of the zoom area will follow the
zoom cursor position, while the relative proportions of the area is
maintained. The enlargement/reduction will be affected
continuously while the centre of the zoom area is retained.

Zoom control in the Zoom pop-up window


To position the zoom area
If you click SELECT inside the Zoom window, the zoom area will be
repositioned with its centre around the pixel where you clicked.
This function will not affect the zoom factor.
To change the zoom factor interactively
If you drag SELECT inside the Zoom window, you will change the
zoom factor continuously. Only up-down mouse movements will
affect the zoom factor.
If you drag upwards, you will enlarge the image continuously, the
zoom factor will increase and the zoom area will become smaller. If
you drag downwards, you will reduce the image continuously, the
zoom factor will decrease and the zoom area will become larger.

Information about zoom factor and interpolation method


The zoom factor (in percent) and the interpolation method (Nearest
Neighbour, Bilinear Interpolation, or Cubic Interpolation) are always
displayed in the Zoom window.

The Active checkbox


The Active checkbox indicates if the Zoom tool is active or not. The
Zoom tool is made active by selecting Zoom in the Tools menu or by
checking the Active checkbox in the Zoom window. If you uncheck the
checkbox, the Brightness/Contrast Control tool is activated instead.

microGOP 2000/S User’s Guide 2-21


2 Using the microGOP 2000/S - Image Display

The Zoom Properties menu


The menu items of the Zoom Properties menu are the following:
• Fit Window
• 10, 50, 75, 100, 150, 200, 400, 800, 1600, 2400, 3200 %
• xx % (Custom)
• Change Custom...
• Show Pixel Value
• Hide Pixel Value
• Show Graphics
• Hide Graphics
• Interpolation
Fit Window
If you select the Fit Window menu item the zoom
factor will be chosen so that the whole image will fit
inside the Zoom window.
Fit Window is the default menu item of the Zoom Properties menu.
This function is also achieved if you click ADJUST inside the Zoom
window.
10, 50, 75, 100, 150, 200, 400, 800, 1600, 2400, 3200 %
If you select one of these menu items, that zoom factor is chosen
while the centre of the zoom area is retained.
xx % (Custom)
This menu item can be customized by the Change Custom menu
item. If you select this menu item, this zoom factor (xx %) is chosen
while the centre of the zoom area is retained.
Change Custom
If you select this menu item, the Custom Zoom Factor window
displays. In this pop-up window you can change the zoom factor
that will appear in the menu item xx % (Custom).

2-22 microGOP 2000/S User’s Guide


Using the microGOP 2000/S - Image Display 2

Show/Hide Pixel Value


Enables or disables the display of pixel values for the individual
pixels when the zoom factor is larger than a certain level which
depends on the displayed image type. The levels are 2400 % (8-bit
Grey scale images), 2600 % (GOP images), 3600 % (16-bit Grey scale
images), and 3900 % (RGB color images). This function is only
available when the interpolation method Nearest Neighbour is
used.
Show/Hide Graphics
Enables or disables the display of graphics in the Zoom window. The
display of graphics in the Zoom window will slow down the image
display performance.

☞ Do not display the graphics if it is not necessary.


Interpolation
This menu item has a pull-right menu with three choices:
• Nearest Neighbour
• Bilinear
• Cubic
Here you can set which interpolation method that should be used
when zooming.

☞ When interactive zooming is going on, nearest neighbour


resampling is always used. When the SELECT mouse button is
released, the zoomed image is resampled using the selected
interpolation method. Overlays and graphics are always zoomed
using nearest neighbour.

☞ The nearest neighbour resampling will always be used when


other color tables than BW are used.

microGOP 2000/S User’s Guide 2-23


2 Using the microGOP 2000/S - Image Display

Pixel Value tool


This tool measures individual pixel values and pixel positions. If you
click or drag SELECT inside the SID or the Zoom window, the pixel
position and the pixel value (for the pixel pointed to by the cursor) will
be displayed in the Pixel Value window.
The X value shows the column position and the Y value shows the row
position, measured from the origin at the upper left corner of the Image
Display. The unit is pixels.
The Mag value shows the grey level value
(intensity) numerically. Black is 0.
The square to the right is a magnification of
the selected pixel.
The bar represents the grey level (intensity),
where black (0) is to the left, and white is to
the right.
The Pixel Value function measures the original intensity values,
independent of the contrast window or color table used.
The Active checkbox indicates if the pixel value tool is active or not. The
tool can be made active by checking the box.

Pixel Value in GOP images


If a GOP image (also known as a polar or vector image) is displayed in
the SID, a few differences can be noted.
The Mag value shows the magnitude
(intensity) value numerically. Black is 0. The
Arg value shows the argument (color) value
numerically. Green is 0.
Instead of the bar, a vector representation of
the pixel is shown in the circular display,
where the line length represents intensity
(magnitude) and the angle of the line
represents color (argument).
The Active checkbox indicates if the pixel value tool is active or not. The
tool can be made active by checking the box.

2-24 microGOP 2000/S User’s Guide


Using the microGOP 2000/S - Image Display 2

Pixel Value in RGB color images


If an RGB color image is displayed in the
SID, the Pixel Value window has three bars,
each representing a color (red, green, and
blue) component. The pixel value is
displayed numerically as three different
values.

Pixel Value in complex c32 images


If a complex c32 image is displayed in the SID, the C32 Pixel Value
window pops up.
The Re value shows the real value, and
the Im value shows the imaginary value
numerically. The image buffer that
contains the complex valued FFT image,
in which the pixel measurement takes
place is shown in the C32 Pixel Value
pop-up window (C32 image buffer 1 in
the example to the right).

microGOP 2000/S User’s Guide 2-25


2 Using the microGOP 2000/S - Image Display

Paint tool
This tool enables you to paint in the image plane or in the overlay planes.

The Active checkbox indicates if the paint tool is active or not. The tool
can be made active by checking the box.
The Paint window gives you the following options for using the Paint
tool:
• You can choose which plane you are going to paint in with the
choice button labelled Plane. it is possible to choose between Image,
BG, or FG.
• The size and shape of the paint brush is adjustable. Move the cursor
inside the square to the right of the text Brush. Drag SELECT: The
size and shape will be adjusted in accordance with the cursor
movements. Release the button when the desired brush size has
been set. The minimum size of the brush is one pixel, and the
maximum size is 32 x 32 pixels. Any combination of length and
width within these limits is allowed (e.g. 1 x 32).
• You can select one of the three functions Paint, Fill, or Erase by
choosing one of the icons in the upper left corner of the Paint pop-
up window.

2-26 microGOP 2000/S User’s Guide


Using the microGOP 2000/S - Image Display 2

Paint in a plane
Select Paint and move the cursor to the Image Display. When it enters
the SID or the Zoom window it changes shape to a brush as defined by
the Brush square. Drag SELECT: A line is drawn, following the cursor
movements.

Fill area
Draw a completely closed area in the Image Display. Select Fill and
move the cursor inside the area. Click SELECT: The area will now
automatically be filled. It is important that the border has no gaps.

Erase in a plane
The chosen plane can be erased when Erase is selected. This function is
similar to the Paint function, but when you drag SELECT inside the SID
or the Zoom window, the plane will be erased at that position.
If you erase in the image plane, the erased area will become black.

Paint or erase a whole plane


If you want a whole plane to be painted or erased, first select Paint or
Erase, then select the All button.

To choose the paint color for the image plane


Grey scale image
If you have a grey scale image displayed in the SID, and you want to
select an intensity value to be used as a “color” when painting in the
image plane, use the slider to set this intensity value. This intensity
is displayed in the square labelled Color below the slider.
GOP image
If you have a GOP image displayed in the SID, and you want to select
a color when painting in the image plane, use the slider labelled Mag
to set the intensity value and the slider labelled Arg to set the color.
To the left of each slider is a choice that indicates if that image band
(magnitude or argument) should be affected by the Paint function.
The selected color is shown in the square labelled Color below the
sliders.

microGOP 2000/S User’s Guide 2-27


2 Using the microGOP 2000/S - Image Display

RGB color image


If you have an RGB color image
displayed in the SID, user the
three sliders to set the painting
color. To the left of each slider
is a choice that indicates if that
image band (red, green, or
blue) should be affected by the
Paint function. The selected
color is shown in the square
labelled Color below the
sliders.

To choose the paint color for the graphic overlay planes


The color for the BG and FG overlays is set in the Overlays pop-up
window. This window will be displayed when you select the Overlays...
button in the Paint pop-up window. See the section Overlay Settings
below.

Overlay Settings
This section describes the options that
are available in the Overlays window.
The BG and FG overlays can either be
enabled or disabled. If an overlay is
enabled, the overlay is thereby visible.
Using the choice button labelled
Enabled you can select if an overlay is
enabled or not.
You can specify a color, either
transparent or solid, for each of the
two overlays. First you have to select
the overlay plane for which you want to specify a color. Select either BG
or FG in the choice button labelled Overlay. The color currently
specified for the chosen overlay is shown in the colored square. The
overlay color is created from the summation of the three color sliders,
labelled R (red), G (green), and B (blue). For example, if all three sliders
are set at maximum then the overlay color will be white. A single slider
at maximum, e.g. red, and the other two sliders at zero will result in the
overlay color being red. Finally, you can select if the color should be
Opaque (solid) or Transparent.

2-28 microGOP 2000/S User’s Guide


Using the microGOP 2000/S - Image Display 2

If Transparent is selected, you can also select Map Under which applies
the Map function to the pixels under the set areas of enabled overlays.
You can select the amount of Opacity for the training overlay when
working with image classification and when drawing training areas. If
you check the Map Under checkbox, the Map function is applied to the
training areas and “under” the classified result.

Rubber Band Box tool


When the Rubber Band Box tool is active, you can drag SELECT inside
the SID or the Zoom window to define a rectangular box. When you
release the mouse button the box is defined. Now, the box can be in edit
or nonedit mode. To switch between these two modes, click ADJUST
inside the SID or the Zoom window.
The functionality of the rubber band box is application dependent, the
SID itself presents only the tool for defining a rectangular box
conveniently.
Edit mode
If the rubber band box is in edit mode, it has small
squares in each corner and along the sides. If you
want to move the box, place the cursor on a box
side (but not on one of the squares) and then drag
SELECT. If you want to change the shape of the
box, place the cursor on one of the small squares
and then drag SELECT.

☞ The coordinates of the Rubber Band Box are available in the


Variable function.

microGOP 2000/S User’s Guide 2-29


2 Using the microGOP 2000/S - Image Display

Rubber Band Circle


When the Rubber Band Circle tool is active, you can drag SELECT inside
the SID or the Zoom window to define a circle. When you release the
mouse button the circle is defined. Now, the circle can be in edit or
nonedit mode. To switch between these two modes, click ADJUST
inside the SID or the Zoom window.
The functionality of the rubber band circle is application dependent, the
SID itself presents only the tool for defining a circle conveniently.
Edit mode
If the rubber band circle is in edit mode, it has
small squares that surrounds the circle. If you
want to move the circle, place the cursor on the
perimeter (but not on one of the squares) and
then drag SELECT. If you want to change the size
of the circle, place the cursor on one of the small
squares and then drag SELECT.

Rubber Band Line tool


When the Rubber Band Line tool is active, you can drag SELECT inside
the SID or the Zoom window to define a line. When you release the
mouse button the line is defined. Now, the line can be in edit or nonedit
mode. To switch between these two modes, click ADJUST inside the SID
or the Zoom window.
The Rubber Band Line is used to measure distances. The distance is
printed in the footer of the Image Display.
Edit mode
If the rubber band line is in edit mode, it has small crosses at the end
points of the line. If you want to move the line, place the cursor on
the line (but not on one of the crosses) and then drag SELECT. If you
want to move an end point, place the cursor on one of the small
crosses and then drag SELECT.

☞ The coordinates of the Rubber Band Line are available in the


Variable function.

2-30 microGOP 2000/S User’s Guide


Using the microGOP 2000/S - Image Display 2

Outline tool
The outline tool can be used to mark the contour of a region or any
irregular structure. The marked region can be automatically closed and
filled. See Tool Properties Menu, page 2-38.

☞ The coordinates of the Outline are available in the Variable


function.

Draw tool
The Draw tool is used to draw
graphics objects and type text
objects in the graphics plane of the
SID.
The objects can be moved and
changed after they have been
created. The objects in the graphics
plane can be copied to the image
plane and to the overlay planes.

The Active checkbox


The Active checkbox indicates if
the Draw tool is active or not. The
Draw tool is made active by
selecting Draw in the Tools menu
or by checking the Active
checkbox. If you uncheck the
checkbox, the Brightness/Contrast
Control tool is activated instead.

Selecting objects
To select graphics or text objects (Draw objects), the Object Selector must
be active. To select a Draw object, click SELECT on it (on the border of
the object). To select additional objects, click ADJUST on them. If you
click ADJUST on a selected object, it is deselected.
You can select one or more objects in a single operation by dragging
(SELECT) a rubberbanding region in the SID to enclose the objects. All
objects completely within the region is selected.
To select all objects, choose Select All from the Edit menu. To deselect
all objects, click SELECT on an area in the SID away from any objects.

microGOP 2000/S User’s Guide 2-31


2 Using the microGOP 2000/S - Image Display

The Draw objects


There are seven different types of Draw objects, each described below.
The Line object
This function is used to draw straight lines. To draw a line, select this
function and drag SELECT in the SID. The line begins where the
mouse button is pressed and it ends where the mouse button is
released.
To constrain the line to 45° increments, press the <Control> key while
you define the starting point of the line.
The Rectangle object
This function is used to draw rectangles and squares. To draw a
rectangle, select this function and drag SELECT in the SID. One
corner is defined when the mouse button is pressed and the opposite
corner is defined when the mouse button is released. To create a
square, press the <Control> key while defining the first corner.
The Freehand object
To draw a freehand line, select this function and drag SELECT in the
SID. The freehand line follows the mouse movements while
dragging and is completed when the mouse button is released. This
is what is called an open freehand line. It is also possible to create
closed freehand lines, where the starting point and the last point are
connected with a straight line. See Tool Properties..., page 2-36.
The Ellipse object
This function is used to draw ellipses and circles. To draw an ellipse,
select this function and drag SELECT in the SID. The two opposite
sides of the ellipse are specified where the mouse button is pressed
and later released. To create a circle, press the <Control> key while
defining the first side.
The Rounded Rectangle object
This function is used to draw rectangles and squares with rounded
corners. It works exactly as the function for drawing rectangles, see
above. The roundness of the corners can be set in the Draw: Tool
Properties window, see page 2-36.

2-32 microGOP 2000/S User’s Guide


Using the microGOP 2000/S - Image Display 2

The Irregular Polygon object


To draw an irregular polygon, select this function and drag SELECT
in the SID. The first line segment begins where the mouse button is
pressed and it ends where the mouse button is released. Each time
you click (or drag) SELECT in the SID a new straight line segment is
defined. A line segment can be constrained to 45° increments, just
press the <Control> key while you click (or drag) SELECT.
To complete the irregular polygon, select the Object Selector or a
Draw object function. The polygon can be opened or closed, similar
to the freehand object described above.
See Tool Properties..., page 2-36.
The Text object
To create a text object, select this function and click SELECT in the
SID. The text will begin at the insert point (vertical bar) now visible
where you pressed the mouse button. Type the text on the keyboard.
Multiple text lines are allowed within one text object, just press the
<Return> key for a new line. A text font (typeface) can be applied on
a text object, see Fonts..., page 2-37.
If you click SELECT inside a text object, the insert point will be
visible in the object. The insert point can be moved within the text
object with the right, left, up, and down arrow keys on the keyboard.
This enables text editing.

Drawing multiple objects of the same type - Hold mode


Normally, as soon as a graphics object or a text object has been created,
the created object is selected and the Object Selector is automatically
chosen in order to enable object modification. If you want to create
several objects of the same type, it is possible to set a function in Hold
mode. This can be done in two ways:
• Select the function you want to use, e.g. the Rectangle function.
• Check the Hold checkbox.
or
• Double-click the function you want to use, and the Hold checkbox
is checked automatically.
When a function is in Hold mode you can draw many objects of the same
type, until you select another function or the Object Selector.
The Irregular Polygon function is not affected by the Hold mode.

microGOP 2000/S User’s Guide 2-33


2 Using the microGOP 2000/S - Image Display

Moving and resizing objects


Only one object can be moved or resized at a time. To be able to move or
resize an object, it must be selected. When the cursor is on (or very close
to) the border of a selected object, there will be three different cursor
images visible, depending on where on the border the cursor is
positioned.
• Move cursor
• Border resize cursor
• Corner resize cursor
When the move cursor is visible, you can drag SELECT and the object is
moved around until you release the mouse button.
When the border resize cursor is visible, you can drag SELECT and that
object border is moved until you release the mouse button.
When the corner resize cursor is visible, you can drag SELECT and that
object corner is moved until you release the mouse button.
If you press the <Control> key when you start to drag, different
constraining effects will occur:
Move
Only vertical or horizontal move is possible.
Border resize
No constraining effect.
Corner resize
Only proportional resizing is possible.

☞ Do not resize the text objects. The size of a text object is defined by
the text that is typed in the text object.

☞ If you want to hide objects while moving or resizing them, check the
Hide While Edit checkbox.

2-34 microGOP 2000/S User’s Guide


Using the microGOP 2000/S - Image Display 2

Object modifiers
All object modifiers are implemented as abbreviated menu buttons.
They apply to all selected objects and to the objects that are to be created.
However, all modifiers may not affect all types of objects, see the
restrictions for each object modifier.
Line Width
The line width specifies the relative thickness of a line. You can
choose from a range of predefined line widths, or specify a custom
line width (Other: ).
Affects all graphics objects but not any text objects.
Line Style
Lines can be drawn in a variety of styles. Affects all graphics objects
but not any text objects.
Line Arrows
This modifier applies arrowheads to the start, end, or both ends of
Line objects and Irregular Polygon objects. Arrowheads can also be
removed. (The arrow that points to the left in the abbreviated menu
applies an arrowhead to the start of a line-shaped object.)
Line Pattern and Colors
With this modifier, you can set the foreground color, the background
color, and the pattern that will affect the border line of a graphics
object, or the text in a text object. A black pattern will show the line/
text in the foreground color, a white pattern will show the line/text
in the background color, and a transparent pattern will not show the
line/text at all. Another pattern will present a combination of the
foreground and background colors according to the chosen pattern.
The background color can be chosen to be transparent. This modifier
affects all objects, graphics and text.

☞ The foreground and background color of the objects must not be


confused with the foreground and background overlay planes of the
SID.
Fill Pattern and Colors
This modifier is very similar to the above described modifier. This
one applies to the area that is surrounded by the border line of a
graphics object. For the text object, it applies to the rectangular area
that surrounds the text. This area is called the Fill area. This modifier
affects all objects, graphics and text, but not any Line objects.

microGOP 2000/S User’s Guide 2-35


2 Using the microGOP 2000/S - Image Display

Markers
A selected object is marked with 2 (Line) or 8 markers. The style (filled/
unfilled rectangles, filled/unfilled circles, crosses), color, and size of
these markers can be specified with the Markers abbreviated menu
buttons.

The Edit menu


Cut
Selected objects can be (temporarily) removed from the graphics
plane by selecting the Cut menu item.
Paste
This menu selection will replace the object(s) that was removed from
the latest Cut operation.
Delete
Selected objects are permanently removed from the graphics plane
by selecting the Delete menu item.
Clear
This menu item deletes all graphics and text objects from the
graphics plane.
Select All
This menu item selects all created objects.

Options menu
Tool Properties...
In the Draw Tool Properties window, a few properties for some
graphics objects can be set.
Set the Freehand and the Irregular
Polygon objects to be opened or closed.
For a closed object, the starting point and
the last point are connected
automatically with a straight line.
Set the corner roundness for Rounded
Rectangle objects.

2-36 microGOP 2000/S User’s Guide


Using the microGOP 2000/S - Image Display 2

Fonts...
In the Font Chooser window, a specific font (typeface) can be
applied to the text in Text objects.

Arrange menu
You can change the relative display order of objects in a stack of
overlapping objects.
To Front
Moves the selected objects to the front of all objects in the graphics
plane.
To Back
Moves the selected objects to the back of all objects in the graphics
plane.
You can copy all objects in the graphics plane to the image plane or to
the overlay planes (foreground and background) of the SID. Only pixels
that are overlapped by the Draw object and foreground patterns (no
background patterns or object markers) are affected by the copy
operation.
Copy To Plane > Image
All objects are copied to the image plane of the SID. The pixel value
for the copied items is defined in the Paint tool.
Copy To Plane > BG / Copy To Plane > FG
All objects are copied to the background/foreground overlay plane
of the SID. Each pixel that is overlapped by the Draw objects is set in
the overlay plane.
microGOP 2000/S User’s Guide 2-37
2 Using the microGOP 2000/S - Image Display

Tool Properties Menu


This menu is used to change the behavior of the
Outline tool. The outline can be automatically
filled and/or closed. Closed means that a line will
automatically be drawn from the last point of the
outline to the first.

Colors Menu
The Colors menu can be pinned and its menu items
will now be described.

Color Table...
Color tables are loaded automatically when images are displayed but it
is also possible to select color tables manually.
These are the choices:
Grey This is the standard color table for grey scale images.

GOP This is a special color table that should be used together with
GOP images - also called polar, or vector images - in order to
see their color representation properly. GOP images are
created by the GOP image processing operations.

Mag Used together with a GOP image in order to view the


magnitude part of the image in grey scale.

Arg Used together with a GOP image in order to view the


argument part of the image in grey scale.

RGB This is the color table for RGB color images, which consist of
three grey scale images, one for each color band (red, green,
and blue).

Red Used together with an RGB image to be able to view the red
band of the image in grey scale.

Green Used together with an RGB image to be able to view the green
band of the image in grey scale.

Blue Used together with an RGB image to be able to view the blue
band of the image in grey scale.

2-38 microGOP 2000/S User’s Guide


Using the microGOP 2000/S - Image Display 2

Map...
This window allows you to manipulate the color look-up table.

The axes in the map window represent the true pixel intensity values on
the horizontal axis and the pixel intensity values as seen by the eye on
the vertical axis. The origin of this coordinate system is at the lower left
corner of the map window.
The value range for the axes of the map window is determined by the
abbreviated choice labelled Range:. There are five choices:
• Binary The value range [0,1].
• Grey/Gop The value range [0, 255].
• Grey16 The value range is determined by the Grey16
Range setting in the Etc function group (Dis-
play of 16 bit grey scale images). See also the
Properties menu of the base window, page 2-4.
• Full 16-bit range The value range [0, 32767]
• Total 16-bit range The value range [-32768, 32767]
It is important to know that these contrast functions affect the color look-
up table only and not the pixel values in the image.

microGOP 2000/S User’s Guide 2-39


2 Using the microGOP 2000/S - Image Display

Three different mapping functions are available; Line, Points, and


Gamma. The Line function allows the position and slope of the mapping
line to be altered. The Points function allows the mapping line to be
designed by several points with straight lines between the points. The
Gamma function allows the mapping line to be exponential.
For displayed images with more than one band, i.e. GOP images (2
bands; magnitude and argument) and RGB color images (3 bands; red,
green, and blue), there is an exclusive choice labelled Band: that is used
to choose which band that should be affected by the mapping function.
Each band can be mapped with its own mapping function. For RGB
color images there is an All choice item that affects all three bands (red,
green, and blue) simultaneously.
The Line function
The Line function allows the position and slope of the mapping line
to be altered. The mapping function (also known as windowing
function) can be described by numeric values in two ways.
• Level & Width values
• Contrast & Brightness values
Level & Width values
Let us define a rectangular box that covers
exactly the part of the map window where the
mapping line is sloped. See the figure for
definition of width and level of the map
window.
The width value corresponds to contrast. A
smaller width relates to higher contrast.
The level value corresponds to the brightness of
the image. A lower level value relates to a
brighter image.

The default map window (as defined by the BW color table) has
a width value of 256 and a level value of 128.

2-40 microGOP 2000/S User’s Guide


Using the microGOP 2000/S - Image Display 2

To alter the map window


You can either use the sliders to alter the contrast and brightness
of the image, or set specific numeric values for level and width,
or you can interact directly inside the map window in order to
alter the position and slope of the mapping line. To do this,
move the cursor inside the map window and drag SELECT.
Up/down mouse movements control the width (contrast) and
left/right mouse movements control the level (brightness), i.e.
• Drag SELECT left Brighter, smaller level value
• Drag SELECT right Darker, larger level value
• Drag SELECT upwards Higher contrast, smaller width
• Drag SELECT downwards Lower contrast, larger width
You can lock either the width or the level value with the two
Lock buttons.
A few mapping examples
Move the cursor inside the map window and drag SELECT
upwards. Note that the slope of the map line increases. The
width value decreases until it reaches 1, when the line is vertical.
Release the mouse button to leave the line in the desired
position. Select Clear to set the map line to its default condition.
Drag SELECT downwards and note that the slope of the map
line decreases, passing through the horizontal where the width
value→∞. If you continue to drag downwards a negative slope
is obtained, producing an inverse image.
Select Clear again. Drag SELECT sideways to the left, and note
that the line slope remains the same, but its position changes.
Similarly, drag to the right and observe the line position moving
to the right.
Now drag upwards until the width value = 1, when pixels with
true intensity values greater than the level value have maximum
intensity, while the other pixels will have no intensity, hence
“thresholding” the image.

microGOP 2000/S User’s Guide 2-41


2 Using the microGOP 2000/S - Image Display

The Points function


The Points function allows the mapping
line to be designed by several points
with straight lines between the points. If
you click SELECT at a desired point in
the map window, the line forms an apex
at the cursor position, and the numeric
fields below the map window will be
updated. These fields will be described
further on.
The mapping line can be in edit or
nonedit mode. To switch between these
two modes, click ADJUST inside the
map window.
Nonedit mode
New apices can be inserted by clicking SELECT inside the map
window.
Edit mode
In edit mode, the mapping line will have a small box around
each apex. If you start to drag SELECT inside such a small box,
that apex will become active and follow the cursor. If you just
click SELECT inside a box, that apex will become active. The
numerical values for the active point will be displayed in the
numeric fields below the map window. You can also - as in
nonedit mode - form new apices by clicking SELECT inside the
map window (but outside the small boxes).
The numeric fields
The apices will always be numbered with increasing x-
coordinates, i.e. the left-most point is numbered 0, the one to the
right of it is numbered 1, and so on. This number is displayed in
the Point numeric field. The position for that point will be
displayed in the numeric fields labelled x and y.
If you change the Point value, the position for that point will be
displayed. In edit mode that apex will become active.
If you change the x- and y-coordinates for a certain point, that
point will be moved in the map window. The origin for the x-
and y-coordinates is in the lower left corner of the map window.

2-42 microGOP 2000/S User’s Guide


Using the microGOP 2000/S - Image Display 2

The Gamma function


This function allows the map window to be
exponential.
Move the cursor inside the map window.
Drag SELECT upwards. Note that an
exponential curve is displayed in
accordance with the gamma function value
indicated in the numeric field below the
map window, and that as the cursor moves
upwards the value of Gamma increases. If
you drag downwards, the gamma function
value decreases.

The Gamma value indicates what exponent the gamma function has:
Gamma
Y = X
The minimum gamma value is 0.10, and the maximum value is 10.00.
A straight mapping line has a gamma value of 1.00.
You can also enter a numeric value in the Gamma field. The map
window is set to its default condition (Gamma=1) by selecting Clear.
The Stretch function
Histogram stretching is a kind of contrast enhancement of images.
The operation stretches out the image grey scale. In this way it is
possible to obtain maximum dynamic range. Note that the stretch
functions affect the color look-up table only and not the pixel values.
When you select the Stretch button, a histogram stretching is
performed on the displayed image. The Line mapping function will
automatically be selected and the resulting mapping line will be
displayed.
Accumulated mapping
It is possible to apply a new map function on an already mapped
image. When mapping an image and you select Accept, the current
mapping function is remembered and the map line is reset to a
straight line. Further mapping modifications can now be applied on
the mapped image.
Reset resets the current map line to a straight line. Clear sets the map
line to its default condition and the image is shown without any
mapping modifications.

microGOP 2000/S User’s Guide 2-43


2 Using the microGOP 2000/S - Image Display

Slicing...
This function is used to identify and indicate
with a color those pixels that have grey levels
or intensities that lie inside or outside a
specified range, called slice. This is done by a
color look-up table manipulation, which
means that the pixel values in the image are
not changed.
The slice is visualized by a colored area
superimposing a grey scale window. The
value range of the grey scale window is
determined by the abbreviated choice
labelled Range:. For a description of the different Range choices, see
Map..., page 2-39.
You can move the slice by placing the cursor on it, and then drag
SELECT.
The numbers below the slice indicate where the limits of the slice are.
For example, Low: 100 and High: 156 indicate that the slice is between
intensities 100 and 156.
The limits of the slice can be changed.
Place the cursor outside the slice, but
inside the grey scale window and then
drag SELECT. With the cursor to the left
of the slice you will move the low slice
limit and to the right of the slice the high
slice limit. Only left and right mouse
movements are possible.
You can also position the slice and change the slice limits by altering the
numeric fields labelled Low and High.
The color of the slice is created from the summation of the three color
sliders, labelled R (red), G (green), and B (blue).
All pixels in the image with intensity values that lie within (select
Inside) or outside (select Outside) the slice limits will be colored with
the color of the slice.
Note that you must have selected the Bands: Mag choice button for the
slicing to have any effect on the displayed image.

2-44 microGOP 2000/S User’s Guide


Using the microGOP 2000/S - Image Display 2

☞ This function is not used to create binary images from grey scale or
gop images. The Thresh function in the Grey function group should be
used to do that.

☞ The colors in the image can not always be displayed with the correct
colors when the slice is moved (mouse button pressed down). The
correct colors will always be displayed when the mouse button is
released.

Slicing in GOP images


If a GOP image (polar image) is displayed in
the SID, a few differences can be noted.
The choice button labelled Bands has two
choices; Mag and Arg. If only Mag is
selected, only intensity values are affected
(use the upper slice specification, labelled
Mag). If only Arg is selected, only argument
values are affected (use the lower slice
specification, labelled Arg). If both Mag and
Arg are selected, both intensity and
argument values are affected, and you must
specify the slice limits in both slice
specifications.

When both Mag and Arg bands are selected, the Logic choice is
available. If OR is chosen, every pixel that has a magnitude value within
the Mag slice limits, or an argument value within the Arg slice limits,
will be colored. If AND is chosen, each pixel must have its two values
within both slice limits. These two examples presumes that Inside is
chosen for both slice settings.
Note that you must at least select one choice in the Bands choice button
for the slicing to have any effect on the displayed image.

microGOP 2000/S User’s Guide 2-45


2 Using the microGOP 2000/S - Image Display

Slicing in RGB color images


If an RGB color image is displayed in the
SID, the Slicing window has three slicing
bars, one for each color band.
Slicing in RGB color images works similarly
to the above described slicing in GOP
images, with the extension that three
different bands are involved.

Pseudo Colors...

With this window you can select to


represent image grey levels with pseudo
color. This can be used to clarify grey scale
images of poor contrast, because it is easier
to discriminate between different colors
than small changes in the grey scale.
The multi-colored spectrum window indicates which color each
intensity value has. You can move this spectrum by using SELECT on
the two buttons having right or left arrow icons. You can also move the
spectrum one ‘step’ at a time by clicking SELECT on the two buttons
having arrow and stop bar icons. A third method to move the spectrum
is to drag SELECT (left-right mouse movements) inside the spectrum
window.
The color concentration buttons to the left are used to select how the
pseudo colors should be spread over the grey scale. A narrow
concentration makes it possible to inspect very small changes in the grey
scale.
The value range of the spectrum window is determined by the
abbreviated choice labelled Range:. For a description of the different
Range choices, see Map..., page 2-39.

2-46 microGOP 2000/S User’s Guide


Using the microGOP 2000/S - Image Display 2

Colormap...
This window displays the current color map used by the SID. This
window is not used by the normal user.

Color Table Menu


This menu is used to quickly change color tables in
the SID.

Unmap
Changes to a linear (unmapped) color table. The same thing is
accomplished by using the ADJUST mouse button in the SID when
the map tool is selected.
The rest of the choices are shortcuts to the Color Table window in the
Colors menu.
BW
Change to a black and white color table.
GOP
Change to a GOP color table.
PSEUDO
Change to a pseudo color table.
LABEL
Change to a label color table.
RGB
Change to an RGB color table.

microGOP 2000/S User’s Guide 2-47


2 Using the microGOP 2000/S - Image Display

Overlays Menu
This menu is used to enable, disable or clear
overlay planes and graphics.
Clear Graphics & Overlays
Erases the foreground plane, background
plane and the graphics.
Clear Graphics
Erases the graphics.
Clear Background / Clear Foreground
Erases the background or foreground plane.
Background On / Background Off
Switches the background plane on or off.
Foreground On / Foreground Off
Switches the foreground plane on or off.
Overlays...
Brings up the Overlay Window.

2-48 microGOP 2000/S User’s Guide


Using the microGOP 2000/S - Image Display 2

Fit Window Menu


This menu is used to change the size of the Image
Display window (SID). No changes are made to
the current image size used by microGOP.
Current Image Size
Sets the size of the SID to the current image size used by microGOP.
Considerate Size
Sets the size of the SID to the current image size used by microGOP.
The maximum size of the SID is with this function limited to 512x512
pixels.
Tiny Size
Sets the height of the SID to be very small. Sets the width of the SID
to the current image width used by microGOP. The maximum width
of the SID is with this function limited to 512 pixels.

Save From Display Menu

It is possible to save the image currently


displayed in the SID. The entire image or a part
of the image can be saved.

Save Rubberband Box Area...


Saves the part of the image in the SID that is defined by the current
rubber band box. This menu item brings up a file browser which is
used to specify a filename for the image.
Save Entire Image...
Saves the entire image displayed in the SID. This menu item brings
up a file browser which is used to specify a filename for the image.
Save XImage as RGB...
Saves the entire image displayed in the SID together with overlays
and graphics as a 24-bit RGB color image file in TIFF format. What
You See Is What You Get (WYSIWYG). This menu item brings up a file
browser which is used to specify a filename for the image. If the
environment variable SMICRO_SAVEASRGB_FORMAT is set to
BMP, the saved file will be in BMP format instead.

microGOP 2000/S User’s Guide 2-49


2 Using the microGOP 2000/S - Image Display

Save Raw 8-bit XImage...


Saves the entire XImage displayed in the SID. This type of images
can be loaded as “Mapped Images” in an Image Sequence. These
images does not need any mapping trough colortables which makes
it possible to display them more rapidly.

☞ Images saved this way can only be displayed correctly with the
same release of the microGOP. Images should only be saved this way
for temporary use with the Image Sequence function as they are
mapped in a way that only the current microGOP knows about.

Properties Menu
This menu is used to control the relative
position of the Image Display Window in
the stack of windows in microGOP.
Image Display always on top
Every time an image is displayed in the Image Display window, this
window is moved to the top of the stacked windows and thus
becomes fully visible.
Not on top
The Image Display window is not moved among the stacked
windows when an image is displayed, and might thus be behind
other windows.

2-50 microGOP 2000/S User’s Guide


Using the microGOP 2000/S - A sample session 2

2.10 A sample session


Suppose we have put something under the microscope lens, adjusted
the microscope and connected the video camera to microGOP 2000/S.

How to grab an image from the camera


1. Select Image Processing... from the View menu in the base window
of microGOP 2000/S .
2. In the Image Processing window: Select the Image function group.
3. Select Video in the Image function block. (Use the Load Image
function to get an image from file if you do not have a camera
connected to the system.)

The Predefined commands list in the Video function parameter area


contains commands that controls the connected frame grabber.

microGOP 2000/S User’s Guide 2-51


2 Using the microGOP 2000/S - A sample session

The live video signal coming from the camera can be displayed in a
window if any of the ‘Live’ commands is used. The command to use
depends on the type of framegrabber connected. A SLIC frame grabber
should use the SLICLive command and a SunVideo framegrabber
should use SunVideoLive command.

☞ The online help on the Video function describes the framegrabber


commands that are supported at the moment.
The predefined command is inserted into the Input Command textfield
when it is selected. The command in the Input Command textfield can
then be edited. Make sure that the camera is connected to the same port
as specified in the command. Edit the Port argument if necessary. The
video image is displayed when the Perform button is selected.
The field of view, light and focus can now be adjusted on the microscope
while looking at the live video signal at the screen.
We are now ready to grab the image. Select the image buffer where the
image should be saved. Press MENU with the cursor in the abbreviated
menu button Image:. Drag the cursor to the image buffer wanted as
output image. In this example we will put the image in Chan.

Make sure that Automatic image update in Image Display is enabled.


(This is set in the Settings window available from the Properties menu
in the microGOP 2000/S main window.) This makes result images
appear in the Image Display window after the function is ready.
Select a grab command (like SunVideoGrab) in the Predefined
commands list and then select Perform. The image is now grabbed and
stored in Chan. It is also visible in the Image Display window.

2-52 microGOP 2000/S User’s Guide


Using the microGOP 2000/S - A sample session 2

How to threshold the image


Switch function group to Grey and select the Thresh function.

The grey levels within the slice interval Low to High are now colored
yellow in the image display. Adjust the slice so that it colors some
significant objects or area in the image. Use the SELECT mouse button.
• Dragging inside the slice moves the slice. The slice width is
maintained.
• Dragging outside the slice moves the Low or High limit.
We have the choice of putting the result image in any of the 7 binary
images available but let’s keep Chan as output image.

☞ Note that Image to threshold is the image that the slice is applied to.
Select Perform and then switch to the Measure function in the Measure
function block.

microGOP 2000/S User’s Guide 2-53


2 Using the microGOP 2000/S - A sample session

How to measure objects in the image


The Measure function segments the binary image into objects and
measures features for each object.
Select the Measure function group and then the funcion Measure.

Select Features to measure... in the Measure parameter area. The


number of features to measure affects the execution time for the
function. We will only measure the features we are interested in.
Select Area and Perimeter as features to be measured. Chan is selected
as Image and that is where we stored the result from the Thresh
function.
Select Perform. The labeled image is displayed in the image display
window. This image displays the different objects in colors.
More details about the use of the label image can be found among the
functions in the Measure function group, see e.g. section Measure, page
3-10-2, and section Create Binary, page 3-10-7.

2-54 microGOP 2000/S User’s Guide


Using the microGOP 2000/S - A sample session 2

The result from the measurement can be inspected immediately by


selecting List measurement results... in the Measure function parameter
area.

The features listed are defaulted to those measured but you can select
which features to list in the Features... pop-up window.

How to display some basics statistics


As the last step let us calculate some statistics on the measurement.
Select Basics in the Measure function block. The result after Perform can
be seen below.

microGOP 2000/S User’s Guide 2-55


2 Using the microGOP 2000/S - How to make a program

2.11 How to make a program


It is time to make a program out of the sequence of functions we run
interactively in the previous section. Once we have a program we can
just press the Run button and the program will perform all the functions
automatically.
1. Select the Video function in the Image function block. As you can
see the function parameter area has the same values as when we
left it.
2. Place the cursor on the Video function icon in the upper right corner
of the function parameter area.
3. Press SELECT and drag the icon into the program area.
4. Drop the icon in the program area by releasing SELECT.
In the same, way drag & drop the Thresh, Measure and
Basics functions into the program area. Entering a
function into the program can also be done by selecting
Program in the pop-up menu to the left of the function
icon. This alternative works better on slow computers.

2-56 microGOP 2000/S User’s Guide


Using the microGOP 2000/S - How to make a program 2

☞ The functions that are put in to the program are always inserted at
the position of the insert arrow. The arrow can be moved by clicking on
its new position.
Run the program by selecting Run in the microGOP 2000/S base
window. The program execution can be stopped and resumed by means
of the Stop and Continue buttons. The program execution always
continues with the selected program line.

☞ The yellow (not visible here in the manual) border around a function
in the program marks the selected program line.
Save the program
permanently to a file by
selecting Save As... in the
File menu in the microGOP
2000/S base window. Use
the file browser to select a
directory and a file name
for the program.
Press Save Program to save
the program.

Select Delete all in the Edit menu above the


program area. Now the program only exists as a file.

To load the program again


we must use the Load
choice in the File menu.
Select Load in the File
menu of the microGOP
2000/S base window.
Browse the directory tree
until you find your
program and then select
Load Program button. It is
also possible to double
click on the filename in the
list.

microGOP 2000/S User’s Guide 2-57


2 Using the microGOP 2000/S - How to make a program

The filemanager can be used instead of the Load Program browser to


load a file. Just locate a microGOP program (with .mcs extension) and
drag its icon to the drop zone in the microGOP base window. It is also
possible to save a program by dragging from the icon in the base
window to the filemanager. The program will be saved as Untitled.mcs
(Remember to rename it in the filemanager).
When we saved the program as test1, two files were created; test1.mcs
and test1.lst. The .mcs file is a binary file that can be interpreted only by
microGOP. The .lst file is a text file that can be inspected with cat, more
or in a text editor. The program can still be loaded even if the .lst file is
lost. (You can load the program and save it again to get a new .lst file).
Here is the .lst file that was created when we saved our program:
1 Video
Image=GreyCh
Command=SunVideoGrab Port=1 Channel=Y
Frames=1 ScaleX=1.0 CenterX=-1 CenterY=-1
2 Thresholding
InputImage=GreyCh
BinaryOut=BinaryCh
MagLow=79
MagHigh=206
ArgLow=64
ArgHigh=192
ThreshMagOutside=No
ThreshArgOutside=No
3 Measure
Image=BinaryCh
Features=Area,Perim
MeasureArea=Yes
4 Basic Statistics
Action=Latest
Feature=Perim
Name=foo
Screen
Comment=
Filename=foo

2-58 microGOP 2000/S User’s Guide


Using the microGOP 2000/S - How to make a program 2

Another example
Delete the program again and make a new program. Enter the following
functions:
Basics Define basic statistics for perimeter. Name it perim_basics.

Loop Set Laps in loop to 4.

Video Select a live video signal (like SunVideoLive).

Variable Statement: Ui(MESSAGE,”Move to next field”)

EndLoop

Basics Print accumulated on Screen. Name : perim_basics.

Use the Large/Small Window choice in the View menu above the
program list to enlarge the Image Processing window. The resulting
program should look something like this:

Let us insert our “old” microGOP program into the loop. Place the
insertion point between the lines Variable and EndLoop. Use Insert in
the File menu in the same way as you used Load before.

microGOP 2000/S User’s Guide 2-59


2 Using the microGOP 2000/S - How to make a program

Before we run the program let us study line 8 in the program (see left
margin). The Basics action is Latest which means that the statistics from
the latest measurement will be printed for each of the 4 loop laps.
Instead we want to accumulate statistics over all 4 images. We need to
edit line 8.
Select the function icon on line 8 by clicking on it until a yellow border
appears around it. Select Edit parameters in the Edit menu. Now the
microGOP 2000/S is in edit mode. The cursor takes a new shape to
indicate that we are editing a function already inserted in a program.
Change the action in the Basics function to Accumulate to. Also change
the Name to perim_basics. Then select Quit edit in the Perform menu.
Now the changes have taken effect in the program. (You can also quit
editing by making a selection anywhere outside the function parameter
area).
Run the new version of the program!

☞ There are two other ways of entering the edit mode. The fastest way
is to double click on the function in the program that shall be edited.
Another way is to drag the icon from the program into the function
parameter area.

☞ Selecting Edit Parameters while in edit mode will open the next
function in the program for edit. This is a convenient way of stepping
through the program to check parameter settings.

☞ A function is only in edit mode when the cursor indicates so.

2-60 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S 3

3 Functions in microGOP 2000/S


3.1 The microGOP 2000/S function groups
The function groups in the function group area of microGOP 2000/S
appear in the order in which they are usually used. The first step is
nearly always an image input function to get an image into the system
and the last step is a measurement and its presentation. The Program
functions controlling the program flow of course appear “anywhere” in
a program sequence. The Program operations are usually not used when
you run interactively without creating a program. There is no built-in
restriction on the order in which to use the different function blocks.

Image
These functions handle images. You can display images from the image
buffers in a image display window. Images can be entered from a video
camera or from a file. and they can be stored on file or printed on a
Postscript printer. Images within the image buffers can also be copied
for changing their pixel formats. Functions for image cropping and
hardcopy are also available.

Etc
Under Etc are functions for setting and defining scale factors and for
controlling the measure area. You can set certain characteristics in the
microGOPs behavior and there are also functions for geometric
correction of images.

Scanstage (Together with scanstage option only)


This group contains functions for calibration of the scanning stage and
for defining and controlling its movements.

Program
Contains functions for program flow control, variables and for
interaction during program execution.

microGOP 2000/S User’s Guide 3-1-1


3 Functions in microGOP 2000/S

Gop (Together with GOP or MIP hardware option only)


The GOP operations measure structure/texture in local
neighbourhoods of the image. Often a GOP operation can discriminate
features that “classical” grey scale operations can not. The GOP
operations create and use as input both ordinary grey scale images and
GOP images. The format and interpretation of GOP images is described
later in this chapter. These operations are not available if your system
does not have a GOP or MIP processor.

Grey
Contains classical linear and non-linear greyscale operations. Some of
these functions use the GOP or MIP in order to make use of large filters.
These operations are not available if you do not have the GOP or MIP.

Binary
The binary operations operate on binary images. The type of operations
found here are erode, dilate, open, close, skeleton, fill and match
operations. The logical operations like not, and, or, exor and subtract are
also located in this group. There are also functions for chain coding and
distance map calculations.

Morpho
This group contains the grey scale morphology functions. The type of
functions found here are: morphological gradient, white and black top
hat, grey scale erosion and dilation, greyscale opening and closing and
the watershed function.

Measure
You can measure objects in a binary image, create a grey level histogram
or measure the area fraction in a greyscale image. The measurement
results can be accumulated, processed and presented by other functions
in the Measure block. They can also be stored in a file.
The Area Fraction function measures the area fraction within greyscale
intervals in one or several greyscale images. The Image Histogram is
measured for one greyscale image at a time.

3-1-2 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S 3

Stereology (Together with stereology option only)


This function group contains functions for stereology measurements.
Volume and Surface measurements can be made from 2D images.

FFT (Together with FFT option only)


This group contains FFT and inverse FFT and other functions that are
run in the frequency domain.

Classify (Together with classifier option only)


This function group contains functions that are used to classify
(segment) images into regions, classes.

The rest of this chapter is an overview of all functions available in the


function blocks of microGOP 2000/S. Each function has a brief
description and a list of its parameters and their meaning. The
interaction i.e. how to enter values, make selections from menus etc. is
not described here (see Chapter 2 and Appendix A) except for some
functions that have a special interactive part in their user interface.

microGOP 2000/S User’s Guide 3-1-3


3 Functions in microGOP 2000/S

3-1-4 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Image Group 3

3.2 The Image function group


This function group contains functions to copy images in different ways.
Images can be copied from and to the image display, to and from file, to
a hardcopy device etc.

Many of the functions in this function group that only copy images
between image buffers and image display are usually only used in a
program. It is often more efficient to perform these functions in other
ways when the microGOP is used interactively: Images can be loaded
from the Image Overview or the deskset file manager and mages can be
displayed and copied using the Image Tool.

microGOP 2000/S User’s Guide 3-2-1


3 Functions in microGOP 2000/S - Image Group

To Display
This function displays one of the image buffers in the Image Display
window. The images can be displayed in the image plane, foreground
plane or background plane. The necessary conversions are made
automatically.
Copy to
Specifies the destination plane for the image.
From Image
Specifies the image to display.

☞ This function is usually used in programs. The Image Tool window


can be used to display images interactively. The Image Tool window
and the Image Display window are described in the sections The Image
Tool window, page 2-7 and The Image Display window, page 2-15.

3-2-2 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Image Group 3

From Display
The From Display function is used to copy images from the Image
Display window to an image buffer. The image can be saved from the
image plane, the background (BG) or the foreground (FG) in the Image
Display window. The image can be saved in any image buffer.
Save
The plane to copy from.
Save in image
The image buffer to put the image in.

☞ This function is usually used in programs. The Image Tool window


can be used to copy images interactively.

microGOP 2000/S User’s Guide 3-2-3


3 Functions in microGOP 2000/S - Image Group

Video
The Video function is used to read images from an image generating
device like a video camera connected to a video frame grabber.
The Video function has built in support for:
• SBus SunVideo™ and Videopix™ frame grabbers from Sun
Microsystems.
• SBus SLIC-Video™ frame grabber from Osprey Technologies, Inc.
• SBus SNAPPER-8, SNAPPER-24, SNAPPER-DIG16 (for digital
video cameras), and PCI SNAPPER-8 frame grabbers from Active
Imaging Ltd.
• Digital cameras Hamamatsu C4742 (B/W, hires, 10-bit) and
Hamamatsu C4742-95 connected to SNAPPER-DIG16.
There is also direct support for the DCP frame grabber from Context
Vision.

☞ Support for additional frame grabbers may have been added since
this manual was printed. The online help for the Video function and the
README file contains information about the supported frame grabbers.
It is possible to use frame grabbers that are not directly supported by
calling an external program that grabs the image and then puts it in the
specified image buffer. See The microvideounit file, page C-13 for further
description of how to use other frame grabbers.
Image
The grey image to store the grabbed image in.
Input command
The command to be executed. This command is usually selected
from the Predefined commands list, after which it can be edited. For
a description of the different command parameters, see The
microvideounit file, page C-13.
Predefined commands:
A list of commands that grabs images from different devices. A
command is selected by clicking on it. The command is then copied
to the Input command textfield where it can be edited. The
commands in the list are read from the microvideounit file. This file
can be edited to add new commands.

☞ Note that the command that is executed is always the one on the
Input command line.

3-2-4 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Image Group 3

Load Image
Loads an image from an image file to an image buffer. Images of
different types can be loaded. The image can be loaded with or without
resampling.
Image type
Indicates the format for the input image. This determines which
conversion program that should be applied to the image file. See The
microimagetype file, page C-10 for description of how to use different
image formats.
Browse
The menu connected to this button
contains the paths in the
IMGPATH environment variable.
The path is copied to the Directory
field when selected.
The first choice in the menu calls up a file browser which can be used
to find the file to load.

The Directory field in the parameter area of the Load Image


functions specifies the first directory that is displayed in the file
browser when the window is drawn. Double clicking on an image
file in the file browser will transfer its name to the Directory and File
fields. Note that the image is loaded into the image buffer when the
Load Image function is performed and not when it is selected in the
file browser.

☞ The files shown in the file browser are only those that match the
type selected in Image type.
microGOP 2000/S User’s Guide 3-2-5
3 Functions in microGOP 2000/S - Image Group

Overview
This button calls up an Image Overview of the images in the
directory in the Directory field.

The image name is transferred to the Directory and File fields when
an image is selected in the Image Overview.

☞ Image icons will only be displayed for images of the imf image
type.
See The Image Overview Window, page 2-11 for further description of
the Image Overview.
Directory
The directory where the file to be loaded is located.
File
The name of the file to load.
Append number / Number
This choice button is here of historical reasons. A number can be
added to the File name if this button is pressed in. It is not
recommended to use this function. Instead, use the Variable
function to produce the wanted file name and then bind the variable
to the File parameter of the Load Image function.

☞ There should be no extension in the file name if this function is


used. The function will append the number to the string in the File
field and then it will append the image extension of the current
Image type.
Load to image
Selects the image buffer to load the image into. The necessary image
conversions are made automatically.

3-2-6 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Image Group 3

Resample / Adapt
The cases where the image to be loaded has a different size than the
current microGOP image size, can be handled in two different ways.
Resample will resample the new image to the current microGOP
image size. This is the normal setting.
Adapt will set the microGOP image size to that of the image to be
loaded. The microGOP will resize all its image buffers and it will
forget about image buffers of the old size.
If the Adapt method is used a confirm message may appear when
the Load Image function is performed. The confirm message does
not appear if the Load Image function is executed from a program.
The confirm message can be switched off by changing in the
microprofile file. See The microprofile file, page C-21.

☞ The default setting of Resample/Adapt can be set in the


microprofile file. See The microprofile file, page C-21.

microGOP 2000/S User’s Guide 3-2-7


3 Functions in microGOP 2000/S - Image Group

Save Image
Saves an image from an image buffer to a file. The image can be stored
in different formats.
Image type
Indicates the format for the output image. This determines which
conversion program that should be applied to the image when
saving it. See The microimagetype file, page C-10 for a description of
how to use different image formats.
Browse
This button has a menu connected to it. It works as the Browse
button menu in the Load image function.
Directory
The directory where the file to be saved is located.
File
The name of the file to be saved.
Append number / Number
This choice button is here of historical reasons. A number can be
added to the File name if this button is pressed in. It is not
recommended to use this function. Instead, use the Variable
function to produce the wanted file name and then bind the variable
to the File parameter of the Save Image function.

☞ There should be no extension in the file name if this function is


used. The function will append the number to the string in the File
field and then it will append the image extension of the current
Image type.
Include Image Information
This choice enables the saving of image information in imf images.
See The Image Information window, page 2-14 and the Show Image
Info function.

3-2-8 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Image Group 3

Show Image Info


This function displays the image information window. See The Image
Information window, page 2-14.

microGOP 2000/S User’s Guide 3-2-9


3 Functions in microGOP 2000/S - Image Group

Display Label
This function displays the current label image. A label image is
produced by the Measure function which can be found in the Measure
group.
This function is not used very often since the Measure function displays
the label image by itself.

3-2-10 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Image Group 3

RGB Display
The RGB Display function can display three 8-bit grey scale images as an
RGB (color) image.
Red
This parameter specifies the grey scale image to use for the red band
in the color image.
Green
This parameter specifies the grey scale image to use for the green
band in the color image.
Blue
This parameter specifies the grey scale image to use for the blue band
in the color image.

☞ The Image Tool can also be used to display three grey scale images
as a RGB image.

microGOP 2000/S User’s Guide 3-2-11


3 Functions in microGOP 2000/S - Image Group

Hardcopy
This function is used to make a hardcopy on a printer of the contents of
an image buffer.
Make hardcopy of
The image buffer to make a hardcopy of.
X center (mm):
Specifies the center of the image in X-direction on the paper. The
value 0 gives an automatic centering in the X-direction.
Y center (mm):
Specifies the center of the image in Y-direction on the paper. The
value 0 gives an automatic centering in the Y-direction.
Width (mm):
Specifies the width of the image on the paper. The value 0 scales the
image automatically to be as large as possible.
Height (mm):
Specifies the height of the image on the paper. The value 0 scales the
image automatically to be as large as possible.

☞ The aspect ratio between width and height of the image is


maintained if the value for at least one of Width and Height is set to 0.
Portrait / Landscape
Selects a vertical or horizontal printout on the paper.
Default Size & Position
Resets the size and position to their default values.

☞ The destination for hardcopies can be changed, see The microprofile


file, page C-21.

3-2-12 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Image Group 3

Copy Image
This function is used to copy images between image buffers. The image
is converted to the format of the destination image when the source and
destination images are of different types.
Copy from
The image to copy from.
Copy to
The Image to copy to.
Some additional parameters must sometimes be set depending on the
type of the input and output images. There are a number of different
cases to consider:
Binary to Grey
The grey value in the output image must be specified.The
specified value is used in the grey scale image for the pixels that
are set to 1 in the binary image. The Clear before copy works like
this: Enabled: The result image is erased before the copy.
Disabled: Only pixels where the binary image is 1 are affected.
Binary to Gop
The magnitude and argument pixel values for the Gop image
must be specified. The specified values are used in the Gop
image for the pixels that are set to 1 in the binary image. The Gop
image will be 0,0 elsewhere.
Binary to c32
The real part of the complex image will be set to 1 where the
binary image is 1 and to 0 where the binary image is 0. The
imaginary part of the complex image will be set to 0.
Grey to Binary
The low and high threshold in the grey scale image must be set.
The pixels in this range will be 1 in the binary image and the
others 0. See also the Thresh function, page 3-7-4.
Grey to Gop
The grey scale image can be copied to the magnitude or the
argument of the Gop image. It is also possible to select if the
other part of the Gop image should be zeroed(affected) or kept
intact.

microGOP 2000/S User’s Guide 3-2-13


3 Functions in microGOP 2000/S - Image Group

Grey to c32
The real part of the complex image is set to the same values as in
the grey scale image. The imaginary part of the complex image
is set to 0.
Gop to Binary
The low and high thresholds for magnitude and argument in the
Gop image must be set. The pixels in this range will be 1 in the
binary image and the others 0. See also the Thresh function,
page 3-7-4.
Gop to Grey
It is possible to copy the magnitude or the argument to the grey
scale image.
Gop to c32
The polar values in the Gop image are converted to cartesian
values in the c32 images.
c32 to Binary
The pixels in the binary image are set to the absolute value (=
hypot(re, im)) of the real and imaginary part in the c32 image.
Values that become larger than 1 in the binary image are set to 1.
c32 to Grey
The pixels in the grey scale image are set to the absolute value (=
hypot(re, im)) of the real and imaginary part in the c32 image.
Values that become larger than max in the grey scale image are
set to max.
c32 to Gop
The cartesian values in the c32 image are converted to polar
values in the Gop image. Values that become larger than the
max for the magnitud part of the Gop image are set to the max.

☞ The Caclulate function in the Grey function group can be used to


copy images between 8-bit and 16-bit grey scale image buffers.

☞ The Caclulate function in the FFT function group can be used to


modify the pixels in a c32 buffer to prevent overflow when the buffer is
copied to a grey scale or Gop image buffer.

☞ The Image Tool window can also be used to copy images between
image buffers.

3-2-14 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Image Group 3

Crop Image
This functions copies a region of one image buffer to another region of
another image buffer. The source and destination buffers must be of the
same type. The size and position of the source region and the destination
region can differ.
Input
The source image buffer.
Output
The destination image buffer.
Sources
This button has a menu connected to it with a number of predefined
source areas.
The black area in the icons describe
what area will be used as source. The
Get RBBox alternative will get the
current area of the rubber band box in
the image display window. The
description of the area is transferred to
the X, Y, Width, and Height fields
when a choice is made.
Destinations
The menu connected to this button works exactly as the one for
Source except that the choices selects the destination area.
X
The normalized X coordinate of the upper left corner of the source
and destination areas respectively.
Y
The normalized Y coordinate of the upper left corner of the source
and destination areas respectively.
Width
The normalized width of the source and destination areas
respectively.
Height
The normalized height of the source and destination areas
respectively.

microGOP 2000/S User’s Guide 3-2-15


3 Functions in microGOP 2000/S - Image Group

Nearest Neighbour / Bi Linear


Selects the type of resampling to use if the sizes of the source and
destination areas does not match.

3-2-16 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Image Group 3

Clear Image
Sets all pixels to 0 in an image buffer.
Clear image
Image to be cleared.

microGOP 2000/S User’s Guide 3-2-17


3 Functions in microGOP 2000/S - Image Group

To Dcp (Together with DCP option only)


Displays one of the images from the image buffers on the DCP. The
necessary image conversions are done automatically.
Display image
The image to display.
DCP destination.
Where to display the image.

3-2-18 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Image Group 3

From Dcp (Together with DCP option only)


Copies an image from the DCP to an image buffer. Any plane in the DCP
can be copied to an image buffer. The necessary image conversions are
made automatically.
Save
The plane to save.
Save in image
The image buffer to save the plane in.

microGOP 2000/S User’s Guide 3-2-19


3 Functions in microGOP 2000/S - Image Group

Color Convert
This function converts between the RGB colorspace to the IHS
colorspace.
The IHS colorspace is represented with Intensity, Hue and Saturation.
The Intensity image is just an average of the RGB pixel values.
The Hue image is circular color tone image. This means that 0 and 255 in
the image are almost the same color tone. The Hue image can be useful
when a specific color should be thresholded out of a color image.
The Saturation image describes how much of a color we have.
R/G/B
Specifies the Red, Green and Blue bands of a RGB color image.
I/H/S
Specifies the Intensity, Hue and Saturation bands of an IHS image.

The algorithm is taken from the book Computer Graphics by


Donald Hearn & M. Pauline Baker, 1986,
Prentice-Hall Internation Editions, ISBN 0-13-165598-1
Color Models - Conversion Between HSV and RGB Models

3-2-20 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Image Group 3

Display
This is an old function that was used to display images in an older
version of the Image Display window. The To Display function should
be used instead.
Overlay
The binary image to display in the foreground. An empty image will
be displayed if E is selected.
Image
The image to display in the image plane. An empty image will be
displayed if E is selected.

microGOP 2000/S User’s Guide 3-2-21


3 Functions in microGOP 2000/S - Image Group

3-2-22 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Etc Group 3

3.3 The Etc function group


This function group contains functions for definition of the geometric
scale factor, geometric transformation and commands for the DCP.

The Settings function is used to define image size, current directory and
how windows should be updated during program execution.
The scale, measure area and setting functions are usually used in the
beginning of microGOP programs.
The DCP Command functions is is used to perform some DCP related
functions like selecting color table, switching foreground and
background on and off. The DCP Command function is only available
with the DCP option.

microGOP 2000/S User’s Guide 3-3-1


3 Functions in microGOP 2000/S - Etc Group

Set Scale
The geometric scale factor relates real-world distances to the pixels that
are used to store the image in microGOP. The scale factor tells us “how
long is a pixel”. Scale factors are referenced by name. All presentations
of distances and measurement data will be scaled using the latest set
scale factor.
It is not necessary to rerun Measure to present data with a new scale
factor. The scale factor is always applied to the data before presentation.
Scale factor name
Type in a scale name or select a scale from the list. No spaces are
allowed in scale factor names.
Delete scale factor
Deletes the selected scale factor and updates the scale factor file
.microgeoscale

☞ New scale factors are defined using the Define Scale function
described on next page.

☞ The scale factors are stored in the file .microgeoscale on the users
home directory. See The .microgeoscale file, page C-20.

3-3-2 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Etc Group 3

Define Scale
This function defines a new geometric scale factor. The scale factors are
saved in a file (see The .microgeoscale file, page C-20) and they can be set
using the Set Scale function. A scale factor is automatically set as the
current one when it is defined.

Scale factor name


The name to be given to the scale factor. For instance, use the name
20x for the scale factor for the 20x lens on a microscope. No spaces
are allowed in scale factor names.
Number of pixels
The number of pixels that corresponds to the Equal to field length in
the selected unit. This distance can be selected by using the rubber
band line tool in the image display window. The rubber band line
tool is automatically selected in the image display window when this
function is selected. Mark the known distance in the image and the
number of pixels is automatically transferred to the Number of
pixels field.
Equal to
The length for the distance in a “real-world” unit.
Unit
The unit of the real world distance.
The Number of pixels field and the Equal to field are used to calculate
the length of a pixel.

microGOP 2000/S User’s Guide 3-3-3


3 Functions in microGOP 2000/S - Etc Group

Measure Frame
The measure frame is a rectangular area covering a part of, or the whole
image. The Measure function uses the measure frame in the following
way:
• Objects that fall within the measure frame are measured.
• Objects that fall outside the measure frame are not measured.
• Objects that touch the edge of the measure frame can be excluded or
included in the measurement. For each edge you define if objects
should be excluded or included.
The measure frame makes it possible to reject objects that are at the
borders of the image. These objects are often cut and should not be used
for calculations.
North, South, Height, West, East, Width
Defines the measure frame in terms of its size and its distances from
the image borders. These values are interrelated so if you change one
of them the others may change as well.
The easiest way to specify a measure frame is to use the Rubber
Band Box tool in the Image Display window. This tool is
automatically selected when the Measure Frame function is selected.
The position and size of the Rubber Band Box is automatically
transferred to the appropriate fields.
Include objects on sides
Selects whether objects touching an edge of the measure frame
should be included or excluded.
The default measure frame is set the whole image with all edges
included which means that all objects will be included in the
measurement.

☞ Only one of Measure Frame and Measure Circle can be active at the
time.

3-3-4 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Etc Group 3

Measure Circle
The measure circle is a circle covering a part of the image. The measure
circle is used in the same way as the measure frame. See Measure Frame,
page 3-3-4.
Center X, CenterY, Radius
These parameters define the center and the radius of the measure
circle.
The easiest way to specify a measure circle is to use the Rubber Band
Circle tool in the Image Display window. This tool is automatically
selected when the Measure Circle function is selected. The position
and size of the Rubber Band Circle is automatically transferred to
the appropriate fields.
Objects on borders
The objects that touch the borders can be Included or Excluded from
the measurements when using the Measure function.

☞ Only one of Measure Frame and Measure Circle can be active at the
time.

microGOP 2000/S User’s Guide 3-3-5


3 Functions in microGOP 2000/S - Etc Group

Show Measure Area


This function displays the current position and size of the measure area.
The measure area is displayed in the background plane in the image
display window.
A measure area is defined with the Measure Frame or Measure Circle
functions.

☞ The measure area will not be visible if something else, like an image,
is displayed in the background plane later. The background plane can
also be obscured by the foreground plane or graphics.

3-3-6 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Etc Group 3

Measure Area Mask


It is sometimes useful to have a binary image containing the measure
area as a mask. This function creates this mask (a filled area) from the
current measure area.
Measure areas are set with the Measure Frame or Measure Circle
functions.
Create mask in
Specifies a binary image buffer to put the mask in.

microGOP 2000/S User’s Guide 3-3-7


3 Functions in microGOP 2000/S - Etc Group

Settings
Settings for some of the microGOP 2000/S’s behavior. These settings can
also be used interactively from the Properties menu in the microGOP
main window.
Automatic image update in
Every time an image in an image buffer is modified it is also updated
in the Image Display window (or DCP) and Image Tool if they have
been selected.
Auto destination (Together with DCP option only)
Specifies if the images should be displayed in the DCP or in the
image display window.
Program execution trace
The program flow can be traced. In the program list the currently
executing microGOP function is highlighted and in the footer of the
Image Processing window the function name is printed.
Image Width / Image Height
Changes the current image size. Images in the microGOP image
buffers that does not match the new size are regarded as empty. The
Image Sizes menu can be used to select predefined sizes. The sizes
are defined in the microimagesize file. See The microimagesize file, page
C-12.
Current Working Directory
The current working directory is set using this field.
Browse
This button brings up a directory browser to make it easier to select
a directory for the Current Working Directory field.

☞ Sometimes one want to change the current image size without


changing the current directory. This is done by selecting the image size
to the wanted one and . ( a dot) as the Current Working Directory.

☞ Sometimes, on the other hand, one want to change the current


working directory without changing the image size. In this case one
must select the wanted directory and then bind the variables
$ImageWidth and $ImageHeight to the ImageWidth and ImageHeight
parameters. See Binding variables to function parameters, page 4-51.

3-3-8 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Etc Group 3

Grey16Range
This function sets the active range in 16-bit grey scale images. Two
different ranges can be set.
Calculations in 16-bit grey scale images:
The pixel values in 16-bit grey scale result images are limited to these
values. Values that become larger than the maximum value are set to
the maximum value and values that become less than the minimum
are set to the minimum value.
Display of 16 bit grey scale images:
The maximum value (and any value larger than maximum) will be
displayed as white and the minimum value (and values less than
minimum) will be displayed as black. The range between minimum
and maximum will be displayed using increasing intensities from
black to white.
Usually the Calculation and Display ranges are set to the same values.
Example 1: 12-bit grey scale images usually use values from 0 to 4095
(=212-1) so mimimum should be set to 0 and maximum should be set to
4095 for both ranges.
Example 2: 10 bit grey scale images usually use values from 0 to 1023
(=210-1) so mimimum should be set to 0 and maximum should be set to
1023 for both ranges.
The ranges are not limited in any way as long as the maximum value is
larger than the minimum value. Negative numbers can also be used.

microGOP 2000/S User’s Guide 3-3-9


3 Functions in microGOP 2000/S - Etc Group

Affine
The Geometry function can perform the same kind of transformation as
this function.
The Affine transformation consists of scaling, rotation and translation of
the image. If two images differ only in these aspects it is possible to fit
the two images to each other exactly. The transformation is described by
two first order polynomials. It is an output-input transformation hence
the polynomials describe where to pick the value in the input image for
a certain location in the output image.
Bilinear interpolation is used to get pixel values in the input image.
In
The image to be transformed.
Out
The resulting image.
Rotation & Mirroring

This menu contains some choices for simple transformations like


rotation and mirroring. The polynomial coefficients for the selected
transformation are calculated when a choice is selected.
Row polynomial: Y = a + by + cx
The row, Y, coordinate for the location in the In image from which to
fetch a pixel value for the Out image pixel at y,x.
Column polynomial: X = A +By + Cx
The column, X, coordinate for the location in the In image from
which to fetch a pixel value for the Out image pixel at x, y
Geometry Tool...
Pops up the Geometry Tool. This tools make it easy to find the
transformation polynomials. The Geometry Tool is described
together with the Geometry function.

3-3-10 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Etc Group 3

Geometry
When we have several images covering the same area or the same object
it is often useful to make the areas or objects overlap. This makes it
possible to combine information from several images in the image
analysis.
The Geometry function can perform geometrical transformations that
can be described by polynomials of degree 1, 2, 3 or 4. If two images
differ only in these aspects it is possible to fit the two images to each
other exactly. The transformation is described by two polynomials. It is
an output-input transformation hence the polynomials describe where
to pick the value in the input image for a certain location in the output
image.
In
The image to be transformed.
Out
The resulting image.
Row polynomial: Y = a + by + cx + ...
The row, Y, coordinate for the location in the In image from which to
fetch a pixel value for the Out image pixel at y,x.
Column polynomial: X = A +By + Cx + ...
The column, X, coordinate for the location in the In image from
which to fetch a pixel value for the Out image pixel at x, y
Geometry Tool...
Pops up the Geometry Tool. This tools make it easy to find the
transformation polynomials.

microGOP 2000/S User’s Guide 3-3-11


3 Functions in microGOP 2000/S - Etc Group

The Geometry Tool


The geometry tool is used to mark control points in the both the input
image and a reference image. These points are used to calculate the
polynomials for the Affine or Geometry function.

The reference image should be displayed to the right and the image to
be transformed to the left. Use the Input image and Reference image
choices to select these images.
The number of points that must be marked depends on the order of the
polynomial that should be used for the transformation.
Order Required number of points
1 3
2 6
3 10
4 15

☞ The points must be numbered in the same order in both images.


As you can see the point to be marked is highlighted in the row above
the image. If you want to move a point already marked select that
point’s number and mark it again. It is also possible to move a point by
selecting ADJUST close to it and then drag to the new position.
The Used points field indicate how many point pairs that have been
marked. This field also specifies the number of points that will be used
for the calculation of the polynomial coefficients. The value can be
changed if fewer points than the number of marked points should be
used.

3-3-12 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Etc Group 3

Select the Polynomial order (not present if geometry tool was brought
up from the Affine function) that shall be used when calculating the
polynomials.
The polynomials are calculated when the Calculate polynomials button
is selected.
The coefficients for the polynomials are transferred to the Y and X areas
for the Affine or Geometry function.
A window that displays the residuals for the control points is displayed
when the polynomial coefficients are calculated. This window displays
the distances from real control points in the input image to the points
calculated from the control point in the reference image using the
polynomials. The error should be as small as possible. A large error in
some or all points means that the transformation can not be performed
correctly with the selected polynomial order.

☞ It is always a good idea to mark as many points as possible to


decrease the error coming from incorrectly marked points.

☞ The Geometry Tool is not involved in the transformation itself, only


in finding the polynomial coefficients. The images that are displayed in
Geometry Tool help you put the control points right but it is the In and
Out images in the Geometry or Affine parameter area that are used by
the transformation. Typically In and Image would be the same image
while Out and Reference are different images. The transformation is
performed with the Perform button in the Affine or Geometry
parameter area.

microGOP 2000/S User’s Guide 3-3-13


3 Functions in microGOP 2000/S - Etc Group

Perspective
This function can perform translation of an image in X and Y directions,
scaling in X and Y and rotation around X, Y and Z axis.
The result image can be displayed using a parallel projection or a
perspective projection.
The origo of the coordinate system is located at the top left of the image.
The X axis is pointing to the right and the Y axis is pointing towards the
bottom of the image. The Z axis is pointing away from the viewer.
The image center is always translated to the origo before the scaling,
rotation, and perspective transformations are performed. The specified
translation is performed after the image has been moved back to its
original position.
In, Out
The input and output images.
Translation X and Y
Specifies the distance that the center of the image shall be moved.
Scale X and Y
Specifies the X and Y scale factors for the transformation.
Rotation X, Y and Z
Specifies the angle (in degrees) in which the image shall be rotated
around an axis.
X axis: A positive angle will tip the top of the image backwards.

Y axis: A positve angle will tip the right side of the image away from
the viewer.

Z axis: A positive angle will rotate the image counter clockwise.

☞ Possible X and Y rotatations: +- < 90 deg


☞ Possible Z rotatation: +- <= 45 deg
Projection
Parallel or Perspective projection. A perspective projection gives a
distorted image where closer parts of the image appears larger. A
perspective projection with an infinite focal distance is the same as a
parallel projection.

3-3-14 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Etc Group 3

Focal distance
The focal distance is used for the perspective projection. The distance
is measured in pixels. Useful distances are larger than half the image
size. A distance smaller than half the image size might give strange
results.

microGOP 2000/S User’s Guide 3-3-15


3 Functions in microGOP 2000/S - Etc Group

Rotate
The Rotate function rotates an image -90 or +90 degrees. The current
image size will change if the width and height of the image are not equal.
This function can be used to change from a landscape to a portrait
format and vice versa.
Original Image
The image to rotate.
Rotated Image
The rotated result.
The rotation choice makes it possible to rotate -90 or
+90 degrees.

3-3-16 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Etc Group 3

DCP Command (Together with DCP option only)


This function makes it possible to send commands to the DCP.
Action Description
A description of the command. This field is not used by the function.
It is only here to make it easier for the user to understand what the,
sometimes cryptic, Command really does.
Command
This is the command that performs some DCP related function.
DCP Menu
Brings up a menu with predefined commands. A selection of a menu
item will transfer it’s action description and command to the Action
description and Command fields. The menu contents is read from
the file microdcpmenu on the release directory. It is also possible to
have a personal file, .micropdcpmenu, in the home directory. The
default file looks like this:
# This is a definition file for dcp commands
#
’DCPMOUSE’ Mouse to DCP
’MDL “1.0" 256 256 setzoom$’ UnZoom
’MDL 1 ~F setgraph$’ Foreground Off
’MDL 1 ~T setgraph$’ Foreground On
’MDL 0 ~F setgraph$’ Background Off
’MDL 0 ~T setgraph$’ Background On
’MDL 0 “EXOR” 0 planeop$’ Clear Image
’MDL 1 “EXOR” 1 planeop$’ Clear Background
’MDL 2 “EXOR” 2 planeop$’ Clear Foreground
’MDL “ ” writeheader$’ Clear Header
’CLOAD -i bw’ B/W Color Table
’CLOAD bwarg’ ARG Color Table
’CLOAD -i gop’ GOP Color Table
’dcuboot’ Boot standard DCP
Each line in this file forms a Command - Action description pair.
There are a number of keywords recognized by the microGOP:
DCPMOUSE
Switches the mouse movements to the DCP. This only works if there
is a physical connection between the tty port, specified in the
Mouse.Tty field in the microprofile file, and the DCP.
microGOP 2000/S User’s Guide 3-3-17
3 Functions in microGOP 2000/S - Etc Group

MDL
Should be followed by a MDL command. See MDL Reference Manual
for description of the Menu Description Language.
CLOAD
Should be followed by the parameters -i, -f or -b and the name of a
color table. The color table is loaded to the specified plane, image,
background or foreground.
Commands that does not match any of these three keywords, like the
last one in the default file, are sent to a shell for execution.

3-3-18 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Scanstage Group 3

3.4 The Scanstage function group


The functions in this group are used to control the scanning stage. It is
only possible to use these functions if you have a scanning stage
controller connected to the system.

The Scanstage function group contains functions for defining and


controlling the movement of the scanning stage in the x, y and z
directions. It also contains commands for controlling the built-in
autofocus of the IDUNA SSC02, IDUNA SSC03, and IDUNA SSC05
scanning stage controllers.
The scanning stage controller is connected to a serial port in the
computer.

☞ The Scanstage functions will only be visible if the they are enabled
with the -SCAN option when the microGOP is started. See How to enable
microGOP options, page C-7.

microGOP 2000/S User’s Guide 3-4-1


3 Functions in microGOP 2000/S - Scanstage Group

Calibrate
This function must be run as the first function in the Scanstage function
group.
The microGOP will open the communication with the scanning stage
controller and the scanning stage will be told to go to its origin (0,0).

☞ The Calibrate function must be called every time the microGOP has
been restarted even if the scanning stage has not been switched off since
the last calibration.

☞ It is only possible to perform one successful calibration. Multiple


Calibrate calls are ignored.
There are some definitions in the microprofile file that are related to the
scanning stage. These are:
Stage.Resolution
The value defines the resolution of the scanning stage in steps per
mm.The value depends on the type of scanning stage and the type of
scanning stage controller. Some normal values are shown below.
Controller Resolution (steps/mm)
MCC 13-JS 4000
SSC02 200
SSC03 128000

Stage.Device
The name of the serial port that the scanning stage is connected to.
Stage.ZInit: On/Off
The value should normally be On. This might not work on non SSC
controllers. Set the value to Off in these cases.

☞ The scanning stage must always be controlled with the joystick or


with commands from the microGOP after calibration. Do not turn the X
and Y knobs directly on the scanning stage because this will cause a
mismatch between the physical position of the scanning stage and the
expected position in the controller.

3-4-2 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Scanstage Group 3

Define Slide
This function is used to define a scan area. The scan area is called a slide.
Each scan area consist of a number of frames. These frames are positions
where the scanning stage should stop to be able to read an image into the
system.
The scan area can be defined by entering the number of frames to scan
in the X and in the Y direction. The X and Y increments between each
frame can be given in microns or as the size of the measure area.
Measure areas are set with the Measure Frame or Measure Circle
functions in the Etc function group.
It is also possible to set the scan area interactively with the scanning
stage joystick.
Slide to define
The scan area is identified by a number. A maximum of 48 scan areas
can be defined.
Define scan area by
Selects the way the scan area can be defined. The scan area can be
defined interactively with the joystick of the scanning stage
controller or with values.
The parameters below are visible if Define scan area by is set to Values.
Number of frames
Defines the number of frames the scan area should have in X and Y
directions.
Increments between frames
This checkbox specifies if the measure area should be used as
increments between the frames. The increments can be specified in
microns if this box is left unchecked.

microGOP 2000/S User’s Guide 3-4-3


3 Functions in microGOP 2000/S - Scanstage Group

The parameters below are visible if Define scan area by is set to


Joystick.
Increments defined by
Defines the increments between frames in the scan area. The
measure area can be used to define the increments. It is also possible
to use the joystick to define these increments.
Press the Perform button to start the interactive definition. Follow
the instructions in the notices that pop up. You can select to define a
three point focus plane. If you use the focus plane the scan stage will
move within this plane when the actual scan is performed.

☞ The start position of a “Values defined” scan area is set when the Set
Slide function is performed.

☞ To cover a part of a sample completely with a scan area:


Define a Measure Frame that includes objects on the north and west
side and excludes objects on the south and east side. Use this
measure frame as increments in the scan area. This will ensure that
objects are only measured once. It is important that the geometric
scale factor is set correctly.

3-4-4 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Scanstage Group 3

Set Slide
This function is used to set the current scan area (or slide). The current
slide must be set in order to perform the Scan function. The current slide
is also used to calculate the number of laps that shall be used in a Frame
Loop in the Program function group, see the function Frame Loop, page
3-5-4.
Set
Current sets the scan area to be scanned to the selected number. A
slide must be defined before it can be set as current. A “Values
defined” slide (see the function Define Slide, page 3-4-3) will use the
current X and Y position of the scan stage as its start position.
This function can also be used to set the number of slides to use in a
Slide Loop. Select Slides in slide loop if this value should be set.
Number
The slide number.

microGOP 2000/S User’s Guide 3-4-5


3 Functions in microGOP 2000/S - Scanstage Group

Set Position
Moves the scanning stage to an absolute position in mm (origin is 0,0).
X position
Specifies the X position to go to.
Y position
Specifies the Y position to go to
Get current position
Puts the current scanning stage position into the X and Y position
fields.
The arrow buttons can be used for moving the scan stage interactively.
You can set how many steps the motors should turn for each click on an
arrow.

Steps
The number of steps to move for each click on an arrow button.

☞ The Steps value is multiplied with the Stage.Step value defined


in the microprofile file. The normal value of Stage.Step is 1.

☞ The $StageX and $StageY system variables can be useful to use in a


program if the stage should be moved from its current position. Define
new variables with a value $StageX+xoffset and $StageY+yoffset and
bind the new variables to the X and Y parameters. See
chapter 4: Variables on how to define variables, and section Binding
variables to function parameters, page 4-51.

3-4-6 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Scanstage Group 3

Set Z Position
This function is used to set the absolute Z position.

☞ Use this function with extreme care. It is very easy to send values to
the scan stage that will cause it to run the lens into the sample. There are
no end switches on the Z motor so the scan stage will go to the position
it is told to go to.
Z position
Specifies the position to go to.

☞ The position is not an absolute value (in mm) as is the case for
the Set Position function. The value depends on how the Z motor is
connected to the microscope.
Get current Z position
Gets the current position of the Z motor.

☞ The $StageZ system variable can be useful to use in a program if the


stage should be moved up or down from its current position. Define a
new variable with a value $StageZ+offset and bind the new variable to
the Z parameter. See chapter 4: Variables on how to define variables, and
section Binding variables to function parameters, page 4-51.

microGOP 2000/S User’s Guide 3-4-7


3 Functions in microGOP 2000/S - Scanstage Group

Show Position
Prints the current scanning stage position in the status area in the
microGOP main window. This position is relative to the origin of the
scanning stage.
Usually the position of the scanning stage is updated in the status area.
The microGOP is, however, unaware of any changes of the position that
the user has made with the joystick. This function can be used to update
the position after some user interaction with the joystick.

3-4-8 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Scanstage Group 3

Scan
This function is used to move the scanning stage to the next frame in a
scan area (slide).
Typically the Scan function is put in the beginning of a Frame Loop and
then it is followed by an Autofocus and a Video grab function.
See ☞ below.
Move to next
This function can not only move to the next Frame (usually used) but
also set the next Slide as current slide.
Scan order (only visible if Frame is selected above)
The scan area can be traversed in two different ways, Meander path
or Line by line.

☞ The Set Slide function must be called before the Scan function can
be called.

☞ The Scan function must be performed for the first frame in the scan
area even if the scan stage is correctly positioned at the first frame.

☞ A program that uses the scanning stage will probably have


Scanstage functions in the following order (there will most likely be
other functions in the program as well):
Calibrate
Define Slide
Set Slide
Frame Loop
Scan
Autofocus
Video grab
EndLoop

microGOP 2000/S User’s Guide 3-4-9


3 Functions in microGOP 2000/S - Scanstage Group

Autofocus
This function is used to control the built-in autofocus function of the SSC
scanning stage controllers.
The autofocus function uses the video signal from the camera to find the
maximum contrast in the image. The autofocus can be executed in
parallel with microGOP functions since it is performed entirely within
the scanning stage controller.
The behavior of the autofocus function can be changed with four
parameters:
Threshold
Tells the autofocus to ignore differences smaller than Threshold. A
normal value is 2-16. Possible values are 1 to 63.
Steps between focus planes
This is a measure of how accurately the focus can be found. A small
value means that the autofocus will move in small steps when trying
to find he best focus. If the microscope is very much out of focus a
small value for Steps will never find the focus. The value must be a
compromise depending on how well we want to focus and how far
out of focus we expect to be which in turn depend upon the
magnification and the depth of field. However, it is possible to make
two calls to Autofocus; one for coarse autofocussing and then one for
fine focusing. This is useful when including Autofocus in a
microGOP program.

☞ Normal values are 10-200 for the SSC02 controller and 1000-
100000 for the SSC03 controller.
Delay factor
This parameter control the time to wait for the scan stage and the
microscope to stabilize after the stage has been moved. This may be
necessary in order to avoid that motion blur disturbs the autofocus.
A high magnification may require a long delay. Delay factor can be
set to 0 to 9. Set 0 for a very stable microscope and to 9 for a very
unstable one.

3-4-10 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Scanstage Group 3

Run autofocus
If Synchronous is selected the microGOP will wait for the scanning
stage to focus before executing the next command. If Asynchronous
is selected the next microGOP command will be executed
immediately.

☞ You would not want to use Asynchronous if the next function is


a Video grab.

☞ The Synchronize function should be used to check that the


autofocussing is ready.

microGOP 2000/S User’s Guide 3-4-11


3 Functions in microGOP 2000/S - Scanstage Group

Synchronize
This function is used only when the Autofocus function is run in
Asynchronous mode. It simply waits until the auofocussing is ready.

3-4-12 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Program Group 3

3.5 The Program function group


The functions in this group are usually used in microGOP programs.
The functions control the flow of the programs with loops, conditional
jumps and subroutine calls.

The Variable function is, among other things, used to define variables
and user interfaces. The powerful Variable function is using a special
programming language. The description of this versatile programming
language is found in chapter 4.
You can make a microGOP program without using any of the program
functions but they are useful and necessary if you want to make flexible
and user friendly programs.

microGOP 2000/S User’s Guide 3-5-1


3 Functions in microGOP 2000/S - Program Group

Loop
This function starts a loop in a program. The loop should end with a End
Loop function. The functions between the Loop and EndLoop functions
will be repeated the specified number of times.
Laps in loop
The number of laps in the loop. The program lines between the Loop
function and the next End Loop function in the program will be
repeated the number of times that is specified here.

☞ It is often useful to bind an integer variable to the laps parameter.


☞ The $Loop system variable contains the current lap number in the
loop. The variable starts at the specified number of laps and is
decremented with 1 for each lap in the loop.

3-5-2 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Program Group 3

Slide Loop
This function is used together with the Scanstage functions.
The function starts a loop over a number of defined slides. The
maximum number of slides to loop over is set in the Set Slide function.
The Slide Loop should end with an End Loop.

☞ This function is here of compatibility reasons and it is not necessary


to use it.

microGOP 2000/S User’s Guide 3-5-3


3 Functions in microGOP 2000/S - Program Group

Frame Loop
This function is used together with the Scanstage functions.
It starts a loop over all frames in the current slide. The current slide must
be set with Set Slide before a Frame Loop is used. Use the Scan function
to jump between the frames in the slide.

☞ A program that uses the scanning stage will probably


have Scanstage functions in the order shown to the right.

☞ The Frame Loop function does not move the scan


stage. It only keeps track of the number of frames in the
current slide. The Scan function must be inserted inside
the loop to perform the movements.

3-5-4 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Program Group 3

End Loop
The End Loop marks the end of a loop (Loop, Slide Loop or Frame
Loop).
There has to be an End Loop for every Loop, Slide Loop and Frame
Loop in a program.

microGOP 2000/S User’s Guide 3-5-5


3 Functions in microGOP 2000/S - Program Group

Label
A Label indicates a position in the program. The Label function is
inserted into a program to enable functions like Goto, IfExtern,
IfExpression, IfFeature, IfQuery and Subroutine to make jumps to it.
Label to insert
The name of the label. This name is used by other functions to refer
to the label.
List defined labels...
This button draws a window which lists all the labels that are
already used in the program

3-5-6 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Program Group 3

Goto
This function makes an unconditional jump to a Label in a program. The
execution of the program will continue at the position of the label.
Goto label
The name of the label to jump to.
Labels...
This button draws a window which lists all the labels that are
already used in the program. A selection in the label list will transfer
the label name to the Goto label field.

microGOP 2000/S User’s Guide 3-5-7


3 Functions in microGOP 2000/S - Program Group

Stop
The Stop function stops the execution of a program. The Continue
button in the microGOP main window can be used to continue
execution on the program line after the Stop function.

3-5-8 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Program Group 3

Subroutine
The Subroutine function makes a jump to a Label in a program. This is
very similar to a Goto except that the point from where the subroutine
call was made is stored. The Return function causes the program
execution to jump back to the line immediately after the latest
Subroutine call.
Call Subroutine
The name of the label (subroutine) to jump to.
Labels...
This button draws a window which lists all the labels that are
already used in the program. A selection in the list will transfer the
name of the label to the Call Subroutine field.

☞ The Return function must be called at some time after the Label
which Subroutine made a jump to. Nested calls are allowed but be sure
that there is a call to Return for every call to Subroutine.
The example to the right shows the program
flow of a subroutine call. A jump is made to a
label and a return jump is made to the line after
the subroutine function. The dots in the figure
represents other functions.

microGOP 2000/S User’s Guide 3-5-9


3 Functions in microGOP 2000/S - Program Group

Return
This function makes a jump in the program to the line after the last
Subroutine call. See the function Subroutine, page 3-5-9.

3-5-10 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Program Group 3

If Query
This is a type of If-then-else function. A notice pops up when the If
Query function is executed. The notice contains a question and two
buttons.

The left button is the TRUE button that cause the then action to be
performed. The right button is the FALSE button causing the else action
to be performed. The action can be Goto a label, a Subroutine call to a
label, Continue for just “falling through” to the next program line or
Skip for skipping the next program line. Continue and Skip saves you
the trouble of inserting labels. The question text as well as the button
texts can be specified.
Question
The text to be printed in the notice.
Then
Select the type of action to be taken: Goto, Subroutine, Continue or
Skip.
Then label
Select a label if the action is Goto or Subroutine.
Labels...
This button draws a window which lists all the labels that are used
in the program.
A selection in the list will transfer the name of the label to the Then
label field.
Then button text
The text to be printed in the TRUE button.
Else
Select the type of action to be taken: Goto, Subroutine, Continue or
Skip.
microGOP 2000/S User’s Guide 3-5-11
3 Functions in microGOP 2000/S - Program Group

Else label
Select a label if the action is Goto or Subroutine.
Labels...
This button draws a window which lists all the labels that are used
in the program.
A selection in the list will transfer the name of the label to the Else
label field.
Else button text
The text to be printed in the FALSE button.

3-5-12 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Program Group 3

If External
This If-then-else function uses the return status from a Unix command
or another external program. If the return status is not equal to 0 the then
branch is performed and if the return status is equal to 0 the else branch
is performed. The actions can be selected as in the If Query function
If external command
The command or program to be invoked.
The rest of the parameters works exactly as the corresponding
parameters in the function If Query.

microGOP 2000/S User’s Guide 3-5-13


3 Functions in microGOP 2000/S - Program Group

If Expression
This If-then-else function compares two variables with some relational
operator. The result is TRUE or FALSE and it determines which branch
of the If Expression statement that is performed.
If
This line is used to select the two variables and the relational
operator. The example below will jump in the THEN branch if the
variable total is larger or equal to the variable $NbrObjects:

☞ Do not try to bind variables here, just enter the variable names
directly.

Show defined variables


This button draws a popup window containing the defined
variables.

The rest of the parameters works exactly as the corresponding


parameters in the function If Query.

☞ Chapter 4 describes how to define variables.

3-5-14 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Program Group 3

If Feature
☞ This function is here of compatibility reasons. The same
functionality can be achieved with a combination of the Variable
function and If Expression.
This If-then-else function checks if a measured object feature is within a
given range. You can state that all objects or at least one object in the
measurement must fulfill the condition. The result is TRUE or FALSE
and determines which branch of the If Feature statement that is
performed.
If
Select which feature to check.
Any/All
Selects how the condition should apply.
Low
The low limit for the interval.
High
The high limit for the interval.

The rest of the parameters works exactly as the corresponding


parameters in the function If Query.

microGOP 2000/S User’s Guide 3-5-15


3 Functions in microGOP 2000/S - Program Group

Shell
This function executes a UNIX command in a Bourne shell. The
execution of a microGOP program stops if the exit status of the program
is not 0.
Shell command
The command to execute.

☞ This function is here of compatibility reasons. The same


functionality can be achieved in the Variable function with the system()
function. The system() function in Variable also runs faster.

3-5-16 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Program Group 3

Notice
This function draws a notice window which the user must confirm
before the program execution continues.

☞ This function is here of compatibility reasons. The Notice function


will disable some timers in the microGOP which will cause some
functions like live video in the Video function to fail. It is strongly
recommended that this function is not used. The same functionality can
be achieved with the Ui() function in the Variable function instead, see
the example below.
Message
A message for the user.
Confirm button text
The text to print in the confirm button.

Here follows an example on how to use the Ui() function in the Variable
function instead of Notice :
Fill in the following in the Notice parameters:

The following notice will be produced:

microGOP 2000/S User’s Guide 3-5-17


3 Functions in microGOP 2000/S - Program Group

The same can be achieved within the Variable function. Fill in the
following lines in the parameter window of the Variable function:
Ui(MESSAGE,"",\
MESSAGE,"Insert the specimen in the microscope !",\
BUTTON_TEXT,"Press when ready","")

The following notice will be produced:

3-5-18 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Program Group 3

Message
The Message function prints a text in the message window. The message
window can be cleared before the message is printed.

☞ This function is here of compatibility reasons. The write and writeln


functions in the Variable function can replace Message. See also the
MessageWindow() function in the Variable function, page 4-31.
Remove old messages
Select this choice if the message window should be cleared before the
message is printed.
Type the message to be printed in the text window.

microGOP 2000/S User’s Guide 3-5-19


3 Functions in microGOP 2000/S - Program Group

Variable
The Variable function is very powerful and is often used to make
powerful and easy to use microGOP programs. The full functionality of
the Variable function is described in chapter 4 of this manual.
The Variable function is, for example, used to define variables, make
calculations, generate user interfaces and call external programs. The
defined variables can be bound to parameters of other functions.
Defined variables...
Displays a window with the defined variables. First, the user defined
variables are listed, then the system variables are listed in
alphabetical order. The object feature vector variables are found at
the end of the list.
Editor...
It can be difficult to get a good overview of the statements that have
been written in to the small Statements window. This button can be
used to bring up the statements in a text editor for editing.

☞ The contents of the text editor must be saved and the editor must
be terminated to be able to continue to work with the microGOP. The
changes made in the text editor are automatically transferred to the
Statements window when the editor is terminated.

☞ The text editor that is used is textedit unless the EDITOR


environment variable has been set. Put a line like this in your .cshrc
file to select another editor:
setenv EDITOR emacs
Statements
Enter the statements to be interpreted in the text window.

☞ The maximum number of characters that can be written into the


Statement text window is limited. It is a good idea to use several
Variable function calls in a program if many statements are used.

☞ This function is the most powerful and also the most complex of all
the functions in the microGOP. It is very well spent time to read all about
it in chapter 4.

3-5-20 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Program Group 3

Present
This function is used to produce histograms and scattergrams that can
not be produced by functions in the Measure function group. The
function uses data that is accessible in the Variable function. See chapter
4 for a description of statements in the Variable function.

☞ This is an advanced function which requires good knowledge of the


Variable function.
Histogram/Scattergram
Selects the type of diagram to be produced. The same type of
histograms and scattergrams as in the Measure functions will be
produced.
Header Texts
These fields should contain string expressions or name of string
variables. The strings will be put above the produced diagram.
Y Vector (only for Scattergrams)
This vector should contain the data for the Y axis.
Y Min
The minimum value for the Y axis.
Y Max
The maximum value for the Y axis.
Ytext1
The first line of Y axis text.
Ytext2
The second line of Y axis text.
Bars (only for Histograms)
Check the boxes if values and % should be written in the histogram
bars.

microGOP 2000/S User’s Guide 3-5-21


3 Functions in microGOP 2000/S - Program Group

X Vector
The vector for containing the data for the X axis.
X Min
The minimum value for the X axis.
X Max
The maximum value for the X axis.
Xtext1
The first line of X axis text.
Xtext2
The second line of X axis text.
Screen/Laser
Specifies where the diagram is printed.
Width
The width of the produced diagram.
Height
The height of the produced diagram.

☞ It is not necessary to fill in all fields. The required fields are X Vector
and Y vector (for scattergrams). The maximum and minimum values
will be calculated from the vectors if they are not specified.
The following pages show some examples of how to use the Present
function.

3-5-22 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Program Group 3

Example: Production of a scattergram using Present


The first example will produce a scattergram with Area/Dmax on the X
axis and Width on the Y axis. Do like this:
Measure the features Area, Dmax and Width with the Measure
function.
Write the following statements in the Variable function and perform
it:
float x_vec[] = $Area[]/$Dmax[]
float x_max = vmax( x_vec[] )
float x_min = 0
char *x_text1 = "Area/Dmax"
char *x_text2 = $ScaleUnit
float y_max = vmax( $Width[] )
float y_min = 0
char *y_text1 = "Width"
char *y_text2 = $ScaleUnit
char *date = \
system("date | awk ’{print$2,$3,$7}’")
char *mean = tostring( vmean( x_vec[] ))
char *stddev = tostring( vstddev( x_vec[] ))

Fill in the Present function like below and the diagram to the right
will be produced when the Present function is performed.

microGOP 2000/S User’s Guide 3-5-23


3 Functions in microGOP 2000/S - Program Group

Example: Production of a histogram using Present


A histogram must have a vector for the X axis where each entry contains
an integer value. It is not possible to present float values at the moment.
The following example will plot the grey scale profile under the latest
drawn rubberband line in the image display window. Do like this:
Draw a rubberband line in the image display window.
Write the following statements in the Variable function and perform
it:
char *header ="Grey scale profile"
char *where="Line (x,y): "+\
tostring($RBLineX1)+","+\
tostring($RBLineY1)+" to "+\
tostring($RBLineX2)+","+\
tostring($RBLineY2)
float v[] = $GreyProfile[]
char *length="Length: "+\
tostring(vdim(v[]))+" pixels"
char *mean=" Mean: "+\
tostring(vmean(v[]))
char *stddev="Stddev: "+\
tostring(vstddev(v[]))
char *min="Min Intensity: "+\
tostring(vmin(v[]))
char *max="Max Intensity: "+\
tostring(vmax(v[]))
int width=vdim(v[])+160
if(width<300) width=300
int heigth=300

Fill in the Present function like below and the diagram to the right will
be produced when the Present function is performed.

3-5-24 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Program Group 3

Timer
Starts or stops a timer (stop-watch). This is used for checking the
execution time for programs or program sections.
Timer function
Selects if the timer should be reset and started or if it should show
the elapsed time since last reset. The elapsed time is displayed in the
microGOP main window. There is no “Stop timer” function.

☞ There is also a timer() function in the Variable function, see chapter 4.

microGOP 2000/S User’s Guide 3-5-25


3 Functions in microGOP 2000/S - Program Group

Pause
The function pauses the program execution for a number of seconds.
Pause
Number of seconds to pause. The maximum is 30 seconds.

☞ A loop can be put around the Pause function if longer pauses than
30 seconds are required.

☞ The timer() function in the Variable function can also be used to


make pauses in a program.

3-5-26 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Program Group 3

Comment
Enters a comment line into the program. This function has no action
associated with it. It is only used to make microGOP program listing
(.lst) files more readable.
Comment
The comment to put in the program.

microGOP 2000/S User’s Guide 3-5-27


3 Functions in microGOP 2000/S - Program Group

3-5-28 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Gop Group 3

3.6 The Gop function group


☞ The optional GOP or MIP processor must be installed in the system to
be able to run the functions in this function group.
These functions detect and measure texture and structures in images.

The operations and their parameters are described in the Image


Operations Reference Manual. The GOP operation parameters are not
described here.
☞ All GOP functions are described in the microGOP 2000/S online help!
• Place the cursor above the icon for a function.
• Press the Help key on the keyboard.
• A help text appears in a help window.
☞ The GOP functions will only be visible if the they are enabled with the
-GOP or -MIP option when the microGOP is started. See How to enable
microGOP options, page C-7.
☞ The -MIP option will only enable the functions that are implemented
in the MIP processor.

microGOP 2000/S User’s Guide 3-6-1


3 Functions in microGOP 2000/S - Gop Group

3-6-2 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Grey Group 3

3.7 The Grey function group


The functions in this group are used to filter or in other ways process
grey scale images. The first nine functions are only available if you have
the GOP or MIP hardware option.

These functions
are only available
with the GOP or
MIP hardware
option.

Grey operations that use the GOP or MIP


The first nine operations in this block use the GOP or MIP processor.
They are not available if your system does not have a GOP or MIP
processor installed. These operations and their parameters are not
described here but can be found in the Image Operations Reference Manual.
The operations are: LpLim, BpLim, HpLim, Wallis, Variance, LpFilt,
BpFilt, HpFilt, and Freichen.
The rest of the functions do not require the GOP or MIP.

☞ The -GOP or -MIP option must be used when the microGOP is


started to enable the functions that use the GOP or MIP.
All the functions in this function group can use either 8-bit or 16-bit grey
scale images as input and output images.

microGOP 2000/S User’s Guide 3-7-1


3 Functions in microGOP 2000/S - Grey Group

☞ All Grey functions are described in the microGOP 2000/S online


help:
• Place the cursor above the icon for a function.
• Press the Help key on the keyboard.
• A help text appears in a Help window

3-7-2 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Grey Group 3

Shading
The Shading function is used to remove uneven illumination in images.
The function needs an image that contains only the uneven illumination.
This image is called the shading image.
The shading image is grabbed under the same light conditions as the
input image. The shading image should not contain any objects. It
should only describe how the illumination varies over the image. The
input image is compensated with the shading image as a reference. The
same shading image can be used to correct all images that are grabbed
under the same light conditions.
There are situations when it is not possible to grab a shading image.
Then the image itself can be used as a shading image. There are two
restrictions: The image must contain dark objects on a bright
background and a large fraction of the image pixels must be
“background” i.e. a smooth surface without any objects.
Image to correct
The grey scale image that is unevenly illuminated.
Reference image
A separate shading image or the same image as Image to correct. If
the same image is used as Reference image the restrictions above
must be taken into account
Corrected image
The result image.

☞ The shading correction only works with dark objects on a brighter


background.

☞ It is often possible to defocus the sample to get a good shading image


when using a microscope.

☞ The shading correction can sometimes produce bad result if the


input image is used as reference image. A better shading correction can
be obtained if the shading image is produced by some kind of low pass
filtering of the input image.

microGOP 2000/S User’s Guide 3-7-3


3 Functions in microGOP 2000/S - Grey Group

Thresh
This function thresholds a grey scale image or a GOP image into a binary
image. Pixels with values within a certain interval (slice) are set to 1 in
the binary image and the rest are set to 0.
When thresholding a grey scale image you set a grey level interval.
When you threshold a GOP image you set intervals for both the
magnitude part and the argument part of the pixel value.
The current slice is applied to the image selected by the Image to
threshold parameter. The slice will be displayed in color in the Image
Display window as soon as a parameter changes or as soon as the cursor
enters any of slice areas in the parameter area.
Image to threshold
A grey scale image or a GOP image.
Binary image
The result image.
Inside/Outside
Select if pixels inside or outside the slice are to be thresholded out.
Magnitude Threshold
Adjusts the slice level. Place the cursor within the slice and drag it to
adjust both Low and High. Place the cursor outside the slice and
drag Low or High.

☞ The image has to be remapped when the dragging of the slice


starts and stops. There can be a short delay between the mouse
button is pressed down and it is possible to move the slice. This
delay is longer on slow computers and when using large images.
Hint: Press down the select button and wait a moment before
dragging in these cases.

☞ The slice that is used during the dragging of the slice differs
slightly from the one that is actually used in the thresholding. The
slice that is shown when not dragging is the “true” one.
Argument Threshold
This part of the UI is only visible when a GOP image is used as Image
to threshold. The colored part of the image in the Image Display
shows the combination of the threshold in the magnitude and the
threshold in the argument of the GOP image. See Magnitude
Threshold above for a description of how to adjust the slice.

3-7-4 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Grey Group 3

Stretch
This function stretches the grey scale of an image to increase the
contrast. Images with low contrast that only use a part of the dynamic
range can be improved by this function.
Input image
The image to stretch.
Output image
The result image.
Relative / Absolute
Absolute stretch remaps the pixel values so that values from
minimum to Low are mapped to minimum in the output image and
pixel values from High to maximum are mapped to maximum in the
output image. The rest of the pixel values will be spread evenly over
the minimum-maximum range.
Relative stretch uses the image grey values to determine the Low
and High values. In this case you enter a percentage instead of an
absolute grey value. The image histogram is measured and the Low
and High percentile is determined. I.e. Low % of the darkest pixels
are excluded. The lowest pixel value in the image with these pixels
excluded is used as absolute Low. The same applies for High from
the high end of the pixel values. The reason for excluding pixel
values and not using the lowest or highest value is to reduce the
influence of noise.
Low, High
See Relative / Absolute description above.

☞ Note that Low ≤ High in Absolute mode and Low + High ≤ 100.0
in Relative mode.

microGOP 2000/S User’s Guide 3-7-5


3 Functions in microGOP 2000/S - Grey Group

☞ A Relative Stretch with Low % and High % set to zero can be used
to make an “automatic” stretch. This will increase the contrast in the
image.The histograms below shows the grey scale distribution before
and after a Stretch operation.

3-7-6 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Grey Group 3

Average
This is a linear filtering operation that computes the local average for
every neighbourhood in the image. The averaging can be flat i.e. each
pixel in the neighbourhood has the same weight or the neighbourhood
can be weighted by a gaussian “bell” function. The weighting function
is called the filter. Larger filters give a higher degree of smoothing.
Input image
The image to filter.
Output image
The result image.
Filter size
The size (width and height ) of the quadratic neighbourhood and the
filter used. Use 3 - 11 for gaussian filters and 3 - 63 for flat filters.
Filter type
Select the filter type, Flat or Gaussian.
Amp
Amplification factor to multiply the output image by. This
parameter is usually 1 when the input and output images are of the
same type.
Off
An offset to be added to the output image.

microGOP 2000/S User’s Guide 3-7-7


3 Functions in microGOP 2000/S - Grey Group

Median
The Median function can be used to remove “salt and pepper” noise in
the image. For each neighbourhood in the image the median of the grey
scale values is computed. This median value becomes the output pixel
value.
The median filter is often used to remove noise from the image with
minimal degradation of sharp edges. One drawback is that can remove
thin lines and destroy corners of objects.
The Median operation does not use a filter. The Filter size parameter
specifies the size of the neighbourhood.
Input image
The image to filter.
Output image
The result image.
Filter size
The neighbourhood size (width and height). Odd values between 3
and 127 are allowed.

☞ The median for a set of sorted numbers is the value in the middle of
the set.

3-7-8 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Grey Group 3

Rank
The Rank function is a generalization of the Median function. Instead of
picking the middle value of the sorted values the n:th value is selected
and becomes the pixel value for the output image.
Input image
The image to filter.
Output image
The result image.
Filter size
The neighbourhood size (width and height). Use odd values
between 3 and 127.
Rank
The value to pick from the sorted values. Possible values are 1 -
(Filter size x Filter size).

microGOP 2000/S User’s Guide 3-7-9


3 Functions in microGOP 2000/S - Grey Group

Sobel
The Sobel function is an edge detector. It detects transitions between
dark and bright areas (grey scale edges). Due to the filter size, 3×3, it is
very sensitive to image noise.
Input image
The image to filter.
Output image
The result image.
Amp
Amplification factor to multiply the output image by.
Off
An offset to be added to the output image.

3-7-10 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Grey Group 3

Prewitt
This is a 3×3 neighbourhood edge detecting function like Sobel.
Input image
The image to filter.
Output image
The result image.
Amp
Amplification factor to multiply the output image by.
Off
An offset to be added to the output image.

microGOP 2000/S User’s Guide 3-7-11


3 Functions in microGOP 2000/S - Grey Group

Laplace
Yet another edge detector. The function is a 3×3 approximation of the
Laplacian operator which is the sum of the second derivatives. This filter
is very sensitive to noise.
Input image
The image to filter.
Output image
The result image.
Amp
Amplification factor to multiply the output image by.
Off
An offset to be added to the output image.

3-7-12 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Grey Group 3

Conv 3×3
This function allows you to design an arbitrary 3×3 filter and apply it to
an image. Depending upon the magnitude of the the coefficients the
resulting image will vary widely in magnitude. The Amp parameter
adjusts the magnitude in the output image.

☞ The vconvolve() function in the Variable function can be used to


convolve images with larger filters.
Input image
The image to filter.
Output image
The result image.
Coefficients
The coefficients of the 3×3 filter (sometimes called kernel, mask or
template). For each 3×3 environment in the image the filter
coefficient is multiplied with the image pixel value and all 9 products
are summed. The sum is multiplied with the Amp factor and the Off
is added. The coefficients should be integer values.

☞ The sum of the coefficients multiplied by Amp should be 1 ( or


actually 1 - Off/M) to produce an image without overflow. ( The
value M is the maximum possible value in the output image. )
Amp
Amplification factor to multiply the output image by.
Off
An offset to be added to the output image.

microGOP 2000/S User’s Guide 3-7-13


3 Functions in microGOP 2000/S - Grey Group

Calculate
This function is a calculator for grey scale images. It takes one or two
images as input and computes an output image.
Input image #1
The first input image.
Input image #2
The second input image.
Output image
The result image.
Expression
The following calculations can be performed:

#1 and #2 are the two input images. Some of the operations does not
use the second input image and some of the operations does not use
the A parameter. The & and | operators are the bitwise and and
bitwise or operators.
A, B
Values for A and B in Expression.

☞ The GetPixels() and SetPixels() function in the Variable function


can be used to access and set pixels in images in a more flexible way.

3-7-14 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Grey Group 3

Mask
The Mask function copies a grey scale image to another grey scale image.
Only pixels that are 1 in the binary mask image are copied. The rest of
the pixels in the output image are set to 0.
Input image
The input image.
Mask image
The binary mask image.
Output image
The result image.

☞ The GetPixels() and SetPixels() function in the Variable function


can be used to access and set pixels in images in a more flexible way.

microGOP 2000/S User’s Guide 3-7-15


3 Functions in microGOP 2000/S - Grey Group

Or
The Or function performs logical bitwise OR for each of the 8 bits in two
grey scale images. This operation can be used for mixing two grey scale
images:
Input image #1
The first input image.
Input image #2
The second input image.
Output image
The result image.
Example
• Use the Mask function to produce a grey image.
• Use the Not to invert the binary mask image.
• Use the inverted binary image and apply the Mask function to
another grey image.
• Now use the Or function to OR the two masked images together.

☞ The GetPixels() and SetPixels() function in the Variable function


can be used to access and set pixels in images in a more flexible way.

3-7-16 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Grey Group 3

Invert
Inverts a grey scale image. The new pixel value = 255 - old pixel value.
Input image
The image to invert.
Output image
The result image.

☞ The GetPixels() and SetPixels() function in the Variable function


can be used to access and set pixels in images in a more flexible way.

microGOP 2000/S User’s Guide 3-7-17


3 Functions in microGOP 2000/S - Grey Group

3-7-18 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Binary Group 3

3.8 The Binary function group


The binary functions operate on binary images.
Most of the functions modify the shape of the objects in the binary image
in some way. The Chaincode function describes the border of the objects
in an image. Distance Map measures the shortest distance from each
pixel in an object to the object border.

We need to introduce some concepts to make is easier to understand the


functions in the Binary functions group.
A 3×3 neighbourhood in a binary image is defined as a pixel plus its
eight closest neighbours.
Each pixel in a binary image is an object pixel or a background pixel.
Object pixels are white, 1, and background pixels are black, 0.

microGOP 2000/S User’s Guide 3-8-1


3 Functions in microGOP 2000/S - Binary Group

An object is a group of object pixels that are connected. We must define


this more strictly. In microGOP 2000/S two different connectivity rules
are used:
4-connectivity
Two pixels are connected if they are horizontal or vertical
neighbours. An object pixel can be connected with other object pixels
in 4 different directions.
8-connectivity
Two pixels are connected if they are horizontal, vertical or diagonal
neighbours. An object pixel can be connected with other object pixels
in 8 different directions.

One object at 8-connectivity


but two at 4-connectivity.

Note that if the objects are 4-connected the background becomes 8-


connected and vice versa.
An object pixel is an inner border pixel if has at least one neighbour which
is a background pixel.
A background pixel is an outer border pixel if it has at least one neighbour
which is an object pixel.

3-8-2 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Binary Group 3

Erode
This operation erodes or “peels off” layers of pixels from the objects. In
each erosion step all inner border pixels become background pixels. The
result is determined by the connectivity rule the operation uses.
Input image
The image to erode.
Output image
The eroded result image.
Connectivity
Select 4- or 8-connectivity for the erosion.
Alternate connectivity
Enables alternating connectivity when running the function more
than 1 step. The use of alternating 4- and 8-connectivity helps to
preserve round shapes that may otherwise degenerate into quadratic
or rhomboid shapes. If Connectivity is set to 4 the function uses 4-,8-
,4-.... connectivity and vice versa.
Number of steps
The number of times to apply the erosion operator. (The number of
layers to peel off).

microGOP 2000/S User’s Guide 3-8-3


3 Functions in microGOP 2000/S - Binary Group

Dilate
This operation dilates or adds layers of pixels to the objects. In each
dilation step all outer border pixels become object pixels. The result is
determined by the connectivity rule the operation uses.
Input image
The image to dilate.
Output image
The dilated result image.
Connectivity
Select 4- or 8-connectivity for the dilation.
Alternate connectivity
Enables alternating connectivity when running the function more
than 2 steps. The use of alternating 4- and 8-connectivity helps to
preserve round shapes that may otherwise degenerate into quadratic
or rhomboid shapes. If Connectivity is set to 4 the function uses 4-,8-
,4-.... connectivity and vice versa.
Number of steps
The number of times to apply the dilation operator. (The number of
layers to add).

3-8-4 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Binary Group 3

Point Erode
This function erodes objects towards points.
The Keep Objects option should be used if only one point per object
should be created. The Break Objects option can cause objects to break
up into several objects when eroding which will cause several points to
be created.
Objects with holes will be eroded towards rings if Keep Objects is
selected.
Input image
The binary input image.
Output image
The binary result image.
Steps
The number of steps to erode. The erosion will be run this number of
steps towards points. This value should be set to -1 to erode entirely
to points.
Border
The pixels outside the image can be considered to be object pixels
(=1) or background pixels (=0).
Break Objects / Keep Objects
Break Objects will break up objects and create several points per
object. The Keep Objects option will create only one point for each
object.

This function was created by Johan Knol of IDUNA Electronics, The Netherlands.

microGOP 2000/S User’s Guide 3-8-5


3 Functions in microGOP 2000/S - Binary Group

Skeleton
The skeleton of an object can be defined in many different ways. It
should be a 4- or 8- connected, one pixel thin, network. The skeleton
describes the topology of an object and is preferably used on objects that
consist of thin segments.
Input Image
The image to run skeleton on.
Output Image
The skeletonized image.
Connectivity
The connectivity for the resulting skeleton can be 4- or 8.

☞ Skeleton is often used together with the Chaincode function to


create data for external programs to work on.

3-8-6 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Binary Group 3

Line Ends
This function operates on a binary skeleton. It erodes or dilates the line
ends in one or several directions. The function can be used to close small
gaps in a network of lines.
Input Image
The input image.
Output Image
The result image.
Number of steps
Number of pixels to remove or add to line ends.
Mask
Select directions to erode/dilate in. Only the selected directions are
handled.
Erode
The selected directions are eroded. Objects can disappear.
Erode keep objects
The erosion can be set not to remove any objects i.e. keep at least one
pixel for all objects.
Dilate
The selected directions are dilated.
Dilate until object
The dilation can be set to dilate only until it reaches another object
pixel.

☞ The line ends are detected in a 3x3 neighbourhood. This means that
only line ends that are 8-connected can be handled.

microGOP 2000/S User’s Guide 3-8-7


3 Functions in microGOP 2000/S - Binary Group

Line Ends 2
This function operates on a binary skeleton. It dilates the line ends
according to the argument in a Gop image. The argument in the Gop
image should describe the angle in which to dilate the line end.
Input Image
The input image.
Gop Image
The Gop image.
Output Image
The result image.
Number of steps
Number of pixels to add to line ends.
Magnitude
Only line ends where the magnitude in the Gop image is above this
value will be dilated.

3-8-8 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Binary Group 3

Open
Open erodes the objects a number of steps and then dilates them the
same number of steps. This can separate objects that are connected by
thinner sections.

☞ Objects that disappear in the erosion are not restored in the dilation.
Input image
The image to open.
Output image
The opened image.
Connectivity
Select 4- or 8-connectivity for the erosion and dilation.
Alternate connectivity
Enables alternating connectivity when running the function more
than 2 steps. The use of alternating 4- and 8-connectivity helps to
preserve round shapes that may otherwise degenerate into quadratic
or rhomboid shapes. If Connectivity is set to 4 the function uses 4-,8-
,4-.... connectivity and vice versa.
Number of steps
The number of steps to erode and dilate.

microGOP 2000/S User’s Guide 3-8-9


3 Functions in microGOP 2000/S - Binary Group

Close
This is the converse to the Open operation. First it dilates and then
erodes the same number of steps. This closes small gaps between objects.
Input image
The image to close.
Output image
The closed image.
Connectivity
Select 4- or 8-connectivity for the dilation and erosion.
Alternate connectivity
Enables alternating connectivity when running the function more
than 2 steps. The use of alternating 4- and 8-connectivity helps to
preserve round shapes that may otherwise degenerate into quadratic
or rhomboid shapes. If Connectivity is set to 4 the function uses 4-,8-
,4-.... connectivity and vice versa.
Number of steps
The number of steps to dilate and erode.

3-8-10 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Binary Group 3

Separate
The Separate function separates objects that touch each other. The best
result is achieved for objects that are compact or at least convex and have
a limited overlap. The function uses the watershed function on a
distance map of the objects. The watershed is used to cut apart
overlapping objects.

☞ This function is here for compatibility with old microGOP


programs. It is not as flexible as the Watershed function.
Input image
The image to separate objects in.
Result
The separated result image.

microGOP 2000/S User’s Guide 3-8-11


3 Functions in microGOP 2000/S - Binary Group

Fill
Fills all holes in objects. A hole is defined as a piece of the background
enclosed by object pixels from one object. The background pixels of the
hole are not connected to the background outside the object.
Input image
The image to fill objects in.
Result
The filled result image.

☞ This function assumes that objects are 8-connected.

3-8-12 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Binary Group 3

Hull
The Hull function creates the convex hull of the objects in a binary
image. All objects are transformed into convex objects.

☞ Objects might be clustered together after the operation.


Input image
The input image.
Result
The result image.

☞ This function assumes that objects are 8-connected.

microGOP 2000/S User’s Guide 3-8-13


3 Functions in microGOP 2000/S - Binary Group

Touch
The Touch function uses a binary image as a mask image. For each
object in the input image is checked how much of the object that is
covered by the mask. The mask is all object pixels in the mask image.
This function is useful when you have somehow determined a few
pixels that you know belong to an interesting object. This image can be
used as a mask on another image which contains the correct shape of the
objects.
A programmer might express the function as:
FOR each object in the Input image
IF ((the object is covered > low %) AND
(the object is covered <= high %)) THEN
keep the object
ELSE
discard the object
Input image
The input image
Mask image
The binary image to use as a mask.
Output image
The result image.

Select the low and high limits on the two “% lines”.

3-8-14 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Binary Group 3

Match
The Match operation uses a 3×3 neighbourhood as a mask or template.
All pixels that match this neighbourhood are treated according to Mode.
Input image
The input image.
Output image
The result image.
Mask
Each location in the mask can be 0, 1 or -. 0 matches background
pixels and 1 matches object pixels. The - character (don’t care)
matches both object pixels and background pixels. You shift through
the values by clicking on them.
Mode
For each neighbourhood that matches the mask you can select three
different actions:
Detect Write object pixels in the output image at matched
positions.
Add Add object pixels to the input image at the matched
positions and write the result in the output image.
Remove Remove object pixels at the matched positions in the
input image and write the result to the output image.
Example
This example will expand the right side of all objects one pixel.

microGOP 2000/S User’s Guide 3-8-15


3 Functions in microGOP 2000/S - Binary Group

Not
Performs an inversion of the pixels (logical NOT operation) in the input
image. Object pixels become background pixels and vice versa.
Input image
The image to invert.
Output image
The inverted result.

3-8-16 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Binary Group 3

And
Performs a logical AND operation between the pixels in two images. If
the pixel at the same location in both images is 1 the output pixel is 1
otherwise it will be 0.
Image 1
The first input image.
Image 2
The second input image.
Result
The result image.

microGOP 2000/S User’s Guide 3-8-17


3 Functions in microGOP 2000/S - Binary Group

Or
Performs a logical OR operation between the pixels in two images. If at
least one of the pixels at the same location in two images is 1 then output
image will be 1 otherwise it will be 0.
Image 1
The first input image.
Image 2
The second input image.
Result
The result image.

3-8-18 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Binary Group 3

Exor
Performs a logical XOR between the pixels in the two images. If one and
only one of the pixels at the same location is 1 the output is 1 otherwise
it is 0.
Image 1
The first input image.
Image 2
The second input image.
Result
The result image.

microGOP 2000/S User’s Guide 3-8-19


3 Functions in microGOP 2000/S - Binary Group

Sub
Subtracts Image 2 from Image 1. If Image 1 is 1 and Image2 is 0 the
Result will be 1 otherwise it will be 0.
Image 1
The first input image.
Image 2
The second input image.
Result
The result image.

3-8-20 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Binary Group 3

Chaincode
This function generates chain code for the objects in the image. The chain
code is stored in a file. There is no other microGOP function that can
operate on this chain code and it can not be imported again. However
the chain code can be used by other programs for analysis of objects and
for generating vector representation of the image. The chain code can be
generated for lines or objects.
Image to chaincode
The binary image to create chain code for.
Chain code filename
The chain code file name.
Coding of: Objects/Lines
Objects or lines can be coded.
The object coding will create a chain around every object.
The line coding must have a skeletonized image as input image.
Every line is coded with a chain from one line end/crossing to
another line end/crossing.

microGOP 2000/S User’s Guide 3-8-21


3 Functions in microGOP 2000/S - Binary Group

Distance Map
Generates a distance map from a binary image. The distance map is a
grey scale image. Each value of a pixel in the grey scale image is the
minimum distance to the object border for the corresponding pixel in the
binary image.
Input image
The binary input image.
Distance map image
The greyscale distance image.

☞ The distance map image often contain low intensities which


indicates that the distance to the background is short.

3-8-22 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Morphology Group 3

3.9 The Morphology function group


This function group contains morphological grey scale functions. The
morphological gradient and the top hat functions are used for edge and
line detection. The erode and dilate functions are used for grey scale
erosion and dilation.

The watershed function is very useful in finding missing contours and


separating objects.

☞ The grey scale dilations are performed using maximum Rank filters
and grey scale erosions are performed using minimum Rank filters. See
grey scale function Rank, page 3-7-9.

There are a lot of books and papers written about the Watershed
function and mathematical morphology. Here are some examples:
Book:
Title: Mathematical morphology in image processing edited by Edward R.
Dougherty, Marcel Dekker, Inc, 270 Madison Avenue, New York, New
York 10016.
Chapter 12 in this book is of special interest: The Morphological
Approach to Segmentation: The Watershed Transformation by S. Beucher
and F. Meyer, Centre de Morphologie Mathematique Ecole des Mines de
Paris, Fontainebleau, France
Paper:
Morphological Segmentation, F Meyer and S. Beucher, Centre de
Morphologie Mathematique, Paris School of Mines, 35, rue Saint Honore’,
77305 Fontainebleau, France, JOURNAL OF VISUAL
COMMUNICATION AND IMAGE REPRESENTATION, Vol 1, No. 1,
September, pp. 21-46, 1990

microGOP 2000/S User’s Guide 3-9-1


3 Functions in microGOP 2000/S - Morphology Group

Morphological Gradient
The morphological gradient is used to find gradients (edges, lines) in a
gray scale image. The difference between the dilated and the eroded
image is calculated.
Input image
The input image
Output image
The result image.
Filter size
The size of the filters.

3-9-2 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Morphology Group 3

Black Top Hat


The Black Top Hat function detects black (or dark) features like lines in
a brighter background. The difference between the Grey Closed image
and the image itself is calculated.
Input image
The input image
Output image
The result image.
Filter size
The size of the filters. Larger filter will detect wider lines.

microGOP 2000/S User’s Guide 3-9-3


3 Functions in microGOP 2000/S - Morphology Group

White Top Hat


The White Top Hat function detects white (or bright) features like lines
in a darker background. The difference between the image and the Grey
Opened image is calculated.
Input image
The input image
Output image
The result image.
Filter size
The size of the filters. Larger filter will detect wider lines.

3-9-4 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Morphology Group 3

Grey Erode
The Grey Erode function erodes the grey scale image. Brighter areas in
the image will shrink and darker areas will expand.
Input image
The input image
Output image
The result image.
Neighbourhood size
The size of the filters.
Steps
The number of times to run the function.

microGOP 2000/S User’s Guide 3-9-5


3 Functions in microGOP 2000/S - Morphology Group

Grey Dilate
The Grey Dilate function dilates the grey scale image. Darker areas in
the image will shrink and brighter areas will expand.
Input image
The input image
Output image
The result image.
Neighbourhood size
The size of the filters.
Steps
The number of times to run the function.

3-9-6 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Morphology Group 3

Grey Open
The Grey Open function runs a number of Grey Erodes followed by the
same number of Grey Dilates. Brighter slightly connected areas in the
image will be separated.
Input image
The input image
Output image
The result image.
Neighbourhood size
The size of the filters.
Steps
The number of erosions and dilations to run.

microGOP 2000/S User’s Guide 3-9-7


3 Functions in microGOP 2000/S - Morphology Group

Grey Close
The Grey Close function runs a number of Grey Dilates followed by the
same number of Grey Erodes. Brighter slightly separated areas in the
image will be connected.
Input image
The input image
Output image
The result image.
Neighbourhood size
The size of the filters.
Steps
The number of erosions and dilations to run.

3-9-8 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Morphology Group 3

Watershed
The Watershed function runs on a grey scale image and produces a
binary image.
Think of the grey scale image as a landscape where the intensity in the
image is the altitude. The valleys have low intensities and the mountains
have high. If we pierce a hole in every local minima (valley) and lower
the whole surface into water, the water will rise up in the valleys. The
water coming from one hole will eventually merge with water from
another hole. At such places, where water from different holes meet, we
will build dams preventing the water from meeting. These dams are the
result of the operation and they will be put in the binary image.
The big problem with the Watershed function is that it often produces
an image with a huge amount of dams (oversegmentation). This can be
prevented with the use of a marker image. This marker image is a binary
image which contains the positions (markers) where the flooding is
allowed to start.
Input image
The grey scale input image.
Marker image
The binary marker image. Use E (empty) to run without a marker
image.
Output image
The binary result image.

microGOP 2000/S User’s Guide 3-9-9


3 Functions in microGOP 2000/S - Morphology Group

3-9-10 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Measure Group 3

3.10 The Measure function group


These functions measure and present object features or grey scale data.

The Measure function is used to calculate object features like area and
perimeter. This function must be run before any object feature data can
be used for object classification or presentation.
The Classify function is used to discard objects that should not be
included in the data presentation.
The object data can be presented with the Histogram, List, Basics or
Scattergram functions.

☞ All object features are scaled with the current scale factor. The scale
factor is set in the Set Scale or Define Scale functions in the Etc function
group.

The Area Fraction function is used to calculate the percentage of


different intensity levels in a grey scale image.
The Grey Histogram function calculates the histogram of the intensity
values in a grey scale image.

microGOP 2000/S User’s Guide 3-10-1


3 Functions in microGOP 2000/S - Measure Group

Measure
The Measure function measures features for objects in a binary image.
The Measure function must be run before any presentation or
classification of object features can be done.
The function creates a label image where pixels belonging to the same
object will have the same label (number). The label image is displayed
when the Measure function is run if Automatic image update is enabled
(see function Settings, page 3-3-8). The label image is displayed in color
where the background is grey and the objects have different bright
colors. The colors are used to make it easier for the user to see the
separate objects.
The current label image can always be displayed using the Display
Label function in the Image function group.

☞ Only the objects that are inside the measure area are put in the label
image. See Use measure area below.
Features to measure...
This button brings up a popup window where the features to
measure are selected. The features are described on next page.

Image
A binary image to measure.

3-10-2 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Measure Group 3

Use measure area


Select if the current measure area should be applied. Measure areas
are defined with the Measure Frame and Measure Circle functions
in the Etc function group.
List measurement results...
Draws a pop-up window in which all measured features for all
objects are listed. The list window is described together with the List
function.
The following features can be measured:
Area
The area for an object.
Perimeter
The perimeter for an object.
Min X, Max X. Min Y, Max Y
The minimum and maximum X and Y coordinates for an object.
Feret X
The length of an objects projection on the x axis.
Feret Y
The length of an objects projection on the y axis.
FeretComp
Feret compactness. Computed as Feret Y / Feret X.
Compact
Compactness. Computed as Perimeter2 / Area ∗ K. K is chosen so
that a perfect circle gets compactness =1.
Eq Diameter
Equivalent diameter. The diameter if the object had been a perfect
circle with the same area.
E Comp
Ellipse compactness. It is the quotient between the object’s
maximum and minimum moment of inertia.

microGOP 2000/S User’s Guide 3-10-3


3 Functions in microGOP 2000/S - Measure Group

Cent GravX
The x coordinate for the object’s center of gravity. The centre of
gravity is the point on which the object would balance if it was a 2-
dimensional body.
Cent GravY
As above but for the y coordinate.
Moment X
The second moment of inertia along the x axis.
Moment Y
The second moment of inertia along the y axis.
Mom Ang
Moment angle. The angle for the object’s axis of minimum inertia.
Length
The length is computed as Perimeter / 2. Hence it is only significant
for “thin” objects.
D Max
The maximum diameter. It is the maximum distance between any
two points on the object’s circumference.
D Max Ang
The angle for the maximum diameter. The maximum distance in the
object occurs between two points and forms an angle with the x axis.
Width
The width of an object perpendicular to D Max.
Ratio
The ratio between D Max and Width. ( D Max / Width )

☞ All object feature measurements are scaled with the system variable
$ScaleFactor. If for some reason you need to convert these values to
number of pixels (e.g. draw a graphics circle with a diameter of D Max
for each object), just divide the feature values with $ScaleFactor.

3-10-4 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Measure Group 3

Classify
The Classify function discards objects that do not fulfill the conditions
set up in a condition list. Up to 10 conditions can be used at the same
time. Objects that pass all conditions will be kept and the others will be
discarded. The Create Binary function can be used to create a binary
image from the classified label image.
You can edit conditions by first selecting them in the list and then
changing the parameters in the area below the list. One condition at a
time can be edited.
Add Condition
Adds a condition to the end of the condition list.
Point...
Pops up the Point pop-up window. A measurement must have been
performed before Point... can be selected. The Point window is
described on page 3-10-6.
Delete condition
Deletes one or all conditions from the condition list. The first
condition can not be deleted.
Conditions:
Shows the number of conditions currently defined. A maximum of
10 conditions can be defined.
The area below the list is used
for editing the currently
selected condition in the list.
Include/Exclude
Defines if the objects that
fulfill the condition should
be kept (included) or
discarded (excluded).
The feature icon selects the
feature for the condition
and the value fields to the
left and right defines the
range for the selected
feature.

microGOP 2000/S User’s Guide 3-10-5


3 Functions in microGOP 2000/S - Measure Group

The Point Window


The Point window is displayed when the Point... button is pressed in the
parameter area of the Classify function. The current label image is also
displayed in the image display.

The Point window contains a list and a few buttons. Use the mouse to
click on objects in the image display. The object numbers and the
features for the objects are displayed in the list.

☞ The maximum and minimum feature values for a feature can be


monitored. Use the feature icon to select the feature to monitor. This is
useful for selecting condition range in the Classify function.
Edit menu
The first two items in this menu can be used for interactive object
classification. Keep Range is used for keeping the objects that have
a feature value between the Min and Max values (for the selected
feature). The Keep Listed objects will keep the objects that are listed
in the list. The Reject Range and Reject Listed objects will reject the
objects instead of keeping them.
Clear list clears the list.
Text size can be used to select a smaller font. (A smaller font makes
it possible to see more features in the list at the same time.)
Features...
Brings up the feature selection window. This window is used to
select the features that shall be displayed in the list.

3-10-6 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Measure Group 3

Create Binary
Creates a binary image from the objects currently in the label image. This
is useful if further binary operations are necessary on the objects in the
label image.
Binary image
Select a binary image.

microGOP 2000/S User’s Guide 3-10-7


3 Functions in microGOP 2000/S - Measure Group

Histogram
Presents one of the features measured with the Measure function. You
can present the latest measurement or you can accumulate over several
measurements. The histogram can be presented on the screen, on a
printer or printed to file.

Printing a histogram of objects in last measurement


Select Print Latest in the menu at the top of the parameter area. Select
the feature to print a histogram for. Change the X-axis and Y-axis
settings if wanted.

X axis:
The number of classes (bars) or the class width (bar width) can be set.
Auto can be used to get automatic scaling of the axis. It is also
possible to set the scaling manually by unchecking the Auto
checkbox.
Y axis:
Select automatic or manual scaling of the Y axis.
Differental/Cumulative
The histogram can be printed as a differential or as a cumulative
histogram.

3-10-8 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Measure Group 3

Print on:
Select Screen, Laser printer, EPS file or Bitmap file. The bitmap file
will be in TIFF format. The EPS file and Bitmap file selections
require a file name.
Size...
This button is visible when printing on Laser and EPS file. The
button brings up a window where it is possible to set the position
and size of the histogram on the paper.
Bar Value/Bar %
Enables printing of frequency and percentage in the bars in the
histogram.
Comment
A text string that will be printed at the top of the histogram.

To define, accumulate and print histograms.


It is necessary to use this approach when data from several
measurements should be presented in the same histogram.
1. The first step is to define a histogram. Select Define in the menu
and select the feature for the histogram.

Histogram name:
The name of the histogram. This name is only used to refer to the
histogram in the accumulate and print steps. Up to 20 different
histograms (with different names) can be defined at the same
time.
X axis:
These fields works exactly as described on last page.

microGOP 2000/S User’s Guide 3-10-9


3 Functions in microGOP 2000/S - Measure Group

2. The second step is to accumulate data to the defined histogram.


Select Accumulate to in the menu and the name of a defined
histogram.

The accumulation is repeated for each new measurement. The


accumulate step always adds data from current measurement.
3. The third step is to print the accumulated histogram. Select Print
Accumulated in the menu. Fill in the lower part of the parameter
area as described earlier in this section.

3-10-10 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Measure Group 3

The printed histogram will look something like the ones below
depending on the parameter settings.

☞ The usual way of using the Histogram Define, Histogram


Accumulate and Histogram Print sequence is to have a Histogram
Define before a Loop in a program. The Loop will then contain a
Measure and a Histogram Accumulate (plus some other code). The
Histogram Print is used after the loop to present the data for all the
accumulations.

☞ The final histogram after accumulating with Auto XMin/XMax may


differ from a histogram accumulated with XMin/XMax “manually” set
to the same values as the final Xmin/Xmax in the Auto histogram. This
is because the class widths vary as the “Auto histogram” is
accumulated. The maximum error is one bin up or down.

microGOP 2000/S User’s Guide 3-10-11


3 Functions in microGOP 2000/S - Measure Group

List
This function prints a list with the feature values for all objects in the
latest measurement. The list can be presented on the screen, on printer
or on a file. Files can be appended which is a way of accumulating over
several measurements.
Features to measure...
This button brings up a popup window where the features to list are
selected.
List last measurement on
The features can be listed on the Screen, Laser, File new, File
append, File append (no header), and File clear.
File new means that the list is printed in an empty file. An existing
file will be overwritten.
File append means that the list is appended to a file. The file is
created if it does not exist.
File append (no header) works just like File append with the
exception that no header information is written for the list of data.
File clear means that an empty file is created. The data in an existing
file will be erased. No list is printed in the file.
Filename:
This field must be filled in for File new, File append, File append
(no header), and File clear.
The following window appears if the Screen is used as destination for
the list.

3-10-12 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Measure Group 3

List last measurement


Redraws the list with the current feature data.
Features...
This button brings up a popup window where the features to list can
be changed.
Text size:
The text can be made smaller to be able to show more data in the
window at the same time.

microGOP 2000/S User’s Guide 3-10-13


3 Functions in microGOP 2000/S - Measure Group

Basics
The Basics function presents standard statistics for one measurement
feature. You can present statistics for the latest measurement or
accumulate over several measurements. The statistics can be presented
on the screen, on a file or on a laser printer. See Histogram for a
description of the Print latest (page 3-10-8) and define-accumulate-
print procedure (page 3-10-9).
Name
Define, Accumulate to and Print accumulated take a name as
parameter.
Destination
Print on Screen, Laser or File.
Filename
If presented on a file the filename is given here.
Comment
A comment text can be printed with the statistics.
Example of a Basics printout on the Screen.

3-10-14 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Measure Group 3

Scattergram
The Scattergram function presents a 2 dimensional diagram of two
features. Each object corresponds to one dot in the feature space.
Scattergrams can be presented for the latest measurement or they can be
accumulated. The scattergram is accumulated on file. The files may
become very large when many object are accumulated. See Histogram
for a description of the Print latest (page 3-10-8) and
define-accumulate-print procedure (page 3-10-9). The Delete function
is used to delete an old accumulated histogram.
Select Print Latest, Define, Accumulate to, Print accumulated or
Delete.
Select which feature to plot on x- and y- axis.
Min X, MaxX, Min Y, Max Y
The scaling of the X and Y axis can be automatic or manual.
Name
This field is used for Define, Accumulate to, Print accumulated or
Delete.
Comment
A comment text can be printed with the scattergram.
Print on:
Select Screen, Laser printer, EPS file or Bitmap file. The bitmap file
will be in TIFF format. The EPS file and Bitmap file selections
requires a file name.
Size on paper...
This button is visible when printing on Laser and EPS file. The
button brings up a window where it is possible to set the position
and size of the histogram on the paper.

☞ The regression line in the scattergram is always based on all objects.

microGOP 2000/S User’s Guide 3-10-15


3 Functions in microGOP 2000/S - Measure Group

Example of a Scattergram.

3-10-16 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Measure Group 3

Area Fraction
The Area Fraction function measures the area fraction for pixels within
certain grey level intervals. It is possible to measure in one image or
accumulate over several images. Accumulation requires a defined task.
After a number of accumulations over some images it is possible to print
the result on paper, file or the display. Tasks that have been defined can
be listed and loaded again.
Up to 10 phases (grey level intervals) can be defined. Each phase is given
a name for identification in the result list. A grey level interval is
specified for each phase. The grey level interval is displayed in the
image display window.
When adding phases to the list you can select Tile mode which means
that neighbouring phases can not overlap in the grey scale. This mode
can be turned off if desired.
The result is presented in a bar diagram and in a list containing the grey
level intervals for the different phases.
The presentation is done in a pop-up window on the display, on the
laser printer or on an EPS file.

☞ The last Area Fraction measurement is stored in the system vector


variable $AreaFraction[], see page 4-9.
Select the action Current, Define, Accumulate to or Print. See
Histogram for a description of the define-accumulate-print procedure
(page 3-10-9).
Use Measure Frame
Measure only pixels that are inside the measure frame.
Input
The grey scale image to be measured. Note that this is also the image
that is displayed in the Image Display window when using the
function interactively.
Name
A name for the Area Fraction task to be Defined, Accumulated to or
Printed.
Load task...
Displays a pop-up window with a list of the tasks defined so far.
From the list a task can be selected and loaded into the parameter
area for editing.

microGOP 2000/S User’s Guide 3-10-17


3 Functions in microGOP 2000/S - Measure Group

Overlap/Tile
Select if phases should be tiled or overlapped.
Add Phase
A new phase can be added before or after the phase currently
selected or to the top or the end of the phase list.
Delete Phase
Deletes the selected phase or all phases.

The area below the list is used for editing the currently selected phase in
the list.
Phase
The name for the selected phase in the list.
Lo, Hi
The grey value range for the current phase.
Create
Creates a binary image from the current phase if set to other than E.
Bar Value
Print the area for each phase on its bar.
Bar %
Print the area fraction on each bar.
Print on:
Select Screen, Laser printer, EPS file, Bitmap file, or Nothing. The
bitmap file will be in TIFF format. The EPS file and Bitmap file
selections requires a file name. Two files are create when EPS file is
used: The EPS file is created without extension and a text file is
created with the extension afp. Nothing doesn’t produce any
printout when the calculation is made. This is useful if you just want
to use the system variables in the Variable function after an Area
Fraction call.

3-10-18 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Measure Group 3

Size on paper...
This button is visible when printing on Laser and EPS file. The
button brings up a window where it is possible to set the position
and size of the histogram on the paper.
Comment
A comment to be printed with the result.

Example of an Area Fraction printout:

microGOP 2000/S User’s Guide 3-10-19


3 Functions in microGOP 2000/S - Measure Group

Dump
This function dumps (writes) a Basics, Histogram or Scattergram to a
file. The dump can be retrieved later and accumulated to further. The
Dump format is binary and is not suited for other programs to work on.
Dump
Indicate the type of statistics to dump: Basics, Histogram or
Scattergram.
Name
The name for the statistics. I.e. the name under which the statistics is
defined in microGOP.
To file
The name of the file to save the dump in.

3-10-20 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Measure Group 3

Retrieve
Retrieve statistics from a previous Dump. A Retrieve replaces any
accumulated data with the same name that might be in use.
Dump
Indicate the type of statistics to retrieve: Basics, Histogram or
Scattergram.
From file
The name of the file to retrieve the dump from.

microGOP 2000/S User’s Guide 3-10-21


3 Functions in microGOP 2000/S - Measure Group

Grey Histogram
Presents a histogram on the screen or on the laser printer over the grey
levels in a grey scale image.
Grey image
The grey image to measure the histogram for.
Binary mask image
If not E the binary image selected is used as a mask for the histogram.
Only pixels lying under he mask are taken into account by the
histogram.
X axis Min Intensity, Max Intensity
Set the min and max grey level for the X-axis in the histogram.
Y axis
The scaling of the Y-axis can be automatic or manual.
Print on:
Select Screen, Laser printer, EPS file, Bitmap file, or Nothing. The
bitmap file will be in TIFF format. The EPS file and Bitmap file
selections requires a file name. Nothing doesn’t produce any
printout when the calculation is made. This is useful if you just want
to use the system variables in the Variable function after a Grey
Histogram call.
Size on paper...
This button is visible when
printing on Laser and EPS
file. The button brings up a
window where it is possible to
set the position and size of the
histogram on the paper.
Comment
A comment to be printed with
the histogram.
Example of a
Grey Histogram
printout:

3-10-22 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Measure Group 3

Variables defined by the Grey Histogram function


A number of system variables are defined after a Grey Histogram
measurement. All the variables contain values from the latest
measurement.

float $GreyHistogram[]
This variable contains the latest measured grey scale histogram.

☞ This vector, like all other vectors, start with index 1. The first
entry (entry 1) in the vector contains the number of pixels for
intensity 0. For an 8-bit image, the entries 1-256 will be filled with
values even if the pixel values are between 0 and 255.
float $GreyHistogramMinVal
float $GreyHistogramMaxVal
Minimum/maximum intensity values in the histogram.
float $GreyHistogramMinFreq
float $GreyHistogramMaxFreq
Minimum/maximum frequency values in the histogram.
float $GreyHistogramMean
Mean intensity value in the histogram.
float $GreyHistogramStdDev
Intensity standard deviation in the histogram.

microGOP 2000/S User’s Guide 3-10-23


3 Functions in microGOP 2000/S - Measure Group

3-10-24 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Stereology Group 3

3.11 The Stereology function group


☞ The stereology functions will only be visible if they are enabled with
the -STEREO option when the microGOP is started. See How to enable
microGOP options, page C-7.
The functions in this function group use stereology methods to calculate
different features in binary images.

Stereology functions can use simple and fast measurements in 2D


images to be able to calculate 3D features.
As an example: It is, if some conditions are fulfilled, possible to measure
volumes and surfaces in 2D images.

☞ The are a lot of books written about stereology. This book describes
stereology methods used in microscopy:
Computer-assisted microscopy: The measurement and analysis of images by
John C. Russ, Plenum Press, New York, ISBN 0-306-43410-5.

microGOP 2000/S User’s Guide 3-11-1


3 Functions in microGOP 2000/S - Stereology Group

Intercept
This is a function that puts test lines on a binary image and then
calculates the intercepts (chords) between the lines and the objects in the
binary image.

The figure above contains one test line and 4 objects. There are 4
intercepts (chords) between the test line and objects and also 4 intercepts
between the test line and the background. There are 7 intersections
(transitions) between the background and the objects along the test line.
The number of objects along the test line is often considered as the
number of intersections divided by 2 which will give the value 3.5 in this
case.
The output from the function is a number of variables containing the
values described above. These variable values can be used for different
stereological calculations. The variables are described later in this
section. First a description of the parameters to the function.
Image
Specifies the binary image to make measurements in.
Number of test lines
The number of test lines to put on the image.
Test Line Directions
The test lines can be put in the following directions:
Horizontal The test lines will be horizontal.
Vertical The test lines will be vertical.
Random The test lines will be drawn at a random angle.
Specified The test lines will be drawn at a specified angle.
Possible angles are in the range ± 90 degrees.

3-11-2 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Stereology Group 3

Test Line Length & Distance


The length of the test lines and the distance between the test lines can
be defined in two different ways:
Defined by measure area
The test line length and distance between test lines are defined
by the measure area. All lines will be put inside the measure area
which means that the lines will have different lengths if they are
put in a Measure Circle or at an angle in a Measure Frame.
Specified
The test line length and distance between the lines are defined
by values.

☞ All lines must fit inside the image.


☞ The test lines will probably not get exactly the specified
length since the lines must begin and end at an integer pixel
position.
The result from the measurements can be inspected by ticking one or
more of the Show Lines, Show Intercepts or Show Measurement
Result check boxes. The measurement does not require any of the boxes
to be checked but the measurement time will increase if any check box
is checked.
Show Lines
The generated test lines will be plotted in the background overlay of
the Image Display.
Show Intercepts
The intercepts (chords) in objects will be plotted in the background
overlay of the Image Display.

microGOP 2000/S User’s Guide 3-11-3


3 Functions in microGOP 2000/S - Stereology Group

Show Measurement Result


A summary of the measurement result will be printed in the
Message window. This is just a quick way to inspect the results of the
measurements. This is an example of the generated printout:
Result from Intercept Measurement
---------------------------------
7 test lines at 33.00 degrees.
Scale unit was micron.
Line Length NIntersections OChords BChords
---- ------ -------------- ------- -------
1 798.14 4 145.673 114.518
79.5178 451.047
7.42215
2 798.14 4 275.477 230.284
52.802 210.572
29.041
3 798.14 0 798.14
4 798.14 4 62.9793 136.154
68.077 460.568
70.3706
5 798.14 4 68.077 167.305
76.3453 361.338
125.08
6 798.14 2 74.4263 522.295
201.425
7 798.14 4 90.9655 35.0099
84.6138 303.454
284.114

The most common way of accessing the measurement results are


through the system variables that can be accessed in the Variable
function after a measurement.

3-11-4 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Stereology Group 3

Variables defined by the Intercept function


A number of system variables are defined after an Intercept
measurement. These variables can be used in different stereological
calculations.

☞ All the variables contain values from the latest measurement. No


accumulation of values from several measurements is made. Any
accumulation can easily be made in the Variable function.
int $InterceptNLines
The number of test lines.
float $InterceptTLineAngle
The angle for the test lines.
char $InterceptScaleUnit
The scale unit used at the time of the measurement.
float $InterceptTLineLengths[]
The length of the test lines.
float $InterceptOChordLengths[]
The length of the intercepts (chords) between the test lines and the
objects in the binary image. This vector contains the intercepts for all
the lines. It is also possible to get the intercepts for a specific test line
by indexing this vector with values from the vector
$InterceptNOChords[]. See description of $InterceptNOChords[]
below.
float $InterceptBChordLengths[]
The length of the intercepts (chords) between the test lines and the
background in the binary image. This vector contains the intercepts
for all the lines. It is also possible to get the intercepts for a specific
test line by indexing this vector with values from the vector
$InterceptNBChords[]. See description of $InterceptNBChords[]
below.
int $InterceptNOChords[]
This variable contains the number of intercepts (chords) between test
lines and objects in the binary image. $InterceptNOChords[i]
contains the number of intercepts for test line i.

microGOP 2000/S User’s Guide 3-11-5


3 Functions in microGOP 2000/S - Stereology Group

int $InterceptNBChords[]
This variable contains the number of intercepts (chords) between test
lines and the background in the binary image.
$InterceptNBChords[i] contains the number of intercepts for test
line i.
int $InterceptNIntersections[]
This variable contains the number of intersections (transitions)
between objects and background along the test lines.
$InterceptNIntersection[i] contains the number of intersections
along test line i.

3-11-6 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Stereology Group 3

Volume Weighted Mean Volume


The function calculates the volume weighted mean volume, Vv, for
isotropic objects or vertical sections. The following formula is used:
3
πl
Vv = -------
3

where:
3
l

is the mean of the “object intercept lengths raised to 3".

☞ Only the intercept lengths in objects hit by a sample point inside the
measure frame are counted.
The Vv calculations are described in:
The new stereological tools: Dissector, fractionator; nucleator and point
sampled intercepts and their use in pathological research and diagnosis. by H.J
.G Gundersen et al, APMIS 96: 857-881, 1988.
A coefficient of error, CE, is calculated as:

3 2
CE = ∑ (l ) 1
------------------ – ----
3 2 N
(∑ l )

where l is the individual intercept length and N is the number of


intercepts.
The CE calculations are described in:
Stereological estimation of the volume weighted mean volume of arbitrary
particles observed on random sections by Gundersen & Jensen, Journal of
Microscopy 138, Pt2, May 1985 , pp. 127-142.
The result of the calculations is presented as a table.
Define/Accumulate/Present Result
The calculations consists of three steps. The first step is to define a
name for the calculations. The second step is to accumulate data
from images to the name. The last step is used to present the
accumulated data.

microGOP 2000/S User’s Guide 3-11-7


3 Functions in microGOP 2000/S - Stereology Group

The Accumulate step uses the following parameters:


Vertical sections/Isotropic objects
The calculations can be performed on isotropic objects or on vertical
sections.
Line Directions
The measure lines can be oriented horizontally,vertically or at
random for isotropic objects.
Number of test lines
The number of test lines can be selected. The distance between test
lines is calculated as image height / number of lines. Objects should
not be hit by more than one test line.
Number of directions
Only sinus weighted directions in the range 0-90 degrees are used for
vertical sections. This value specifies the number of sinus weighted
directions to use. The first direction is selected at random and the
following directions are calculated by adding Direction offset to the
previous direction.
Direction offset
See Number of directions above.
Show Lines/Points/Intercepts:
These check boxes are used to enable the display of test lines, sample
points and detected intercepts. Disabling these check boxes
decreases the time required for the Accumulate step.
Image
The binary image to perform the calculations in.

The Present Result step uses the following parameters:


Print on Screen/Laser/File
Specifies the destination for the table.
Result File Name
A file name must be specified if the destination is a File.
Comment
A comment can be included in the table header.

3-11-8 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Stereology Group 3

Example of a produced table:


Volume weighted mean Volume for Isotropic Objects
Name: Volume1
Scale unit: pixel
Comment: This is an example
Accumulated
Image Angle N l3sum l3mean Vv CE
------------------------------------------------------------------
1 18.6 16 250232.6 15639.5 16377.7 0.177
2 -61.3 10 87786.4 8778.6 13614.3 0.162
3 26.4 12 96361.5 8030.1 11970.6 0.142
4 9.6 17 179039.5 10531.7 11679.5 0.119
5 32.6 20 149787.8 7489.4 10656.4 0.102
6 -69.6 14 166721.5 11908.7 10941.8 0.103
7 87.2 7 117907.0 16843.9 11430.1 0.106
------------------------------------------------------------------
Total 96 1047836.3 10915.0 11430.1 0.106

The table columns are described below.


Image
Field number.
Direct or Angle
Used direction or angle.
N
Number of intercepts.
l3sum
The sum of ’intercept lengths raised to 3’.
l3mean
The mean of ’intercept lengths raised to 3’.
Vv
The volume weighted mean volume.
CE
Coefficient of error.

☞ The Vv and CE are update for each line in the table. They are not
calculated per field !

microGOP 2000/S User’s Guide 3-11-9


3 Functions in microGOP 2000/S - Stereology Group

Surface Area per Unit Volume


The function calculates the Surface Area per unit Volume, Sv, for
isotropic objects or vertical sections. The following formula is used:

S v = 2P L

where:

PL

is the number of object-background transitions divided by the total


length of the test lines.

☞ Only object-background transitions inside the measure frame are


counted.
The Sv calculations are described in:
Computer-assisted microscopy: The measurement and analysis of images by
John C. Russ.Third Printing, page 225.1990 Plenum Press, New York,
ISBN 0-306-43410-5.
The result of the calculations is presented as a table.
Define/Accumulate/Present Result
The calculations consists of three steps. The first step is to define a
name for the calculations. The second step is to accumulate data
from images to the name. The last step is used to present the
accumulated data.

The Accumulate step uses the following parameters:


Vertical sections/Isotropic objects
The calculations can be performed on isotropic objects or on vertical
sections.
Line Directions
The measure lines can be oriented horizontally, vertically or at
random for isotropic objects.
Number of test lines
The number of test lines can be selected. The distance between test
lines is calculated as image height / number of lines. Objects should
not be hit by more than one test line.

3-11-10 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Stereology Group 3

Number of directions
Only sinus weighted directions in the range 0-90 degrees are used for
vertical sections. This value specifies the number of sinus weighted
directions to use. The first direction is selected at random and the
following directions are calculated by adding Direction offset to the
previous direction.
Direction offset
See Number of directions above.
Show Lines/Intercepts:
These check boxes are used to enable the display of test lines and
detected intercepts (transitions object-background). Disabling these
check boxes decreases the time required for the Accumulate step.
Image
The binary image to perform the calculations in.

The Present Result step uses the following parameters:


Print on Screen/Laser/File
Specifies the destination for the table.
Result File Name
A file name must be specified if the destination is a File.
Comment
A comment can be included in the table header.

microGOP 2000/S User’s Guide 3-11-11


3 Functions in microGOP 2000/S - Stereology Group

Example of a produced table:


Surface Area per unit Volume for Isotropic Objects
Name: Surface1
Scale unit: pixel
Comment: This is an example
Accumulated
Image Angle Intercepts(P) Length(L) Sv
----------------------------------------------------
1 -15.1 139 7655.6 0.0363
2 61.3 137 7658.8 0.0360
3 20.9 131 7649.9 0.0354
4 -34.4 130 7664.0 0.0351
----------------------------------------------------
Total 537 30628.3 0.0351

The produced table consists of the following columns:


Image
Field number.
Direct or Angle
Used direction or angle.
Intercepts
Number of intercepts (transitions object-background).
Length
The length of the test lines inside the measure frame.
Sv
The surface area per unit volume.

☞ The Sv is update for each line in the table. It is not calculated per
field !

3-11-12 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Stereology Group 3

Mean Surface to Volume Ratio


The function calculates the mean Surface to Volume ratio, S/V, for
isotropic objects or vertical sections. The following formula is used:

4
S ⁄ V = ------
L3

where:

L3

is the mean intercept length.

☞ Only the intercept lengths in objects hit by a sample point inside the
measure frame are counted.
The S/V calculations are described in:
Computer-assisted microscopy: The measurement and analysis of images by
John C. Russ. Third Printing, page 228. 1990 Plenum Press, New York,
ISBN 0-306-43410-5.
The result of the calculations is presented as a table.
Define/Accumulate/Present Result
The calculations consists of three steps. The first step is to define a
name for the calculations. The second step is to accumulate data
from images to the name. The last step is used to present the
accumulated data.

The Accumulate step uses the following parameters:


Vertical sections/Isotropic objects
The calculations can be performed on isotropic objects or on vertical
sections.
Line Directions
The measure lines can be oriented horizontally,vertically or at
random for isotropic objects.
Number of test lines
The number of test lines can be selected. The distance between test
lines is calculated as image height / number of lines. Objects should
not be hit by more than one test line.

microGOP 2000/S User’s Guide 3-11-13


3 Functions in microGOP 2000/S - Stereology Group

Number of directions
Only sinus weighted directions in the range 0-90 degrees are used for
vertical sections. This value specifies the number of sinus weighted
directions to use. The first direction is selected at random and the
following directions are calculated by adding Direction offset to the
previous direction.
Direction offset
See Number of directions above.
Show Lines/Points/Intercepts:
These check boxes are used to enable the display of test lines, sample
points and detected intercepts. Disabling these check boxes
decreases the time required for the Accumulate step.
Image
The binary image to perform the calculations in.

The Present Result step uses the following parameters:


Print on Screen/Laser/File
Specifies the destination for the table.
Result File Name
A file name must be specified if the destination is a File.
Comment
A comment can be included in the table header.

3-11-14 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Stereology Group 3

Example of a produced table:


Mean Surface to Volume Ratio for Isotropic Objects
Name: SVRatio1
Scale unit: pixel
Comment: This is an example
Accumulated
Image Angle N lsum lmean S/V
-----------------------------------------------------------
1 79.4 15 248.0 16.5 0.242
2 -72.0 17 367.0 21.6 0.208
3 60.6 15 222.4 14.8 0.224
4 61.4 11 175.3 15.9 0.229
5 -6.0 9 226.1 25.1 0.216
6 -18.7 11 203.7 18.5 0.216
7 -14.9 10 224.0 22.4 0.211
-----------------------------------------------------------
Total 88 1666.5 18.9 0.211

The produced table consists of the following columns:


Image
Field number.
Direct or Angle
Used direction or angle.
N
Number of intercepts (transitions object-background).
lsum
The sum of intercept lengths.
lmean
The mean intercept length.
S/V
The mean surface to volume ratio.

☞ The S/V value is update for each line in the table. It is not calculated
per field !

microGOP 2000/S User’s Guide 3-11-15


3 Functions in microGOP 2000/S - Stereology Group

3-11-16 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - FFT Group 3

3.12 The FFT function group


This function group contains functions using the Fourier transform in
different ways. In addition to the Fourier transform it self there are
functions to restore linearly distorted images and images with areas of
lost data. Some filter and window functions are also included in this
group.

The functions FFT and Inverse FFT are the base functions in this group
and they are used to convert an image to its corresponding Fourier
transform and vice versa.
The Convolution and Correlation function use the FFT routine and
different border modes to perform convolution and correlation
respectively.
The BT PSD (Blackman-Tukey Power Spectral Density) function is used
to estimate the density distribution of the power spectrum of an image.
This can for example be useful when creating a Wiener filter.
The radial and angular distribution of a power spectrum can be viewed
with the Radial PSD function.
The two functions RL Restore (Richardsson-Lucy Restoration) and
Wiener are used to improve a linearly distorted image.
The Normalized Averaging function is used to adapt areas of lost data
to the neighborhood in a least square error way.

microGOP 2000/S User’s Guide 3-12-1


3 Functions in microGOP 2000/S - FFT Group

☞ All functions in this group only work on image buffers of the type
c32. The Copy Image function in the Image function group can be used
to convert from and to c32. It is also possible to use the Image Tool
window interactively.

☞ The c32 images are converted to a normalized grey scale image


before they are displayed. The largest value in the c32 image is
displayed as white. See How are c32 images copied ?, page D-2 in Appendix
D - Image copy rules.

3-12-2 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - FFT Group 3

FFT (Fast Fourier Transform)


This function calculates the Fourier transform of an image buffer. If the
transform should be visualized it is recommended to view it in a log
scale, see the function Calculate (page 3-12-13).
Input image
Input image to transform.
FFT image
Destination of the transformed image.

☞ This function works on all images with even width and height but
the execution time is extremely long on image sizes that are not a power
of 2 (256x256, 512x512,... etc.). The reason for this is that an ordinary DFT
(Discreet Fourier Transform) must be used on such images.

☞ A description of the Fourier transform can be found in Digital Image


Processing by Rafel C. Gonzalez, Addison-Wesley Publishing Company,
1977.

microGOP 2000/S User’s Guide 3-12-3


3 Functions in microGOP 2000/S - FFT Group

Inverse FFT
This function calculates the inverse Fourier transform of an image
buffer. See also FFT, page 3-12-3.
FFT image
Input Fourier transform.
Output image
Destination of the inverse transformed Fourier spectrum.

☞ This function works on all images with even width and height but
the execution time is extremely long on image sizes that are not a power
of 2 (256x256, 512x512,... etc.). The reason for this is that an ordinary
inverse DFT (Discreet Fourier Transform) must be used on such images.

☞ A description of the inverse Fourier transform can be found in


Digital Image Processing by Rafel C. Gonzalez, Addison-Wesley
Publishing Company, 1977.

3-12-4 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - FFT Group 3

Convolution
The convolution function is used to perform a convolution between two
images. The convolution uses a Zero border mode for the Convolution
kernel and the specified Border mode for the Input image. See also
Correlation, page 3-12-6.
Input image
Input image to be filtered.
Convolution kernel
Image containing the filter kernel.
Output image
Destination image for the result.
Border mode
Border mode to use for the Input image. Three different border
modes are implemented:
Copy The image is extended with the values at the image
borders.
Zero The image is extended with zero values.
Circular The image is not extended which implies a circular
image.

☞ Usually the Copy border mode is recommended as it keeps the


DC level at the image borders.

☞ If the edge effects are accepted the speed can be improved by


using the Circular border mode.

☞ This function works on all images with even width and height.
☞ A description of the convolution operation can be found in Digital
Image Processing by Rafel C. Gonzalez, Addison-Wesley Publishing
Company, 1977.

microGOP 2000/S User’s Guide 3-12-5


3 Functions in microGOP 2000/S - FFT Group

Correlation
The correlation function is used to perform correlation between two
images. The correlation uses a Zero border mode for the Correlation
image and the specified Border mode for the Input image. The
autocorrelation function is performed by selecting the same Input
image and Correlation image and by using the Zero border mode. See
also Convolution, page 3-12-5.
Input image
First image to be correlated.
Correlation image
Second image to be correlated.
Output image
Destination image for the result.
Border mode
Border mode to use for the Input image. Three different border
modes are implemented:
Copy The image is extended with the values at the image
borders.
Zero The image is extended with zero values.
Circular The image is not extended which implies a circular
image.

☞ Usually the Zero mode is used for this function.

☞ This function works on all images with even width and height.
☞ A description of the correlation operation can be found in Digital
Image Processing by Rafel C. Gonzalez, Addison-Wesley Publishing
Company, 1977.

3-12-6 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - FFT Group 3

BT PSD (Blackman-Tukey Power Spectral


Density estimation)
This function is used to estimate the power spectrum of an image. The
result of this function can be used with the Wiener function when
creating a Wiener filter.
The power spectrum of an image is often distributed as an inverse
exponential function and a good estimate can often be created
synthetical with the Exp function.
The function divides the image into a number of subimages depending
on the size of the window. A power spectrum estimate is then calculated
for each subimage by using the Blackman-Tukey method, see figure.
The average of these results is then calculated and stored in the output
image.

Figure 3-1: The procedure of estimating the power spectrum of a sub image.

Input image
Input image.
Output image
Output image for the estimated power spectrum.
Window
One of three window types (Hanning, Parzen, Welch or None)
where None corresponds to a rectangular window.

☞ The default window is Hanning.


Window size
This is the size of the quadratic window type chosen by the Window
parameter.

microGOP 2000/S User’s Guide 3-12-7


3 Functions in microGOP 2000/S - FFT Group

☞ This function works on all images with even width and height but
the execution time is extremely long on image sizes that are not a power
of 2 (256x256, 512x512,... etc.). The reason for this is that ordinary DFT
(Discreet Fourier Transform) must be used on such images.

☞ The esimating of power spectrum is described by M.D.Levine in


Vision in man and machine, McGraw-Hill, 1985.

3-12-8 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - FFT Group 3

Radial PSD (Power Spectral Density)


This function is used to visualize the radial and angular distribution of
a power spectrum or a Fourier transform.
The function can be used to visualize the radial distribution before
creating a equalizer filter.
Input PSD
Input power spectrum.
Output PSD
Output power spectrum containing a plot of the radial and angular
distribution.

☞ This function works on all images with even width and height.

microGOP 2000/S User’s Guide 3-12-9


3 Functions in microGOP 2000/S - FFT Group

Richardsson-Lucy Restoration
This is an iterative function to deconvolve a linearly distorted image.
The algorithm is based on Bayes rule and solves the deconvolution
problem by using statistical theory.
Before this function is used an estimation of the point spread function
must be made, see Defocus (page 3-12-18) and Motion (page 3-12-19).
The iterative function starts by storing the 1st guess of the distorted
image, for example the Blurred image itself, in the Improved image
buffer (see figure). This image is then blurred once more with the Blur
kernel. The result is then compared with the Blurred image and a image
with scale factors is created. The Improved image buffer is then
multiplied with the scale factor image to compensate for the distortion.
At last, by executing this loop several times the Improved image will
become more and more like the original.

Figure 3-2: Overview of the steps in the Richardsson-Lucy algorithm.

Input image
The distorted image.
Blur kernel
The estimated point spread function.
1st guess
The image where from the iterations should start.

☞ If no attempt to restore the image has been made earlier, the


Input image can be used here.
Output image
Where to store the result image.

3-12-10 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - FFT Group 3

Number of iterations
The number of iterations which should be done before storing the
result.

☞ If more iterations are needed, the iterations can be continued by


specifying the result image as the first guess in the next operation.

☞ This function works on all images with even width and height.
☞ A description of the Richardsson-Lucy method can be found in the
astronomical journal, volume 79, number 6, An iterative technique for the
rectification of observed distributions by L.B.Lucy.

microGOP 2000/S User’s Guide 3-12-11


3 Functions in microGOP 2000/S - FFT Group

Normalized Averaging
This function is used to restore missing data in an image. A certainty
image must be created to assign a certainty value to every pixel. The
areas where the data is lost the certainty should be set to zero and the
error free areas should be assigned a value of one.
A local window function should also be specified. An appropriate
window can be created with the Applicability function.
The method uses the formula below to interpolate the areas with a low
certainty values while the certain areas are kept. The input image is
denoted I, the certainty image c and the applicability window α.

α × cI
N = ---------------
α×c

Input image
The distorted image.
Certainty image
Image with certainty values corresponding to the pixel valued in the
input image.
Applicability
Window function describing the locality of the operation.
Output image
The result image.

☞ This function works on all images with even width and height.
☞ Normalized convolution is described by Carl-Fredrik Westin in A
Tensor Framework for Multidimensional Signal Processing, PhD thesis,
Linköping University, Dissertation No 348, 1994.

3-12-12 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - FFT Group 3

Calculate
This function is used to perform pixel wise calculations between two
images, with an image and a constant ... etc. The calculation functions
implemented are described below.
Input image #1
The first input image.
Input image #2
The second input image.
Expression
This parameter describes the calculation operation which should be
performed.
These are the operations that can be performed:

☞ The two last operations are used to normalize an image relative


its maximum value or relative its total dynamic range.

☞ It is very useful to perform a normalize operation, with B set to


255, before a c32 image is copied to a grey scale image.
A, B
Complex constants used in Expression.

microGOP 2000/S User’s Guide 3-12-13


3 Functions in microGOP 2000/S - FFT Group

Wiener filter
This function creates an optimal Fourier domain Wiener filter from a
power spectrum estimate, a Fourier domain point spread function and a
noise level. The Wiener filter is returned as a Fourier transform of the
Wiener kernel.
The Wiener filter deconvolution method builds on a model where the
image has been distorted with a linear process whereafter additive noise
has been introduced, see figure. If these two parameters and the
distribution of the power spectrum can be estimated, a optimal inverse
filter (Wiener filter) can be calculated. The distorted image is then
restored by convolving it with the calculated filter.

Input PSS
Power spectrum distribution of the original image.

☞ Often an inverse exponential function can be used, see Exp filter


(page 3-12-17).
Blur FFT
Fourier transform of the point spread function (for example a
Defocus or Motion filter).
Output filter
Output image for the Fourier domain Wiener filter.
Noise level
Noise level compared to the power spectrum.

☞ This function works on all images with even width and height.
☞ The Wiener filter is described by J.S.Lim in Two-dimensional signal
and image processing, Prentice Hall, 1990.

3-12-14 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - FFT Group 3

Equalizer filter
This function is used to create a 10 band equalizer filter in the Fourier
domain. The magnitude of the frequency bands are set by the
parameters Band0 to Band9.
A equalizer filter can be created to compensate for distortion in separate
frequency bands. For example suppressing band limited noise or
amplifying high frequencies in blurred images.
Equalizer filter out
The output image for the generated equalizer.
Band0, ..., Band9
Amplification factor for the frequency bands respectively.

☞ This function works on all images with even width and height.

microGOP 2000/S User’s Guide 3-12-15


3 Functions in microGOP 2000/S - FFT Group

Gauss filter
The Gauss filter function is used to create a Fourier domain Gauss filter.
The standard deviation of the filter is given as a parameter. This is a
locally optimal blur filter meaning that the filter is local in both the
Fourier domain and in the image domain.
Gauss filter out
Output image for the generated filter.
Sigma
Standard deviation of the Gauss filter.

☞ This function works on all images with even width and height.

3-12-16 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - FFT Group 3

Exponential filter
The Exp filter function is used to create a Fourier domain exponential
filter. The scaling factor of the filter is given as a parameter.

☞ This function can also be used to generate a synthetic power spectral


density function for the Wiener filter.
Exp filter out
Output image for the generated filter.
k
Scaling factor of the exp filter (a typical value is -1).

☞ This function works on all images with even width and height.
☞ A description of the Fourier transform can be found in Digital Image
Processing by Rafel C. Gonzalez, Addison-Wesley Publishing Company,
1977.

microGOP 2000/S User’s Guide 3-12-17


3 Functions in microGOP 2000/S - FFT Group

Defocus filter
This function generates a Fourier domain defocus filter. The extension in
pixels of the defocus blur is given as a parameter. The defocus filter can
be described in the image domain as a circular area on which each pixel
value is spread out.
This filter can be used with the Wiener filter or the Richardsson-Lucy
method to improve a defocused image.
Defocus filter out
Output image for the defocus filter.
Radius
The extension of the defocus blur function in pixels.

☞ This function works on all images with even width and height but
the execution time is extremely long on image sizes that are not a power
of 2 (256x256, 512x512,... etc.). The reason for this is that an ordinary DFT
(Discreet Fourier Transform) must be used on such images.

3-12-18 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - FFT Group 3

Motion filter
This function generates a Fourier domain motion filter. The extension in
pixels and the direction of the motion is given as a parameter. The
motion filter can be described in the image domain as a line in the
direction of the motion on which each pixel value is spread out.
This filter can be used with the Wiener filter or the Richardsson-Lucy
method to improve a motion blurred image.
Motion filter out
Output image for the motion filter.
Radius
The extension of the motion in pixels.
Angle
The direction of the motion in radians.

☞ The angle is defined clockwise.

☞ This function works on all images with even width and height.

microGOP 2000/S User’s Guide 3-12-19


3 Functions in microGOP 2000/S - FFT Group

Butterworth filter
This function generates a Fourier domain Butterworth filter. The filter
order, radius and end magnitude are given as parameters.
The filter is a low pass filter which also passes a fairly high amount of
high frequencies to preserve some of the edge contents in the image.
Butterworth filter out
Output image for the Butterworth filter.
Order
The order of the Butterworth filter.
Radius
The extension of the filter.
Magnitude
Magnitude of the filter at radius Radius.

☞ This function works on all images with even width and height.
☞ A description of the Butterworth filter can be found in Digital Image
Processing by Rafel C. Gonzalez, Addison-Wesley Publishing Company,
1977.

3-12-20 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - FFT Group 3

Applicability
This function generates a applicability window. The filter radius and
shape is given as parameters. This type of window is normally used with
the function Normalized Averaging.
Applicability window out
Output buffer for the applicability window.
Alpha
The scaling factor of the the exponential part.
Beta
The order of the cos2 part.
Radius
Radius of the window function.

☞ This function works on all images with even width and height.
☞ The applicability window function is described by Carl-Fredrik
Westin in A Tensor Framework for Multidimensional Signal Processing, PhD
thesis, Linköping University, Dissertation No 348, 1994.

microGOP 2000/S User’s Guide 3-12-21


3 Functions in microGOP 2000/S - FFT Group

3-12-22 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Classify Group 3

3.13 The Classify function group


☞ The image classification functions will only be visible if they are
enabled with the -CLASS option when the microGOP is started. See
Setting up the microGOP 2000/S environment in Appendix C.
The functions in this group are used to classify (segment) an image into
regions, classes, that in some sense are homogeneous, and to visualize
classified images.

Supervised Statistical Image Classification§


The objective of an image classification is to assign (label) each pixel in
an image to one of a set of classes. Often we consider multidimensional
pixel data (data from more than one feature image), so the values of a
pixel can be represented as a feature vector.
v = v 1, v 2, … ,v n

The user "supervises" the process by initially selecting some pixels from
each possible class, so called training. From this information, the
classification algorithm determines what characterises each class, and
finally assigns each pixel of the image to one of the classes. Thus, for
each pixel in the image a class membership is determined, and the pixel
is assigned a certain color associated with that class.
Some classification examples:
• Segmentation of an MR image of the brain into white and grey
matter, fat, cerebrospinal fluid, etc.
• Segmentation of a remote sensing scene into water, forest, crop
types, urban areas, etc.

§ The image classification is based on statistical and contextual methods described in detail in:
• H V Sæbø, K Bråten, N L Hjort, B Llewellyn, E Mohn: Contextual classification of remotely sensed
data: Statistical methods and development of a system. Report no. 768. Technical report, Norwegian
Computing Center, 1985.
• T M Einarsson: Statistisk klassifikation af billeder. Eksamensprojekt nr.29/92. IMSOR, Technical Uni-
versity of Denmark, Lyngby 1992. (This report is written in danish.)
• K Conradsen, B K Ersbøll: Variable selection in non-linear discriminant analysis. IMSOR, Technical
University of Denmark.

microGOP 2000/S User’s Guide 3-13-1


3 Functions in microGOP 2000/S - Classify Group

Feature values
To be able to determine a class membership we need to measure a
number of features for every pixel in the input image. With features is
meant values measured from the image, such as intensity values, or
results from image processing operations (local spatial frequency
estimates, local variance values, local orientation estimates, shape
measurement values, etc.). The feature values of a pixel are represented
with a feature vector.
Examples of features in remote sensing
Intensity values in images coming from different spectral bands.
Examples of features in color images
Intensity values from the red, green, and blue color band,
respectively.
Examples of features in MRI
Intensity values from MR images taken with different timing
parameters (same slice position).

The feature space


The n-dimensional feature vector of every pixel in the image can be said
to span an n-dimensional feature space, where n is the number of feature
values. Each pixel in the image corresponds to one point in this feature
space. If the features are chosen properly, the pixels belonging to a
certain class form a cluster in the feature space.
A one-dimensional feature space (grey scale histogram) is shown in the
left figure below, where clusters of pixels from two classes can be seen.
The figure to the right illustrates an example with three classes in a two-
dimensional feature space with the features Feature1 and Feature2 on the
two axes.

3-13-2 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Classify Group 3

Classification rules
Each pixel in the image is classified by taking the pixel’s coordinates in
feature space (i.e. the feature vector for the pixel), and then assigning the
pixel to a certain class according to some decision rule. This is possible
if we have chosen a suitable set of features.
One way to obtain a rule by which points in the feature space are
assigned to a class, is to subdivide the feature space into sub-spaces with
a set of boundaries mathematically defined as (hyper-)planes or other
kinds of surfaces. The class membership can then be determined by
deciding into which sub-space the feature vector falls.
Box classification
There are several ways to make this subdivision. The simplest form
is thresholding in a one-dimensional feature space. This is illustrated
in the left figure below.
The generalization of thresholding is called box classification. Using
this rule, the feature space is subdivided into n-dimensional cubes,
where n is the number of features. See the two-dimensional example
below (the figure to the right).

There are of course more sophisticated and more complicated rules


than box classification. Without getting involved in any
mathematical formulas, the methods (rules) implemented in
microGOP 2000/S will briefly be described below. These methods
require some supervised knowledge about the feature values for
each class. This is made possible through the training area
definition.

microGOP 2000/S User’s Guide 3-13-3


3 Functions in microGOP 2000/S - Classify Group

Train & Gather Statistics


When training, the user interactively selects training areas for each
candidate class. These are areas known (or assumed) to contain pixels
from the class. The training area selection is done by marking pixels in
certain colors with the Train tool in the Image Display.
The n-dimensional histogram for the training data for each class is
computed, where n is the number of features. The histograms are then
parameterised and represented as Gaussian distributions in which the
parameters that must be estimated are the mean feature values,
represented by an n-dimensional mean vector, and also an nxn
covariance matrix for each class.
In other words, each class is assumed to have its feature vectors
clustered around the mean vector in a Gaussian fashion. The shape of
the Gaussian "hump" is determined by the covariance matrix, and the
location of it (in feature space) by the mean vector.
When only one feature is used to discriminate the different classes (one-
dimensional case), the mean and the variance values of the feature are
calculated for each training area.

☞ A word of warning: It is usually not true that the more features are
used, the better the result will be. If, for instance, a feature is added that
is very correlated with an already existing feature, the estimated
covariance matrix will be almost singular causing numerical problems.

3-13-4 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Classify Group 3

Classical non-contextual methods


The common aspect for the classical, non-contextual, methods is that
each pixel is classified on the basis of the data (feature vector) for this
pixel only (in relation to the statistics data gathered from the training
areas).
Maximum Likelihood (ML)
ML is a statistical classification method based on Bayes decision
theory and uses a probability model. Given the feature values of a
pixel, the probability that the pixel belongs to a certain class is
estimated for each class, and the class for which the probability is
maximum is selected for the pixel.
Minimum Distance (MD)
The Minimum Distance rule assigns a pixel to the class for which the
distance from the feature vector of the pixel to the mean vector for
the pixels in the corresponding training area is minimum. In other
words, a pixel is assigned to the class whose mean vector of feature
values is closest to the feature vector of the pixel. Hence, the distance
in feature space decides the class membership.

No covariance matrix is needed since in this model it is assumed that


the features are statistically independent with equal variance (no
Gaussian assumption for class distributions is made).

microGOP 2000/S User’s Guide 3-13-5


3 Functions in microGOP 2000/S - Classify Group

Contextual methods
Taking surrounding pixels into account when classifying images can be
done in different ways. The use of contextual feature images (results
from GOP operations) is one way. There are also several contextual
methods (discrimination rules) available and implemented in
microGOP 2000/S.
The models that use contextual classification methods state that when
determining the class for a certain pixel, its neighbouring pixels tend to
belong to the same class. To put it simple, it is unusual to find a patch of
wheat in the middle of a corn field.
Each pixel is thus classified on the basis of the data for itself and its
neighbouring pixels. When classical, non-contextual, classification
methods are used, the spatial dependencies between classes are
overlooked. By using a contextual discrimination rule this simplification
can be avoided. A contextual method is, however, computationally
expensive, so it is only feasible to use a small neighbourhood, e.g. data
from four surrounding pixels.
Owen, Hjort & Mohn (OHM)
This method includes a class configuration model which states that
in most cases all pixels within a cross neighbourhood (the actual
pixel and its 4 neighbours to the north, south, west, and east) will
belong to the same class. In some cases there will be two different
classes within the cross, but the probability of the occurrence of three
or more classes within the cross neighbourhood is assumed to be
zero.
In more detail, the OHM class configuration model states that only 9
different situations within a cross neighbourhood can occur. These 9
situations are divided into 3 groups:

1. The most probable situation, all 5 pixels belong to the same


class. Default probability setting p = 0.8
2. 4 pixels in a T-shape belong to one and the same class. The T-
shape can be rotated so that 4 different situations can occur.
For this group, the default probability setting q > 0.1
3. 3 pixels in an L-shape belong to one and the same class. The
2 other pixels in the cross neighbourhood belong to another
class. The L-shape can be rotated so that 4 different situations
can occur. For this group, the default probability setting r <
0.1

3-13-6 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Classify Group 3

The probability for other class combinations within the cross


neighbourhood is set to zero.
The posterior probabilities p, q, and r can be measured from a
classification result and used for reestimation of these three
probabilities in a new classification.
Welch, Salter & Haslett (WSH)
This method also includes a class configuration model. In this model
only interaction between two neighbouring pixels at a time is
considered. Looking in a 3x3 neighbourhood, if the centre pixel is
considered to belong to a certain class CX, the probability P(CX) that
its closest neighbour (north, south, west, or east) belongs to the same
class is high, the default setting is 0.8. For every other class C1, C2, ...,
CN (not CX) there is a setting for the probability that the neighbour
belongs to that particular class. In the microGOP a simplification is
made so that the probability that the neighbour belongs to a different
class than the centre pixel is equal for all classes except CX. The sum
of all probabilities adds up to 1.
For every pixel, its 4 neighbouring pixels are regarded - but only one
at a time (geometrical isotropy is assumed).
The probability matrix can be reestimated by using the posterior
probability matrix measured from a classification result. (In this case
the probability that the neighbour belongs to a different class than
the centre pixel is not equal for every class.)
Switzer
This is a very simple contextual model. Instead of only using the
centre pixel data, a mean feature vector value is calculated from its 4
neighbours (north, south, west, and east). Both the centre value and
the mean value are used as features. This method is equivalent to
applying a small mean filter on every feature image and using the
results as feature images as well. No class configuration is specified
in this model.

microGOP 2000/S User’s Guide 3-13-7


3 Functions in microGOP 2000/S - Classify Group

Linear / Quadratic discrimination


With linear discrimination means that when calculating statistics for the
feature space, only one common covariance matrix is used for all classes.
This is a simplification (which makes the classification significantly
faster) of the quadratic discrimination model.
With quadratic discrimination means that when calculating statistics for
the feature space, class dependent covariance matrices are used, i.e. one
covariance matrix is calculated for each class.

A priori probability
If we pick a pixel in the image at random, its probability of belonging to
a certain class is called the a priori probability. By default, a classification
is performed using equal prior probabilities for all classes.

Mahalanobis distance
The weighted distance from one point in the feature space to the mean
vector value of a certain class is called the Mahalanobis distance. This
distance measure is the answer to the following question; How far from
the class centre - in feature space - is the actual pixel?

Reject class
For every pixel in a classified image, the Mahalanobis distance to the
assigned class is measured. If this distance is too large, you might want
to classify it into a reject class instead of the class suggested by the
classifier. This Mahalanobis distance threshold is specified by a quantile
of the chi2-distribution function for the assigned class. The size of the
quantile can be set by the user.

Result images
Apart from the classification result image, it is also possible to generate
a Mahalanobis distance image that reflects the Mahalanobis distance to the
assigned class centre for every pixel. This can be seen as an inverted
certainty image (i.e. how well did the classifier perform?). Dark areas -
well classified pixels, bright areas - poorly classified pixels.

3-13-8 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Classify Group 3

Autocorrelation models
No correlation
If a model without correlation is used, neighbouring pixels are
assumed to be independent. This is the most common method.
Autocorrelation
If an autocorrelation model is used, correlation between
neighbouring pixels is assumed. This method is very costly
computationally, so the classification is time-consuming.
In the autocorrelation model used in microGOP 2000/S, two
different noise processes are assumed to be present.
1. A noise process having an autocorrelation function
described by a 3x3-pixel neighbourhood.
2. Proportion that belongs to autocorrelated noise.
The autocorrelation model can be used together with the OHM and
the WSH discrimination methods.

Classification Jobs
A classification job is defined by a set of building blocks:
• Train image & background image.
• Definition of class colors and class names.
• A description of the different feature images needed for the
classification.
• Statistics file.
The information regarding a classification job is stored in a Job file having
file extension .cic (context image classifier).

microGOP 2000/S User’s Guide 3-13-9


3 Functions in microGOP 2000/S - Classify Group

ImClassify
This function classifies an image (scene) according to statistics already
defined in an existing classification job, see page 3-13-9.
This function also acts as a portal to the interactive Train functionality,
where it is possible to produce statistics for use in future classification of
similar scenes using ImClassify, but also to perform classification tests
and one-scene classifications.
Browse...
This button calls up a file browser which can be used to find and load
a specific classification job that is stored on file (file extension .cic). To
be able to create a new classification job, launch the Train window,
see The Train window, page 3-13-12.
Job Name
The full path file name for the current classification job.
Train...
Launches the Train window, see The Train window, page 3-13-12.
Required feature images
This list contains the feature images to be used when running a
classification. Before feature images are selected, the list contains
information about how many feature images are needed and what
image type they must have for the current classification job.
To select a feature image
• First, select a list item. This displays a window that describes
the nature of the feature image in the read-only Feature
image description text field.
• In this pop-up window, select an image buffer to be used as
Feature Image.
• Apply changes, or select another list item.

3-13-10 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Classify Group 3

Classified result
The classification result.
The result image is always an 8-bit grey scale image where pixels
belonging to class 1 have pixel value 1, pixels belonging to class 2
have pixel value 2, and so on. Each class is associated with a specific
class color and a class name, as defined when the train image was
produced.
This result image is best viewed within this function or the
DispClassIm function where the pixel values are visualized with the
correct class colors.
Background Image
A background image that is displayed "under" the classification
result. Normally, this image is one of the feature images, the original
image, or the buffer that holds the Mahanalobis Distance image (see
below).
Mahalanobis Distance Image
A grey scale image where pixel values denote the Mahalanobis
distance to the classified class. See Mahalanobis distance, page 3-13-8.
If E is selected, no such image is generated.

☞ If you invert the Mahalanobis distance image and display this as the
background image "under" the classified result, you will see the
classification with intensity values that indicate the certainty of the
classification. In an area with low intensity values (dark) the
classification is considered to be uncertain, and vice versa.

microGOP 2000/S User’s Guide 3-13-11


3 Functions in microGOP 2000/S - Classify Group

The Train window


With this interactive (non-programmable) function, it is possible to
produce statistics files to be used in future classification of similar scenes
using ImClassify. Classification tests and one-scene classifications can
also be performed.
The Job Files menu
The menu connected to the Job Files button contains the following
menu items:
Create...
This choice calls up a file browser which can be used to create a
new classification job.
Load...
This choice calls up a file browser which can be used to find and
load a specific classification job that is stored on file (file
extension .cic).
Save
This choice saves the status of the current classifier job.
Save As...
This choice calls up a file browser which can be used to save a
classification job under a new name.
Delete...
This choice calls up a file browser which can be used to delete all
files associated with a classification job.
Edit Training Areas ...
Activates the SID Train Tool and enters the training mode.
In the training mode it is only possible to work with the SID Tools
(e.g. Train, Zoom, and Contrast/Brightness) and to display new
background images using the Image Tool. If other SID Tools than
the Train Tool are used, the Train Tool must be activated (check the
Active checkbox) again when training is to be resumed.
More about the Train Tool is found in the section To edit a train image
using the SID Train Tool, page 3-13-18.

3-13-12 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Classify Group 3

Classification Method
This is where the classification method (discrimination rule) is
selected.
• Non contextual
• Contextual OHM - Owen, Hjort & Mohn, see page 3-13-6.
• Contextual WSH - Welch, Salter & Haslett, see page 3-13-7.
• Contextual Switzer, see page 3-13-7.
Show Expert Settings ...
Depending on the classification method selected, there may be more
parameters that can be set prior to the classification, see Expert
Settings, page 3-13-16. This button expands the Train window.
Hide Expert Settings ...
Hide the expert settings and make the Train window smaller.
Feature Images list
This list contains the feature images to be used when running a
classification. Up to 16 feature images can be used. A menu is
associated with this list. If the MENU mouse button is clicked within
the list, the same menu items as in the Feature Images menu are
available, see below.
The Feature Images menu
The menu connected to the Feature Images button contains the
following menu items:
Edit...
Edit the selected feature image, see To edit a feature image, page 3-
13-14.
Add before...
Add a new feature image before the selected one.
Add after...
Add a new feature image after the selected one.
Display image
Display the selected feature image.
Remove selected
Remove the selected feature image from the list.

microGOP 2000/S User’s Guide 3-13-13


3 Functions in microGOP 2000/S - Classify Group

To edit a feature image


• First, either select a feature image in the list and select Edit..., or
add a new feature image to the list. The Feature Image window
pops up.

• Type a Feature image description in the text window so that


feature images in future classifications can be selected more easily.
• Then select an image buffer or an image file to be used as feature
image. You can use a file browser (Browse...) to locate an image
file (extension .imf).
• Apply changes, or select another feature image in the list, or add
a new feature image to the list.
Class result
The classification result.
See the ImClassify function, Classified result, page 3-13-11.
Background
A background image that is displayed "under" the classification
result. See the ImClassify function, Background Image, page 3-13-11.
You can either select the background image from the last training
session, Job Image, or an Other Image of your choice.
Mahalanobis distance image
A grey scale image where pixel values denote the Mahalanobis
distance to the classified class. See the ImClassify function,
Mahalanobis Distance Image, page 3-13-11.

3-13-14 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Classify Group 3

Run Classification
Perform a classification according to the settings of the Train
window.
Done
Dismiss the Train window and automatically save the changes made
in the current classification job.

☞ If the push-pin is pulled out, the Train window is dismissed and the
changes made in the current classification job are automatically saved.

☞ When the current classification job is saved, all feature images used
are copied to image files in the same directory as the rest of the necessary
classifier files, and named according to the following name rule:
jobname_f###.imf
where
• jobname is the name of the current classification job.
• ### is a three-digit image number, i.e. the first feature image gets
the number 001, the second 002, and so on.
For example, the fourth feature image in the classification job yummy is
copied to the file yummy_f004.imf.
The next time the Train window is launched for this classification job,
the icons in the Feature Images list will reflect (with JOB) that the
feature images are saved files from an earlier session.

microGOP 2000/S User’s Guide 3-13-15


3 Functions in microGOP 2000/S - Classify Group

Expert Settings
Discrimination
Linear
Linear discrimination is used when calculating statistics, i.e. only
one common covariance matrix is used for all classes.
Quadratic
Quadratic discrimination is used when calculating statistics. Class
dependent covariance matrices are used, i.e. one covariance
matrix is calculated for each class.

Auto Correlation
Available for the OHM and WSH contextual methods.
Off
No noise correlation model is used.
Default
Autocorrelation model is used. The default values for rho (0.5)
and theta (0.5) are used. rho is the autocorrelation between first-
order neighbouring pixels, and theta is the proportion of the total
variation due to autocorrelated noise.
Other
Autocorrelation model is used. The values for rho and theta can
be set by the user.

OHM Probabilities
Only available for the OHM contextual method.
Default
The default values for the probability settings p (0.8), q (0.0828),
and r (0.1172) are used for the OHM classification method.
Other
The values for p, q and r can be set by the user.

3-13-16 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Classify Group 3

Other cvdisc options


In order to enable a few extra features available in the classifier
program cvdisc (not yet implemented in the microGOP user
interface), cvdisc command line options can be entered here. The text
entered will be appended to the cvdisc program call.
Valid command line options
-e Sets all off-diagonal elements in the covariance
matrices to zero. This results in a minimum distance
classification, if a non-contextual classification
method is selected.
-fastohm Selects a special case of the OHM method. Only the
most probable situation can occur, i.e. the probability
that all 5 pixels in a cross neighbourhood belonging to
the same class is assumed to be 1, see Owen, Hjort &
Mohn (OHM), page 3-13-6. This method is equivalent
to applying a small mean filter on every feature image
before using it.
-ap ap1 ap2 ... apn
Sets the prior probabilities for each class. n is the total
number of classes.
-rq quantile
Sets the reject class Mahalanobis distance threshold to
the distance given by quantile (0.0 ≤ quantile ≤ 1.0). By
default, a result pixel in the reject class will get the
pixel value 0 (background).
-rc pixelvalue
Sets the result pixel value for the reject class
(0 ≤ pixelvalue ≤ number of classes).

Show external call


If this check box is marked, the full external call to the classifier
program cvdisc is written on stderr. Only for experienced users.

microGOP 2000/S User’s Guide 3-13-17


3 Functions in microGOP 2000/S - Classify Group

To edit a train image using the SID Train Tool


When training, the user interactively selects training areas by marking
pixels in certain colors for each candidate class. These are areas known
(or assumed) to contain pixels belonging to the class. Up to 16 classes can
be defined.
Before a supervised classification can be made, a train image must be
defined. When training, a background image for the training session
must be displayed in the SID.
The SID Train Tool is only available when you are in training mode. In
the training mode it is only possible to work with the Train Tool and to
display new background images using the Image Tool. It is also possible
to work with other SID Tools (such as Zoom and Contrast/Brightness),
but then the Train Tool must be activated (check the Active checkbox)
again when training is to be resumed.
The first time the training mode is entered (for the current classification
job), it may be convenient to display a background image before
entering training mode. A background image can be one of the
following types:
• Binary image
• 8-bit grey scale image (Grey)
• 16-bit grey scale image (Grey16)
• GOP image
• Color RGB image
If there already exists a train image associated with the job, a few things
happen automatically:
• The background image from a previous training session is
displayed.
• The train image is displayed as opaque or in transparent colors on
top of the background image.
• The same class colors and class names as defined in the previous
training session are used.
• The color table CLASS is automatically loaded in the SID. This
makes it possible to paint with opaque or transparent colors (in a
training overlay) on top of the background image.

☞ The opacity of the transparent (or opaque) colors is selectable


from the SID Overlays window, see Overlay Settings, page 2-28.

3-13-18 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Classify Group 3

To define a new class / rename a class


When the menu item Edit > Add Class is selected, a new class is
defined.
The name of this class is set to
Class# by default, and appears as a
new item in the class list. The
name can be changed in the text
field below the class list.
Remember to press the <Return>
or <Tab> key in order to change
the name.
To delete a class
Select the class to be deleted in the
class list. Select the
Edit > Delete Class menu item.
The areas associated with the class
are erased in the SID and the class
name is removed from the list.
To delete all classes
When the menu item Edit > Delete All Classes is selected, all classes
are deleted from the class list and all training areas are erased in the
SID.
To save the train image
When the button Save is selected, the colored areas in the SID are
saved as a train image and the corresponding colors and class names
are saved in the classification job file.
To alter the color of a class
To change the color for the selected class in the class list, either select
one of the predefined colors in the color palette in the abbreviated
choice labelled Color, or set the red (R), green (G), and blue (B) color
controlling sliders to a desired color mix.
Other SID Train Tool features
For a description on how to paint, erase, fill an area, paint/erase all
areas, and to adjust the shape of the paint brush, see Paint tool, page
2-26. The technique is very similar.

microGOP 2000/S User’s Guide 3-13-19


3 Functions in microGOP 2000/S - Classify Group

If the check box labelled Active is marked the Train Tool is active. If
you unmark the check box, the Train Tool becomes inactive (the
training mode is still on) and the SID Brightness/Contrast Control
Tool becomes active.

☞ If the button Cancel is selected, or if the push-pin is pulled out of the


Train Tool window, you will inactivate and exit the SID Train Tool and
exit the training mode without saving the changes.

3-13-20 microGOP 2000/S User’s Guide


Functions in microGOP 2000/S - Classify Group 3

DisplayClass
This function displays a classified image with correct class colors as
defined by the specified classification job.
Browse...
This button calls up a file browser which can be used to find and load
a specific classification job that is stored on file (file extension .cic).
Job Name
The full path file name for the classification job.
Classified result
The classification result.
Background Image
A background image that is displayed "under" the classification
result.

microGOP 2000/S User’s Guide 3-13-21


3 Functions in microGOP 2000/S - Classify Group

3-13-22 microGOP 2000/S User’s Guide


Variables 4

4 Variables
This chapter describes the programming language used in the Variable
function in the Program function group.
The programming language is an interpreting language that can be used
to define variables, perform calculations, generate graphical user
interfaces, draw graphics and call external programs.
Variables that have been defined can be bound to parameters of almost
any function in the microGOP.
It is, for example, possible to generate a user interface where the user
specifies the number of images that shall be read from the video camera.
This value can then be bound to the Laps parameter of the Loop
function.

☞ The on-line help for the Variable function is very extensive.


4.1 Variable types
The following types of variables can be defined:
Type Description Range
int Integer values. -2147483648 to 2147483648
Integer vectors.
float Floating point values. -3.4e38 to -1.4e-45
0.0
1.4 e-45 to 3.4e38
Float vectors.
char Character strings.

Variable names must begin with a character but can contain digits. The
programming language is case sensitive, which means that the
microGOP distinguishes between upper and lower case letters. (The
variables Amp and amp are two different variables.)

microGOP 2000/S User’s Guide 4-1


4 Variables

4.2 Definition of variables


Definition of integer variables
Examples of valid definitions:
int a
int laps = 14
int laps_square = laps * laps
int h = 0x7f

It is possible to assign an expression value to a variable at the time it is


defined.

☞ Integer variables that are not explicitly assigned a value get the
default value 0.

Definition of float variables


Examples of valid definitions:
float f
float scale_factor = 0.7
float amp = 3.4 * laps

☞ Float variables that are not explicitly assigned a value get the default
value 0.0

☞ All float and integer expressions are calculated using float. The float
values are truncated when they are assigned to integer variables. It is
possible to mix float and integers in expressions.

Definition of character string variables


Character string variables can be defined in two different ways,
automatic length strings or defined length strings. Automatic length
strings get their length when they are assigned a value at definition time.
Defined length string variables can not be assigned strings that are
longer than the initial length. The length of string variables can be
declared using expressions and variables, as well as constants.
Examples of character string definitions:
char *name = "Test1"
char *Date = system("date")
char FileName[200]
char lastname[len]
char Path[500] = "/export/home/" + name

4-2 microGOP 2000/S User’s Guide


Variables 4

The second example defines the variable Date to be assigned the value
of the external program date, which returns the current date and time.
See also the function system(), page 4-17.
The last example defines a variable with the maximum length of 500.
The initial value of it will be "/export/home/Test1".

☞ Strings are concatenated by using +.


It is possible to access individual characters in character strings:
char *str = "Hello Bob !"
char *str1 = str[1] + "i" + str[6, strlen(str)]
This example assigns the string "Hi Bob !" to the variable str1.

☞ It is not possible to assign to individual index in character strings.


Definition of integer and float vectors
Vectors (arrays) can be defined with a specified length or as an empty
vector (length = 0).

☞ Vector indices start at 1.


Example of integer vector definitions:
int vec1[]
int my_histogram[] = $GreyHistogram[]

The vector vec1[] is defined but has the initial length 0. The vector
my_histogram[] gets the length and values from the system variable
vector $GreyHistogram[].
Example of float vector definitions:
float my_vec[] = vinit(10, 7)
float my_feature[] = 5.6 * $Area[]/$Perimeter[]
The first example defines a new float vector with length 10 where all
values are set to 7. See also the function vinit(), page 4-20.
The other example defines a new vector in which each element will have
the value 5.6 multiplied with each objects’ measured area divided by its
perimeter. See system variables $Area[] and $Perimeter[], page 4-11. It is
thus possible to mix scalar values with vectors in a vector expression.
Vectors have a dynamic length which can be changed at any time. New
vector elements can be assigned to a defined vector without redefining
it. The following example will make the vector one element longer by
adding the value 7:
my_vec[] = vcreate( my_vec[], 7)

microGOP 2000/S User’s Guide 4-3


4 Variables

The individual vector elements can be accessed and assigned. Example:


int z=3
vec10[z+1] = 5.67 * $Area[77]
This example assigns the fourth element of the vector vec10[] the value
5.67 multiplied with the area of the 77th object. (There must be at least
77 objects or this statement will fail.)
It is also possible to use a range of a vector. Example:
float top[] = vec10[ 3, vdim( vec10[] )]
This example shows how a new vector is created and assigned the 3rd
trough last element of vec10[]. The syntax of the range is [first, last]
which will access all elements from first to last.

☞ Vectors can only be assigned vector values.


☞ The length of a vector is always the length it got at its last
assignment.

☞ Vectors are always dynamic. This means that a vector gets its current
length when it is assigned. The space for the vector is allocated
automatically.

Undefining variables
Variables that have been defined can be assigned values throughout the
current microGOP session.

☞ A variable can be redefined. It is always the latest definition that is


valid.
Variables that are not needed anymore can be undefined with a special
function:
undef(variable)
The call to undef() will undefine the variable and free all the space it
occupies. Example:
float tmp[] = $Area[] * 5.6
float average = vmean( tmp[])
undef(tmp[])
This example undefines and frees the space occupied by tmp[].
It is also possible to undefine all user defined variables by giving no
argument to undef(). Example:
undef()

4-4 microGOP 2000/S User’s Guide


Variables 4

4.3 Operators
The following operators can be used in expressions:
+ Addition of integer variables, float variables, integer vectors,
and float vectors. Strings are concatenated with this operator.

- Subtraction of integer variables, float variables, integer


vectors, and float vectors.

* Multiplication of integer variables, float variables, integer


vectors, and float vectors.

/ Division of integer variables, float variables, integer vectors,


and float vectors.

% The modulo operator. Example:


int a=17
int b = a % 10

This will give b the value 7.

0x Hexadecimal integer values can be specified using the 0x


prefix. The value is interpreted as a 2-complement integer
value (32 bits). Example: (These three lines are identical)
int a = 0x7f
int a = 0x7F
int a = 127

☞ Values that are larger than 32 bits will not be interpreted


correctly.

Bitwise operators
& Bitwise AND.

| Bitwise OR.

~ Bitwise NOT. This is a unary operator that inverts all the bits
in its operand. The following example will assign the value
248 to the variable a:
int a = 255 & ~7

^ Bitwise EXOR.

The bitwise operators only work on integers. The operands will be


converted to integers before the operator is applied.
microGOP 2000/S User’s Guide 4-5
4 Variables

Special vector and character string operators


[n] This operator is used to refer to element n in a vector or
character string. Example:
float b = $Area[5]
char *str = $ScaleUnit[1]

These examples will assign the area of the fifth object to


the variable b and the first character in the current scale
factor unit to str.
[first, last] This operator is used to specify a range in a vector or
character string. Example:
float v[] = $Area[10,33]
char *name="Bob Lindeman"
char *first_name = name[1,3]

These examples will create a vector for the areas of


objects 10 to 33. This vector will be assigned to v[]. The
variable first_name will get the value "Bob".

☞ There are also some relational operators that are used in conditions.
These operators are described together with the conditions in the if
expression, page 4-29.

4.4 Comments
Comments can be used to make your Variable code easier to
understand. All lines that start with a \ are comment lines. Example:
\ The variable n is the number
\ of images that shall be processed
int n
\ amp is the amplification
float amp=4.5

☞ The \ must be the very first character on the line.


4.5 The continuing statement character
If you want to continue a statement on a new line, the \ character must
be used as the last character on a line. See examples further on in this
chapter.

4-6 microGOP 2000/S User’s Guide


Variables 4

4.6 System variables


There are a number of predefined system variables in the microGOP.
These variables can be used but not assigned or redefined. All system
variable names begin with the character $.

☞ The Defined Variables window can be used to inspect the current


values of all variables, user defined and system variables.
Variable Description

char $Version The current microGOP version.


char $VersionDate The date when the microGOP version
was created.
char $SidVersion The version of the SID library.
int $ProgramPid The process ID for the running
microGOP.
char $IMBUFFERPATH The directory where the microGOP image
buffers are stored.
int $NbrObjects The number of objects in the latest
measurement.
int $Loop The current value of the loop counter
inside a program loop.
☞ The loop counter runs backwards.
float $Scalemm The number of mm/pixel for the current
scale factor.
float $ScaleFactor The number of units/pixel for the current
scale factor.
char $ScaleUnit The current scale factor unit.
float $MFrameWidth
float $MFrameHeight The scaled width and height of the latest
set Measure Frame (Etc function group).
float $MFrameArea The area of the current measure area as
defined by the Measure Frame or
Measure Circle function.
int $MCircleX
int $MCircleY
int $MCircleRadius The center X and Y coordinates (in pixels)
and the radius (in pixels) for the latest set
Measure Circle (Etc function group).
int $SlideCurrent The current scan stage slide number.
int $FrameCurrent The current scan stage frame number.

microGOP 2000/S User’s Guide 4-7


4 Variables

Variable Description

float $StageX
float $StageY The current scan stage X and Y position in
mm.
float $StageZ The current scan stage Z position.
☞ This is not an absolute value in mm.
int $StageFrameX
int $StageFrameY The current frame column (X) and row (Y)
in the scan pattern.
int $ImageWidth
int $ImageHeight The current image width and height in
pixels.
int $Grey16CalcMin
int $Grey16CalcMax The minimum and maximum value for
calculations in 16-bit grey scale images.
See the function Grey16Range,
page 3-3-9.
int $Grey16DisplayMin
int $Grey16DisplayMax The minimum and maximum value for
display of 16-bit grey scale images. See
the function Grey16Range, page 3-3-9.
int $RBBoxX1
int $RBBoxY1 The X and Y coordinates of the upper left
corner of the last set rubber-band box.
int $RBBoxX2
int $RBBoxY2 The X and Y coordinates of the lower
right corner of the latest rubber-band box.
int $RBLineX1
int $RBLineY1 The X and Y coordinates of the start point
of the last set rubber-band line.
int $RBLineX2
int $RBLineY2 The X and Y coordinates of the end point
of the latest rubber-band line.
int $RBLineDistance The distance (in pixels) between the end
points of the latest rubber-band line.
int $RBCircleX1
int $RBCircleY1 The X and Y coordinates of the upper left
corner of the last set rubber-band circle.
int $RBCircleX2
int $RBCircleY2 The X and Y coordinates of the lower
right corner of the latest rubber-band
circle.

4-8 microGOP 2000/S User’s Guide


Variables 4

Variable Description

char $ImageOverviewDirectory
The directory name (full path) of the
directory currently displayed in the
Image Overview window.
int $ImageOverviewNSelected
The number of selected images in the
Image Overview window. See the
Variable string function
ImageOverviewFile(), page 4-17.
float $AreaFraction[] The latest area fractions measured with
the Area Fraction function in the
Measure function group.
float $GreyHistogram[] This variable contains the latest measured
grey scale histogram.
☞ This vector, like all other vectors, start
with index 1. The first entry (entry 1) in
the vector contains the number of pixels
for intensity 0.
For an 8-bit image, the entries 1-256 will
be filled with values even if the pixel
values are between 0 and 255.
float $GreyHistogramMinVal
float $GreyHistogramMaxVal
Minimum/maximum intensity values in
the latest measured grey scale histogram.
float $GreyHistogramMinFreq
float $GreyHistogramMaxFreq
Minimum/maximum frequency values
in the latest measured grey scale
histogram.
float $GreyHistogramMean
Mean intensity value in the latest
measured grey scale histogram.
float $GreyHistogramStdDev
Intensity standard deviation in the latest
measured grey scale histogram.
For the last 7 system variables, see the function GreyHistogram,
page 3-10-22.

microGOP 2000/S User’s Guide 4-9


4 Variables

Variable Description

float $GreyProjectionH[] The horizontal projection of the mean


grey scale values in the columns of the
current rubber-band box. Each entry in
the vector contains the mean value in a
column. The pixel values are measured in
the displayed image.
float $GreyProjectionV[] The vertical projection of the mean grey
scale value in the rows of the current
rubber-band box. Each entry in the vector
contains the mean value in a row. The
pixel values are measured in the
displayed image.
float $GreyProfile[] This vector contains the grey scale values
in the displayed image under the current
rubber-band line.
float $GreyOutlineProfile[]
This vector contains the grey scale values
in the displayed image under the current
outline.
float $OutlineX[]
float $OutlineY[] The X and Y vectors for the current
outline.

☞ The outline is a SID tool, see 2.9 The Image Display window,
page 2-15.

int $X
int $Y The coordinates for the current pixel
value point. See also Pixel Value tool,
page 2-24.
int $PixelValue The pixel value for the current pixel value
point, see Pixel Value tool, page 2-24.
int $MapWidth
int $MapLevel The current width and level used in the
Map tool, see page 2-39.
float $CPInX[]
float $CPInY[]
float $CPRefX[]
float $CPRefY[] These 4 vectors contain the current
control point coordinates. See the
Geometry Tool, page 3-3-12.

4-10 microGOP 2000/S User’s Guide


Variables 4

Variable Description

int $InterceptNLines
float $InterceptTLineAngle
char $InterceptScaleUnit
float $InterceptTLineLengths[]
float $InterceptOChordLengths[]
float $InterceptBChordLengths[]
int $InterceptNOChords[]
int $InterceptNBChords[]
int $InterceptNIntersections[]
All these variables are defined by the
Intercept function in the Stereology
function group.
char $MeanVolumeUnit
float $MeanVolume
float $MeanVolumeCE These variables contain the values from
the latest Present in the Volume
Weighted Mean Volume function in the
Stereology function group.
char $SurfaceAreaUnit
float $SurfaceArea These variables contain the values from
the latest Present in the Surface Area per
unit Volume function in the Stereology
function group.
char $SurfaceToVolumeRatioUnit
float $SurfaceToVolumeRatio
These variables contain the values from
the latest Present in the Mean Surface to
Volume Ratio function in the Stereology
function group.
float $Area[], $Perimeter[], $MinX[], $MaxX[], $MinY[], $MaxY[],
$FeretX[], $FeretY[], $FeretComp[], $Comp[], $EqCircle[],
$EllComp[], $CgravityX[], $CgravityY[], $MomentX[],
$MomentY[], $MomAng[], $Length[], $Dmax[],
$DmaxAngle[], $Width[], $Ratio[]
These vectors contain the feature values
from the latest object measurement. See
function Measure, page 3-10-2.

microGOP 2000/S User’s Guide 4-11


4 Variables

Variable Description

There are some extra object features that can be accessed in Variable:
float $DmaxX1[]
float $DmaxY1[]
float $DmaxX2[]
float $DmaxY2[] These variables contain the coordinates
for the two points that has been used to
calculate Dmax.
☞ Dmax must have been calculated by
the Measure function in the function
group Measure.
float $WidthX1[]
float $WidthY1[]
float $WidthX2[]
float $WidthY2[] These variables contain the coordinates
for the two points that has been used to
calculate Width.
☞ Width must have been calculated by
the Measure function in the function
group Measure.
float $MomentXY[] The $MomentXY[] can be accessed in
addition to $MomentX[] and
$MomentY[].

4-12 microGOP 2000/S User’s Guide


Variables 4

4.7 Functions
Math functions
The following math functions are defined for microGOP expressions.
The functions are the same as those available in the C program
language. See also the UNIX man pages for each function, e.g. % man
sqrt gives you help on the sqrt function.
sqrt(x) square root: √x
hypot(x,y) euclidian distance: √x2+y2
sin(x) sine value of x
cos(x) cosine value of x
tan(x) tangent of x
atan(x) arc tangent of x in the range -π/2 to π/2
atan2(y,x) arc tangent of y/x in the range -π to π
acos(x) arc cosine of x in the range 0 to π
asin(x) arc sine of x in the range -π/2 to π/2
exp(x) exponential function ex
exp2(x) exponential function 2x
exp10(x) exponential function 10x
log(x) natural logarithm of x
log2(x) base-2 logarithm of x
log10(x) base-10 logarithm of x
pow(x,y) x raised to the power of y: xy
rand() returns a random value in the range 0.0 to 1.0. The
standard C function drand48() is called.
☞ See also comment about vrand() below.
abs(x) absolute value of x
All these math functions also exist in vector versions. These vector
versions of the functions are prefixed with a v. Example: vsin(v[])
returns a vector with the sine value of all elements in the vector v[].

☞ The vector versions take vectors as arguments and return vectors.


☞ The vrand() function should be used together with some other
vector or vector function which can specify the length of the produced
vector. This example will produce a vector with 100 random numbers
between 0 and 5:
float rnd[] = vinit(100,5) * vrand()

microGOP 2000/S User’s Guide 4-13


4 Variables

The timer function


timer()
This function returns the number of milliseconds since the last call to
this function. The value 0 is returned from the first call.

String functions
The string functions return character strings.
mktemp(str)
Creates a unique string from str by adding 6 characters. This can be
useful to create temporary files with unique names.
tostring(val)
tostring(val, ndecimals)
Converts the value (float or integer expression) val to a string.
Example: tostring(45.9/9) returns the string "5.1". The
argument ndecimals defines the number of decimals to generate.
Example: tostring(45.9/9, 3) returns the string ”5.100".
tostring(vector, sepstring)
tostring(vector, ndecimals, sepstring)
Converts every value (float or integer) in vector to a substring and
concatenates them to one string. The argument sepstring defines the
separator string to be inserted between each substring, e.g. " ". The
argument ndecimals defines the number of decimals to generate.
tochar(value)
Returns a string containing the character that is represented by the
value in the ASCII character set. Example: tochar(65) returns
"A".
tochar(vector)
Returns a string containing the characters represented by each of the
ASCII values in vector.

4-14 microGOP 2000/S User’s Guide


Variables 4

strformat(str, expr)
strformat(str, expr, padstr)
Formats a string, left or right adjusted, in a number of positions. A
negative value in the argument expr will left adjust the string, and a
positive value will right adjust the string.
Example:
writeln strformat("hello", -20)

will print the string "hello ".


Another example:
writeln "A:" strformat( tostring(1.34,3), 10)
writeln "B:" strformat( tostring(10.9,3), 10)

will print something like this:


A: 1.340
B: 10.900

The optional third argument can be used to specify the pad character
(space is default).
Example:
int a=3
writeln strformat( tostring(a), 5, "0")
writeln strformat( "Wait", -10, ".")

The example will print this:


00003
Wait......

microGOP 2000/S User’s Guide 4-15


4 Variables

strtok(strexpr)
strtok(strexpr, sep)
strtok(0, sep)
strtok()
These functions make it possible to extract substrings, tokens, from a
string by specifying substring separators. The strtok(strexpr...
function stores a string which is modified everytime a strtok(..., sep)
call is made with a specified separator string.
strtok(strexpr) Store a new string. This string is valid
until a new string is stored. The string is
also returned.
strtok(strexpr, sep) Store a new string as above. The first
substring separated by any spans of
characters in the string sep is returned.
strtok(0, sep) Return the next substring in the stored
string. The substrings are separated with
any of the characters in the string sep.
strtok() Return the stored string.
Example:
char *str="Mary had a little lamb."
\ Set the string in strtok()
strtok(str)
\ extract substrings separated by space
writeln strtok(0," ")
writeln strtok(0," ")
writeln strtok(0," ")
writeln strtok(0," ")
\ extract substrings separated by space and '.'
writeln strtok(0," .")
Will print:
Mary
had
a
little
lamb

4-16 microGOP 2000/S User’s Guide


Variables 4

system(command)
This function is used to call an external program. The string returned
from the external program is returned from the function. Example:
char *date=system("date")

The system() function is often used to call external programs without


taking care of any return values. Example:
system("lpr test.log")

ImageName(type, nbr)
Returns the name of an image buffer file. The type should be GREY,
GREY16, BINARY, GOP, LABEL or C32 and the nbr should be 0-6
(the number must be 1 for LABEL). Example:
char *binreg1name=ImageName(BINARY, 1)

ImageOverview(directory)
ImageOverview(directory, extension)
ImageOverview(directory, iconsize)
ImageOverview(directory, extension, iconsize)
Displays an Image Overview of the image files in the directory
directory. The size of the icons can be specified. The overview will
be made of imf images unless another file extension is specified. See
also separate description of the Image Overview window, page 2-11.
ImageOverview(REMOVE)
Removes the Image Overview window.
ImageOverviewFile(n)
ImageOverviewPath(n)
Returns the name (or the full path name) of the nth selected file in the
Image Overview. See also the system variables
$ImageOverviewDirectory and $ImageOverviewNSelected, page
4-9.

microGOP 2000/S User’s Guide 4-17


4 Variables

ImageInfoGet(tag)
Returns the image information for tag tag. The tag names (and
values) are defined in the file ImageInfoTags.inc. The following tags
are available:
INFO_TAG_NAME
INFO_TAG_ID
INFO_TAG_DATE
INFO_TAG_YEAR
INFO_TAG_MONTH
INFO_TAG_DAY
INFO_TAG_HOUR
INFO_TAG_MINUTE
INFO_TAG_SHORT_COMMENT
INFO_TAG_LONG_COMMENT
INFO_TAG_IMAGE_DESCRIPTION
INFO_TAG_SYSTEM
INFO_TAG_HOSPITAL
INFO_TAG_SEQUENCE
INFO_TAG_SEQ_TR
INFO_TAG_SEQ_TI
INFO_TAG_SEQ_TE
INFO_TAG_PLANE
INFO_TAG_COIL
INFO_TAG_COIL_POS
INFO_TAG_SLICE_NR
INFO_TAG_SLICE_POSITION
INFO_TAG_SLICE_THICKNESS
INFO_TAG_SLICE_DISTANCE
INFO_TAG_IMAGE_WIDTH_MM
INFO_TAG_IMAGE_HEIGHT_MM
INFO_TAG_MAPPED_PIXELS
INFO_TAG_WINDOW_CENTER
INFO_TAG_WINDOW_WIDTH
INFO_TAG_CONTRAST_SUB
INFO_TAG_PIXEL_WIDTH
INFO_TAG_PIXEL_HEIGHT

Example, how to get the value of the name field:


#include "/opt/CVmg2000S/ImageInfoTags.inc"
char *name = ImageInfoGet(INFO_TAG_NAME)

☞ The returned value is always a string.


☞ The ImageInfoGet() and ImageInfoSet() functions are mainly
intended to be used together with medical MR and CT images.
For more information see Image Information window, page 2-11.
ImageInfoSet(tag, info)
This function is used to set the image information value for a certain
tag. Example:
#include "/opt/CVmg2000S/ImageInfoTags.inc"
ImageInfoSet(INFO_TAG_NAME, "Fred")

☞ The info parameter should always be a string.


4-18 microGOP 2000/S User’s Guide
Variables 4

String to value functions


tovalue(str)
This function converts a string to a float value. The following
example will convert the string "5.67" to the float value 5.67.
char *stringvalue="5.67"
float a = tovalue(stringvalue)

toint(str)
Returns the decimal equivalent of the first character in str (according
to ASCII). Example: toint("A") returns 65.
toints(str)
Returns an integer vector with the decimal equivalents (ASCII
values) of all characters in str.
strlen(str)
The function returns the length of the string str.

String to vector function


tovector(str)
This function converts a string to a vector.The standard atof()
function is run on every "word" in the string. Example:
int timevec[]= tovector("Tue Jan 10 10:02:13 MET 1995")

Will set timevec[] to: 0, 0, 10, 10, 2, 13, 0, 1995.

microGOP 2000/S User’s Guide 4-19


4 Variables

Vector functions
There are a number of functions that operate on vectors. These functions
are described below.
vinit(length, val)
This function produces a vector with length length where every
element is set to val. Example:
float v[] = vinit(10,5)

Will set the vector v[] to the length 10 and all elements to 5.
The vinit() function can only produce vectors with a maximum
length of 10242 or ($ImageWidth⋅$ImageHeight), whichever is the
largest. Longer vectors can be produced by concatenating two
shorter ones:
float v[] = { vinit(1000000,0), vinit(500000,0) }

It is also possible to generate empty, zero length vectors.


float v[] = vinit(0,0)

{ a,b,c... } or
vcreate(a,b,c....)
This function produces a vector from its arguments. The arguments
can be integers, floats, integer vectors or float vectors. Example:
int a[] = vinit(5,1)
float x=5.67
float b[] = { 1,4,4.5, x, a[], a[2,3] }
or
float b[] = vcreate(1,4,4.5, x, a[], a[2,3])

Will produce a vector b[] with these values:


1, 4, 4.5, 5.67, 1, 1, 1, 1, 1, 1, 1

The vcreate() ( {...} ) function can be used to add elements to a vector.


This is an example of how it can be done:
float my_vec[]
int i = 1
while( i <= 10 ) \
my_vec[] = { my_vec[], $Area[ i * 2 ] },\
i = i + 1

It is also possible to generate empty, zero length vectors.


float v[] = { }
float b[] = vcreate()

4-20 microGOP 2000/S User’s Guide


Variables 4

vec(val)

☞ This is an old function that should not be used anymore. The


function produces a vector with the length 10000 where every
element has been set to val.
The function vinit() function should be used instead of this function.
vdim( vector )
Returns the length of the vector.
vmax( vector )
The maximum value in the vector.
vmin( vector )
The minimum value in the vector.
vsum( vector )
The sum of the vector values.
vmean( vector )
The mean value in the vector.
vstddev( vector )
The standard deviation in the vector.
vindex( vector , val)
Returns the index of the first value equal to val in vector. (Or zero if
the value does not exist.)
vramp(start, stop, length)
This function creates a vector with length length where the first
element will get the value start and the last element the value stop.
Element n will get the value: start + (stop-start)/(length-1) * (n -1)
vsort( vector )
Sorts the elements in vector in increasing order. The sorted vector is
returned.

microGOP 2000/S User’s Guide 4-21


4 Variables

vtrunc(vector, min, max)


Returns a vector where every element in vector smaller than min
have been replaced with min and all elements larger than max have
been replaced with max. This function is useful when an image
should be assigned pixel values from a vector. Example:
SetPixels(GREY, 1, vtrunc( GetPixels(GREY,1) * 1.5, 0, 255) )

This example will multiply all pixel values in grey scale image 1 with
1.5 without getting any values larger than 255.
vlut(v[], tab[])
Returns a vector where every element in v[] has been passed through
the lookup table tab[]. ( Element i is set to tab[ v[i] ]. )
vconvolve(vector, wid, hgh, coeffs[], amp, off)
Performs a convolution between the data in vector and the
coefficients in coeff[]. The wid and hgh parameters specifies the
width and height of the data in vector. The coeff[] vector should
have a size equal to n2 where n is odd and larger or equal to 3.
Example: 3x3 average filter on the image in grey buffer 1 and result
in grey buffer 2:
SetPixels(GREY, 2,\
vconvolve(GetPixels(GREY,1),\
$ImageWidth,$ImageHeight,\
{ 1,1,1,\
1,1,1,\
1,1,1 }, \
1/9, 0) )

vmask(vector, maskvector)
Returns a vector with all the elements in vector that have the same
index as non zero elements in maskvector. Example:
int v[] = vmask( { 1,2,3,4,5 }, { 1,1,0,0,1 } )

The example will assign 1,2,5 to v[].


vtranspose(vector, c)
The vector vector can be seen as matrix with c columns. The function
transposes the matrix. Example:
float v[] = { 1,2,3,4,5,6 }
float v1[] = vtranspose(v[], 3)

The example will assign the vector 1,4,2,5,3,6 to v1[].

4-22 microGOP 2000/S User’s Guide


Variables 4

vclass(vector, CLASSES, nclasses)


Sorts the elements in vector and then divides the value range in
nclasses classes. The frequency of values in each class is returned as
a nclasses length vector. This function can be useful when values
should be created for the x axis in the Present function.
vclass(vector, WIDTH, width)
As above but the number of classes is set as:
(max value - min value)/width +1
vclass(vector1, RANGES, vector2)
Returns a vector with the number of values in vector1 that falls into
the different class intervals (value ranges) that is specified in vector2.
Example:
float a[] = { 0.2, 1, 1.5, 3, 4, 6, 7 }
float ranges[] = { 1, 2, 5 }
float v[] = vclass(a[], RANGES, ranges[])

The vector v[] will get the length 4 (one more than the length of
ranges[]) and will contain the values 1, 2, 2, 2 (One value in v[] is < 1,
two values fall in the interval 1 ≤ x < 2, two values fall in the interval
2 ≤ x < 5, and two values are ≥ 5).

microGOP 2000/S User’s Guide 4-23


4 Variables

Reading external data


GetData(filename)
GetData(filename, dtype)
GetData(filename, dtype, offset, nitems)
This function reads values from an external file. The function returns
a vector that contains the read and interpreted values. The data can
be binary, or in text (ASCII) format.
dtype can be one of the following:
GET_ASCII_DATA Reads ASCII data as float values. The file
should contain float values in ASCII
format. The function returns a float vector
that contains all successfully read float
values.
The function will stop reading data from
the file if an illegal float value is found.
The file can contain newlines, tabs or
spaces between the float values.
The call GetData("dat") is identical to
GetData("dat", GET_ASCII_DATA).
GET_CHAR_DATA Reads binary data interpreted as
char (8 bits).
GET_UCHAR_DATA Reads binary data interpreted as
unsigned char (8 bits).
GET_SHORT_DATA Reads binary data interpreted as
short (16 bits).
GET_USHORT_DATA Reads binary data interpreted as
unsigned short (16 bits).
GET_FLOAT_DATA Reads binary data interpreted as
float (32 bits IEEE).
The optional parameter offset can be used to specify the file offset in
bytes from where data should be read. The parameter nitems
specifies the number of items that shall be read.

☞ The parameters offset and nitems can not be used together with
GET_ASCII_DATA.
The following example reads 100 short values starting at offset
512 bytes from the file /tmp/values.dat to the integer vector v.
int v[] = GetData("dat", GET_SHORT_DATA,512,100)

4-24 microGOP 2000/S User’s Guide


Variables 4

Image size function


The size of the image buffers is usually set with the Settings function in
the Etc function group but there is also a function in Variable that can set
the size.
ImageSize(wid, hgh)
The function sets the current size of the image buffers.

Image Access functions


There are a number of functions that can be used to set and get pixel
values from the image buffers.
The type parameter in the functions specifies the image type. This type
should be one of the following:
BINARY Binary image buffer
GREY 8-bit grey scale buffer
GREY16 16-bit grey scale buffer
GOPMAG Magnitude of GOP buffer
GOPARG Argument of GOP buffer
C32RE Real part of C32 buffer
C32IM Imaginary part of C32 buffer.
LABEL The label image produced by the Measure function.
☞ It is not possible to set values in the label image.
The nbr parameter in the functions specifies the image buffer number.
The number should be in the range 0 - 6. The label image buffer number
should be 1.

Functions to erase the contents of image buffers


The following function clears (erases) image buffers.
ImageClear()
Clear all image buffers.
ImageClear(type)
Clear all image buffers of the specified type. The parameter type can
be BINARY, GREY, GREY16, GOP, or C32.
ImageClear(type, nbr)
Clear the specified image buffer. The parameter type as above, and
nbr in the range 0-6.

microGOP 2000/S User’s Guide 4-25


4 Variables

Functions to get pixel data from image buffers


☞ These functions can generate huge vectors which might need a lot of
memory.
GetPixel(type, nbr, x, y)
Returns the pixel value at the specified position. Example:
int middle_pixel = \
GetPixel(GREY, 1, $ImageWidth/2, $ImageHeight/2)
GetPixels(type, nbr)
Returns a vector with all the pixel values from the specified image.
GetPixels(type, nbr, x, y, wid, hgh)
Returns a vector with pixel values from the specified region in the
image.
GetPixels(type, nbr, x[], y[])
Returns a vector with pixel values at the positions specified in the
vectors x[] and y[].

Functions to set pixels in image buffers


SetPixel(type, nbr, x, y, value)
Sets the specified pixel (at x,y) to value.
SetPixels(type, nbr, v[])
Sets an entire image to the pixel values specified in v[]. The vector v[]
should have the length $ImageWidth Þ $ImageHeight.
SetPixels(type, nbr, v[], x, y, wid, hgh)
Sets a region in an image to the values specified in v[]. The vector v[]
should have the length wid⋅hgh.
SetPixels(type, nbr, x[], y[], v[])
Sets the pixel positions specified in x[] and y[] to the values specified
in v[]. ( The position x[i], y[i] is set to v[i]. )

☞ No automatic truncation of the values are made before writing data


into the image buffers. This means that the user must be sure that the
values are not to large or to small. The vtrunc() function is very useful to
use if values should be limited to a certain range.

4-26 microGOP 2000/S User’s Guide


Variables 4

☞ Every call to any of the GetPixel or SetPixel functions above will


generate a read (or write) operation from the image file. It is a good idea
to read image data into a vector with a single GetPixels() call if many
pixels should be processed. It is also a good idea to write as many pixels
as possible in a single SetPixels() call.

microGOP 2000/S User’s Guide 4-27


4 Variables

Writing external image files


There is a function that can be used to create external imf image files
from vectors.
WriteImage(name, type, wid, hgh, v[])
This function creates an image file with size widxhgh.The type
should be one of: BINARY, GREY or GREY16. Example:
WriteImage("/tmp/test1", \
GREY, 333, 444, vramp(0, 255, 333*444))

This example will create a 8-bit greyscale image called /tmp/test1.imf


containing increasing pixel values from black at the top to white at
the bottom. The size of the image will be 333x444.
WriteImage(name, type, wid, hgh, v1[], v2[])
This form of the function creates an image file with two values per
pixel. The type should be GOP or C32. The vector argument v1[] is
used as magnitude values in a GOP image and as the real part in a
C32 image. v2[] is similarly used as argument values in a GOP image
and as the imaginary part in a C32 image. The length of each of the
two vectors should be wid⋅hgh.

☞ The Save Image function in the Image function group can be used
to save image files in any image file format.

☞ You can also save the image in the Image Display window together
with overlays and graphics. What you see is what you get (wysiwyg).
SidSaveXImageAsRGB(filename)
This function saves the contents of the Image Display window as an
external 24-bit RGB color image file. The saved image will contain
overlays and graphics. The image is saved in TIFF format as default.
This can be changed to BMP if the environment variable
SMICRO_SAVEASRGB_FORMAT is set to BMP. Example:
SidSaveXImageAsRGB("/tmp/rgb.tif")

SidGetXImageAsRGB(red, green, blue)


This function saves the contents of the Image Display window as
three 8-bit grey scale image buffers (as an RGB image). The saved
image will contain overlays and graphics. Example:
SidGetXImageAsRGB(1, 2, 3)

4-28 microGOP 2000/S User’s Guide


Variables 4

If expression
A simple form of if expression can be used in the Variable function.
The syntax is:
if (condition) statement [, statement]
The statements are only performed if the condition is true.
The following conditions can be used:
expr1 > expr2 true if expr1 is larger than expr2
expr1 >= expr2 true if expr1 is larger or equal to expr2
expr1 < expr2 true if expr1 is less than expr2
expr1 <= expr2 true if expr1 is less than or equal to expr2
expr1 == expr2 true is expr1 is equal to expr2
expr1 != expr2 true if expr1 is not equal to expr2
The conditions can also be more complex:
(condition) && (condition)
true if both conditions are true.
(condition) || (condition)
true if any of the conditions is true.
! (condition) true if condition is false
ifdef( var) true if var is a defined variable.
strcmp(str1, str2) false if the strings are identical.
Examples:
if( ! ifdef( a) ) int a=6
if( a+10 < b) a=a+10, b=b*3
if( (a<b) && (a<c) ) \
writeln "a is less than b and c"

☞ If expressions should not be nested. This is illegal:


if(a>b) if(c<d) i=i+1

Use this instead:


if( (a>b) && (c<d) ) i=i+1

microGOP 2000/S User’s Guide 4-29


4 Variables

☞ The while expression does not work properly when it is put in an if


statement. This code:
if(a>b) while(i<100) writeln "i=" i, i=i+1

is identical to:
while( (a>b) && (i<100) ) writeln "i=" i, i=i+1

☞ The Ui() function must be the last statement among the if statements
if it is used. This will work (i will be incremented):
if( a> b) i=i+1, Ui(MESSAGE, "Hello World !")

but this will not work (i will not be incremented):


if( a> b) Ui(MESSAGE, "Hello World !"), i=i+1

The statements after the Ui() function will not be executed.

While expression
A simple form of while expression can be used in the Variable function.
The syntax is:
while (condition) statement [, statement]
The statements after the condition will be repeated until the condition
is false.
The syntax of the condition is described on previous page.
Examples:
int i=1
float v[] =vinit(10, rand()*10)
while(i<=vdim(v[])) v[i] = v[i]*v[i], i=i+1

☞ It is very easy to write a while statement that never ends. The


condition must become false for the loop to end. It is always possible to
stop the execution of a while statement with the Stop button.

☞ While and if expressions should not be nested. It may cause


unpredictable results.

☞ The Ui() function should not be used in a while expression. It will


not work properly.

4-30 microGOP 2000/S User’s Guide


Variables 4

Message Window
The Message window which is used by the write functions on next page
(and also by the Message function in the Program function group) can
be controlled with the MessageWindow() function.
MessageWindow(GEOMETRY, x, y, wid, hgh)
Sets the position and size of the Message window.
MessageWindow(FONT, fontname_str)
Sets the font to use in the Message window. Any font listed by
xlsfonts can be used.
MessageWindow(REMOVE)
Removes the Message window from the screen.
MessageWindow(TYPE, filename_str)
Inserts the contents in the specified file into the Message window.

microGOP 2000/S User’s Guide 4-31


4 Variables

Write and writeln statements


These statements can be used to output text in a window or on file. The
file() function on next page is used to change the destination to a file.
Example:
clear
writeln "The current date is "+system("date")
writeln
writeln "This is a test"
float a=5*5
writeln "The value of a is " a
float b[] = vramp(1,4,4)
writeln "The vector b " b[]
write "Hello "
write "user "
writeln
writeln "This is the last line"

The clear statement removes the previous contents of the message


window.
The writeln statement always ends its output with a new line character.
The write statement does not print a new line character.
The different forms of the statements are:
writeln
writeln expression
writeln stringexpression expression
write expression
write stringexpression expression
The expression can be an integer, float, string or vector expression.

4-32 microGOP 2000/S User’s Guide


Variables 4

The file() function


The file() function is used to change the destination for the write and
writeln statements to a file.
file(filename)
The file filename will be created. The file is truncated (made empty)
if it already exists. All subsequent output from the write and writeln
statements will be written to the file.
file(filename, APPEND)
The file filename will be created if it does not exist. All subsequent
output from the write and writeln statements will be appended to
the file.
file(CLOSE)
The output from the write and writeln statements is redirected to the
message window again.
This example appends the current date to the file /tmp/test
file("/tmp/test", APPEND)
writeln system("date")
file(CLOSE)

Object Measurement Functions

Feature Classification function - ObjectKeep


ObjectKeep(vec)
Makes an object feature classification. The parameter vec is a vector that
should have the same length as the number of objects in the latest object
measurement. The value 0 in the vector means that the corresponding
object should be removed. Any other value will keep the object.
Example: Keep the largest object:
\ Create a vector with all zeroes
int keep[] = vinit($NbrObjects, 0)
\ Find largest and let it live
keep[ vindex($Area[], vmax($Area[])) ] = 1
ObjectKeep(keep[])

Example:
Keep objects which have a dmax which is larger than length/1.5:
float keep[] = vtrunc($Dmax[]-$Length[]/1.5,0,1)
ObjectKeep(keep[])

microGOP 2000/S User’s Guide 4-33


4 Variables

Intensity Measurement function - GetIntensity


GetIntensity(vector, meanvec)
Calculates the mean intensity value for each object in the latest object
measurement.
For every object found in the label image, a mean value is calculated
from the corresponding intensity values found in the input vector
vector. The mean values are stored in the float vector meanvec which
must be declared before calling the function.
The input vector vector should have the length
$ImageWidth⋅$ImageHeight.
The vector meanvec will get the length $NbrObjects.
The GetIntensity() function also returns the mean intensity value for the
background.
\ Define the result vector first.
float mean[]
float bgvalue = GetIntensity(GetPixels(GREY,1), mean[])

This example calculates the mean intensities from the image buffer
GREY 1 for each object in the latest object measurement. The mean
intensity value for the background is stored in the variable bgvalue.

4-34 microGOP 2000/S User’s Guide


Variables 4

Functions to set the active SID tool


The active SID tool in the Image Display window can be set with the
SidTool() function. See Image Display window, page 2-15 for a
description of the different tools.
SidTool(tool)
Activates a specific tool in the SID. The tool is one of:
MAP, ZOOM, ZOOMPAN, PIXVAL, PAINT, RBLINE, RBBOX,
RBCIRCLE, OUTLINE or DRAW.
Some of the tools have optional attributes that are described below.
SidTool(tool, REMOVE)
Deactivates a specific SID tool and removes its windows.

MAP tool attributes


SidTool(MAP, MAP_LEVEL, level, MAP_WIDTH, width)
Sets a linear mapping with the specified level and width.

PAINT tool attributes


SidTool(PAINT, PAINT_IMAGE)
SidTool(PAINT, PAINT_FG)
SidTool(PAINT, PAINT_BG)
Enables painting in the image plane, foreground plane or
background plane.
SidTool(PAINT, PAINT_BRUSH)
Selects the paint brush.
SidTool(PAINT, PAINT_FILL)
Selects the fill function.
SidTool(PAINT, PAINT_ERASE)
Selects the erase function.
SidTool(PAINT, PAINT_WIDTH, width)
Sets the width of the brush.
SidTool(PAINT, PAINT_HEIGHT, height)
Sets the height of the brush.

microGOP 2000/S User’s Guide 4-35


4 Variables

SidTool(PAINT, PAINT_BANDS, band)


Sets the band to paint in:
1 - Magnitude
2 - Argument
3 - Magnitude and Argument
SidTool(PAINT, PAINT_VALUES, mag,arg)
Sets the pixel value to paint with in magnitude and argument.

RBLINE tool attributes


SidTool(RBLINE, x1, y1, x2, y2)
Sets the position of rubber band line.

RBBOX tool attributes


SidTool(RBBOX, x, y, width, height)
Sets the top left corner and the width and height of the box.

RBCIRCLE tool attributes


SidTool(RBCIRCLE, x, y, width, height)
Sets the upper left corner and the width and height of a rectangle
that encloses the rubber band circle. If width ≠ height an ellipse will
be set.

OUTLINE tool attributes


SidTool(OUTLINE, close_mode, fill_mode)
The close_mode should be:
OUTLINE_OPEN
The outlines that are drawn are not automatically closed.
OUTLINE_CLOSED
The outlines that are drawn are automatically closed.
The fill_mode should be:
OUTLINE_FILLED
The outlines that are drawn are filled.
OUTLINE_UNFILLED
The outlines that are drawn are not filled.

4-36 microGOP 2000/S User’s Guide


Variables 4

To set the Slice Color


SidSliceColor(red, green, blue)
SidSliceColor()
Sets the color of the slice in the SID Slicing function and in the
thresholding functions; Thresh in the Grey function group, and
Ui(THRESHGREY, ...). The 3 color arguments should have values in the
range 0-255. A call with no arguments resets to the default slice color.

To copy the XImage from the SID


There is a special function that can be used to copy the XImage from the
SID. The purpose is to be able to display an image sequence much faster
using ’mapped’ images.
SidSaveXImage(filename)
Saves the XImage in the SID as an image file. This image can be used
as a ’mapped’ image in the Image Sequence window.

☞ The saved image is only guaranteed to be displayed with correct


colors by the same microGOP release that saved it. In fact the colors
might also be wrong of the microGOP is restarted after the images
have been saved.
SidDisplayXImage(filename)
Displays an image that has been saved with SidSaveXImage().

☞ The functions above should never be used to store images


permanently. The images can only be displayed in a correct way by the
microGOP.

microGOP 2000/S User’s Guide 4-37


4 Variables

Functions that draw graphics in the SID


The Draw tool of the SID can be controlled with the Graphics() function.
The Graphics() function can draw lines, rectangles, ellipses, circles and
text.
The Graphics() function can take many arguments at the same time.
Example:
Graphics(GRAPHICS_CLEAR,\
GRAPHICS_LINE_STYLE, GRAPHICS_LINE_SOLID,\
GRAPHICS_LINE_WIDTH, 5,\
GRAPHICS_LINE, 10,10,100,100,\
GRAPHICS_COPY, GRAPHICS_FG_PLANE,\
GRAPHICS_CLEAR)

The example clears all graphics, draws a solid line with the width 5 and
then copies the line to the foreground plane. Finally the graphics is
cleared again. (The line in the foreground plane will not be erased.)

☞ The rendering speed of the graphics can be improved a lot by


putting as many argument as possible in the same call to Graphics().

☞ The graphics objects that can be created will always use a number of
attributes like colors and line width. The current value of these attributes
are always kept by the SID. It is very important to set all the attributes
used by an object if you want to be 100 % sure of the appearance of the
created object.

The Line object


Graphics(GRAPHICS_LINE, x1, y1, x2, y2)
Draws a line from x1, y1 to x2,y2.
Graphics(GRAPHICS_LINE, x1[], y1[], x2[], y2[])
This form of GRAPHICS_LINE can be used to draw many lines at
the same time. Lines will be drawn from x1[n], y1[n] to x2[n], y2[n]
for each entry n in the vectors.

☞ The vectors must have equal length.

4-38 microGOP 2000/S User’s Guide


Variables 4

Graphics attributes for the Line object


The line object uses the following attributes:
Graphics(GRAPHICS_LINE_FOREGROUND, index)
Sets the foreground color for lines. The index should be in the range
0-255. The color can be inspected in the ’Colormap’ window in the
SID, see Colors menu, page 2-38. The following predefined indices
(colors) exists:
RED_INDEX, GREEN_INDEX, BLUE_INDEX, GREY_INDEX,
WHITE_INDEX, BLACK_INDEX, YELLOW_INDEX,
BG1_INDEX, BG2_INDEX, WORKSPACE_INDEX,
CYAN_INDEX, MAGENTA_INDEX, TURQ_INDEX
Example:
Graphics(GRAPHICS_LINE_FOREGROUND, RED_INDEX)

Graphics(GRAPHICS_LINE_BACKGROUND, index)
Sets the background color for lines. This color is used when the
GRAPHICS_LINE_DOUBLEDASH line style is used. The index
should be selected as described for the
GRAPHICS_LINE_FOREGROUND attribute.
Graphics(GRAPHICS_LINE_WIDTH, width)
Sets the line width to width pixels.
Graphics(GRAPHICS_LINE_STYLE, style)
The line style. Possible line styles are:
GRAPHICS_LINE_SOLID
Solid lines drawn with GRAPHICS_LINE_FOREGROUND
color.

GRAPHICS_LINE_TRANSPARENT
Invisible lines. Only useful for rectangle, ellipse and circle
objects.

GRAPHICS_LINE_DASH
Dashed lines drawn with
GRAPHICS_LINE_FOREGROUND color.

GRAPHICS_LINE_DOUBLEDASH
Dashed lines drawn with both
GRAPHICS_LINE_FOREGROUND and
GRAPHICS_LINE_BACKGROUND colors.

microGOP 2000/S User’s Guide 4-39


4 Variables

Graphics(GRAPHICS_LINE_ARROWS, n)
Sets arrows on line ends, n can be:
0 - No arrows
1 - Arrow at start of line
2 - Arrow at end of line
3 - Arrows at start and end of line

The Rectangle object


Graphics(GRAPHICS_RECT, x, y, wid, hgh)
Draws a rectangle with sharp corners.
Graphics(GRAPHICS_RECT, x[], y[], wid[], hgh[])
This form of GRAPHICS_RECT can be used to draw many
rectangles at the same time. Rectangles will be drawn from x[n], y[n]
with dimensions wid[n], hgh[n] for each entry n in the vectors.

☞ The vectors must have equal length.


☞ GRAPHICS_RRECT can be used instead of GRAPHICS_RECT
to draw rectangles with rounded corners.

The Ellipse object


Graphics(GRAPHICS_ELLIPSE, x, y, wid, hgh)
Draws an ellipse inside the specified box.
Graphics(GRAPHICS_ELLIPSE, x[], y[], wid[], hgh[])
This form of GRAPHICS_ELLIPSE can be used to draw many
ellipses at the same time. Ellipses will be drawn inside the boxes
specified by position x[n], y[n] and the dimensions wid[n], hgh[n]
for each entry n in the vectors.

☞ The vectors must have equal length.

4-40 microGOP 2000/S User’s Guide


Variables 4

The Circle object


Graphics(GRAPHICS_CIRCLE, x, y, radius)
Draws a circle with center at x, y with the specified radius.
Graphics(GRAPHICS_CIRCLE, x[], y[], radius[])
This form of GRAPHICS_CIRCLE can be used to draw many circles
at the same time. Circles will be drawn at x[n], y[n] with radius
radius[n] for each entry n in the vectors.

☞ The vectors must have equal length.


The following example draws a circle with a radius of 5 pixels
around the centre of gravity for every labelled object:
Graphics(GRAPHICS_CIRCLE,\
$CgravityX[]/$ScaleFactor,\
$CgravityY[]/$ScaleFactor,\
vinit($NbrObjects, 5))

☞ The rectangle, ellipse and circle objects will use the line attributes for
the borders of the objects. They will also use different fill attributes for
the interior of the objects. This is an example that uses all the attributes:
It draws a rectangle with a green and yellow border filled with a blue
and red stippled interior.
Graphics(GRAPHICS_CLEAR,\
GRAPHICS_LINE_FOREGROUND, YELLOW_INDEX,\
GRAPHICS_LINE_BACKGROUND, GREEN_INDEX,\
GRAPHICS_LINE_WIDTH, 20,\
GRAPHICS_LINE_STYLE, GRAPHICS_LINE_DOUBLEDASH,\
GRAPHICS_FILL_FOREGROUND, BLUE_INDEX,\
GRAPHICS_FILL_BACKGROUND, RED_INDEX,\
GRAPHICS_FILL_STYLE, GRAPHICS_FILL_OPAQUE_STIPPLED,10,\
GRAPHICS_RECT, 100, 100, 200, 300)

microGOP 2000/S User’s Guide 4-41


4 Variables

Graphics fill attributes for objects


The following attributes control the appearance of the rectangle, ellipse,
and circle objects.
Graphics(GRAPHICS_FILL_FOREGROUND, index)
Sets foreground fill color. The index should be selected as described
for the GRAPHICS_LINE_FOREGROUND attribute.
Graphics(GRAPHICS_FILL_BACKGROUND, index)
Sets background fill color. The index should be selected as described
for the GRAPHICS_LINE_FOREGROUND attribute.
Graphics(GRAPHICS_FILL_STYLE, style)
Sets the fill style. The following styles are available:
GRAPHICS_FILL_SOLID
The entire area will be filled with the foreground color.

GRAPHICS_FILL_TRANSPARENT
The entire area will be unfilled.

GRAPHICS_FILL_STIPPLED, n
Stipple means that the area will be filled with the foreground
color where the stipple is set. The areas where the stipple is
not set are transparent. The n should be in the range 0-83. The
order of the stipples is the same as in the stipple menu in the
Draw window in the SID.

GRAPHICS_FILL_STIPPLED, "file.bmp"
Sets the stipple to the contents of the X11 bitmap file file.bmp

GRAPHICS_FILL_OPAQUE_STIPPLED, n
As above but the fill background color will be used where the
stipple is not set.

GRAPHICS_FILL_OPAQUE_STIPPLED, "file.bmp"
Sets the stipple to the contents of the bitmap file file.bmp

4-42 microGOP 2000/S User’s Guide


Variables 4

The Text object


Graphics(GRAPHICS_TEXT, str, x, y)
Draws the string str at x, y. Example:
There are a quite large number of attributes that control the
appearance of the printed text. This example uses all these attributes.
The example renders a yellow string at 100,100 using the font 12x24.
The background of the text will be stippled in red and blue:
Graphics(GRAPHICS_CLEAR,\
GRAPHICS_FONT, "12x24",\
GRAPHICS_LINE_FOREGROUND, YELLOW_INDEX,\
GRAPHICS_FILL_FOREGROUND, BLUE_INDEX,\
GRAPHICS_FILL_BACKGROUND, RED_INDEX,\
GRAPHICS_FILL_STYLE, GRAPHICS_FILL_OPAQUE_STIPPLED,10,\
GRAPHICS_TEXT, "Hello World !", 100,100)

Graphics(GRAPHICS_TEXT, str, xpos[], ypos[])


Draws the string str at all positions defined by every coordinate pair
(xpos[n], ypos[n] for every entry n).
Graphics(GRAPHICS_TEXT, str, sepstr, xpos[], ypos[])
The string str should contain a number of text tokens separated by a
separator string as defined by sepstr. This function draws a new text
token at every position defined by the vectors xpos[], ypos[]. If the
number of coordinates in the two vectors is larger than the total
number of text tokens in the string str, the last token will be repeated
for the last position(s). Example:
Graphics(GRAPHICS_TEXT, "Bill is rich"," ",x[], y[])

This will write Bill at (x[1], y[1]), is at (x[2], y[2]), and rich at
(x[3], y[3]). If the two vectors are longer than 3 elements, the word
rich will be written in the positions (x[4], y[4]), (x[5], y[5]), and so on.
Graphics(GRAPHICS_TEXT, str, "", x[], y[])
The string str is now considered to consist of text tokens only one
character long with no separators.

microGOP 2000/S User’s Guide 4-43


4 Variables

Graphics attributes for the Text object


The color for the text is the same as for the foreground of lines. See
GRAPHICS_LINE_FOREGROUND attribute, page 4-39.
The text is rendered on a background that is the same as for the
rectangle, ellipse and circle objects. See the fill attributes for these
objects, page 4-42.
The font can be selected with the following attribute:
Graphics(GRAPHICS_FONT, font)
Sets the font to print text with. The font value should be a string
containing the font name. Example:
Graphics(GRAPHICS_FONT, "12x24")

☞ Any of the fonts listed by the xlsfonts program can be used. Type
xlsfonts at the UNIX prompt to get a list of available fonts.

Graphics copy functions


Graphics(GRAPHICS_COPY, GRAPHICS_IMAGE_PLANE,pixval)
Copies graphics to the image plane using pixval.

☞ Only graphics that has been painted with a foreground color is


copied.
Graphics(GRAPHICS_COPY, GRAPHICS_FG_PLANE)
Graphics(GRAPHICS_COPY, GRAPHICS_BG_PLANE)
Copy graphics to the foreground/background image plane.

☞ Only graphics that has been painted with a foreground color is


copied.
There are also some Graphics() commands to copy the graphics from the
outline, rubber band line and rubber band box tools:
Graphics(GRAPHICS_COPY, mode, \
GRAPHICS_IMAGE_PLANE, pixval)
Graphics(GRAPHICS_COPY, mode, GRAPHICS_FG_PLANE)
Graphics(GRAPHICS_COPY, mode, GRAPHICS_BG_PLANE)
The mode should be GRAPHICS_OUTLINE,
GRAPHICS_RBLINE or GRAPHICS_RBBOX.

4-44 microGOP 2000/S User’s Guide


Variables 4

Graphics erase functions


Graphics(GRAPHICS_CLEAR)
Deletes all graphics in the SID.
Graphics(GRAPHICS_CLEAR_FG_PLANE)
Graphics(GRAPHICS_CLEAR_BG_PLANE)
Erases the foreground or background image planes
Graphics(GRAPHICS_CLEAR_ALL)
Erases the graphics, and the foreground and background planes.

4.8 Include files


It is possible to use Variable statements that are written in an external
file. Example:
#include "definitions.txt"

The statements in the file will be executed.


Instead of a fixed file name string, a character string expression is also
allowed as file argument.

☞ The #include statements can not be nested. (#include is not allowed


in the included file.)

microGOP 2000/S User’s Guide 4-45


4 Variables

4.9 Creating User Interfaces


Most microGOP programs need some string or value input from the
user. This input can be the name of the files where data shall be saved or
the number of image fields that shall be measured.
The Ui() function is used to generate a user interface (UI) and assign user
specified values to variables.

☞ The Ui() function used to be called read() in early versions of the


microGOP.
Each Ui() function call will generate a popup window with a number of
UI elements.
The following example will generate a popup window with two
message strings and one textfield where the user can enter a string.
char name[50]="Test1"
Ui(MESSAGE, "The blob finder",\
MESSAGE, "",\
VALUE, "Enter filename", name)

The microGOP program stops when the popup window has appeared
and it will not continue until the user has pressed the Continue button.
The Cancel button can be used to quit the popup window and stop the
execution of the microGOP program.

4-46 microGOP 2000/S User’s Guide


Variables 4

Description of the different UI elements


☞ Any number of UI elements can be used in a single Ui() statement.
POSITION, x,y
Sets the position for the popup window.
Example: POSITION, 10,10

MESSAGEGLYPH, "filename.xbm"
The bitmap in the X11 bitmap file filename.xbm is rendered in the
popup window. Such a bitmap file can be generated by saving a
binary image using the xbm image type.
Example: MESSAGEGLYPH, "mylogo.xbm"

MESSAGEGLYPH, "filename1.xbm filename2.xbm"


Several bitmaps can be on the same row by including several
filenames in the same string.
The bitmap files should be located in the same directory as the
microGOP program was saved in, or in any of the directories
specified by the PATH environment variable. Otherwise, the full
path must be specified.
MESSAGE, str
The string is written in the popup window.
Example: MESSAGE, "The blob finder"

VALUE, prompt, variable


A textfield with the prompt is generated. The variable is assigned
the value in the textfield. Integer, float or character strings can be
used.
SLIDER, prompt, min, max, variable
The slider makes it possible to set an integer value graphically. The
value is always an integer.
GREY, prompt, variable
BINARY, prompt, variable
GOP, prompt, variable
GREY16, prompt, variable
C32, prompt, variable
These UI elements generates image buffer selectors. The variable
should be an integer. The value will be set to the selected image
buffer number (0-6).
microGOP 2000/S User’s Guide 4-47
4 Variables

EXCLUSIVE, prompt,\
ITEM, itemtext1, value1,\
DEFAULTITEM, itemtext2, value2,\
ITEM, itemtext3, value3,\
variable
The EXCLUSIVE UI element generates a exclusive choice selector
with a number of choices. The variable is assigned the value
specified for the selected choice. The values and the variable can be
of any type.
The tag DEFAULTITEM can be used to set the default choice.
THRESHGREY, prompt, greyimage, lowvariable, highvariable
This UI element draws two sliders and also displays the grey level
image buffer specified by greyimage. The sliders can be used to
adjust the color slice that is displayed together with the grey level
image. The slice values are assigned to the integer variables
lowvariable and highvariable.
This function is useful to use when the threshold level shall be
adjusted by the user. The lowvariable and highvariable variables
can then be bound to the low and high parameter of the Threshold
function.

☞ No actual thresholding is done by this function, only assignment


of variables. The variables must be bound to the Low and High
parameters of the Thresh function to perform the thresholding.
BUTTONS,\
BUTTON, buttontext1, value1,\
BUTTON, buttontext2, value2,\
BUTTON, buttontext3, value3,\
variable
The BUTTONS command inserts a number of buttons in the UI. The
variable is assigned the value specified for the selected button if a
button is clicked. The variable will not be assigned any new value if
no button is clicked. The values and the variable can be of any type.
The execution of the program will continue when a button is clicked.

4-48 microGOP 2000/S User’s Guide


Variables 4

BUTTON_TEXT, continue_text, cancel_text


The text in the Continue and Cancel buttons can be set. See example
on next page.
The Cancel button is not drawn in the UI if cancel_text is set to an
empty string (""). Both the Continue and Cancel buttons can be
omitted if any BUTTONS have been defined in the Ui call.
Example: BUTTON_TEXT,"",""

See example on next page on how to use BUTTON_TEXT.


UI_CONTINUE_ACTION, action
This UI element enables the user to continue the execution of the
program by performing an action in the SID Image Display. The
parameter action can be one of the following:
PIXVAL
RBLINE
OUTLINE
Example: UI_CONTINUE_ACTION, PIXVAL

The SID Pixel Value tool is activated, and then the program
waits for user action. The program continues either when you
click in the SID or when you select a button in the user interface.
UI_TIMEOUT, seconds
A timeout can be set on the Ui function. This means that the
execution of the program will continue when the timer times out
regardless of user interaction. The granularity of the timer is 5
seconds.
Example: UI_TIMEOUT, 20

This will display the popup window for a maximum time of 20


seconds. Then the window will be removed and the execution of the
program will continue as if the user clicked on the Continue button.

microGOP 2000/S User’s Guide 4-49


4 Variables

An example of how to use the Ui() function


This short example generates a rather complex user interface:
char filename[50] = "Test1"
int amp=5
int greyim=3
int is_fast
Ui(POSITION, 400,100,\
MESSAGE,"The blob finder.",\
MESSAGE,"",\
VALUE,"Enter filename:", filename,\
GREY, "Use buffer:", greyim,\
SLIDER,"Amplification:", 1, 10, amp,\
EXCLUSIVE, "Algorithm:",\
ITEM, "Slow", 0,\
ITEM, "Fast", 1,\
is_fast,\
BUTTON_TEXT, "Press when ready", "Stop program")

The generated user interace will look something like this:

☞ Note that the value of the variables are displayed in the interface.

4-50 microGOP 2000/S User’s Guide


Variables 4

4.10 Binding variables to function parameters


A variable does not become really useful until it is bound to a microGOP
function parameter. This is done from the Variable binding window that
pops up when the Variable binding item is selected in the Perform
menu of a microGOP function.

The contents of the parameter list in the Variable binding window will
be different for every function since it contains the current function
parameters only. In the example above it is possible to assign variables
to the In,Out and Steps parameters of the function.
The parameter that shall be bound to a variable is selected in the
Parameter list and the variable is selected from the Defined variables
list. The binding is performed by using the Bind button.
Example:
We want to bind the integer variable i to the parameter Steps of the
Close function.
Select the Steps parameter in the parameter list and then the i
variable in the Defined variables list. Press Bind to perform the
binding.
After putting the function in the program list it is possible to see that
the parameter is bound to a variable.

microGOP 2000/S User’s Guide 4-51


4 Variables

The current bindings for the parameters are also displayed in the
parameter list.
The user interface item for a parameter is greyed out in the parameter
area if the parameter is bound to a variable.
A parameter can be unbound by selecting it in the parameter list and
then using the Unbind button. All the parameters in a function can be
unbound by selecting Unbind all in the Unbind menu.
If a microGOP function parameter is bound to a variable the value of
that variable is used when that function’s program line is executed (at
"run-time").

☞ A parameter can be bound to a variable not yet declared. This is


done by typing the name of the variable at the Variable: textfield above
the variable list in the Variable binding window. This enables you to
make microGOP programs without having performed a declaration for
every variable used. When a function with a bound parameter is
executed interactively or from a program then of course the variable
must be defined or an error will occur. When you bind a parameter to a
not yet declared variable you get a warning. As long as you know what
you are doing the warning can be ignored.

☞ It is often useful to bind integer variables to input and output images


of functions. Usually this is no problem: The value 0 is Channel and 1-6
is the image buffers 1-6. A problem arises when the function can have
several types of input and output images. The Crop Image function is a
good example. This function can have binary, 8-bit grey, gop, 16-bit grey
or c32 images as both input and output.
In this case one must recalculate the value of
the variable. The binary buffers have the
values 0-6 and the grey buffers have the
values 7-13 and the gop buffers have the
values 14-20 and so on.

4-52 microGOP 2000/S User’s Guide


OPEN LOOK concepts Appendix A

Appendix A: OPEN LOOK concepts


The microGOP User Interface is built in in accordance with the OPEN
LOOK guidelines. OPEN LOOK aims towards more consistent User
Interfaces within and among applications.
This appendix is a brief overview of OPEN LOOK terminology. The
concepts are are illustrated by examples from microGOP 2000/S.

A.1 The mouse


In microGOP 2000/S, you will use the mouse for nearly all operations.

This manual assumes the use of a right-handed mouse, with the three
mouse buttons defined as follows:
SELECT Button
The left mouse button (called SELECT) selects function buttons,
icons and items in pop-up windows, chooses menu items, and items
in lists (files etc.). When you click SELECT in a list a new item is
selected and the previously selected item is unselected.
ADJUST Button
The middle mouse button is called ADJUST. It adjusts the selection
made by SELECT. When you click ADJUST in a list a new item is
selected but the previously selected items remain selected too.
MENU Button
The right mouse button (called MENU) displays menus, submenus,
and pop-up menus, and chooses items from menus.

microGOP 2000/S User’s Guide A-1


Appendix A OPEN LOOK concepts

A.2 Mouse Button Activities


Standard mouse button activities are moving, clicking, pressing, and
dragging.
Move
Move the pointer (cursor) by sliding the mouse with no buttons
pressed.
Click
Press and release the designated mouse button quickly. To “double-
click”, press and release the designated mouse button twice quickly.
Press
Push down and hold down the designated mouse button.
Drag
Press the designated mouse button, hold it down while moving the
mouse, then release the button.
Drag & Drop
Press SELECT on a “dragable” item e.g. a file icon Then drag the item
to its destination and release SELECT.

A.3 How to use the microGOP control items


There are a few standardized control items that are used throughout the
microGOP. Here follows an overview of the control items available in
microGOP.

Push-pin Menu button Header Button Drop zone

Menu item Footer

A-2 microGOP 2000/S User’s Guide


OPEN LOOK concepts Appendix A

Some of these control items are encountered already in the microGOP


base window. Since this is the main window for the microGOP it has an
iconify button in the header. Clicking on this button causes the
microGOP to be iconified. This means that the microGOP windows
currently on the screen disappear and are replaced by a small symbol,
an icon.
The microGOP is still alive and could e.g. run a program while it is
iconified. Of course no interaction can take place since the controls are
not visible.
If MENU is pressed while the cursor is in the header area a pop-up menu
appears. The most important item on the menu is Quit which will quit
microGOP. Close is the same as iconify.
Some menus and windows have pins in the upper left corner. Normally
these menus and windows disappear after a selection has been made.
By clicking on the pin they can be made permanent (until you unpin
them).

microGOP 2000/S User’s Guide A-3


Appendix A OPEN LOOK concepts

A.4 Buttons
The label on a button used for a single command can be text or an icon
image.
To choose a button, click SELECT on the button, i.e. move the pointer
(cursor) to the button, then press and release the left mouse button
quickly.
When you press a button, it is highlighted to provide visual feedback.
When a button has a window mark - three dots (...) - following the label,
choosing the button causes a pop-up window to be displayed.

A.5 Menu buttons


The label on a menu button can be text or an icon image.
Menu buttons always have a menu mark, an outlined triangle following
the label. The triangle points to where the menu is displayed (either
below or to the right of the menu button). To display the menu that
corresponds to a menu button, click MENU on the menu button, i.e.
move the pointer (cursor) to the menu button, then quickly press and
release the right mouse button.

A.6 Abbreviated menu buttons


Abbreviated menu buttons are small square buttons with a menu mark
inside them. The label for the button is displayed to the left, and the
choice from the button menu is displayed to the right of the abbreviated
menu button. Abbreviated menu buttons has the same function as
ordinary menu buttons.

A-4 microGOP 2000/S User’s Guide


OPEN LOOK concepts Appendix A

A.7 Menus
There are different methods to display and choose from a menu:
• If you click MENU on a menu button, the menu displays as
described above. You can choose a menu item by clicking on it with
MENU or SELECT. Click outside the menu to cancel it.
• If you press MENU on a menu button, the menu displays while the
MENU button remains pressed. Drag MENU (i.e. hold the right
menu button down while moving the mouse) to the menu item you
want and release the mouse button to choose it.
• If you press SELECT on a menu button, the default choice for the
menu replaces the label on the menu button. Releasing SELECT at
this point will select the default choice.
• If you click SELECT on a menu button, the default choice for the
menu will be selected.
When items in a menu are dimmed, they are temporarily unavailable.

A.8 Choice buttons


Choice buttons (or exclusive settings) are displayed as touching
rectangles. You can make one choice from each group of settings. The
chosen setting is highlighted.

To make a choice, click SELECT on the corresponding rectangle.

A.9 Check boxes


Check boxes are another type of choice buttons.

To make a choice, click SELECT on the check box to display the check
mark.

microGOP 2000/S User’s Guide A-5


Appendix A OPEN LOOK concepts

A.10 Text fields


Text fields are used when the application requires input from the
keyboard. For example, you use a text field when you type the name of
an image you want to rename. To enter text in a text field, first click
SELECT on the text field to activate the text field caret (a black triangle),
then type the text on the keyboard. The caret is always displayed at the
text insert point. You can use the <left-arrow> and <right-arrow> keys
to move the insert point.

When a text field cannot display the entire text string, scrolling buttons
are displayed to allow you to scroll the contents of the text field.

A.11 Numeric fields


Numeric fields are text fields that can only contain numbers. You enter
numbers in a numeric field in the same way as you enter text in a text
field.

When a numeric field has increment/decrement scrolling buttons, you


can click SELECT on the scrolling buttons to increase or decrease the
number displayed in the numeric field.

A.12 Sliders
Sliders are used to set a numeric value and to give a visual indication of
the setting.

The numbers to the left and to the right of the slider indicate the range
of possible settings. There are different methods to set a numeric value
with the slider:

A-6 microGOP 2000/S User’s Guide


OPEN LOOK concepts Appendix A

• If you drag SELECT on the slider button, the numeric value will
change while you move the mouse until you release the mouse
button.
• If you click SELECT to the left of the slider button, the numeric
value will decrease with one.
• If you click SELECT to the right of the slider button, the numeric
value will increase with one.
• If you click SELECT on either of the end boxes, the minimum or the
maximum value will be displayed in the numeric field.

microGOP 2000/S User’s Guide A-7


Appendix A OPEN LOOK concepts

A.13 Scrollbars
Scrollbars allow you to change the view on the data that is displayed in
a scrolling list or a text pane. The figure below shows the parts of the
scrollbar and an example of its use.

You use the SELECT button to scroll through the data. When you scroll
upward, you move the view on the data incrementally toward the
beginning. When you scroll downward, you move the view on the data
incrementally toward the end. The elevator shows you where you are in
the data. The dark area of the cable (the proportion indicator) shows you
how much of the total contents that is displayed.
You can use the scrollbar in the following ways:
• Go to the beginning (click SELECT on the top cable anchor).
• Go to the end (click SELECT on the bottom cable anchor).
• Move one line toward the beginning (click SELECT on the up arrow).
• Move one line toward the end (click SELECT on the down arrow).
• Move to any arbitrary location (press SELECT in the drag area and
drag the elevator).
• Scroll quickly toward the beginning (press SELECT on the up arrow).
• Scroll quickly toward the end (press SELECT on the down arrow).

A-8 microGOP 2000/S User’s Guide


OPEN LOOK concepts Appendix A

A.14 Pop-up windows


Each pop-up window has a pushpin. If the window is unpinned, you can
push the pin in (click SELECT on the pin) to keep the window displayed.
To dismiss the pop-up window, click SELECT on the pin to unpin it.

You can move the pop-up window by dragging SELECT on the header
of the pop-up window.
Each pop-up window has a pop-up window menu, which is displayed
by pressing MENU on the pop-up window header. The menu allows
you to dismiss or refresh the pop-up window, move the window to the
back of the display, or bring forward the associated base window. This
menu is not commonly used.

A.15 Notices
Notices are pop-up windows that displays warnings, messages,
questions, or other information that require an immediate action. When
a notice appears, you cannot continue using the application until you
respond appropriately - such as clicking SELECT on a button in the
notice pop-up window.

microGOP 2000/S User’s Guide A-9


Appendix A OPEN LOOK concepts

A-10 microGOP 2000/S User’s Guide


Starting the microGOP 2000/S Appendix B

Appendix B: Starting the


microGOP 2000/S
This appendix describes how the microGOP 2000/S is started.

B.1 Starting the X server


An X window server must be running before the microGOP 2000/S can
be started. This is sometimes made automatically when the user logs in.
The X server is running when there are windows on the screen.
If no X server is running it can be started with the following command:
% openwin

The command will start an X server and the OpenWindows window


manager.
To start the X server with a 24-bit TrueColor default visual:
% openwin -dev /dev/fb defdepth 24
To start the X server with an 8-bit PseudoColor default visual:
% openwin -dev /dev/fb defdepth 8
It is also possible to use other X servers and window managers like CDE
(Common Desktop Environment).
Contact your system administrator if you are not able to start an X
server.

B.2 Starting microGOP 2000/S


There are some environment variables that must be setup to be able to
use the microGOP. These variables are described in Appendix C:
Configuring the microGOP 2000/S. Please check that the essential
environment variables have been setup before continuing below.
The microGOP can be started from a terminal window (xterm, dtterm,
shelltool, cmdtool, etc) or from some menu as described on page 1-3.
The command is always the same:
% smicro
The smicro command will accept a large number of options. The options
are described in The command line options to smicro, page C-6.

microGOP 2000/S User’s Guide B-1


Appendix B Starting the microGOP 2000/S

B.3 Setting the license key


The microGOP 2000/S is a licensed software which means that it must
be unlocked with a license key the first time it is started after an
installation. A new license key must also be used if the old one has
expired.
The license key controls how many users that can run the microGOP at
the same time. The license key also specifies the options that can be used
and when the license expires.
The following window appears if no valid license key is found:

The license key must now be typed at the License Key line exactly as
printed on the license key sheet.

☞ Upper and lower case characters must be used exactly as on the


license key sheet. Note that there can be both 0 (zero) and O (as in Oliver)
in the license key.
Press the Set License button when the key has been typed in at the line.
The microGOP will now display the Setup Window.

☞ The license key can also be setup with -k option as described in The
command line options to smicro, page C-6.

☞ The -k option must be used to set a new license key when the current
is still valid.

☞ A license key file can be used to make it easier to manage many


licenses for many computers in a network. See Using a license key file,
page C-5.

B-2 microGOP 2000/S User’s Guide


Starting the microGOP 2000/S Appendix B

B.4 The Setup Window


The Setup window appears when the microGOP has been started with
the smicro command. This window makes it possible to select the
different options that should be used in the current microGOP session.

The Help... button can be used to get some information about the
different options.
The + button will show some additional settings i.e. the initial image
size.
The main options are also described below.
GOP
Enables the use of the GOP processor. The GOP operations in the
Gop and Grey function groups are enabled. The GOP processor must
be available to be able to run the operations.
MIP
Enables the use of the MIP processor. The GOP operations in the Gop
and Grey function groups are enabled. The MIP processor must be
available to be able to run the operations.

☞ The MIP and GOP operations should usually not be used at the
same time !
DCP
Enables the use of the DCP. The DCP is the old separate image
display processor from ContextVision. The DCP processor must be
available to be able to run the DCP related functions.

microGOP 2000/S User’s Guide B-3


Appendix B Starting the microGOP 2000/S

SCAN
Enables the use of a scan stage controller. The Scanstage function
group will be enabled. A scan stage controller must be connected to
a serial port to be able to use the functions.
GREY8
Enables the use of 8-bit grey scale image buffers.
GREY16
Enables the use of 16-bit grey scale image buffers.
GOP
Enables the use of GOP image buffers.
STEREO
Enables the Stereology function group.
FFT
Enables the FFT function group and the C32 image buffers.
CLASS
Enables the Image Classification function group.

☞ The Setup Window can be disabled (not displayed) with the smicro
option -nosetup. See The command line options to smicro, page C-6.

B-4 microGOP 2000/S User’s Guide


Starting the microGOP 2000/S Appendix B

B.5 Error messages from microGOP 2000/S


The microGOP will print error messages if something goes wrong at
start-up. Some of these most common error messages are describe
below.
Licence check failed
The license for microGOP has not been set (or it has expired). Set the
license as described earlier in this appendix.
Error messages as the ones below may appear if the environment
variables have not been setup as described in Appendix C: Configuring the
microGOP 2000/S.
smicro: command not found
The microGOP software can not be found using the PATH
environment variable.
It is impossible to locate the microGOP 2000/S software.
The SMICROHOME environment variable has been set to the wrong
directory.
Environment variable IMGPATH is not set
Setting it to ...
The environment variables IMGPATH and IMBUFFERPATH has
not been set.
The image buffer directory ... is not writable !
The first directory in IMGPATH (or the directory specified with
IMBUFFERPATH) must be writable for the microGOP user. This
directory is used for the image buffers in the microGOP.
The MIPPATH must be specified when using option -MIP
The MIPPATH has not been setup correctly. See installation
documentation for the MIP processor.
The license does not include the FFT option.
The FFT functions will be disabled.
The FFT option has been used without having a license that includes
the FFT option. Please contact ContextVision to get a new license.

microGOP 2000/S User’s Guide B-5


Appendix B Starting the microGOP 2000/S

B-6 microGOP 2000/S User’s Guide


Configuring the microGOP 2000/S Appendix C

Appendix C: Configuring the


microGOP 2000/S
Each user of the microGOP must setup his/her own environment. By
environment we mean the personal settings that affect the behavior and
functionality in the microGOP.

C.1 The README file


The README file is delivered with every new release and it always
contains the latest detailed instructions on setting up the environment
on your system. The README file also contains information about the
changes and bug fixes in the new release. This manual is not always
updated for every new release but the README file always contains
information about new features in the microGOP.

☞ The README file can be inspected by typing smicro -README


which will start an editor (textedit unless EDITOR is set) with the
contents of the README file.
The rest of this appendix will describe how to set the environment for
the microGOP 2000/S and how to change files to change the behavior of
the microGOP 2000/S.

microGOP 2000/S User’s Guide C-1


Appendix C Configuring the microGOP 2000/S

C.2 Essential environment variables


There are three (3) environment variables that must be setup to be able
to run the microGOP.
1. The SMICROHOME environment variable
The environment variable SMICROHOME should be set to the directory
where the microGOP 2000/S is installed. This is usually /opt/
CVmg2000S in Solaris 2.x and /cvab/microGOP2000S (or some other
directory) in Solaris 1.x.
2. The PATH environment variable
The environment variable PATH should contain $SMICROHOME.
3. The IMBUFFERPATH environment variable
This environment variable should be set to a directory that should
be used for the microGOP image buffers. The specified directory
must be writable for the microGOP user. The image buffer files are
only used by the microGOP and it is therefore practical to put them
in a special directory and then forget about them. The image buffer
directory is also used to store some temporary files created by the
microGOP.
☞ The image buffers may require very large space if large images
are used. Especially the C32 image buffers require a lot of space
since these images are stored with 2 floats (8 bytes) per pixel. This
means that one 1024x1024 C32 buffer requires 8 Mega Bytes of disk
space.
☞ It is best to have the image buffer directory on a fast local disk
to get maximum performance out of the microGOP. The microGOP
uses the buffer files very extensively and it may run much slower if
the image buffers are located on a remote disk on a slow network.
☞ The image buffer directory must be unique for every microGOP
user.

C-2 microGOP 2000/S User’s Guide


Configuring the microGOP 2000/S Appendix C

Example of environment variable setup


The environment variables should be set in the users .login or .cshrc or
some other file that is read when the user logs in.
This example is how the user john who is using Solaris 2 can setup his
environment variables.
First we must create create an image buffer directory that john can use.
We will use a directory im/BUFFERS on johns home directory.
% cd ~john
% mkdir im
% mkdir im/BUFFERS
John is using csh as command shell so he puts the following lines in his
.cshrc file.
setenv SMICROHOME /opt/CVmg2000S
setenv PATH $PATH\:$SMICROHOME
setenv IMBUFFERPATH $HOME/im/BUFFERS

We must now read the .cshrc file to set the commands in the current
shell:
% source .cshrc

It is also possible to logout and then login again.


It should be possible to start the microGOP now by typing smicro as
described in Starting microGOP 2000/S, page B-1.

☞ It is possible to start the microGOP without setting up anything but


this is not recommended. The whole path to the smicro program must
be specified. Example in Solaris 2 ( The path will be different in Solaris
1.x.):
% /opt/CVmg2000S/smicro (Do not start like this)

The IMGPATH environment variable


The directories that are specified in IMGPATH will be available as Browse
menu entries in the Load Image and Save Image functions.
The first directory in IMGPATH is used for image buffers unless
IMBUFFERPATH has been set.

☞ The IMBUFFERPATH must be set if IMGPATH has “.” as first directory.

microGOP 2000/S User’s Guide C-3


Appendix C Configuring the microGOP 2000/S

The EDITOR environment variable


The EDITOR environment variable can be set to the name of the users
favorite text editor. This environment variable is used when whenever
the microGOP opens an editor. The default editor is textedit.

The DISPLAY environment variable


The microGOP will normally display its user interface on the machine
where it is running. The DISPLAY environment variable is used to define
the X server to use for an application. The following commands will
display the microGOP user interface on the display igor:0.
% setenv DISPLAY igor:0
% smicro

You can also use:


% smicro -display igor:0

☞ The microGOP interface will be displayed on the display specified


but the microGOP executes on the machine where it was started.

C-4 microGOP 2000/S User’s Guide


Configuring the microGOP 2000/S Appendix C

C.3 Using a license key file


It is possible to put license keys for the microGOP in a license key file.
This is practical if many microGOP licenses are used in the same
network. The microGOP can be installed on a network disk that is
available from all computers. The license key file should also be put on
a disk available from all computers.
The SMICRO_KEY_FILE environment variable should specify the full
path of the license key file. A line like this in all the users .cshrc file
should do it:
setenv SMICRO_KEY_FILE <full path name of license key file>

The syntax of the license key file should be like in this example (the
comment field is optional). Lines that start with a # sign are comment
lines.
#
# microGOP 2000/S License File
#
# hostid hostname key comment
# ------ -------- --------------- -------
8077b60b otto msxHJibZsZJeTMo single user, FFT
807ae8b2 ludde qrxItl4WrW2aXMi single user, FFT
5100786f lufsen kxYN154kdySD0RK single user
5323012e pluto lwCxpnfNNFfSGmg single user, FFT
7235473c molle dpDxLc6pEM7KBhU single user, FFT
727107c2 milou kmxBNh3ytmzP0RO 5 users, FFT
5541f24b pongo mTxO2avtUIeTHjd 2 users
55005a09 idefix pnxOf023BnCObWP 2 users, FFT
807bc36d ultra iyxfd7lddyfD2PL 3 users, FFT

The smicro start script will look in the license file specified by
SMICRO_KEY_FILE for a license for the computer it is running on.

microGOP 2000/S User’s Guide C-5


Appendix C Configuring the microGOP 2000/S

C.4 The command line options to smicro


The smicro start script has a lot of command line options. The -help
option can be used to get a printout with a short description of all the
options:
% smicro -help

microGOP 2000/S Version 2.51 / Solaris 2.x


(c) ContextVision Systems AB
usage: smicro options
possible options:
-help print this help
-k key set licence key and start microGOP 2000/S
-x xsize image width (default: 512)
-y ysize image height (default: 512)
-l calc16min min value in 16 bit grey scale images
(default: 0)
-h calc16max max value in 16 bit grey scale images
(default: 4095)
These values are used to limit the result
from functions that produce 16 bit
greyscale images.
-L display16min min value in 16 bit grey scale images
(default: 0)
-H display16max max value in 16 bit grey scale images
(default: 4095)
A linear mapping between the two values
are used when 16 bit grey scale images are
displayed.
-i iconsize iconsize to use (32-152 is possible,
default:64 )
-I icon_mega_bytes max image size in mega bytes to create
icons for.
-display dpy use dpy as display (X server)
-setup display options setup window (default)
-nosetup do not display options setup window
-cd dir will cd to directory ’dir’ before starting
the microGOP
-DCP add DCP optional functions
-SCAN add SCANstage optional functions
-GOP add GOP optional functions
-MIP add MIP optional functions
-GREY16 show 16-bit greyscale image buffers
-FFT add FFT optional functions + C32 buffers
-STEREO add STEREOlogy optional functions
-CLASS add Image CLASSifier optional functions
-BETA include beta functions
-NOVIDEO do not use video frame grabber
-NOGREY8 do not show 8-bit greyscale image buffers
-NOGOP do not show GOP image buffers
-README open an editor with current README file
-remove removes all image buffers on all dirs in
IMGPATH
-clashes check for possible file name clashes
-paths show value of used paths (for debugging)
-dxlib enable the use of Direct Xlib
-v verbose mode (for debugging)
name.mcs load the program ’name.mcs’
-run name.mcs load and start the program ’name.mcs’

C-6 microGOP 2000/S User’s Guide


Configuring the microGOP 2000/S Appendix C

Most of the switches are never used by regular users and some of the
switches can be controlled within the Setup Window.
The -k switch can be used to setup a license key for the microGOP. This
is not used very often since the license key is usually setup using the
license key window described in Setting the license key, page B-2.

C.5 How to enable microGOP options


The environment variable SMICROOPTIONS can be used to define what
options that should be enabled in the microGOP. The enabled options
will selected by default in the Setup window described in The Setup
Window, page B-3.
Example how to set the SMICROOPTIONS environment variable:
setenv SMICROOPTIONS ’-SCAN -FFT -STEREO -CLASS -MIP -GREY16’

This example will enable the functions in the Scanstage, FFT, Stereology,
and Image Classifier function groups and also the GOP operations
running in the MIP processor. The 16-bit grey scale image buffers will
also be enabled.

☞ It is possible to add other smicro command line switches to the


SMICROOPTIONS environment variable.

☞ The Setup window can be disabled (not displayed) by adding


-nosetup to SMICROOPTIONS. The microGOP will then start directly.
Example:
setenv SMICROOPTIONS ’-SCAN -FFT -STEREO -CLASS -MIP -GREY16 -nosetup’

microGOP 2000/S User’s Guide C-7


Appendix C Configuring the microGOP 2000/S

C.6 Files used by microGOP 2000/S


The microGOP uses a number of files for personal setups, like geometric
scale factors, colors on diagrams, image formats, video input units
etc.The microGOP also uses a number of files to store temporary images
and data.

Image buffer files


The images that the microGOP works with internally are stored as
image files.The format is ordinary ContextVision image files (imf). The
names of these files are:
Image Buffer Name
Binary Channel MICROGOP-B1IMAGE-CH1.imf
Binary 1-6 MICROGOP-B1IMAGE-R[1-6].imf
Grey 8-bit Channel MICROGOP-U8IMAGE-CH1.imf
Grey 8-bit 1-6 MICROGOP-U8IMAGE-R[1-6].imf
GOP Channel MICROGOP-GOPIMAGE-CH1.imf
GOP 1-6 MICROGOP-GOPIMAGE-R[1-6].imf
c32 Channel MICROGOP-C32IMAGE-CH1.imf
c32 1-6 MICROGOP-C32IMAGE-R[1-6].imf
Grey 16-bit Channel MICROGOP-S16IMAGE-CH1.imf
Grey 16-bit 1-6 MICROGOP-S16IMAGE-R[1-6].imf

Theses files are stored in the directory specified by the IMBUFFERPATH


environment variable.
The image buffers that match the current image size will be visible in the
Image Tool window. The buffers that do not match the current image
size will appear as if they were empty.

C-8 microGOP 2000/S User’s Guide


Configuring the microGOP 2000/S Appendix C

The microloadprogram file


MicroGOP programs that are often used can be inserted as menu choices
in the Load Program menu. A program is loaded and started when such
a choice is selected.
The definitions for the choices are inserted in the file .microloadprogram
on the users home directory.
The default microloadprogram file is located in the release directory. The
file should be copied to the users home directory if changes should be
made to it.
% cp /opt/CVmg2000S/microloadprogram ~/.microloadprogram

☞ The name should be .microloadprogram on the users home directory.


☞ The personal file will, if it exists, be used instead of the one on the
release directory.
The default microloadprogram file contains some example programs that
are delivered with the microGOP.
Each line in the microloadprogram file should contain the path to a
microGOP program and the text that should appear in the Load
Program menu. Lines that starts with a # are comment lines. Empty lines
defines a space in the Load Program menu. Submenus to the Load
Program menu can be defined.
Example of a .microloadprogram file:
#
# Fibre analysis menu
#
MENU Fibre Analysis
/export/home/sik/bin/fwone Measure One
/export/home/sik/bin/fwnew New Measurement
/export/home/sik/bin/fwacc Accumulate
/export/home/sik/bin/fwpres Present Diagram
MENUEND
/export/home/sik/bin/gsadmstart ASTM

The example will generate the following menus:

microGOP 2000/S User’s Guide C-9


Appendix C Configuring the microGOP 2000/S

The microimagetype file


This file specifies the different image file formats that the microGOP can
load and save in the Load Image and Save Image functions.
This file is located in the release directory. The file should be copied to
the users home directory if changes should be made to it.
% cp /opt/CVmg2000S/microimagetype ~/.microimagetype

☞ The name should be .microimagetype on the users home directory.


☞ The personal file will, if it exists, be used instead of the one on the
release directory.
Each line in the microimagetype file specifies an image format. The syntax
for a line is:
Name Extension Pathname Loadcmd Savecmd
Name
This is the name that will be used for the image type. The name will
appear in the image type menus in the Load Image and Save Image
functions.
Extension
The file browsers in the Load Image function looks for files with this
file extension and Save Image stores the file with this extension.
A - can be used to if no specific extension should be used.
Pathname
The directories in the pathname are available as menu items in the
Load Image and Save Image functions. Normally this field should
be set to IMGPATH.
Loadcmd
This program is invoked when a Load Image is performed. It should
convert an image to the imf format. The microGOP 2000/S invokes
the program with the following parameters:
Loadcmd image_to_load imf_image -f type hgh wid [resample]

The image_to_load should be converted to to an imf image


(imf_image) with the specified type and, if the last parameter (7th)
is given, the size should also be resampled to the specified height
and width. The size of the original image should be kept if the 7th
parameter is not given. The type can be b1, u8,p8, c32 or s16.

C-10 microGOP 2000/S User’s Guide


Configuring the microGOP 2000/S Appendix C

Savecmd
This program is invoked when Save Image is performed. The
microGOP 2000/S invokes the program with the following
parameters:
Savecmd imf_image image_to_save -f type hgh wid

The imf file (imf_image) should be saved as an image in the


specified format. The type specifies the type and wid and hgh the
size of the imf image.
The default microimagetype file contains definitions for loading and
saving imf, TIFF, Windows BMP, Sunraster, raw images and Postscript.
The default microimagetype file may have been changed since this
manual was written. The latest microimagetype file is always described in
the README file.
Example of the default microimagetype file:
imf imf IMGPATH loadimf saveimf
imf.Z imf.Z IMGPATH loadimf saveimf
tif tif IMGPATH loadtiff savetiff
TIFF,Information - IMGPATH loadtiff_INFO -
TIFF - IMGPATH loadtiff savetiff
TIFF,RGB - IMGPATH loadtiff_RGB savetiff_RGB
TIFF,CMYK - IMGPATH loadtiff_CMYK savetiff_CMYK
TIFF,RED - IMGPATH loadtiff_R -
TIFF,GREEN - IMGPATH loadtiff_G -
TIFF,BLUE - IMGPATH loadtiff_B -
TIFF,BAND#1 - IMGPATH loadtiff_1 -
TIFF,BAND#2 - IMGPATH loadtiff_2 -
TIFF,BAND#3 - IMGPATH loadtiff_3 -
TIFF,BAND#4 - IMGPATH loadtiff_4 -
BMP,Information bmp IMGPATH loadbmp_INFO -
BMP bmp IMGPATH loadbmp savebmp
BMP,RGB bmp IMGPATH loadbmp_RGB savebmp_RGB
BMP,R bmp IMGPATH loadbmp_R -
BMP,G bmp IMGPATH loadbmp_G -
BMP,B bmp IMGPATH loadbmp_B -
PostScript ps IMGPTAH - savepostscript
PostScript,RGB ps IMGPTAH - savepostscript_RGB
Sunraster - IMGPATH loadras saveras
raw - IMGPATH loadraw saveraw
raw,swab - IMGPATH loadraw_auto_auto_auto_swab_0 -
raw,eof - IMGPATH loadraw_auto_auto_auto_noswab_eof -
raw,eof,swab - IMGPATH loadraw_auto_auto_auto_swab_eof -
xbm - IMGPATH - savexbm

microGOP 2000/S User’s Guide C-11


Appendix C Configuring the microGOP 2000/S

☞ The “-” as extension indicates that the image files does not have a
specific extension.

☞ The “-” as loadcmd or savecmd tells the microGOP that there is no


load or save program for the image type.

Information about different image types


24-bit color RGB Tiff images (8 bits per color band), with and without
included thumbnails (not loaded), and also 36-bit RGB Tiff images with
12 bits per color band can all be loaded using the TIFF, RGB setting.
Some of the image types (TIFF,RGB, TIFF,CMYK and BMP,RGB)
makes it possible to load color images into three (or four) consecutive 8-
bit grey scale image buffers. It is also possible to save three (or four)
consecutive 8-bit grey scale buffers as colorimages using these image
formats.
Binary images can be saved as X bitmap xbm files. These files can be
used as interface icons in the Ui(MESSAGEGLYPH, ...) call in the
Variable (Program function group) function.

The microimagesize file


This file specifies the different image sizes that will appear in the image
size menu in the Settings function.
The microimagesize file is located in the release directory. The file should
be copied to the users home directory if changes should be made to it.
% cp /opt/CVmg2000S/microimagesize ~/.microimagesize

☞ The name should be .microimagesize on the users home directory.


☞ The personal file will, if it exists, be used instead of the one on the
release directory.
Each line in the file specifies an image size. The format should be:
widthxheight menu-text
Example of a microimagesize file:
256x256 Small
768x576 Video PAL
384x288 Video PAL/2
192x144 Video PAL/4
640x480 Video NTSC
1024x1024 Large
1280x1024 Larger

C-12 microGOP 2000/S User’s Guide


Configuring the microGOP 2000/S Appendix C

The microvideounit file


The Video function (Image function group) invokes a function that
grabs images from an image input device, such as a video camera
connected to a frame grabber. The microvideounit file defines the
supported frame grabbers and their functionality.
The microvideounit file is located in the release directory. The file should
be copied to the users home directory if changes should be made to it.
% cp /opt/CVmg2000S/microvideounit ~/.microvideounit

☞ The personal file should be located in the user’s home directory and
its name should be .microvideounit. This file, if it exists, will be used
instead of the one in the release directory.
Each line in the microvideounit file should contain a command that grabs
an image or displays live video from a video card. There is built-in
support for a number of video cards. The following frame grabbers
were supported at the time this manual was written:
Sbus SLIC from Multimedia Access Corporation.
Sbus SNAPPER-8, SNAPPER-24, SNAPPER-DIG16 (with support
for Hamamatsu C4742 and C4742-95 digital video cameras),
and PCI SNAPPER-8,
all from Active Imaging.
Sbus SunVideo from Sun Microsystems.
Sbus Videopix from Sun MicroSystems.
DCP frame grabber from ContextVision.
The maximum image size that can be used with the frame grabbers is
768x576 for PAL signals, and 640x480 for NTSC signals.

The supported Video commands


☞ Support for additional frame grabbers may have been added since
this manual was printed. The on-line help for the Video function and the
README file contain the latest information about supported frame
grabbers and video functions.
A video command has the following syntax:
VideoCommand parameterlist
where parameterlist follows this syntax:
parameter1=value1 parameter2=value2 ...

microGOP 2000/S User’s Guide C-13


Appendix C Configuring the microGOP 2000/S

Video commands
The following video commands are available for the different devices:
SLIC
SLICLive parameterlist Enable live video
SLICGrab parameterlist Grab an image
SLICLiveOff Disable live video
SLICLiveClose Release video device
SNAPPER-8, SNAPPER-24, SNAPPER-DIG16
SnapperLive parameterlist Enable live video
SnapperGrab parameterlist Grab an image
SnapperOff Disable live video
SnapperClose Release video device
Hamamatsu C4742-95 digital video camera
C4742-95_Live parameterlist Enable live video
C4742-95_Grab parameterlist Grab an image
C4742-95_LiveOff Disable live video
C4742-95_Close Release video device
Hamamatsu C4742 digital video camera
C4742_Live parameterlist Enable live video
C4742_Grab parameterlist Grab an image
C4742_LiveOff Disable live video
C4742_Close Release video device
Videopix
VideoPixLive parameterlist Enable live video
VideoPixGrab parameterlist Grab an image
VideoPixLiveOff Disable live video
Sun Video
SunVideoLive parameterlist Enable live video
SunVideoGrab parameterlist Grab an image
SunVideoLiveOff Disable live video
SunVideoClose Release video device

C-14 microGOP 2000/S User’s Guide


Configuring the microGOP 2000/S Appendix C

ContextVision DCP frame grabber


DcpVideoOn parameterlist Enable live video
DcpVideoGrab parameterlist Grab an image
DcpVideoOff Disable live video
The DCP frame grabber can only grab 512x512 images.

Parameters for Live Video and Grab Commands


Parameter options, common for several input devices are described in
this section.

☞ More parameter options, specific for a certain device are available.


These will be described later on.
Parameter SLIC Snapper C4742-95 C4742 Videopix Sun Video DCP

Port=p x x x x
Channel=ch x x x
HQ=hq x x
SX=sx x x x x x
SY=sy x x x x x
CX=cx x x x x x
CY=cy x x x x x
Grab only
Frames=f x x x x x x x
Live only
Size=size x x x x x
Low=low x x x x x x
High1=high1 x x x x x x
High2=high2 x x x x x x
Histogram=hi x x x x x x
Wedge=w x x x x x x
Info=i x x x x x x

microGOP 2000/S User’s Guide C-15


Appendix C Configuring the microGOP 2000/S

Parameters Default Description


p 1 The port number:
SLIC & Sun Video: 0, 1, or 2
Snapper: 1, 2, 3, or 4
Videopix: 1, 2, or 3
ch Y The color channel: Y, R, G, B, or RGB.
RGB will grab all three R, G, and B
bands simultaneously.
Snapper: Only R (default), G, B, or RGB.
hq TRUE TRUE = Grab complete frame (2 fields).
FALSE = Grab only 1 line-doubled field
(faster but lower vertical resolution).
sx 1.0 Horizontal scaling factor ( ≤ 1.0) which
makes it possible to adjust the
geometry of the grabbed image.
sy 1.0 Vertical scaling factor ( ≤ 1.0).
cx -1 The x position for the centre of the
grabbed image area within the possible
area (768x576 for PAL).
-1 means centered.
cy -1 As above, but the y position.
Grab only
f 1 The number of video frames used to
make an averaged image when
grabbing.
Live only
size HALF The size for live video can be FULL
(displays the image in full resolution),
HALF, or QUARTER (lower
resolutions). The display frequency
(sampling rate) will be higher with
smaller sizes.
Here follows some video command examples:
SLICLive Port=1 Channel=Y HQ=FALSE Size=FULL SX=1.0 SY=1.0 CX=-1
CY=-1 B=-1 C=-1
SnapperLive Port=1 Channel=RGB Sync=CSYNC Size=HALF HQ=TRUE
Frames=1 SX=1.0 SY=1.0 CX=-1 CY=-1 PLL=FAST CCIR=TRUE
SnapperGrab Port=1 Channel=Y Sync=Y1 HQ=TRUE Frames=1 SX=1.0 SY=1.0
CX=-1 CY=-1 PLL=FAST CCIR=TRUE
C4742-95_Live Size=HALF Gain=-1 Offset=-1 Shutter=-1 Binning=FALSE
SX=1.0 SY=1.0 CX=-1 CY=-1
C4742_Grab Frames=1 SX=1.0 SY=1.0 CX=-1 CY=-1

C-16 microGOP 2000/S User’s Guide


Configuring the microGOP 2000/S Appendix C

The following (generic) arguments for the live video commands


make it easier to adjust the illumination to a proper level. It is
possible to set colors (green, purple, and blue) on a selected range of
grey values. A small histogram can also be added in the Live Video
window.
These arguments are only valid for monochrome images
(R, G, B, or Y channels).
Parameters Default Description
low - Intensity values below low will be
colored blue in the live window.
high1 - Intensity values above high1 will be
colored green in the live window.
high2 - Intensity values above high2 will be
colored purple in the live window
(overrides high1).
hi FALSE TRUE = Enables a histogram in the live
window. The mean grey value is also
displayed in the histogram. (The
sampling rate will decrease if the
histogram is enabled).
FALSE = Disables the histogram.
w - TRUE = Enables a grey scale color
wedge in the upper left corner of the
live window. (Automatic if low, high1,
high2, or hi is used).
FALSE = Disables the color wedge.
i TRUE TRUE = Displays the sampling rate
(frame/sec) information at the top of
the live window.
FALSE = No sampling rate information
is displayed.
The following video command example will color intensity values in the
range 0-19 blue, pixel values in the range 241-253 green, and values
between 254-255 purple during the live video session. A small
histogram will also be displayed in the Live Video window.
SLICLive ... Low=20 High1=240 High2=253 Histogram=TRUE

microGOP 2000/S User’s Guide C-17


Appendix C Configuring the microGOP 2000/S

Parameter options specific for SLIC


B=b C=c Both SLICLive & SLICGrab.
Default Description
b 128 Brightness value (range 0-255).
c 64 Contrast value (range 0-127).

Parameter options specific for Snapper


Sync=sync PLL=pll CCIR=ccir Both SnapperLive & SnapperGrab.
Default Description
pll FAST Selects sync hardware.
FAST: Syncs fast on good video signals.
SLOW: Syncs better on bad sync signals
(such as VCR).
ccir TRUE TRUE: Selects CCIR (768x576, 50Hz)
FALSE: Selects EIA (640x480, 60Hz)
sync Selected Channel Selects the sync source.
CSYNC: sync on separate sync signal.
Rn: sync on red in input n
Gn: sync on green in input n
Bn: sync on blue in input n
Default is sync on selected channel:
R, G, B, or RGB(CSYNC).

Parameter options specific for Videopix


ScaleX=vpsx VideoPixGrab only.
Default Description
vpsx 1.0 Horizontal scaling factor (0.01-10.0)
which makes it possible to adjust the
geometry of the grabbed image.

C-18 microGOP 2000/S User’s Guide


Configuring the microGOP 2000/S Appendix C

Parameter options specific for Hamamatsu C4742-95


Gain=gain Offset=offset Shutter=shut Binning=bin
C4742-95_Live & C4742-95_Grab
Default Description
gain 0 The built-in gain factor (0-255). -1 will
keep the current gain factor.
offset 127 The built-in offset factor (0-255).
-1 will keep the current offset factor.
shut -1 Sets the camera shutter speed.
Range 1-1039 in normal mode.
Range 1-519 in binning mode.
A value of -1 will keep the current
shutter setting. The shutter function is
switched on the first time shut > 0.
bin FALSE FALSE: Resolution is set to 1280x1024.
TRUE: Enables the 2x2 built-in binning,
which reduces the resolution to
640x512.

Parameter options specific for DCP


Channel=dcpch Sync=dcpsync DcpVideoOn & DcpVideoGrab.
ScaleX=dcpsx DcpVideoGrab only.

Default Description
dcpch Green The color channel.
Use Red, Green, or Blue.
dcpsync Green Selects the sync source.
Use Composite, Green, External, or
Internal.
dcpsx 1.113 Horizontal scaling factor which makes
it possible to adjust the geometry of the
grabbed image. Use the default value to
get square pixels.

microGOP 2000/S User’s Guide C-19


Appendix C Configuring the microGOP 2000/S

External video commands


The Video function will call an external program if the command is not
recognized as a command for a supported frame grabber.
The Video function invokes the program like this (where Videocmd is
the contents of a line in the microvideounit file):
Videocmd imf_image wid hgh

The imf_image is the u8 or s16 imf file that shall be created. The width
and height are specified by wid and hgh.

☞ It is possible to pass extra parameters to the program by adding


them after the program name in the microvideounit file.

The .microgeoscale file


The .microgeoscale file in your home directory stores the geometric scale
factors that have been defined. The scale factor file is read each time the
microGOP is started. There is no .microgeoscale file supplied in the
release, it is created when you run microGOP 2000/S. Geometric scale
factors are handled by the Define Scale and Set Scale functions in the
Etc function group.
Each line in the .microgeoscale file have the following format:
name unit pixel_length
Example of a .microgeoscale file:
100x micron 0.1741428077
20x micron 0.8810380101

C-20 microGOP 2000/S User’s Guide


Configuring the microGOP 2000/S Appendix C

The microprofile file


The microprofile file is read at start-up time. It sets the values for some
parameters in microGOP 2000/S. Some parameters are initial settings
that can be changed from within microGOP while others last throughout
the whole microGOP session. If a parameter is not set in microprofile it
obtains a default value.
This file is located in the release directory. The file should be copied to
the users home directory if changes should be made to it.
% cp /opt/CVmg2000S/microprofile ~/.microprofile

☞ The name should be .microprofile on the users home directory.


☞ The personal file will, if it exists, be used instead of the one on the
release directory.
The syntax in the microprofile file is
Keyword: value
In this section the parameters are represented as
Keyword: value [ Range / Legal values ]

Description of keywords and values


Hardcopy.Device: microlp
This is the command that is used when an image shall be printed
with the Hardcopy function. The script microlp is used by default
but this can be changed if for instance a special high quality printer
exists. If there for instance is a high quality printer connected to the
printer device kodak the line could look like this instead:
Hardcopy.Device: lp -o nobanner -dkodak
Printer.Command: microlp
This command is used for all printouts.
Mouse.Tty: /dev/ttya
This entry specifies on which terminal port the DCP mouse
connection should be connected. This is only useful if you have a
DCP with no separate mouse.
Mouse.Speed: 9600
The default baud rate for the DCP mouse connection.

microGOP 2000/S User’s Guide C-21


Appendix C Configuring the microGOP 2000/S

Stage.Resolution: 200
The scan stage motor resolution in steps/mm.
Stage.BaudRate: 2400 [300-38400]
The baudrate for the serial communication. The speed must match
the speed of the scan stage controller.
Stage.Step: 1
The number of steps to move the scanstage motors for each
microGOP 2000/S step. (May be useful for some stage controllers).
Stage.Device: /dev/ttyb
Specifies the terminal port to connect the scanstage controller to.
Stage.AF_Threshold: 16
The default threshold value used in the Autofocus function.
Stage.AF_Delay: 3
The default delay value used in the Autofocus function.
Stage.AF_MaxStep: 10⋅Stage.Resolution
The maximum allowed number of steps in the Autofocus function.
Stage.ZInit: On [Off, On]
Enables the use of the Stage.ZInitValue tag.
Stage.ZInitValue: 500000
The initial Z position, set when calibrating the scan stage.
Stage.ZInit must be On.
Video.SunVideo_Device: /dev/rtvc0
The device name for the SunVideo card that shall be used.
Video.Slic_Device: /dev/slv0
The device name for the SLIC card that shall be used.
Video.Slic_Sync_Count: 2
Video.Snapper_Device_Nbr: 0
The device number for the Snapper 8/24 video cards.

C-22 microGOP 2000/S User’s Guide


Configuring the microGOP 2000/S Appendix C

Video.Dig16_Device_Nbr: -1 (= automatic)
The device number for the Snapper DIG16 digital camera frame
grabber.
Video.Dig16_Tty: /dev/ttya
The serial port for serial communication with digital camera.
Video.Dig16_Tty_Baud: 9600
The speed for serial communication with digital camera.
AutoDestination.DCP: Off [ Off, On ]
Defines if the DCP should be used as default destination when
automatic image display is enabled.
AutoUpdate.Window: On [ On, Off ]
Set if the automatic image displayed is enabled or not.
AutoUpdate.WindowWhenClosed: On [ On, Off ]
Set if the automatic image displayed is enabled when the microGOP
is iconified.
AutoUpdate.ImageTool: On [ On, Off ]
Set if the image in Image Tool should be updated whenever the
image content changes.
LoadImage.LoadMode: Adapt [Adapt, Resample]
Specifies if the microGOP should use Adapt or Resample as default
in the Load Image function.
LoadImage.Warning: No [No/Yes]
Specifies if warnings should be given when the image size changes
when a new image is loaded.
Trace.ProgramList: On [ On, Off ]
Trace.Footer: On [ On, Off ]
Select if the program flow should be traced in the Image Processing
window footer or in the program list.

microGOP 2000/S User’s Guide C-23


Appendix C Configuring the microGOP 2000/S

Zoom.Width: 300
Zoom.Height: 300
The default width and height of the Zoom window.
Zoom.X: 545
Zoom.Y: 128
The default x and y coordinates for the top left corner of the zoom
window.
Color.NUntouched: 64
For debugging purposes only.
Sid.FGColor: ff0000
Sid.BGColor: 00ff00
The default foreground and background plane colors for the Image
Display window.
Sid.FGMode: Opaque [Opaque, Transparent]
Sid.BGMode: Opaque [Opaque, Transparent]
Sets the default type of foreground and background plane in the
Image Display window.

The Object Histogram settings:


ObjHist.TxtColor:
black [red, yellow, turquoise, black, grey]
The color of the text in the Object Histogram.
ObjHist.AxisColor:
black [red, yellow, turquoise, black, grey]
ObjHist.BarColor:
red [red, yellow, turquoise, black, grey]
The color of the histogram axes and bars.
ObjHist.Height: 600
ObjHist.Width: 500
Total height and width of the histogram (in pixels).
ObjHist.Filled: Stippled [Solid, Stippled, None]
The style of the histogram bars.

C-24 microGOP 2000/S User’s Guide


Configuring the microGOP 2000/S Appendix C

ObjHist.XTicks: 15
ObjHist.YTicks: 10
The number of ticks for the x- and y-axes (approximately).
ObjHist.Font:
-adobe-times-bold-r-normal--14-140-75-75-p-77-iso8859-1
The font to be used for the text in the histogram. The UNIX
command xlsfonts displays a list of available fonts. The X server’s
default font is obtained if no ObjHist.Font (or default) is specified.
ObjHist.PmpWidth: 500
ObjHist.PmpHeight: 500
Default size for printing on file.
ObjHist.Ruling: Yes [Yes, No]
The histogram background can be cross-ruled for ease of reading out
the bars.
ObjHist.Rulespace: Dense [ Loose, Dense ]
The ruling can be loose or dense.
ObjHist.RuleColor:
Turquoise [red, yellow, turquoise, black, grey]
The color of the ruling.

Scattergram, Image histogram, Area Fraction settings:


The Scattergram, Image histogram and Area Fraction diagrams take the
same parameters with a few exceptions.
Scat.TxtColor:
black [red, yellow, turquoise, black, grey]
Scat.AxisColor:
black [red, yellow, turquoise, black, grey]
Scat.BarColor:
red [red, yellow, turquoise, black, grey]
Scat.Height: 600
Scat.Width: 500
Scat.XTicks: 15
Scat.YTicks: 15
Scat.Font: -adobe-times-bold-r-normal--14-140-75-75-p-77-iso8859-1

microGOP 2000/S User’s Guide C-25


Appendix C Configuring the microGOP 2000/S

Scat.PmpWidth: 500
Scat.PmpHeight: 500
Scat.Ruling: Yes [ Yes, No ]
Scat.Rulespace: Dense [ Loose, Dense ]
Scat.RuleColor:
Turquoise [red, yellow, turquoise, black, grey]
GreyHist.TxtColor:
black [red, yellow, turquoise, black, grey]
GreyHist.AxisColor:
black [red, yellow, turquoise, black, grey]
GreyHist.BarColor:
red [red, yellow, turquoise, black, grey]
GreyHist.Height: 600
GreyHist.Width: 500
GreyHist.Filled: Stippled [Solid, Stippled, None]
GreyHist.XTicks: 15
GreyHist.YTicks: 10
GreyHist.Font:
-adobe-times-bold-r-normal--14-140-75-75-p-77-iso8859-1
GreyHist.PmpWidth: 500
GreyHist.PmpHeight: 500
GreyHist.Ruling: Yes [ Yes, No ]
GreyHist.Rulespace: Dense [ Loose, Dense ]
GreyHist.RuleColor:
Turquoise [red, yellow, turquoise, black, grey]
AreaFract.TxtColor:
black [red, yellow, turquoise, black, grey]
AreaFract.AxisColor:
black [red, yellow, turquoise, black, grey]
AreaFract.BarColor:
red [red, yellow, turquoise, black, grey]
AreaFract.Height: 600
AreaFract.Width: 500
AreaFract.Filled: Stippled [Solid, Stippled, None]

C-26 microGOP 2000/S User’s Guide


Configuring the microGOP 2000/S Appendix C

AreaFract.PTicks: 15
Number of ticks (appr.) on the y axis.
AreaFract.Font:
-adobe-times-bold-r-normal--14-140-75-75-p-77-iso8859-1
AreaFract.TextswFont:
-adobe-courier-bold-o-normal--14-140-75-75-m-90-iso8859-1
The font to be used in the text list presented beside the diagram. The
X server’s default font is obtained if no AreaFract.TextswFont (or
default) is specified.
AreaFract.PmpWidth: 500
AreaFract.PmpHeight: 500
AreaFract.Ruling: Yes [ Yes, No ]
AreaFract.Rulespace: Dense [ Loose, Dense ]
AreaFract.RuleColor: Turquoise
Measure.PupStrategy: Keep [Remove, Keep]
The pop-up windows produced by Object Histogram, Scattergram,
Image Histogram and Area Fraction can be removed as soon as a
new function is selected or they can remain on the screen.
Measure.TmpDir: /tmp
The Measure functions create temporary files that may become very
large. /tmp is the correct place to store temporary files. If there is not
enough room on the / partition another directory can be specified
instead.

microGOP 2000/S User’s Guide C-27


Appendix C Configuring the microGOP 2000/S

The microdcpmenu file


This file defines the contents of the DCP menu. The format of the file is
described together with the DCP Command function in the Etc function
group.

Temporary files
The following temporary files are created by microGOP 20000/S. They
need not be examined or handled by the user. Some of these file may
become very big and cause disk space problems. Therefore you should
be aware of their existence. They all reside in the directory /tmp unless
otherwise stated in the file .microprofile.
microGOP-<PID>-areafraction
microGOP-<PID>-psobjhistogram
microGOP-<PID>-psscattergram
microGOP-<PID>-psareafraction
microGOP-<PID>-psgreyhistogram
microGOP-<PID>-list_screen
microGOP-<PID>-list_printerpr
microGOP-<PID>-basics_file
microGOP-<PID>-<scattergramname>-scatdata
This file may become very large for large measurements.
<PID> is the process number for the microGOP 20000/S that created the
file. This is so that multiple microGOPs can run on the same host. The
files above are all removed when microGOP 2000/S is exited.
If you run into space problems change the tmp directory to another
partition where there is more space. See the section The microprofile file
above, setting Measure.TmpDir, page C-27.

Postscript files
The Object Histogram, Scattergram, Area Fraction and Image
Histogram are sent to the printer as Postscript™ files. For a scattergram
the size of the Postscript file is proportional to the number of objects.
This may cause problems when many objects are present ( > 100 000).
The file can choke the lp spooler and it will take a long time to print on
the laser printer. ( You can notice the same effect when printing the
scattergram on the screen).

C-28 microGOP 2000/S User’s Guide


Image copy rules Appendix D

Appendix D: Image copy rules


This appendix describes the implicit rules that are used when images are
copied between the different image formats that are used in the
microGOP 2000/S.

D.1 How are grey scale and binary images


copied ?
The basic rule when image pixels are copied from one format to another
is that the pixel values should be kept if possible. This means that
copying from a “smaller” to a “larger” format is very natural: the pixel
value is kept.
Example: A binary image that is copied to any other format will keep the
pixel values 0 and 1.
Copying from a “larger” to a “smaller” format is more complicated since
it might not be possible to fit large pixel values from one image into an
image where the maximum pixel value is smaller. The main rule in this
case is that the pixel values that can be copied without problem are
copied as is. The pixel values that are to large (or small) will be set to the
largest (or smallest) pixel value that is possible in the destination image.
Example: Copying a 16-bit grey scale image with pixel values in the
range 0-4095 (like an MR image) to a 8-bit grey scale image will keep the
pixel values between 0-255 intact. Pixel values that are larger than 255 in
the 16-bit image will be set to 255 in the 8-bit grey scale image.

D.2 How are Gop images copied ?


The Gop images have two values for every pixel, a magnitude and an
argument. The main rule is that only the magnitude part of the image is
involved when copying from and to a grey scale or binary image. Any
magnitude values that are to large to fit in the destination image are set
to the maximum value which is possible.
The exception from this rule is when images are copied from a gop
image to a complex c32 image. The polar pixel values in the Gop image
are converted to a cartesian float values in the c32 image.

☞ The argument pixel values in the Gop images are 8-bit values in the
range -128 to + 127. These values represent the angle -π to π.

microGOP 2000/S User’s Guide D-1


Appendix D Image copy rules

D.3 How are c32 images copied ?


The cartesian float values in the c32 image are converted to polar values
before any copying is made. This polar value is used if the destination is
a Gop image. Any magnitude pixel values that are larger than 255 are set
to 255.
Only the magnitude part of the polar value is used if the destination is a
binary or grey scale image. Any magnitude values that are to large to fit
in the destination image are set to the maximum in the destination
image.

D-2 microGOP 2000/S User’s Guide


microGOP 2000/S User’s Guide Index

A Display Control Processor, 1-1


DISPLAY environment variable, C-4
A priori probability, 3-13-8
Display images, 2-8
About microGOP, 2-4
Distance, 2-30
Accumulated mapping, 2-43
Drag & drop functions, 2-56
ADJUST button, A-1
Draw graphics, 2-31, 4-38
Auto display destination, 3-3-8
Draw Tool, 2-31
Autocorrelation model, 3-13-9
Automatic image update, 3-3-8 E
B Edit menu, 2-57
Edit program, 2-60
Background overlay, 2-15
EDITOR environment variable, C-4
Background pixel, 3-8-1
Environment variable setup, C-3
BG, 2-15
Environment variables, C-2
Binary function group, 3-8-1
DISPLAY, C-4
Binary images, 2-6
EDITOR, C-4
Box classification, 3-13-3
IMBUFFERPATH, C-2
Brightness/Contrast Control, 2-17
IMGPATH, C-3
Bug fixes, C-1
PATH, C-2
C SMICROHOME, C-2
SMICROOPTIONS, C-7
CDE, B-1 Error messages, B-5
Changes, C-1 Etc function group, 3-3-1
Classification job, 3-13-9 Example programs, C-9
Classify function group, 3-13-1 External data, 4-24
Color Table menu, 2-47
Color tables, 2-38 F
Colors menu, 2-38
Fast Fourier Transform, 3-12-3
Command line options, C-6
Feature images, 3-13-9
Common Desktop Environment, B-1
Feature space, 3-13-2
Complex c32 images, 2-6
Feature vector, 3-13-1, 3-13-2
Configuring the microGOP 2000/S, C-1
Features
Connectivity, 3-8-2
Area, 3-10-3
Continue button, 2-4, 2-57
Cent GravX, 3-10-4
Copy graphics to image plane, 2-37
Cent GravY, 3-10-4
Copy graphics to overlay plane, 2-37
Compact, 3-10-3
Current working directory, 3-3-8
D Max, 3-10-4
c32 image, 2-6
D Max Ang, 3-10-4
D E Comp, 3-10-3
Eq Diameter, 3-10-3
DCP, 1-1, B-3 Feret X, 3-10-3
Dcp menu, 2-5 Feret Y, 3-10-3
Defined Variables, 2-3 FeretComp, 3-10-3
Display basics statistics, 2-55
microGOP 2000/S User’s Guide I-1
Index microGOP 2000/S User’s Guide

Length, 3-10-4 estimation, 3-12-7


Max X, 3-10-3 Butterworth filter, 3-12-20
Max Y, 3-10-3 Calculate, 3-7-14
Min X, 3-10-3 Calculate, Fourier Domain, 3-12-13
Min Y, 3-10-3 Calibrate, 3-4-2
Mom Ang, 3-10-4 Chaincode, 3-8-21
Moment X, 3-10-4 Classify, 3-10-5
Moment Y, 3-10-4 Clear Image, 3-2-17
Perimeter, 3-10-3 Close, 3-8-10
Ratio, 3-10-4 Color Convert, 3-2-20
Width, 3-10-4 Comment, 3-5-27
FFT, 3-12-3 Conv 3x3, 3-7-13
FFT function group, 3-12-1 Convolution, 3-12-5
FG, 2-15 Copy Image, 3-2-13
File menu, 2-1 Correlation, 3-12-6
Files used by microGOP 2000/S, C-8 Create Binary, 3-10-7
Fit Window menu, 2-49 Crop Image, 3-2-15
Float variables, 4-2 DCP Command, 3-3-17
Foreground overlay, 2-15 Define Scale, 3-3-3
Frame grabbers, 3-2-4, C-13 Define Slide, 3-4-3
Function groups, 2-10, 3-1-1 Defocus filter, 3-12-18
Binary, 3-1-2, 3-8-1 Dilate, 3-8-4
Classify, 3-1-3, 3-13-1 Display, 3-2-21
Etc, 3-1-1, 3-3-1 Display Label, 3-2-10
FFT, 3-1-3, 3-12-1 DisplayClass, 3-13-21
Gop, 3-1-2, 3-6-1 Distance Map, 3-8-22
Grey, 3-1-2, 3-7-1 Dump, 3-10-20
Image, 3-1-1, 3-2-1 End Loop, 3-5-5
Measure, 3-1-2, 3-10-1 Equalizer filter, 3-12-15
Morphology, 3-1-2, 3-9-1 Erode, 3-8-3
Program, 3-1-1, 3-5-1 Exor, 3-8-19
Scanstage, 3-1-1, 3-4-1 Exponential filter, 3-12-17
Stereology, 3-1-3, 3-11-1 FFT (Fast Fourier Transform), 3-12-3
Functions Fill, 3-8-12
Affine, 3-3-10 Frame Loop, 3-5-4
And, 3-8-17 From Dcp, 3-2-19
Applicability, 3-12-21 From Display, 3-2-3
Area Fraction, 3-10-17 Gauss filter, 3-12-16
Autofocus, 3-4-10 Geometry, 3-3-11
Average, 3-7-7 Goto, 3-5-7
Basics, 3-10-14 Grey Close, 3-9-8
Black Top Hat, 3-9-3 Grey Dilate, 3-9-6
BT Power Spectral Density Grey Erode, 3-9-5

I-2 microGOP 2000/S User’s Guide


microGOP 2000/S User’s Guide Index

Grey Histogram, 3-10-22 Prewitt, 3-7-11


Grey Open, 3-9-7 Radial Power Spectral Density, 3-12-
Grey16Range, 3-3-9 9
Hardcopy, 3-2-12 Rank, 3-7-9
Histogram, 3-10-8 Retrieve, 3-10-21
Hull, 3-8-13 Return, 3-5-10
If Expression, 3-5-14 RGB Display, 3-2-11
If External, 3-5-13 Richardsson-Lucy Restoration, 3-12-
If Feature, 3-5-15 10
If Query, 3-5-11 Rotate, 3-3-16
ImClassify, 3-13-10 Save Image, 3-2-8
Intercept, 3-11-2 Scan, 3-4-9
Inverse FFT, 3-12-4 Scattergram, 3-10-15
Invert, 3-7-17 Separate, 3-8-11
Label, 3-5-6 Set Position, 3-4-6
Laplace, 3-7-12 Set Scale, 3-3-2
Line Ends, 3-8-7 Set Slide, 3-4-5
Line Ends 2, 3-8-8 Set Z Position, 3-4-7
List, 3-10-12 Settings, 3-3-8
Load Image, 3-2-5 Shading, 3-7-3
Loop, 3-5-2 Shell, 3-5-16
Mask, 3-7-15 Show Image Info, 3-2-9
Match, 3-8-15 Show Measure Area, 3-3-6
Mean Surface to Volume Ratio, 3-11- Show Position, 3-4-8
13 Skeleton, 3-8-6
Measure, 3-10-2 Slide Loop, 3-5-3
Measure Area Mask, 3-3-7 Sobel, 3-7-10
Measure Circle, 3-3-5 Stop, 3-5-8
Measure Frame, 3-3-4 Stretch, 3-7-5
Median, 3-7-8 Sub, 3-8-20
Message, 3-5-19 Subroutine, 3-5-9
Morphological Gradient, 3-9-2 Surface Area per Unit Volume, 3-11-
Motion filter, 3-12-19 10
Normalized Averaging, 3-12-12 Synchronize, 3-4-12
Not, 3-8-16 Thresh, 3-7-4
Notice, 3-5-17 Timer, 3-5-25
Open, 3-8-9 To Dcp, 3-2-18
Or (binary), 3-8-18 To Display, 3-2-2
Or (grey), 3-7-16 Touch, 3-8-14
Pause, 3-5-26 Variable, see also Variable
Perspective, 3-3-14 functions, 3-5-20
Point Erode, 3-8-5 Video, 3-2-4
Present, 3-5-21 Volume Weighted Mean Volume, 3-

microGOP 2000/S User’s Guide I-3


Index microGOP 2000/S User’s Guide

11-7 Images in microGOP 2000/S, 2-6


Watershed, 3-9-9 IMBUFFERPATH environment variable,
White Top Hat, 3-9-4 C-2
Wiener filter, 3-12-14 IMGPATH environment variable, C-3
Inner border, 3-8-2
G Insert arrow, 2-10
General Operator Processor, 1-1 Insert program, 2-2, 2-59
Geometrical transformations, 3-3-11 Integer variables, 4-2
Geometry Tool, 2-3, 3-3-12
GOP, 1-1, 3-6-1, 3-7-1, B-3 L
Gop function group, 3-6-1 License key, B-2
GOP images, 2-6 License key file, C-5
Grab an image, 2-51 Linear discrimination, 3-13-8
Graphics plane, 2-15 Load program, 2-1
Grey function group, 3-7-1 Logging in, 1-2
Grey scale images, 2-6
M
H Mahalanobis distance, 3-13-8
Histogram, 3-5-24, 3-10-8, 3-10-22 Map, 2-39
Map Under, 2-29
I Math functions, 4-13
Icon, 1-5 Maximum Likelihood, 3-13-5
Image buffer files, C-8 Measure area, 3-3-6, 3-3-7
Image buffers, 2-6, 4-25 Measure circle, 3-3-5
Image classification, 3-13-1 Measure frame, 3-3-4
Contextual methods, 3-13-6 Measure function group, 3-10-1
Non-contextual methods, 3-13-5 Measure object features, 3-10-1
Owen, Hjort & Mohn (OHM), 3-13-6 Measure objects in the image, 2-54
Switzer, 3-13-7 MENU button, A-1
Welch, Salter & Haslett (WSH), 3-13- microdcpmenu file, 3-3-17, C-28
7 microgeoscale file, C-20
Image copy rules, D-1 microGOP Setup window, B-3
Image Display, 2-3, 2-15 microimagesize file, C-12
Image function group, 3-2-1 microimagetype file, C-10
Image Information, 2-3, 2-14 microloadprogram file, C-9
Image Overview, 2-3, 2-11 microprofile file, C-21
Image plane, 2-15 microvideounit file, C-13
Image Processing window, 2-3, 2-10 Minimum Distance, 3-13-5
Image Sequence, 2-3, 2-13 MIP, 1-1, 3-6-1, 3-7-1, B-3
Image size, 2-6, 2-7, 3-3-8, 4-25 Mixing images, 3-7-16
Image Tool, 2-3, 2-7 Morphology function group, 3-9-1
Image types, 1-4, C-11, C-12 Mouse, A-1
Image width/Image height, 3-3-8

I-4 microGOP 2000/S User’s Guide


microGOP 2000/S User’s Guide Index

N R
Neighbourhood, 3-8-1 README file, C-1
New program, 2-2 Reject class, 3-13-8
Residuals, 3-3-13
O Rubber Band Box, 2-29
Object features, see also Features, 3-10-3 Rubber Band Circle, 2-30
Object pixel, 3-8-1 Rubber Band Line, 2-30
On-line help, 1-4 Run a program, 2-57
OPEN LOOK, 1-2 Run button, 2-4
OPEN LOOK concepts, A-1
openwin, B-1 S
OpenWindows, 1-3, B-1 Sample session, 2-51
Operating system, 1-5 Save From Display menu, 2-49
Optional hardware, 1-1 Save program, 2-2, 2-57
Options, B-3, C-7 Scale factor, 3-3-2, 3-3-3
Outer border, 3-8-2 Scanstage function group, 3-4-1
Outline Tool, 2-31 Scattergram, 3-5-23, 3-10-15
Overlay planes, 2-15 SELECT button, A-1
Overlay settings, 2-28 Set the active SID tool, 4-35
Overlays menu, 2-48 SID, 2-15
SID menu, 2-16
P SID planes, 2-15
Paint, 2-26 SID Tool Properties, 2-38
Paint color, 2-27 SID Tools
Parameter area, 2-10 Brightness/Contrast Control, 2-17
PATH environment variable, C-2 Draw, 2-31
Pixel Value, 2-24 Outline, 2-31
Point Window, 3-10-6 Paint, 2-26
Postscript files, C-28 Pixel Value, 2-24
Present grey scale data, 3-10-1 Rubber Band Box, 2-29
Present object features, 3-10-1 Rubber Band Circle, 2-30
Program execution trace, 3-3-8 Rubber Band Line, 2-30
Program function group, 3-5-1 Train, 3-13-12, 3-13-18
Program list, 2-10 Zoom, 2-20
Programming language, 4-1 Zoom/Pan, 2-18
Program, how to make, 2-56 SID Tools menu, 2-16
Properties menu, 2-4 Slicing, 2-44
Pseudo colors, 2-46 smicro, B-1
PseudoColor default visual, 1-4, B-1 SMICROHOME environment variable,
C-2
Q SMICROOPTIONS environment
Quadratic discrimination, 3-13-8 variable, C-7
Quit, 2-2 Soft Image Display, 2-15

microGOP 2000/S User’s Guide I-5


Index microGOP 2000/S User’s Guide

Starting microGOP, 1-3, B-1 MESSAGEGLYPH, 4-47


Starting the X server, B-1 POSITION, 4-47
Step button, 2-4 SLIDER, 4-47
Stereology, 3-11-1 THRESHGREY, 4-48
chords, 3-11-2 UI_CONTINUE_ACTION, 4-49
intercepts, 3-11-2 UI_TIMEOUT, 4-49
intersections, 3-11-2 VALUE, 4-47
Stereology function group, 3-11-1 Unix, 1-5
Stop button, 2-4, 2-57 User interfaces, to create, 4-46
String functions, 4-14
String to value functions, 4-19 V
String to vector function, 4-19 Variable binding, 4-51
String variables, 4-2 Variable functions
System configuration, 1-1 file, 4-33
System variables, 4-7 GetData, 4-24
Grey Histogram variables, 3-10-23 GetIntensity, 4-34
Intercept variables, 3-11-5 GetPixel, 4-26
GetPixels, 4-26
T Graphics, 4-38
Temporary files, C-28 ImageClear, 4-25
Texture, 3-6-1 ImageInfoGet, 4-18
The Train window, 3-13-12 ImageInfoSet, 4-18
Threshold the image, 2-53 ImageName, 4-17
Tools menu, 2-16 ImageOverview, 4-17
Top Hat, 3-9-3, 3-9-4 ImageOverviewFile, 4-17
Train image, 3-13-9 ImageOverviewPath, 4-17
Training, 3-13-1, 3-13-4 ImageSize, 4-25
Training area, 3-13-3, 3-13-4, 3-13-12, 3- Math functions, 4-13
13-18 MessageWindow, 4-31
Transformation polynomials, 3-3-11, 3- mktemp, 4-14
3-12 ObjectKeep, 4-33
TrueColor default visual, 1-4, B-1 SetPixel, 4-26
Tutorial, 2-51 SetPixels, 4-26
Type text, 2-31 SidDisplayXImage, 4-37
SidGetXImageAsRGB, 4-28
U SidSaveXImage, 4-37
UI elements, 4-47 SidSaveXImageAsRGB, 4-28
BINARY, GREY, GREY16, GOP, SidSliceColor, 4-37
C32, 4-47 SidTool, 4-35
BUTTONS, 4-48 strformat, 4-15
BUTTON_TEXT, 4-49 String functions, 4-14
EXCLUSIVE, 4-48 String to value functions, 4-19
MESSAGE, 4-47 String to vector function, 4-19

I-6 microGOP 2000/S User’s Guide


microGOP 2000/S User’s Guide Index

strlen, 4-19 Operators, 4-5


strtok, 4-16 Set the active SID tool, 4-35
system, 4-17 System variables, 4-7
timer, 4-14 Types, 4-1
tochar, 4-14 User interfaces, to create, 4-46
toint, 4-19 Variable binding, 4-51
toints, 4-19 Variable definition, 4-2
tostring, 4-14 While expression, 4-30
tovalue, 4-19 Write and writeln statements, 4-32
tovector, 4-19 Vector functions, 4-20
Ui, 4-46 Vectors, 4-3
undef, 4-4 Video commands, C-13
vclass, 4-23 Video frame grabbers, 3-2-4, C-13
vconvolve, 4-22 View menu, 2-3
vcreate, 4-20
vdim, 4-21 W
vec, 4-21 Watershed, 3-9-9
Vector functions, 4-20 Windowing, 2-39
vindex, 4-21 Windows
vinit, 4-20 About microGOP, 2-4
vlut, 4-22 Defined Variables, 2-3
vmask, 4-22 Geometry Tool, 2-3, 3-3-12
vmax, 4-21 Image Display, 2-3, 2-15
vmean, 4-21 Image Information, 2-3, 2-14
vmin, 4-21 Image Overview, 2-3, 2-11
vramp, 4-21 Image Processing, 2-3, 2-10
vsort, 4-21 Image Sequence, 2-3, 2-13
vstddev, 4-21 Image Tool, 2-3, 2-7
vsum, 4-21 microGOP Setup window, B-3
vtranspose, 4-22 Point, 3-10-6
vtrunc, 4-22
WriteImage, 4-28 X
writeln, 4-32 X bitmap, 4-47, C-12
#include, 4-45 X server, B-1
{ ... }, 4-20 X Window System, 1-2
Variables, 4-1
Comments, 4-6 Z
Continuing statement character, 4-6 Zoom, 2-18, 2-20
Draw graphics in SID, 4-38 Zoom factor, 2-18, 2-20
If expression, 4-29 Zoom Properties menu, 2-22
Include files, 4-45 Zoom/Pan, 2-18
Intercept variables, 3-11-5
Object feature classification, 4-33

microGOP 2000/S User’s Guide I-7


Index microGOP 2000/S User’s Guide

16-bit Grey scale images, 2-6, 3-3-9


24-bit display, 1-4
4-connectivity, 3-8-2
8-bit display, 1-4
8-bit Grey scale images, 2-6
8-connectivity, 3-8-2

I-8 microGOP 2000/S User’s Guide

S-ar putea să vă placă și