>

Table Of Contents

Introduction ............................................................................................ i


Chapter 1 No more loops and more speed ........................................ 1-1

Techniques 1-1

Getting rid of loops 1-1

The Where function 1-2

> and < operators 1-4

# and ## operators 1-5

Recursion 1-7

Accessing arrays in memory order 1-12

Minimizing virtual memory 1-13

Row replacement 1-15

Exercise 1-15

Chapter 2 Regions of Interest ............................................................. 2-1

Techniques 2-1

Background 2-1

Running the Program 2-5

Program Design 2-9

Program Description 2-10

Loading in the image 2-15

Creating a new ROI 2-17

Matching the event with a region 2-25

Deleting a region 2-27

Editing a region 2-29

The magic! 2-37

Exercises 2-44

Chapter 3 Active Contours AKA Snakes ........................................... 3-1

Techniques 3-1

Background 3-1

Running the Program 3-2

Theory 3-6

Program Design 3-9

Program Description 3-10

Exercises 3-31


Chapter 4 Simulated Annealing .................................................... 4-1

Techniques 4-1

Background 4-1

Running the Program 4-2

Theory 4-5

Program Design 4-8

Program Description 4-8

Virtual function 4-24

Virtual procedures 4-26

Exercises 4-27

Chapter 5 Objects ........................................................................... 5-1

Back in the dark ages 5-1

Chapter 6 Objects and GUIs ......................................................... 6-1

Techniques 6-1

Background 6-1

Running the Program 6-1

Program Description 6-2

Chapter 7 Watershed Segmentation ............................................. 7-1

Techniques 7-1

Background 7-1

Running the Program 7-3

Theory 7-8

Program Design 7-13

Program Description 7-15

expand method 7-27

shrink method 7-28

downsample method 7-29

propagateUp method 7-30

calcReverseIndices method 7-32

scanElevation method 7-33

watershed method 7-35

Exercises 7-46

Chapter 8 Compound Objects ...................................................... 8-1

Techniques 8-1

Background 8-1

Running the Program 8-1

Theory 8-3

Program Design 8-3

Program Description 8-6

Incorporating the compound object in some code 8-11

Building the well GUI 8-13

Building the well GUI 8-14

Creation of the colorWell object 8-17

Realization of the application 8-19

User clicks in the color well 8-20

User clicks on one of the color patches of the color choice panel 8-21

User releases the mouse over one of the color wells 8-23

User destroys one of the color wells 8-25

Exercises 8-27