DigiFlow User Guide

Version 3.0, June 2008

 

© Dalziel Research Partners
2000 – 2008



Contents

1 Introduction. 1

1.1 History. 1

1.2 Key features. 2

1.3 User guide. 2

2 Installation. 3

2.1 Basic installation. 3

2.2 Windows configuration. 3

2.2.1 Basic configuration. 3

2.2.2 Encapsulated PostScript configuration. 4

2.2.3 Additional memory. 5

2.3 Installation with framegrabber 6

2.3.1 Framegrabber installation. 6

2.3.2 Camera configuration. 6

2.3.3 Local security policy. 6

2.3.4 Video capture configuration. 7

3 Basics. 8

3.1 Starting DigiFlow.. 8

3.2 Main Window.. 10

3.3 Image Selectors. 11

3.4 Sifting. 12

3.5 DigiFlow Macros. 12

3.6 Threads. 12

3.7 Text output 13

4 Common dialogs. 15

4.1 Open Image. 15

4.2 Save Image As. 17

4.3 Sifting input streams. 18

4.3.1 Selector timing. 18

4.3.2 Selector region. 20

4.3.3 Matching intensities. 22

4.4 Modifying output streams. 24

4.4.1 Setting output stream colour. 24

4.4.2 Full colour. 25

4.4.3 File format 25

4.4.4 First index. 25

4.4.5 Resampling. 26

4.4.6 Save user comments. 26

4.4.7 Encapsulated PostScript streams. 26

4.5 dfc Help. 27

4.6 Code library. 29

5 Menus. 31

5.1 File. 31

5.1.1 Open Image. 31

5.1.2 Run Code. 31

5.1.3 Save As. 31

5.1.4 Live Video. 31

5.1.5 Edit Stream.. 38

5.1.6 Merge Streams. 39

5.1.7 Export AVI 40

5.1.8 Print View.. 42

5.1.9 Print Visible View.. 42

5.1.10 Export to EPS. 42

5.1.11 Export Visible to EPS. 45

5.1.12 Close. 45

5.1.13 Exit 45

5.2 Edit 45

5.2.1 Copy. 45

5.2.2 Zoomed Copy. 45

5.2.3 Properties. 46

5.2.4 Coordinates. 48

5.2.5 Region. 52

5.2.6 Process again. 53

5.2.7 Dialog responses. 53

5.2.8 dfcConsole. 54

5.3 View.. 57

5.3.1 Zoom.. 57

5.3.2 Fit Window.. 58

5.3.3 Cursor. 58

5.3.4 Vectors. 59

5.3.5 Appearance. 60

5.3.6 Colour scheme. 60

5.3.7 Toggle colour. 63

5.3.8 Toolbar. 63

5.3.9 Slaves. 63

5.3.10 Threads. 65

5.3.11 Pause all threads. 66

5.3.12 Refresh. 66

5.3.13 In Parallel 66

5.4 Create. 67

5.5 Sequence. 67

5.5.1 Animate. 67

5.6 Analyse. 70

5.6.1 Time information. 70

5.6.2 Ensembles. 84

5.6.3 Dye images. 86

5.6.4 Synthetic schlieren. 93

5.6.5 Particles. 118

5.6.6 Particle Tracking Velocimetry. 132

5.6.7 Optical flow.. 154

5.7 Tools. 159

5.7.1 Recipe. 159

5.7.2 Transform intensity. 160

5.7.3 Combine images. 168

5.7.4  Slave process. 173

5.7.5 To world coordinates. 174

5.8 Window.. 176

5.9 Help. 176

5.9.1 Help (browser) 176

5.9.2 dfc Help. 176

5.9.3 About DigiFlow.. 176

6 Techniques. 178

6.1 Determining black. 178

7 Chaining processes. 180

8 Interpreter basics. 183

8.1 Syntax. 183

8.2 Variables. 184

8.2.1 Simple variables. 184

8.2.2 Compound variables. 184

8.3 Assignment 185

8.4 Arrays. 186

8.5 Lists. 188

8.6 Operators. 189

8.7 Constants. 190

8.8 Execution control 191

8.9 User-defined functions. 193

8.10 User input and ouput 194

8.11 Input of code from files. 195

8.12 Debugging. 195

8.12.1 Error handling. 195

8.12.2 View variables. 196

8.12.3 Messages. 198

8.12.4 Queries. 199

8.12.5 Break points. 199

8.12.6 dfcConsole. 199

9 Functions. 202

9.1 Basic mathematical functions. 203

9.2 String functions. 203

9.3 Array functions. 203

9.4 Type manipulation functions. 203

9.5 Information functions. 204

9.6 Variable functions. 204

9.7 File handling. 204

9.8 Reading and writing images. 205

9.9 Windows and views. 205

9.10 Timing functions. 206

9.11 Statistical functions. 206

9.12 Image processing functions. 207

9.13 Flow functions. 208

9.14 Coordinate functions. 208

9.15 Camera control 208

9.16 Array plotting functions. 209

9.17 Numerical functions. 209

9.18 Differential functions. 210

9.19 Handling threads. 210

9.20 ftp functions. 211

9.21 DirectDraw functions. 211

9.22 GhostScript functions. 211

9.23 Logging. 212

9.24 Registry functions. 213

9.25 Configuration and licence functions. 213

9.26 All functions. 213

10 Macros. 216

10.1 DigiFlow command files. 216

10.1.1 Running processes. 216

10.1.2 Control of input streams. 217

10.1.3 Control of output streams. 221

10.1.4 Chaining responses. 223

10.1.5 Multiple output streams. 224

10.1.6 Accessing dialogs. 224

10.2 Recording user input 225

11 Plotting and drawing. 227

11.1 Drawing commands. 227

11.2 The DigiFlow Drawing format 228

11.3 Simple plot 229

11.4 Text 231

12 Image file formats. 232

12.1 Windows bitmap files (.bmp) 232

12.2 TIFF files (.tif) 232

12.3 GIF files (.gif) 232

12.4 Enhanced metafiles (.emf) 232

12.5 Windows metafiles (.wmf) 233

12.6 Encapsulated PostScript (.eps) 233

12.7 DigiFlow floating point image format (.dfi) 233

12.7.1 Header. 233

12.7.2 Tag. 234

12.7.3 8 bit image (DataType = #1001) 234

12.7.4 8 bit multi-plane image (DataType = #11001) 234

12.7.5 Compressed 8 bit image (DataType = #12001) 234

12.7.6 32 bit image (DataType = #1004) 235

12.7.7 32 bit multi-plane image (DataType = #11004) 235

12.7.8 Compressed 32 bit image (DataType = #12004) 236

12.7.9 64 bit image (DataType = #1008) 236

12.7.10 64 bit multi-plane image (DataType = #11008) 236

12.7.11 Compressed 64 bit image (DataType = #12008) 237

12.7.12 32 bit range (DataType = #1014) 237

12.7.13 64 bit range (DataType = #1018) 237

12.7.14 Rescale image (DataType = #1100) 238

12.7.15 Rescale image rectangle (DataType = #1101) 238

12.7.16 Colour scheme (DataType = #2000) 239

12.7.17 Colour scheme name (DataType = #2001) 239

12.7.18  Colour scheme name variable (DataType = #2002) 239

12.7.19 Description (DataType = #3000) 239

12.7.20 User comments (DataType = #3001) 240

12.7.21 Creating process (DataType = #3002) 240

12.7.22 Creator details (DataType = #3003) 240

12.7.23 Image time (DataType = #3018) 240

12.7.24 Image coordinates (DataType = #4008) 240

12.7.25 Image plane details (DataType = #4108) 241

12.8 DigiFlow Particle tracking format 242

12.9 DigiFlow pixel data format (.dfp) 242

12.10 DigiFlow drawing format (.dfd) 242

12.11 DigImage raw format (.pic) 242

12.12 DigImage compressed format (.pic) 243

12.13 DigImage movie format(.mov or .dfm) 244

13 Configuration files. 247

13.1 DigiFlow_Licence.dfc. 247

13.2 DigiFlow_LocalData.dfc. 248

13.3 DigiFlow_Cameras.dfc. 248

13.4 DigiFlow_Dialogs.dfs. 251

13.5 DigiFlow_Status.dfs. 252

14 Extending DigiFlow.. 255

14.1 Installing extensions. 255

References. 256

Index. 257

15 Licence Agreement 262

Licence: 262

Warranty: 263

Other Conditions: 263

 


1 Introduction

DigiFlow provides a range of image processing features designed specifically for analysing fluid flows. The package is designed to be easy to use, yet flexible and efficient, and includes a powerful yet flexible macro language. Whereas most image processing systems are intended for analysing or processing single images, DigiFlow is designed from the start for dealing with sequences or collections of images in a straightforward manner.

Before installing or using DigiFlow, please read the Licence Agreement (see §15) and ensure you have completed the registration requirements.

1.1 History

The origins of DigiFlow lie in an earlier system by the same author: DigImage. This earlier system, with its origins in 1988 and first released commercially in 1992, pioneered many uses of image processing in fluid dynamics. Utilising its own DOS-extender technology, DigImage existed in the base 640kB of DOS memory (and later from the command prompt under Windows 3.x and 9x), accessing around 12MB of extended memory for image storage and interface with the framegrabber hardware.

To obtain the necessary performance in these early days of image processing on desktop computers, DigImage required a framegrabber card to be installed to provide not only image capture, but also image display and some of the processing. While this close coupling allowed efficient real-time processing and frame-accurate control of a video recorder, it ultimately restricted the development and deployment of the technology. The original ISA bus based Data Translation DT2861 and DT2862 frame grabber cards remained available until 2001, but by that time suitable motherboards had become difficult to source. At time of writing (2007) and despite its reliance on outdated technology, DigImage is still used in many laboratories around the world.

The development of DigiFlow began in 1994, although the project had a number of false starts and development put on hold a number of times due to other commitments. The code of this version has its origins in 1997 as part of the development of synthetic schlieren (see §5.6.4). The computational and resolution requirements for synthetic schlieren could not be accommodated efficiently within the framework of DigImage.

Despite sharing many approaches, algorithms and techniques, DigiFlow does not re-use any of DigImage’s 8Mbytes Fortran 77 and 2MB Assembler source code. The design goals for power, flexibility and efficiency in DigiFlow could only be achieved by starting again from scratch.

DigiFlow builds on experience with DigImage from the user view point to provide a more powerful, more flexible, but simpler interface. It also builds on the programming experience to provide a more flexible, powerful and maintainable code base (now in excess of 13MB of source).

A central feature of DigiFlow is a powerful macro language (dfc) and interpreter. This provides users with an efficient and flexible environment in which to automate and customise processing, as well as proving to be a very useful general computational and plotting tool.

Versions of DigiFlow have been in use in Cambridge since 2000, and at other selected laboratories since 2002. Its wider dissemination began in late 2003 with a series of beta releases. The first commercial release (version 1.0) dates from February 2005, with parallel processing and other technologies providing substantial speed increases being introduced with version 2.0 during 2007. Version 3.0, released in 2008, provides further performance improvements plus a wealth of new processing features.

1.2 Key features

DigiFlow has been designed from the outset to provide a powerful yet efficient environment for acquiring and processing a broad range of experimental flows to obtain both accurate quantitative and qualitative output.

Central to design philosophy is the idea that an image stream may be processed as simply as a single image. Image streams may consist of a sequence of images (e.g. from a ‘movie’), or a collection of images related in some other manner.

Efficiency is obtained through the use of advanced algorithms (many of them unique to DigiFlow/DigImage) for built in processing options.

Power and flexibility are obtained through an advanced fully integrated macro interpreter (using DigiFlow’s dfc macro language) providing a similar level of functionality to industry standard applications such as MatLab. This interpreter is available to the user either to directly run macros, or as part of the various DigiFlow tools to allow more flexible and creative use. Commercial versions of DigiFlow include additional features such as partial compilation to further improve performance.

Although not an essential component, DigiFlow retains the potential DigImage released by the control of a framegrabber. Not only does this greatly simplify the process of running experiments, acquiring images, processing them, extracting and plotting data, but it also enables real-time processing of particle streaks and synthetic schlieren, for example.

1.3 User guide

This User Guide is designed to provide the primary reference for DigiFlow. The User Guide is supplied in both .html and .pdf formats and is linked to the help system within DigiFlow. Pressing the F1 function key within DigiFlow will start a web browser and take you to the most appropriate point in the .html version of the User Guide.

The User Guide is not in itself complete: detailed descriptions of the many functions provided by the macro interpreter may be found in the interactive help system (Help: dfc Functions). The User Guide is also supplemented by a variety of scientific publications that expand on some of the underlying technologies.

The typographical convention used in the User Guide is described below:

 

Typography

Description

Analyse

Windows elements such as prompts, menu items and dialogs.

Expt_A.dfi

File names, etc.

read_image()

Interpreter commands and functions.

:=

Interpreter operators and syntax.

"string"

Interpreter operators and syntax.

# comment

Formal argument names for interpreter functions.

my_image

Variables, numbers, etc., for the interpreter.

file0

Formal argument names for interpreter functions.

 


2 Installation

2.1 Basic installation

DigiFlow is a typical Windows application with a graphical user interface, menus, dialog boxes and toolbars. However, unlike many applications, DigiFlow does not require a special installation procedure, but can simply be copied to the desired directory. In most cases DigiFlow will be delivered in a .zip or self-extracting (.exe) archive file, downloaded from the web. This should simply be unzipped into your selected directory. As such, DigiFlow does not require administrative access to install.

The installed part of DigiFlow consists of DigiFlow.exe, which contains the core functionality, and a range of DLL files that handle specific menu options. DigiFlow also makes use of various global start-up files stored in the same directory.

During use, DigiFlow generates two status files in the directory in which it is started. These are DigiFlow_Status.dfs13.5), which contains a range of information describing the settings, and DigiFlow_Dialogs.dfs13.4), which records your last responses to many of the prompts, etc. By storing this information in the directory in which DigiFlow is started, DigiFlow is able to keep a separate set of information for each user, or for each specific task, without polluting the registry. Additionally, these status files can be deleted or moved as the user wishes. In some circumstances, DigiFlow_Status.dfs may become corrupted. If DigiFlow fails to start, or exhibits unexpected behaviour, you should try removing (or renaming) DigiFlow_Status.dfs to see if this cures the problem.

It is recommended that you use a new directory for each new set of experiments and for each new project. In this way the DigiFlow strategy of storing localised status files will facilitate use of DigiFlow in the various different contexts. In such an environment it is frequently most convenient to start DigiFlow from the command prompt within the appropriate directory structure, although other strategies such as multiple shortcuts or setting up associations for Windows Explorer are also possible.

If you wish to run DigiFlow from a command prompt (strongly recommended), it is worth putting this directory on the path so that DigiFlow may be started by simply typing DigiFlow at the prompt. If you prefer to start DigiFlow from the desktop or start menu, you will need to create a shortcut at that point and set the Start in directory appropriately. It is strongly recommended that you do not run DigiFlow from the directory in which the program resides.

2.2 Windows configuration

2.2.1 Basic configuration

Specification of the file extension for file names within DigiFlow is mandatory in most circumstances as DigiFlow utilises this extension to determine the file type. However, by default, Windows XP hides the extensions to files of known types, a feature that causes problems with DigiFlow. We recommend, therefore, that you turn off this feature. DigiFlow will attempt to do this for itself, but this may not work on some systems. If DigiFlow does not make all extensions visible automatically, then you may achieve this manually through the View tab of Tools: Folder Options under Windows Explorer. Simply remove the check mark from Hide extensions for known file types. Note that this will need to be done for each DigiFlow user.

By default, DigiFlow will not be associated with any file types or extensions. If you wish to make such an association (and thus allow DigiFlow to be started by double-clicking on a file of that type within Explorer), then you should open Explorer and select View, Folder Options then select the File Types tab. We recommend that the following extensions are associated with DigiFlow on all installations: .dfc, .dfd, .dfi, .dft and .dfs. You may also wish to set up associations for other standard image formats such as .bmp, .tif, .png and .jpg.

2.2.2 Encapsulated PostScript configuration

DigiFlow can create Encapsulated PostScript (.eps) files from image and graphical output for incorporation into documents in packages such as LaTeX and Word. This can be achieved either through DigiFlow’s inbuilt .eps facility, or using a Windows printer driver. The former is restricted to bit images (or a rasterised version of graphics), whereas the latter can produce both bit image and vector graphics.

By default, DigiFlow searches for a printer named EPS to use to create the .eps files. Creation of this printer is relatively straight forwards. Start the Add Printer Wizard from the Printers and faxes window, selecting Local printer attached to this computer and using the File: (print to file) port. Select a PostScript printer driver (e.g. the HP C LaserJet 4500-PS) and name the printer “EPS”. (You do not want to make this the default printer, you may, however, wish to share the printer to simplify the setting up of further machines.) For Windows Vista, it is recommended that you download an Adobe PostScript driver from www.adobe.com as some of the drivers distributed with Windows Vista format their PostScript in a manner that inhibits the use of LaTeX packages such as psfrag.

Once the wizard has finished, right-click on the new EPS printer and select Printing preferences. Click on the Advanced button expand Document Options and PostScript Options within it. Under PostScript Output Option select Encapsulated PostScript (EPS), as indicated in figure 1.