Avizo Users Guide
Avizo Users Guide
Avizo Users Guide
1995-2014
c Konrad-Zuse-Zentrum für Informationstechnik Berlin (ZIB), Germany
1999-2014
c FEI, SAS
Trademark Information:
2014.
c We are constantly improving the performance of our products-all specifications are subject to change without notice.
FEI, the FEI logo, Amira, Avizo, and Open Inventor are trademarks of FEI Company or its affiliates. All other trademarks
belong to their respective owners.
Avizo is being jointly developed by Konrad-Zuse-Zentrum für Informationstechnik Berlin (ZIB) and FEI, SAS.
FEI, SAS is a source licensee of Open Inventor from Silicon Graphics, Inc.
Avizo Earth and the XLVolume extension include user protection under license for Landmark U.S. Patent Numbers 6,765,570.
This manual has been prepared for FEI licensees solely for use in connection with software supplied by FEI and is furnished
under a written license agreement. This material may not be used, reproduced or disclosed, in whole or in part, except as
permitted in the license agreement or by prior written authorization of FEI. Users are cautioned that FEI reserves the right to
make changes without notice to the specifications and materials contained herein and shall not be responsible for any damages
(including consequential) caused by reliance on the materials presented, including but not limited to typographical, arithmetic
or listing errors.
Contents
1 Introduction 1
1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Features overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2.1 Data import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.2 Viewing, navigation, interactivity . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.3 Visualization of 3D Image Data . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.4 Image processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.5 Model reconstruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.6 Visualization of 3D models and numerical data . . . . . . . . . . . . . . . . . 6
1.2.7 General Data Processing and Data Analysis . . . . . . . . . . . . . . . . . . 7
1.2.8 Matlab integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2.9 High Performance Visualization . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2.10 Automation, Customization, Extensibility . . . . . . . . . . . . . . . . . . . 8
1.3 Editions and Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.3.1 Editions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.3.2 Packs available in all editions . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.3.3 Optional packs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.3.4 License keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.4 System Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.4.1 Graphics Cards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.4.2 Firewall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.4.3 Microsoft Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.4.4 Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.4.5 Mac OS X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.5 Avizo License Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.5.1 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.5.2 About Avizo licensing management . . . . . . . . . . . . . . . . . . . . . . . 19
1.5.3 License manager actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.5.4 Licensing troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.5.5 Contacting the license administrator . . . . . . . . . . . . . . . . . . . . . . 30
1.6 Data Import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
1.7 First steps in Avizo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
1.8 Contact and Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3 Getting Started 37
3.1 Start the program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.2 Loading Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.3 Invoking Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.4 Visualizing Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.5 Interaction with the Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
ii CONTENTS
4.2.2 Simple Data Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
4.2.3 Resampling the Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
4.2.4 Displaying an Isosurface . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
4.2.5 Cropping the Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
4.2.6 Volume Rendering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
4.3 Segmentation of 3D Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
4.3.1 Interactive Image Segmentation . . . . . . . . . . . . . . . . . . . . . . . . . 67
4.3.2 Volume Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
4.3.3 Threshold Segmentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
4.3.4 Refining Threshold Segmentation Results . . . . . . . . . . . . . . . . . . . 70
4.3.5 More hints about segmentation . . . . . . . . . . . . . . . . . . . . . . . . . 71
CONTENTS iii
6.7.1 Basic computational tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
6.7.2 Tensor data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
9 Deconvolution 109
9.1 General remarks about image deconvolution . . . . . . . . . . . . . . . . . . . . . . 110
9.2 Data acquisition and sampling rates . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
9.3 Standard Deconvolution Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
9.4 Blind Deconvolution Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
9.5 Bead Extraction Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
9.6 Performance issues and multi-processing . . . . . . . . . . . . . . . . . . . . . . . . 125
iv CONTENTS
10.1.1 File Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
10.1.2 Edit Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
10.1.3 Project Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
10.1.4 View Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
10.1.5 Window Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
10.1.6 Help Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
10.1.7 Standard Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
10.1.8 Main Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
10.1.9 Properties Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
10.1.10 Progress Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
10.1.11 Viewer Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
10.1.12 Console Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
10.1.13 Online Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
10.1.14 File Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
10.1.15 Job Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
10.1.16 Preferences Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
10.1.17 Snapshot Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
10.1.18 System Information Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
10.1.19 Object Popup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
10.1.20 Create Object Popup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
10.2 Data Types and General Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
10.2.1 Class Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
10.2.2 Scalar Field and Vector Fields . . . . . . . . . . . . . . . . . . . . . . . . . . 185
10.2.3 Coordinates and Grids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
10.2.4 Surface Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
10.2.5 Vertex Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
10.2.6 Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
10.2.7 Data parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
10.2.8 Shadowing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
10.3 Avizo Start-Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
CONTENTS v
10.3.1 Command Line Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
10.3.2 Environment Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
10.3.3 User-defined start-up script . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
10.4 Template Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
10.4.1 Template Projects Description . . . . . . . . . . . . . . . . . . . . . . . . . . 194
11 Scripting 197
11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
11.2 Introduction to Tcl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
11.2.1 Tcl Lists, Commands, Comments . . . . . . . . . . . . . . . . . . . . . . . . 198
11.2.2 Tcl Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
11.2.3 Tcl Command Substitution . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
11.2.4 Tcl Control Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
11.2.5 User-Defined Tcl Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . 201
11.2.6 List and String Manipulation . . . . . . . . . . . . . . . . . . . . . . . . . . 202
11.3 Avizo Script Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
11.3.1 Predefined Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
11.3.2 Object commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
11.3.3 Global Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
11.4 Avizo Script Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
11.5 Configuring Popup Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
11.6 Registering pick callbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
11.7 File readers in Tcl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
vi CONTENTS
12.4.3 Lock the display coordinates unit on the working one . . . . . . . . . . . . . 231
12.4.4 Activate/deactivate the units editor dialog when loading spatial data objects . 231
12.5 Avizo components working with the units management . . . . . . . . . . . . . . . . 232
12.5.1 Data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
12.5.2 Files formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
12.5.3 Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
CONTENTS vii
13.3.3 Using Distance Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
13.3.4 More about Distance Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
13.3.5 Measurement Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
13.4 Example 3: Separating, Measuring and Reconstructing . . . . . . . . . . . . . . . . . 271
13.4.1 Principle of the Watershed Algorithm . . . . . . . . . . . . . . . . . . . . . . 273
13.4.2 Prior Segmentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
13.4.3 Separation using Watershed step by step . . . . . . . . . . . . . . . . . . . . 275
13.4.4 Separation Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
13.4.5 Filtering Individual Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
13.4.6 Geometry Reconstruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
13.5 Example 4: Further Image Analysis - Distribution of Pore Diameters in Foam . . . . 284
13.5.1 First step: pore detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
13.5.2 Second step: pore post-processing . . . . . . . . . . . . . . . . . . . . . . . 285
13.5.3 Third step: custom measure group definition to determine the distribution of
pore diameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
13.5.4 Fourth step: custom measure definition to compute the sphericity of pore . . . 291
13.6 Example 5: Further Image Analysis - Average Thickness of Material in Foam . . . . . 293
13.6.1 Porosity Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
13.6.2 Detection of the Separation Surfaces . . . . . . . . . . . . . . . . . . . . . . 295
13.6.3 Distance Map of the Material . . . . . . . . . . . . . . . . . . . . . . . . . . 296
13.6.4 Calculation of the Material Average Thickness . . . . . . . . . . . . . . . . . 299
13.7 Example 6: Advanced Segmentation . . . . . . . . . . . . . . . . . . . . . . . . . . 299
13.7.1 Segmenting sand pack with watershed tool in the Segmentation Editor . . . . 300
13.7.2 Segmenting multiphase using the Watershed Segmentation wizard . . . . . . 304
13.8 More about Image Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
13.8.1 Choosing image filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
13.9 Registration, Alignment and Data Fusion . . . . . . . . . . . . . . . . . . . . . . . . 319
13.9.1 Getting started with spatial data registration using the Transform Editor . . . . 320
13.9.2 Data fusion, comparing and merging data . . . . . . . . . . . . . . . . . . . . 332
13.9.3 Registration with landmarks, warping surfaces and image . . . . . . . . . . . 341
13.9.4 Registration of 3D image data sets . . . . . . . . . . . . . . . . . . . . . . . 350
viii CONTENTS
13.9.5 Registration of 2D image and 3D image data sets . . . . . . . . . . . . . . . 368
13.9.6 Alignment of 2D images stacks . . . . . . . . . . . . . . . . . . . . . . . . . 370
13.9.7 Alignment and pre-processing of FIB/SEM images stacks using the FIB Stack
Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
13.9.8 Registration of 3D surfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
13.9.9 Registration of 3D image and surface, nominal-actual analysis . . . . . . . . 406
13.10 Advanced Surface and Grid Generation . . . . . . . . . . . . . . . . . . . . . . . . . 411
13.10.1 Getting started: a workflow from 3D images to surfaces and grids . . . . . . . 412
13.10.2 Adjusting segmentation for geometry extraction . . . . . . . . . . . . . . . . 414
13.10.3 Generating surfaces with controlled smoothing . . . . . . . . . . . . . . . . . 416
13.10.4 Using the Simplification Editor . . . . . . . . . . . . . . . . . . . . . . . . . 418
13.10.5 Using the Surface Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
13.10.6 Remeshing and exporting surfaces . . . . . . . . . . . . . . . . . . . . . . . 424
13.10.7 Generating tetrahedral grid . . . . . . . . . . . . . . . . . . . . . . . . . . . 426
13.10.8 Assigning boundary conditions and exporting data . . . . . . . . . . . . . . . 428
13.11 More about label measures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
13.11.1 The Measures Group Selection dialog . . . . . . . . . . . . . . . . . . . . . 431
13.11.2 User measures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
13.11.3 Configurable native measures . . . . . . . . . . . . . . . . . . . . . . . . . . 433
13.11.4 About project backup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
13.11.5 Scripting tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
CONTENTS ix
14.2 Avizo Wind Edition Models Information and Display . . . . . . . . . . . . . . . . . 448
14.2.1 Properties and parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
14.2.2 Colormaps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
14.2.3 Viewing the grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
14.2.4 Viewing the boundaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453
14.3 Avizo Wind Edition Scalar Fields Display . . . . . . . . . . . . . . . . . . . . . . . 456
14.3.1 Scalar field profile on a cross section . . . . . . . . . . . . . . . . . . . . . . 456
14.3.2 Scalar field isolines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
14.3.3 Legend and captions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
14.3.4 Isosurfaces of pressure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
14.4 Avizo Wind Edition Vector Fields Display . . . . . . . . . . . . . . . . . . . . . . . 462
14.4.1 Particles animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
14.4.2 Illuminated streamlines (ISL) . . . . . . . . . . . . . . . . . . . . . . . . . . 465
14.4.3 Line integral convolution (LIC) . . . . . . . . . . . . . . . . . . . . . . . . . 466
14.4.4 Vectors in a plane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
14.4.5 Stream ribbons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
14.4.6 Find the 3D critical points . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
14.5 Avizo Wind Edition Statistical and Arithmetic Computations . . . . . . . . . . . . . 470
14.5.1 Surface and volume integrals . . . . . . . . . . . . . . . . . . . . . . . . . . 471
14.5.2 Arithmetic computation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
14.6 Avizo Wind Edition Vorticity Identification . . . . . . . . . . . . . . . . . . . . . . . 478
14.6.1 Vorticity-related variables computation . . . . . . . . . . . . . . . . . . . . . 478
14.6.2 Vortex core lines identification . . . . . . . . . . . . . . . . . . . . . . . . . 480
14.6.3 Vortical flow visualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
14.7 Avizo Wind Edition Measurements . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
14.7.1 3D measurements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485
14.7.2 Histograms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
14.7.3 Data probing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
x CONTENTS
16 Avizo Earth Edition User’s Guide 495
CONTENTS xi
17.3.7 Step 6 - Formation factor experiment simulation . . . . . . . . . . . . . . . . 547
17.3.8 Step 7 - Effective formation factor calculation . . . . . . . . . . . . . . . . . 549
17.3.9 Step 8 - Formation factor computation validation . . . . . . . . . . . . . . . . 551
17.4 Getting started with Avizo XLab Thermo Pack . . . . . . . . . . . . . . . . . . . . . 553
17.4.1 Theoretical elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553
17.4.2 Step 1 - Load the data set . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
17.4.3 Step 2 - Set the voxel size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558
17.4.4 Step 3 - Create a label field from the data set . . . . . . . . . . . . . . . . . . 558
17.4.5 Step 4 - Remove isolated conducting materials parts . . . . . . . . . . . . . . 558
17.4.6 Step 5 - Selection of a sub-region . . . . . . . . . . . . . . . . . . . . . . . . 559
17.4.7 Step 6 - Thermal conductivity experiment simulation . . . . . . . . . . . . . 560
17.4.8 Step 7 - Effective thermal conductivity calculation . . . . . . . . . . . . . . . 563
17.4.9 Step 8 - Thermal conductivity computation validation . . . . . . . . . . . . . 565
xii CONTENTS
21 Avizo XPand Pack User’s Guide 603
21.1 Introduction to Avizo XPand Pack . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
21.1.1 Overview of Avizo XPand Pack . . . . . . . . . . . . . . . . . . . . . . . . . 604
21.1.2 System Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 606
21.1.3 Structure of the Avizo File Tree . . . . . . . . . . . . . . . . . . . . . . . . . 606
21.1.4 Quick Start Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
21.1.5 Compiling and Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . 610
21.1.6 Maintaining Existing Code . . . . . . . . . . . . . . . . . . . . . . . . . . . 612
21.2 The Development Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613
21.2.1 Starting the Development Wizard . . . . . . . . . . . . . . . . . . . . . . . . 614
21.2.2 Setting Up the Local Avizo Directory . . . . . . . . . . . . . . . . . . . . . . 615
21.2.3 Adding a New Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616
21.2.4 Adding a New Component . . . . . . . . . . . . . . . . . . . . . . . . . . . 616
21.2.5 Adding an Ordinary Module . . . . . . . . . . . . . . . . . . . . . . . . . . 617
21.2.6 Adding a Compute Module . . . . . . . . . . . . . . . . . . . . . . . . . . . 618
21.2.7 Adding a Read Routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618
21.2.8 Adding a Write Routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619
21.2.9 Creating the Build System Files . . . . . . . . . . . . . . . . . . . . . . . . . 620
21.2.10 The Package File Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621
21.3 File I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624
21.3.1 On file formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624
21.3.2 Read Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625
21.3.3 Write Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633
21.3.4 Use the AmiraMesh API to read and write files in Avizo format . . . . . . . . 638
21.4 Writing Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642
21.4.1 A Compute Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642
21.4.2 A Display Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 650
21.4.3 A Module With Plot Output . . . . . . . . . . . . . . . . . . . . . . . . . . . 658
21.4.4 A Compute Module on GPU . . . . . . . . . . . . . . . . . . . . . . . . . . 663
21.5 Data Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685
CONTENTS xiii
21.5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685
21.5.2 Data on Regular Grids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688
21.5.3 Unstructured Tetrahedral Data . . . . . . . . . . . . . . . . . . . . . . . . . 694
21.5.4 Unstructured Hexahedral Data . . . . . . . . . . . . . . . . . . . . . . . . . 697
21.5.5 Unstructured Mixed Models . . . . . . . . . . . . . . . . . . . . . . . . . . . 699
21.5.6 Data Defined on Unstructured Models . . . . . . . . . . . . . . . . . . . . . 700
21.5.7 Other Issues Related to Data Classes . . . . . . . . . . . . . . . . . . . . . . 700
21.6 Documentation of Modules in Avizo XPand Pack . . . . . . . . . . . . . . . . . . . . 704
21.6.1 The documentation file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 704
21.6.2 Generating the documentation . . . . . . . . . . . . . . . . . . . . . . . . . 706
21.7 Miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706
21.7.1 Time-Dependent Data And Animations . . . . . . . . . . . . . . . . . . . . . 706
21.7.2 Important Global Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709
21.7.3 Save-Project Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 710
21.7.4 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 712
xiv CONTENTS
Chapter 1
Introduction
Avizo is a 3D data visualization, analysis and modeling system. It allows you to explore and analyze
data sets from various areas, including:
Examples from these disciplines are illustrated by several demo scripts contained in the online version
of the user’s guide.
3D data can be quickly explored, analyzed, compared, and quantified. 3D objects can be represented
as image volumes or geometrical surfaces and grids suitable for numerical simulations, notably as
triangular surface and volumetric tetrahedral grids. Avizo provides methods to generate such grids
from voxel data representing an image volume, and it includes a general-purpose interactive 3D viewer.
Section 1.1 (Overview) provides a short overview of the fundamentals of Avizo, i.e. its object-oriented
design and the concept of data objects and modules.
Section 1.2 (Features) summarizes key features of Avizo, for example direct volume rendering, image
processing, and surface simplification.
Section 1.3 (Packs and Editions) briefly describes optional packs and editions available for Avizo and
what they can be used for.
Section 1.4 (System Requirements) provides system specific information.
Section 1.5 (Avizo License Manager) details for entering and managing Avizo license passwords.
Section 1.6 (Data Import) provides some general hints on how to import data sets into Avizo.
Section 1.7 (First steps) provides hints about tutorials included in this guide.
Section 1.8 (Contact and Support) provides contact information for your technical support, license
administrator, or sales representative.
1.1 Overview
Avizo is a modular and object-oriented software system. Its basic system components are modules and
data objects. Modules are used to visualize data objects or to perform some computational operations
on them. The components are represented by little icons in the Project View. Icons are connected
by lines indicating processing dependencies between the components, i.e., which modules are to be
applied to which data objects. Alternatively, modules and data objects can be displayed in a Project
Tree View. Modules from data objects of specific types are created automatically from file input data
when reading or as output of module computations. Modules matching an existing data object are
created as instances of particular module types via a context-sensitive popup menu. Projects can be
created with a minimal amount of user interaction. Parameters of data objects and modules can be
modified in Avizo’s interaction area.
For some data objects such as surfaces or colormaps there exist special-purpose interactive editors that
allow the user to modify the objects. All Avizo components can be controlled via a Tcl command
interface. Commands can be read from a script file or issued manually in a separate console window.
The biggest part of the screen is occupied by a 3D graphics window. Additional 3D views can be
created if necessary. Avizo is based on the latest release of Open Inventor by FEI, SAS. In addition,
several modules apply direct OpenGL rendering to achieve special rendering effects or to maximize
performance. In total, there are more than 270 data object and module types. They allow the system
to be used for a broad range of applications. Scripting can be used for customization and automation.
User-defined extensions are facilitated by the Avizo developer version.
2 Chapter 1: Introduction
1.2.1 Data import
Avizo can load directly different types of data, including:
A large number of file formats are supported in Avizo Standard Edition or through specific optional
readers. For an introduction to data import, see section 4.1. For more details, see section 1.6.
You can quickly explore 3D images looking at single or multiple orthographic or oblique sections.
Data sets can be superimposed on slices, displayed as height fields, or with isolines contouring. You
can cut away parts of your data to uncover hidden regions. Curved or cylinder slices are also available.
One of the most intuitive and most powerful techniques for visualizing 3D image data is direct volume
rendering. Light emission and light absorption parameters are assigned to each point of the volume.
Simulating the transmission of light through the volume makes it possible to display your data from any
view direction without constructing intermediate polygonal models. By exploiting modern graphics
hardware, Avizo is able to perform direct volume rendering in real time, even on very large data when
Features overview 3
using the Avizo XLVolume Pack. Thus volume rendering can instantly highlight relevant features
of your data. Volume rendered images can be combined with any type of polygonal display. This
improves the usefulness of this technique significantly. Moreover, multiple data sets can be volume
rendered simultaneously – a unique feature of Avizo. Transfer functions with different characteristics
required for direct volume rendering can be either generated automatically or edited interactively using
an intuitive colormap editor. Avizo volume rendering can use the latest techniques for high quality
visualization effects such as lighting or shadows.
1.2.3.3 Isosurfaces
Isosurfaces are most commonly used for analyzing arbitrary scalar fields sampled on discrete grids.
Applied to 3D images, the method provides a very quick, yet sometimes sufficient method for recon-
structing polygonal surface models. Beside standard algorithms, Avizo provides an improved method,
which generates significantly fewer triangles with very little computational overhead. In this way, large
3D data sets can be displayed interactively even on smaller desktop graphics computers.
With the Avizo XLVolume Pack, even very large data sets that cannot be fully loaded in memory can
be manipulated at interactive speed. Multi-resolution techniques can manage and visualize extremely
large amounts of volume data of up to hundreds of gigabytes. You can then, for instance, quickly select
a region of interest and extract down-sampled or partial data for further processing.
The image Align Slices enables you to build a consistent stack of images with manual or automatic
tools, if, for instance, physical cross-sections have been shifted during image acquisition.
Image features can be enhanced by applying a wide range of filters for controlling contrast, smoothing,
noise reduction and feature enhancement. See Chapter 13 Avizo Fire Edition User’s Guide.
Segmentation means assigning labels to image voxels that identify and separate objects in a 3D image.
Avizo offers a large set of segmentation tools, ranging from purely manual to fully automatic: brush
(painting), lasso (contouring), magic wand (region growing), thresholding, intelligent scissors, contour
fitting (snakes), contour interpolation and extrapolation, wrapping, smoothing and de-noising filters,
morphological filters for erosion, dilation, opening and closing operations, connected component anal-
ysis, images correlation, objects separation and filtering, etc. See section 4.3 for a tutorial about image
4 Chapter 1: Introduction
segmentation with Avizo Standard Edition. See also Chapter 13 Avizo Fire Edition User’s Guide about
automatic and advanced segmentation.
Features overview 5
tetrahedral grids suitable for advanced 3D finite-element simulations. These grids are constructed
using a flexible advancing-front algorithm. Again, special care is taken to obtain meshes of high
quality, i.e., tetrahedra with bad aspect ratio are avoided. Several different file formats are supported,
so that the grid can be exported to many standard simulation packages.
Avizo can also reconstruct surfaces from scattered points (see Delaunay Triangulation and Point Wrap
Triangulation modules).
1.2.5.5 Skeletonization
A set of tools is included for reconstructing and analyzing a dendritic, porous or fracture network from
3D image data.
Avizo can visualize arbitrary functional data given on 3D Point Cluster sets or Line Sets.
A number of drawing styles and coloring schemes help to yield meaningful and informative visualiza-
tions of polygonal models, whether generated from image data or imported from CAD or simulation
package. Surface and 3D grid meshes can be colored or textured in order to visualize a second inde-
pendent data set.
Another Avizo feature comprises the realistic view-dependent way of rendering semi-transparent sur-
faces. By correlating transparency with local orientation of the surface relative to the viewing direction,
complex spatial structures can be understood much more easily.
Avizo allows you to analyze numerical data coming from measurements or simulations. Avizo Stan-
dard Edition supports polygonal surfaces such as triangular meshes, 3D lattices with uniform, recti-
linear of curvilinear coordinates, and 3D tetrahedral or hexahedral grids. Most general purpose image
visualization techniques and analysis tools can be applied, such as: slice extraction, computation of
isolines or isosurfaces, data probing and histograms. In addition, scalar quantities can be visualized
with pseudo-colors on the grid itself.
Beside visualization, data representations such as isosurfaces, grid cuts or contour lines can be ex-
tracted as first class data objects.
6 Chapter 1: Introduction
Displacement vectors can be visualized on grids or applied as grid deformation that can be animated.
Avizo Wind Edition provides extensive additional support for numerical data import/export, visualiza-
tion and analysis.
Avizo provides many advanced tools for vector fields and flow visualization. Vector arrows can be
drawn on a slice, within a volume, or upon a surface. The flow structure may be better revealed by
representations such as fast Line Integral Convolution on slices or arbitrary surfaces, illuminated and
animated streamlines, stream ribbons, stream surfaces, particle animations, synthetic Vector Probe...
All of these stream visualization techniques are highly interactive. While seed point distributions can
be automatically calculated, you can also select and interactively manipulate seed points and structures,
thus supporting the investigation the flow field and highlighting of different features. Avizo can also
support six-component complex vector fields and phase visualization, e.g. electromagnetic fields.
Avizo Wind Edition provides extensive support for flow and CFD post-processing.
Avizo has support for iconic visualization of tensor field, extraction of eigenvalues, computation of
rate of strain tensor, gradient tensor.
Avizo Wind Edition can compute many secondary variables from simulation results including various
tensor.
Multiple data sets can be combined to compare images of different objects, or images of an object
recorded at different times or with different imaging modalities such as X-ray CT and MRI. In ad-
dition, fusion of multi-modal data by arbitrary arithmetic operations can be performed to increase
the amount of information and accuracy in the models. Avizo allows manual registration through
interactive manipulators, automatic rigid or non-rigid registration through landmarks, and automatic
registration using iterative optimization algorithms (see Register Images module).
Surfaces can also be registered using rigid or non-rigid transformations, based on landmarks sets warp-
ing, alignment of centers or principal axes, or distance minimization algorithms.
Many utilities are available for data processing. Here are some important ones. Resampling can reduce
or enlarge the resolution of a 3D image or data sets defined on regular grids, and different sampling
kernels are supported. Data can be cropped or regions of interest can be defined. Data can be converted
Features overview 7
to any supported primitive type, from byte to 64-bits floating point numbers. Multi-component data
such as multi-channel images or vector data can be composed or decomposed. Standard 3D field op-
erators such as scalar field gradient or vector field curl are available. Surface curvatures and distances
between surfaces can also be computed, as scalar or vector information. The powerful Arithmetic
module allows the user to perform calculations on data sets with user-defined expression, and can be
used to interpolate data between regular grids and polyhedral grids. Data sets can also be created from
arithmetic expressions.
You can query the exact values of your data sets at arbitrary locations specified interactively by a
mouse click, or along user-defined lines and spline curves. Probe points can serve to set interactively
isosurfaces. You can plot or export the data for further processing with spreadsheet or plotting appli-
cations, with probing, measuring, counting, and other statistical modules quantify densities, distances,
areas, volumes, mean value and standard deviation, ...
Histograms of values can be computed and plotted, possibly restricted to a region of interest.
The Avizo Fire Edition provides an extensive set of intensity and geometrical measurements on image
or label data, either for individual labeled particles or as statistics.
8 Chapter 1: Introduction
be customized by using Tcl. Avizo can also be used for batch processing.
See Chapter 11, including a short introduction to the Tcl scripting language.
C++ programming
With the Avizo XScreen Pack, Avizo can also be extended by programmers. The Avizo XPand Pack
permits creation of new custom components for Avizo such as file readers and writers, computation
modules, and even new visualization modules, using the C++ programming language. New modules
and new data classes can be defined as subclasses of existing ones. In order to simplify the creation of
new custom extensions, a development wizard is included.
See the Avizo XPand Pack User’s Guide for detailed information.
Template projects
Template projects can be used to ease repetitive tasks on a set of similar data. A template project
consists of a backup of an original project that can be replicated on another data of same type. See
Chapter 10.4.1.
1.3.1 Editions
Currently, the following editions are available for Avizo 8.
Note: see section 1.4 System Requirements about system requirements and hardware platform avail-
ability.
Avizo Fire Edition. The application for Material Sciences. For in-
dustrial tomography, crystallography, material microstructure evolution, modality inspection for
nano-structure, non-destructive investigation and surface analysis, Avizo Fire Edition delivers the
whole feature-set allowing Material Scientists to see the invisible, and understand and present their
data.
Avizo Green Edition. The application for Climate and Earth Sciences
Research offers a set of features dedicated to the visualization and analysis of climate, oceanogra-
phy, environmental or earth-mapped data. It includes a dedicated ”Earth Visualization” module, a set
of advanced geographical projections, and a high-level support of the NetCDF CF-1.0 metadata for-
mat (”Climate Forecast”). It delivers a unique set of features for researchers who study and analyze
climatology datasets.
10 Chapter 1: Introduction
Avizo Wind Edition. The application for CFD/FEA engineering visual-
ization. Avizo Wind Edition is a high-end extensible software for advanced post-processing of sim-
ulation data, ranging from flow to thermal, and stress data. It brings an extensive array of advanced
visualization and analysis tools to CFD and multi-physics, mechanical and thermal engineering, man-
ufacturing simulation and micro-structural prediction, non linear structural and geotechnical problems.
12 Chapter 1: Introduction
XReadIGES, XReadSTEP, XReadCATIA5. The Catia 5, IGES and
STEP readers allows visualization of data coming from the CAD area. Coupled with XScreen, they
provide the means to visualize CAD models in immersive visualization or collaborative environment.
XPand AvizoXPand
XScreen AvizoXScreen
XTeam AvizoXTeam
XLVolume AvizoXLVolume
XSkeleton AvizoXSkeleton
XReadCATIAfive AvizoXReadCATIA5
XReadIGES AvizoXReadIGES
XReadSTEP AvizoXReadSTEP
XLabHydro AvizoXLabHydro
XLabHydroGPU AvizoXLabHydroGPU
XLabDiffusion AvizoXLabDiffusion
XLabElectro AvizoXLabElectro
XLabThermo AvizoXLabThermo
For additional information about Avizo and its extensions, please refer to the Avizo web site,
http://www.vsg3d.com.
14 Chapter 1: Introduction
• Microsoft Windows XP/Vista/7/8 (32-bit and 64-bit)
• Linux x86 64 (64-bit). Supported 64-bit architecture is Intel64/AMD64 architecture. Supported
Linux distribution is Red Hat Enterprise Linux 5.
• Mac OS X 10.7 and 10.8 (64-bit)
Some of the editions and optional packs presented in section 1.3.1 Editions and section 1.3.3 Optional
packs are limited to some platforms:
• Avizo Wind Edition: support of Abaqus reader (.odb format) and STAR-CCM reader are
available only on Microsoft Windows and Linux, not on Mac OS X;
• XScreen is supported only on Microsoft Windows and Linux, not Mac OS X;
• XReadIGES, XReadSTEP, XReadCATIA5 are supported only on Microsoft Windows, not on
Linux or Mac OS X;
• XLab Hydro, XLab Diffusion, XLab Electro, XLab Thermo are supported only on Microsoft
Windows 64-bit, not on Microsoft Windows 32-bit, Linux or Mac OS X.
Avizo requires a display resolution of at least 1024x768 and at least 15 bits of color depth. We
strongly recommend using at least 1280x1024 with 24-bit color depth. System requirements should
match the Open Inventor ones especially the minimum OpenGL version which should be 2.1 at least.
See below for more details about graphics cards.
Apart from 3D graphics hardware, probably the most important system parameter is main memory.
You should have at least 2 GB, preferably 4 GB or more.
The speed of the processor of course is also an important parameter. However it is less critical than
the graphics system and the main memory size. For the PC versions, we recommend at least a 2 GHz
processor. Recent multi-core CPUs are perfectly adapted for running Avizo. Most CPU demanding
algorithms in Avizo are now taking advantage of multi-core systems.
System Requirements 15
Avizo menu Help/System information provides some information about your system including which
GPU is in your computer.
To have more information about CUDA, you can visit the CUDA faq:
https://developer.nvidia.com/cuda-faq.
1.4.2 Firewall
An internet access is necessary to activate Avizo. It may happens that your firewall prevents the
connection to the license server.
For more information, please refer to section 1.5.4.2 licensing troubleshooting (firewall problem).
1.4.4 Linux
Avizo is only available for Intel64/AMD64 systems.
The official Linux distribution for Avizo is Red Hat Enterprise Linux 5 64-bit. Nevertheless, Avizo is
likely to work on some other 64-bit Linux distributions if required version of system libraries can be
found, but technical support of those platforms will be limited. Here is a non exhaustive list of these
64-bit Linux distributions:
• Red Hat Enterprise Linux 5.x, the official Linux distribution which Avizo has been fully tested
on.
16 Chapter 1: Introduction
• Red Hat Enterprise Linux 6.x, using some of the additional libraries from the
$AVIZO ROOT/lib/compat-LinuxAMD64 directory.
• CentOS 5 and Scientific Linux 5.
• Ubuntu 12.04 and 13.04, using some of the additional libraries from the
$AVIZO ROOT/lib/compat-LinuxAMD64 directory.
• OpenSUSE 12.3, using some of the additional libraries from the $AVIZO ROOT/lib/compat-
LinuxAMD64 directory.
The folder $AVIZO ROOT/lib/compat-LinuxAMD64 contains the most commonly missing depen-
dencies (libjpeg.so.62, libgfortran.so.1, libXm.so.4, libstdc++.so.6). If your
Linux distribution misses one of those files or has different versions installed, copy that file into the
$AVIZO ROOT/lib/arch-LinuxAMD64-Optimize directory. You can also install them using the soft-
ware manager/tool of your linux distribution. For instance, you can install some of them on Ubuntu
distribution using the following command:
sudo apt-get install libjpeg62 libstdc++6 libmotif4
Graphics Hardware: Avizo works with the current 3D graphics drivers from nVidia and ATI under
Xorg.
Notes:
• On some distributions, some parts of the user interface, the segmentation editor for example,
may not display correctly. This is a known Qt issue. You can work around this by disabling the
composite option in the extension section of your Xorg.conf configuration file:
Section "Extensions"
Option "Composite" "disable"
EndSection
• To work properly on Linux systems where SELinux is enabled, Avizo requires the modification
of the security context of some Avizo shared object files so they can be relocated in memory.
The user (maybe root) that installs Avizo has to run the following command from a shell console
in order to set the right security context :
chcon -v -t texrel shlib t "${AVIZO ROOT}"/lib/arch-Linux*-*/lib*.so
In order to add custom extensions to Avizo with Avizo XPand Pack you will need gcc 4.1.x on RHEL
5.
System Requirements 17
Notes: Use gcc --version to find out the version of the GNU compiler.
In order to use the Calculus MATLAB module, that establishes a connection to MATLAB (The
MathWorks, Inc.), some installation steps most be followed. The LD LIBRARY PATH environment
variable should be set to MATLAB INSTALLATION PATH/bin/glnx86 on Linux 32-bit and
MATLAB INSTALLATION PATH/bin/glnxa64 on Linux 64-bit. The PATH environment
variable should be also set to MATLAB INSTALLATION PATH/bin.
If after doing this you still have trouble starting Calculus MATLAB, it might be be-
cause the GNU Standard C++ Library (libstdc++) installed on your platform is older
than the one required by MATLAB. You can check MATLAB’s embeded libstdc++
version in MATLAB INSTALLATION PATH/sys/os/glnx86 on Linux 32-bit and
MATLAB INSTALLATION PATH/sys/os/glnxa64 on Linux 64-bit. If needed, add this
path to LD LIBRARY PATH.
1.4.5 Mac OS X
The Mac OS X version of Avizo has been developed on Mac OS X 10.7 and tested on Mac OS X 10.7
and 10.8 running on an Intel CPU. This version might not work properly on other Mac OS X releases
or non-Intel CPU Apple platforms.
In order to add custom extensions to Avizo with Avizo XPand Pack you will need gcc 4.2.x provided
by the standard Xcode development environment.
Graphics Hardware: Avizo works with the current Mac 3D graphics drivers from nVidia and ATI.
In order to use the Calculus MATLAB module, which establishes a connection to MATLAB
(The MathWorks, Inc.), some installation steps most be followed. The LD LIBRARY PATH
environment variable should be set to MATLAB INSTALLATION PATH/bin/maci64 (for in-
stance add LD LIBRARY PATH set to "/Application/MATLAB R2013a/bin/maci64" in
/.MacOSX/environment.plist).
In order to run CUDA enabled modules, Mac OS X requires the most recent CUDA driver for Mac (at
least 5.0.xx) to be installed. It can be found at the following URL: http://www.nvidia.com/object/mac-
driver-archive.html and must be installed manually. If this driver is not installed, modules of Avizo
using GPU compute capabilities will not be able to run properly. Moreover, compilation of Avizo
XPand Pack modules using the CUDA API (even the examples) will fail.
18 Chapter 1: Introduction
• License manager actions
• Local activation mode
• FNP license server(s) mode
• Actions independent of activation mode (local or server)
• Licensing troubleshooting
• Offline activation
• Firewall problem
• Licensing events log
• License lookup log
• Contacting the license administrator
20 Chapter 1: Introduction
1.5.3.1 Local activation mode
When you work in local activation mode, Avizo allows you to manage your licenses. Different actions
are available on depending on the status of your licenses.
When you purchase one or more Avizo (editions and/or extensions) licenses, you should receive an
email from vsg@flexnetoperations.com containing a set of activation codes for each purchased prod-
uct or option.
Launch Avizo and select Activate. On the first page of the Activation Wizard, you must select Use
local activation codes and click on Next. In the Activate Local Licenses page, simply copy and paste
your activation codes into the provided text field and press Activate.
A connection to the online activation server will start immediately.
When activation is complete, the product is ready to be used, and the license manager displays infor-
mation related to the activation.
An activation code is a string similar to the following:
#License: Avizo (Avizo- 1 year time-limited node-locked application license (including main-
tenance service) - Multiple platforms support) - Expiration date: 12/13/2014:
BL5F-7773-A9F1-F79B Avizo 8.1
Once Avizo is activated, you can add other node-locked license to activate new extensions or editions.
To do so, select Help > License Manager and click on the Activate Additional Extensions or
Editions button (see figure 1.4).
The license manager wizard is opened and displays the page Activate New Local Licenses (see figure
1.3). Simply copy and paste your activation codes into the provided text field and press Activate.
After activating a node-locked license on a computer, you may wish to move it to a new one. To do
so, you first need to de-activate the first license by returning the associated activation code and then
activate it again on the new computer.
To do so, open the Help > License Manager (see figure 1.4) and click on the Deactivate Product
22 Chapter 1: Introduction
button (see figure 1.5). The all licenses are returned to the server and can be activated on any other
system.
When a new version of Avizo is released, and if the activation process has been used for a previous
version, after installing and launching the new Avizo version, a dialog is displayed. It offers several
choices, including an Upgrade option.
If the licensed modules are under maintenance, they will be immediately available for use after the
upgrade process.
Re-activating a license
When you use a renewable license (through a subscription agreement), Avizo will stop working when
the license expiration date is reached.
When you launch a new session of Avizo, the license will be ignored and you will get the no license
found dialog (see Figure 1.1).
You must re-enter your activation codes which will be reactivated after pressing on Activate.
As soon as you have renewed your subscription, you can re-activate your node-locked license to allow
Avizo to run again for a new period of time.
Avizo floating (or concurrent) licenses are handled by FlexNet Publisher tool. In order to manage
Avizo floating licenses, you need to:
1. Install FlexNet Publisher license server manager on a local server of your LAN,
2. Activate your Avizo licenses on this license server,
3. Configure each Avizo instance on local computers to use this license server.
For explanations about how installing a FlexNet license server and managing floating licenses
(activation, upgrade, re-activation, return), please refer to:
www.vsg3d.com/support/licensing/flexnet.html
At Avizo startup, select the Activate option and then Use FNP license server on the first page of the
Activation Wizard.
You will need to specify the name of the main FNP license server and you can specify a port number
with a separator ”:” (¡ServerName¿:¡PortNumber¿).
It is provided by your license administrator. You can also specify two additional servers if you have
24 Chapter 1: Introduction
redundant servers.
A connection to the FNP license server will start immediately. When done, the product is ready to be
used.
Note: It is possible to test the connection to the specified server(s) using the Test buttons.
Reconfigure
When you launch for the first time a Beta version or if your Beta licenses are expired, the Activation
Wizard is opened at the Activate Beta Licenses page. Simply copy and paste your activation codes into
the provided text field and press Activate.
A connection to the online activation server will start immediately. When done, the product is ready
to be used.
Show available extensions
When Avizo is running, you can see the activated licenses on your computer.
Select Help > Show Available Extensions.
Note: One activation code can activate several licenses.
26 Chapter 1: Introduction
Figure 1.9: License Manager - Beta Activation Wizard
If you do not have any Internet connection, you can activate, upgrade, reactivate and return your
licenses offline by following the instructions of the documentation placed here:
AVIZO ROOT/share/license/FLEXnet/Offline_Activation_User_Guide.pdf
If you have an internet connection but encounter the error ”Unable to connect to server https” when
trying to activate a license, it probably comes from your firewall configuration.
You need to configure your firewall to allow the connection to the online activation server:
• Server: vsg3d.flexnetoperations.com
• IP: 64.14.29.85
• Port: 443 (https)
If an error occurs during Avizo activation, you can find more details in the licensing events log.
However, most likely you will need to send it to the technical support team for analysis (Help >
Online Support menu).
This log file details all activation actions and licensing information only when an error occurs.
If the VSG LICENSE DEBUG environment variable is set to a file name, licensing debug output is
written to the specified file when Avizo is launched. You can open and read this debug file yourself.
However, most likely you will need to send it to the technical support team for analysis (Help >
Online Support menu).
Below are instructions for setting this environment variable on Windows and on Linux and Mac OS X
systems.
Note: For using a license debug filename as indicated below, you need sufficient privileges to write
into the Avizo installation directory. Otherwise, set VSG LICENSE DEBUG to a path where you
can write files. For example, /home/<your login name>/debug.txt, or C:\Temp\debug.txt.
You can set the environment variable via the Control Panel for Windows or you can set it in a
command prompt on all platforms.
28 Chapter 1: Introduction
Windows - Control Panel
1. You can get to the Control Panel via the Windows Start menu.
2. In the Control Panel, select the System application.
3. Click on the Advanced tab.
4. Press the Environment variables button.
5. In either the User or System variables, press the New button.
6. For the Variable name enter VSG LICENSE DEBUG.
7. For the Variable value enter debug.txt (without the quotes).
8. Close the dialogs by clicking on OK.
9. Run Avizo from the Start menu. When the License Manager dialog is displayed, dismiss it.
10. Then look for a file named debug.txt in the top level of the Avizo installation directory. Send the
file to tech support for analysis.
1. On Windows you can get to a command prompt via the Windows Start menu as follows:
Start > Programs > Accessories > Command Prompt
2. In the command prompt window, type:
set VSG LICENSE DEBUG=debug.txt
3. Change the current directory to where your Avizo executable is. For example:
cd C:\Program Files\Avizo8\bin\arch-Win64VC10-Optimize
4. Run Avizo as follows:
Avizomain.exe
5. When the License Manager dialog comes up, dismiss it.
6. Look for the file debug.txt in the current directory. Send the file to tech support for analysis.
1. On Linux and Mac OS X systems, the exact command to use for setting environment variables
depends on the kind of shell you are using. Here are examples for a few commonly used shells.
Bash shell:
export VSG LICENSE DEBUG=debug.txt
C shell:
setenv VSG LICENSE DEBUG debug.txt
2. In the window in which you set the environment variable, change to the Avizo installation di-
rectory. For example:
30 Chapter 1: Introduction
1.7 First steps in Avizo
For a quick introduction to Avizo, you can visit http://www.vsg3d.com/webcasts, and watch introduc-
tory videos such as Avizo Getting Started, Introduction to Avizo, or Avizo Fire Edition Getting Started
in addition to the tutorials below.
The step-by-step tutorials in this user’s guide are largely independent of each other, so after reading
the Getting Started section it is possible to skip around and just follow those tutorials which inerest
you. If you go through all the tutorials you will get a good survey of Avizo’s basic features. The same
applies to each Avizo edition. A minimum set of recommended tutorials are shown in bold in the list
below.
In all tutorials the steps to be performed by the user are marked by a dot. If you only want to get a
quick idea how to work with Avizo you may skip the explanations between successive steps and just
follow the instructions. But in order to get a deeper understanding you should refer to the text.
You can visit the Avizo User’s Forum at www.avizo3d.net to get and share information with the Avizo
community.
Avizo technical support can be contacted using the Online Support item in Avizo Help menu or using
the contact information in Section 1.8 (Contact and Support). FEI technical support is dedicated to
customers having purchased or renewed a maintenance contract. To speed up the management of your
questions please don’t forget to supply us with the license number or license file of your FEI product,
the platform where you use it and depending on your issue a log file (VSG LICENSE DEBUG export,
Help/SystemInformation for Avizo, IvReport for OpenInventor), images and a small sample project.
If you are evaluating Avizo, do not hesitate to contact your support application engineer or sales rep-
resentative to assist you finding how Avizo can help you.
FEI also provides trainings and consulting services.
32 Chapter 1: Introduction
1.8 Contact and Support
For purchasing an Avizo license and for support, visit our web sites or contact one of the following
addresses.
Online:
Hotline requests
Phone: +33 556 13 37 71
Fax: +33 556 13 02 10
Email: vsghotline@fei.com
IMPORTANT NOTE
Avizo 8 is a major evolution of the Avizo product family including new extensions, enhancements of
the user interface for ease of use and simplified workflows, new and enhanced features, and perfor-
mance improvements.
For complete information about new features, enhancements and solved issues in this release
please review the Release Notes and What’s New documents included in Avizo package directory
<install_dir>/share/doc/ also available at http://www.vsg3d.com/avizo-release-notes.
36 Chapter 2: What’s New in Avizo 8
Chapter 3
Getting Started
The following text has the form of a short step-by-step tutorial. Each step builds on the steps described
before. We recommend that you read the text online and carry out the instructions directly on the
computer. Instructions are indicated by a dot so you can execute them quickly without reading the
explanations between the instructions.
Note: You may link the start script into a directory contained in your binary path, e.g. /usr/bin:
• ln -s $INSTALLDIR/Avizo8/bin/start
• ln -s $INSTALLDIR/Avizo8/bin/AvizoEarth
• ln -s $INSTALLDIR/Avizo8/bin/AvizoWind
• ln -s $INSTALLDIR/Avizo8/bin/AvizoGreen
When Avizo is running, a window like the one shown in Figure 3.1 appears on the screen. The user
interface is divided into four major regions. The 3D viewer window displays visualization results, e.g.,
slices or isosurfaces. The Project View will contain small icons representing data objects and modules.
The Properties Area displays interface elements (ports) associated with Avizo objects. Finally, the
lower left pane is shared by the console and Avizo’s integrated hypertext help browser. Click on the
Console or Help tab to select which window you want to view. The console prints system messages
and lets you enter Avizo commands. You can use the help browser to read the user’s guide online.
You can also activate the help browser by pressing F1, selecting User’s Guide from the Help menu of
Avizo’s main window, or by typing help in the console window.
After selecting this menu item, the file dialog appears (see Figure 3.2). By default the dialog displays
the contents of the directory defined in the environment variable AVIZO DATADIR. If no such variable
exists the contents of Avizo’s demo data directory are displayed. You can quickly switch to other
directories, e.g., to the current working directory, using the directory list located in the upper part of
the dialog window.
At the top of the Project View is an Open Data button which is a shortcut to the File/Open Data dialog.
You may use it for opening data files in the tutorials that follow. However, the tutorials will instruct
you to use the File/Open Data command.
Avizo is able to determine many file formats automatically, either by analyzing the file header or the
file name suffix. The format of a particular file will be printed in the file dialog right beside the file
name.
Now, we would like to load a scalar field from one of the demo data directories contained in the Avizo
distribution.
• Change to the directory data/tutorials, select the file motor.am and press OK.
Loading Data 39
Figure 3.2: Data sets can be loaded into Avizo using the file browser. In most cases, the file format can be determined
automatically. This is done by either analyzing the file header or the file name suffix.
The data will be loaded into the system. Depending on its size this may take a few seconds. The file is
stored in Avizo’s native Avizo format. The file motor.am contains 3D image data of an engine. The
data represents a series of parallel 2D image slices across a 3D volume. Once it has been loaded, the
data set appears as a green icon in the Project View. In the following we call this data set ”motor data
set”.
• Click on the green data icon with the left mouse button to select it.
This causes some information about the data record to be displayed in the Properties Area (Figure 3.3).
In our case we can read off the dimensions of the data set, the primitive data type, the coordinate type,
as well as the voxel size. To deselect the icon, click on an empty area in the Project View window. You
may also pick the icon with the left mouse button and drag it around in the Project View.
Clicking on an object typically causes additional buttons to be displayed in the button area at the top of
the Project View. These buttons are convenience buttons allowing easy one-click access to the modules
most frequently used by the selected object. The tutorials, however, will have you to access modules
via the menu interface to help familiarize you with the organization of modules within Avizo.
Invoking Editors 41
Figure 3.4: In order to attach a module to a data set, click on the green icon using the right mouse button. A popup menu
appears containing all modules which can be used to process this particular type of data.
filename, original size, or bounding box. Another example is the Transform Editor which can be used
to translate or rotate the data in world coordinates. However, at this point we don’t want to go into
details. We just want to learn how to create and delete an editor:
Further information about particular editors is provided in the user’s reference manual.
• click with the right mouse button on the green data icon. Choose the entry called Bounding Box.
After you release the mouse button, a new Bounding Box module is created and is automatically
connected to the data object. The Bounding Box object is represented by a yellow icon in the Project
View and the connection is indicated by a blue line connecting the icons. At the same time, the graphics
output generated by the BoundingBox module becomes visible in the 3D viewer. Since the output is
not very interesting, in this case we will connect a second display module to the data set:
• Choose the entry called Ortho Slice from the popup menu of the engine data set.
Now a 2D slice through the engine is shown in the viewer window. Initially, a slice oriented perpen-
dicular to the z-direction and centered inside the image volume is displayed. Slices are numbered 0, 1,
2, and so on. The slice number as well as the orientation are parameters of the Ortho Slice module. In
order to change these parameters, you must select the module. As for the green data icon, this is done
by clicking on the Ortho Slice icon with the left mouse button. By the way, in contrast to the Bounding
Box, the Ortho Slice icon is orange, indicating that this module can be used for clipping.
Now you should see various buttons and sliders in the Properties Area, ordered in rows. Each row
represents a port allowing you to adjust one particular control parameter. Usually, the name of a port
is printed at the beginning of a row. For example, the port labeled Slice Number allows you to change
the slice number via a slider.
By default, Ortho Slice displays slices with xy orientation, i.e., perpendicular to the z-direction. How-
ever, the module can also extract slices from the image volume perpendicular to x- and y-direction.
Visualizing Data 43
3.5 Interaction with the Viewer
The 3D viewer lets you look at the model from different positions. If you click on the Trackball button
in the viewer toolbar, moving the mouse inside the viewer window with the left mouse button pressed
lets you rotate the object. If you click on the Translate or the Zoom buttons, you can translate or zoom
the object. (For zoom, move the mouse up and down.)
Alternatively, with the middle mouse button pressed you can translate the object. For zooming press
both the left and the middle mouse buttons at the same time and move the mouse up or down.
Notice that the mouse cursor has the shape of a little hand inside the viewer window. This indicates that
the viewer is in viewing mode. By pressing the ESC key you can switch the viewer into interaction
mode. In this mode, interaction with the geometry displayed in the viewer is possible by mouse
operations. For example, when using Ortho Slice you can change the slice number by clicking on the
slice and dragging it.
• Select different buttons of the Orientation port of the Ortho Slice module.
• Rotate the object in a more general position.
• Disable the adjust view toggle in the Options port.
• Change the orientation using the Orientation port again.
• Choose different slices using the Slice Number port or directly in the viewer with the interaction
mode described above.
Each display module has a viewer toggle by which you can switch off the display without removing
the module. This button is just to the right of the colored bar where the module name is shown as
illustrated below.
• Deactivate and activate the display of the Ortho Slice or Bounding Box module using the viewer
toggle.
If you want to remove a module permanently, select it and choose Remove Object from the Project
View menu. Choose Remove All from the same menu to remove all modules.
• Remove the Bounding Box module by selecting its icon and choosing Remove Object from the
Project View menu.
• Remove all remaining modules by choosing Remove All Objects from the same menu.
Now the Project View should be empty again. You may continue with the next tutorial.
Avizo provides extensive support for importing, visualizing, processing 2D and 3D images. For an
overview of related features, please refer to Features overview section. The tutorials in this chapter
introduce the following topics:
1. Using the File/Open Data... browser and setting the file format.
2. Reading 3D image data from multiple 2D slices.
3. Setting the bounding box or voxel size of 3D images.
4. The Stacked Slices file format.
5. Working with Large Disk Data.
Figure 4.1: The Format option of the file browser
Image data is loaded in Avizo with the File/Open Data... dialog. All file formats supported by Avizo
are recognized automatically either by a data header or by the file name suffix. What follows is only
of concern in these cases:
Example:
• Files containing the string Avizo in the first line are considered Avizo files.
• Files with the suffix .stl are considered STL files.
If automatic file format detection fails, e.g. because some non-standard suffix has been used, the format
may be set manually using the File/Open Data As... dialog.
• Enter 1 in the first,second and third text field of the Voxel Size port.
• Click OK.
This method will always create a data set with uniform coordinates, i.e., uniform slice distance. In
case of variable slice distances, the StackedSlices format should be used.
• # Avizo Stacked Slices is an optional header that allows Avizo to automatically deter-
mine the file format.
• pathname is optional and can be included if the pictures are not in the same directory as the
description file. A space separates the tag ”pathname” from the actual pathname.
• On Windows systems, pathname should still be specified with / and not.
• pixelsize is optional, too. The statement specifies the pixel size in x- and y-directions. The
bounding box of the resulting 3D image is set from 0 to pixelsize*(number of pixels-1).
• picture1.tif 10.0 is the name of the slice and its z-value, separated by a space character.
• end indicates the end of the description file.
• Comments are indicated by a hash-mark character (#).
The data will be displayed in the Project View as a regular green data icon. The info line indicates that
it belongs to the data class HxRawAsExternalData.
This retrieves a down-sampled version of the data. Disconnect the grain.view data icon from
the Extract Subvolume module by selecting NO SOURCE in the Master port of grain.view, and
use it as an overview (e.g. with Ortho Slice). Selecting NO SOURCE in the DATA port of Extract
Subvolume doesn’t disconnect grain.view from Extract Subvolume
• Selecting the Extract Subvolume module in the Project View and deselect the subsample check
Figure 4.4: The usage of Avizo as Large Disk Data. For instantaneous update, the auto-refresh check boxes of the Extract
Subvolume and Isosurface modules have been checked
Loading Avizo, StackedSlices, and Raw ”as Large Disk Data” is a convenient and fast way of exploring
data that exceed the size of system memory. However, especially with StackedSlices, it is not always
the most efficient way of doing this. Avizo can store the image data in a special format that facilitates
the random retrieval of data from disk.
Although you will most likely not notice any difference with the small image data used in this tutorial,
this method for retrieving large data significantly accelerates the Apply operation.
Please follow the instructions below. Each step builds on the step before.
In the Edit menu, select the Preferences item. This opens the AvizoPreferences dialog. Please select
the LDA tab (see Figure 4.6). Using the slider or text field, set the threshold to 10MB. When you load
a file of file size greater than this threshold, the out-of-core data dialog will be displayed.
Note: To see the images as laid out in this tutorial, you should also use the Layout tab of the
Edit/Preferences menu, and toggle on show viewer in top-level window.
Please open the file grain.raw using the File/Open Data... menu (see Figure 4.7). The file is located in
$AVIZO ROOT/data/tutorials/outofcore/ in the Avizo install directory. Its size is 16MB,
above the defined threshold.
The Out-Of-Core data dialog is displayed. Three loading options are displayed (see Figure 4.8):
• Convert to LDA: convert the file to an LDA file, and then load it.
• PRO: This builds a multiresolution file allowing full interactive view or local full resolu-
tion viewing.
• CON: This can be time consuming, with an initial pass and then the true conversion pass.
• Read from disk: read data blocks from disk, allowing almost continuous disk access.
• PRO: No need to generate an extra file.
• CON: Continuous access to disk. Slow with data sets larger than 4GB.
• Read in memory: load full data into memory and then access to memory only.
• PRO: Adapted for average sized data.
• CON: Requires as much RAM as your data set size. Usually not applicable for data sets
greater than 500MB or 1GB.
Please select ”Convert to LDA”. Then, on the next dialog (Destination file), specify the LDA destina-
tion file. grain.lda for instance (see Figure 4.9).
Note: An .lda file can be loaded then, without any conversion required.
Another option allows you to perform conversion in batch mode so you can run other processes while
the conversion is done in the background.
As the input data is raw, please fill in the raw data parameters dialog with information as on the
following figure (see Figure 4.10):
Data type is byte, dimension 256*256*256.
During conversion, the out-of-core conversion progress is showed in the progress bar (see Figure 4.11).
This process is done in two steps. First of all, an initial step, and then the conversion step at about
4MB/s (on a P4 2.6GHz, no SATA disk). You can cancel the process if you wish.
Right-click on the data icon in the Project View. In the Display submenu choose the Ortho Slice
module. Repeat these steps for a Slice and a Volume Rendering. You can also display the bounding
box of the full volume.
In order to view this scene with the same settings, after converting grain.raw into grain.lda (lda
file required, with the right name) please load the project grain.hx (in the same directory
$AVIZO ROOT/data/tutorials/outofcore).
1. orthogonal slices
2. simple threshold segmentation
3. resampling the data
4. displaying an isosurface
5. cropping the data
6. volume rendering
We start by loading the data you already know from Section 3 (Getting Started): a 3D image data set
of a part of a 256 x 256 x 128 CT scan of an engine block.
• Connect a Bounding Box module to the data (use right mouse on motor.am).
• Connect an Ortho Slice module to the data.
• Connect a second and third Ortho Slice module to the data.
• Select Ortho Slice 2 and press xz in the Orientation port.
• Similarly, for Ortho Slice 3 choose yz orientation.
• Rotate the object in the viewer to a more general position.
• Change the slice numbers of the three Ortho Slice modules in the respective ports or directly in
the viewer as described in section Getting Started.
In addition to the Ortho Slice module, which allows you to extract slices orthogonal to the coordinate
axes, Avizo also provides a module for slicing in arbitrary orientations. This more general module
is called Slice. You might want to try it by selecting it from the Display submenu of the engine data
popup menu.
Visualizing 3D Images 59
Figure 4.13: Engine data set visualized using three orthogonal slices.
Figure 4.14: By adjusting the data window of the Ortho Slice module a suitable value for threshold segmentation can be found.
Intensity values smaller than the min value will be mapped to black, intensity values bigger than the max value will be mapped
to white.
A more powerful way of quantitatively examining intensity values of a data set is to use a data probing
module Point Probe or Line Probe. However, we will not discuss these modules in this introductory
tutorial.
Visualizing 3D Images 61
press the green Apply button at the bottom of the Properties Area to start the computation. After you
press this button they produce a new data object containing the result.
A new green data icon representing the output of the resample computation named motor.Resampled
is created. You can treat this new data set like the original engine data. In the popup menu of the
resampled engine you will find exactly the same attachable modules and you can save and load it like
the original data.
You may want to compare the resampled data set with the original one using the Ortho Slice module.
You can simply pick the blue line indicating the data connection and drag it to a different data source.
Whenever the mouse pointer is over a valid source, the connection line appears highlighted in lighter
blue.
A new window pops up. There are two ways to crop the data set. You can either type the desired
ranges of x, y, and z coordinates into the crop editor’s window or put the viewer into interaction mode
and adjust the crop box using the green handles directly in the viewer window.
The new dimensions of the data set are given in the Properties Area. If you want to work with this
cropped data record in later sessions you should save it by choosing Save Data As ... from the File
menu.
As you already might have noticed, the crop editor also allows you to rescale the bounding box of the
data set. By changing the bounding box alone, no voxels will be cropped. You may also use the crop
editor to enlarge the data set, e.g., by entering negative values for the Min index fields. In this case the
Visualizing 3D Images 63
Figure 4.16: The crop editor works on uniform scalar fields. It allows you to crop a data set, to enlarge it by replicating boundary
voxels, or to modify its coordinates, i.e. to scale or shift its bounding box.
first slice of the data set will be duplicated as many times as necessary. Also, the bounding box will be
updated automatically.
• Remove all objects in the Project View other than the motor.am data record.
• Select the data icon and read off the range of data values printed on the first info line (0...255).
• Connect a Volume Rendering module to the data.
• Set the range in the Colormap port of the Volume Rendering to 74..255.
• Select the Volume Rendering Settings and change the lighting to none.
Figure 4.17: The Volume Rendering module can be used to generate volume renderings based on an emission-absorption model.
Segmentation of 3D Images 65
Figure 4.18: Lighting computation are applied to the volume rendering, resulting in an easier to understand representation.
pixel belongs, e.g., material 1 or material 2. The segmentation is stored in a separate data object called
a Label Field. A segmentation is the prerequisite for surface model generation or accurate quantifi-
cation such as volume measurement. The segmentation process can be automatic, semi-automatic or
interactive depending on the input images and desired results. This tutorial introduces each approach.
This tutorial comprises the following steps:
A new green icon appears, the Label Field that will hold the segmentation results. Simultaneously, the
image segmentation editor is displayed in the 3D viewer pane.
By default, the segmentation editor operates in 4-viewer mode. In this mode, three 2D viewers with
different orientations and an additional 3D viewer are displayed.
The tools of the segmentation editor are displayed where the Project View and Properties Area are
normally displayed. You can click on the tabs at the top of this region to switch between the two
displays. For this tutorial, you’ll want to display the segmentation tools.
• Use the mouse to expand the viewer so that you have more room to maneuver in.
• In the upper right view, use the slider on the bottom to scroll through the slices. Go to slice 30.
You see six ”white” structures.
• If necessary, click on the second button under the label Zoom and Data Window to zoom out the
data so that you have a view of the entire slice.
• Click on the second button under the label Tools, the brush.
• Mark the one of the structures with the mouse. Hold down the control button to unselect wrongly
selected pixels if necessary.
• When done, select the entry Inside in the Materials list. Then click the + button under the
Selection label.
The previously selected pixels are now assigned to the material Inside. You can right click on the entry
Inside in the Materials list and choose a different draw style (for example, dotted).
• Click into the material list and choose New Material from the right button menu.
• Mark a second structure using the brush, select the new material in the Materials list and assign
the pixels to that structure.
• Go to slice 31 and practice by segmenting the two same structures.
Hint: If you prefer to work with one larger view rather than four smaller views, click on the Lay-
out1 button in the viewer toolbar. To cycle through each of the four views, press the Layout1 button
repeatedly. To return to 4-viewer mode, press the Layout4 button.
If a structure does not change a lot from slice to slice, you can use interpolation.
• Go to slice 30 and mark the top right structure using the brush. Go to slice 35 and mark the same
structure.
• Choose from the menu bar: Selection/Interpolate.
Segmentation of 3D Images 67
Figure 4.19: Image segmentation editor after selecting and assigning pixels for two structures in one slice
Hints:
• It is highly recommended to frequently save the segmentation results while working. In order
to do so, select the label field in the Avizo main window and choose Save or Save As... from the
Avizo File menu.
• The brush is only the most basic segmentation tool. The segmentation editor provides many
more functions that are described on its reference page.
• There are many useful key bindings, including SPACE and BACKSPACE to change the slice
number or ”d” to toggle the draw style.
• Of course you can give the materials more meaningful names or colors using the context menu
(right mouse button in the list).
At this point you may want to close the editor by pressing the Close button. Save the label field. In the
next tutorial you will learn how to create a 3D surface model from the segmentation results.
The units in the volume column depend on the units you have specified the voxel size.
Segmentation of 3D Images 69
The first step is to separate the object from the background. This is done by segmenting the volume
into exterior and interior regions on the basis of the voxel values.
By this procedure each voxel having a value lower than the threshold is assigned to Exterior and each
voxel whose value is greater than or equal to the threshold is assigned to Interior. This may, however,
cause artifacts that are not part of the object but which have voxel values above the threshold to be
assigned to the interior. This can be suppressed by setting the remove couch option which assures that
only the biggest coherent area will be labeled as the interior and all other voxels are assigned to the
exterior.
After you press the Apply button, a new data object is computed and its icon appears in the Project
View. The data object is denoted motor.labels. It is of type Label Field, represents a cubic grid with
the same dimensions as motor.am, and contains an interior or exterior label for each voxel according
to the segmentation result.
• Select the motor.labels icon and click on the Segmentation Editor icon in the green title bar in
the Properties Area.
• In the lower right view, use the slider on the bottom to select slice 206.
• Choose a magnification ratio suitable by pressing the zoom-up button in the Zoom and Data
region of the editor.
The image segmentation editor shows the image data to be segmented (motor.am) as well as brownish
contours representing the borders between interior and exterior regions as contained in the motor.labels
data object. As you can see, the borders are not so smooth and there is a little island in the lower center,
bordered by brownish contours. This is what we want to improve now.
• Choose Remove Islands... from the editor’s Segmentation menu. In response, a little dialog
window appears.
• In the dialog window select the all slices mode. Then press Remove in order to apply the filter
in all slices. Note how the segmentation results become less noisy.
• To further clean up the image, choose Smooth Labels... from the editor’s Segmentation menu.
Another dialog box appears.
• Select the 3D volume mode and press the Apply button in order to execute the smoothing opera-
tion.
• To examine the results of the filter operations, browse through the label field slice by slice. In
addition to the slice slider you may also use the cursor-up and cursor-down keys for this.
• Click on the cross button to close the image segmentation editor.
Segmentation of 3D Images 71
• Compute/Connected Components. This module searches for connected regions.
• Image Segmentation/Correlation Histogram. This module can create a label field from correlated
regions in 2 images sets, typically after registration.
• Image Segmentation/Interactive Thresholding and other tools from Avizo Fire Edition. This
extension offers advanced tools for quantification including object separation and labelling. See
Chapter 13 Avizo Fire Edition User’s Guide.
Prior to segmentation, think about improving image quality and reducing noise in dataset with:
Avizo allows the user to create geometric models derived from various types of data: surfaces from
points sets, surfaces from 3D images, tetraedral grid from surfaces, center line spatial graphs from 3D
images. For an overview of related features, please refer to Features overview section. The tutorials in
this chapter introduce the following topics:
As a prerequisite for the following steps, you need a label field, which holds the result of a previous
image segmentation. You can either use the label field which you created in the previous tutorial or
load the provided motor.labels.am data set from the data/tutorials directory.
5.1.1 Extracting Surfaces from Segmentation Results
Now we let Avizo construct a triangular surface of the segmented object.
The option add border ensures that the created surface be closed. A new data object motor.labels.surf
(or motor.surf.am depending from your starting point) is generated. Again, it is represented by a green
icon in the Project View.
The number of triangles is reduced from over 1.2 millions to 49K. The progress bar tells you how
much of the simplification task has already been done.
To examine the simplified surface, attach a Surface View module to the motor.labels.surf data object.
The Surface View module maintains an internal buffer and displays all triangles stored in this buffer. By
default the buffer shows all triangles forming the boundary to the exterior. If you change the selection
at the Materials port, the newly selected triangles are highlighted, i.e., they are displayed using a red
wireframe representation. The Add and Remove buttons cause the highlighted triangles to be added to
or removed from the buffer, respectively. You may easily visualize a subset of all triangles using a 3D
selection box or by drawing contours in the 3D viewer. Press the Clear button of the Buffer port to see
the display shown in Figure 5.1.
As a prerequisite for the following steps, you need a triangular surface, which is usually the result of
a previous surface reconstruction. Load the supplied motor.labels.surf data set from the data/tutorials
Automatically, a Surface View module will be attached to the motor.labels.surf surface. For details
about that module see its description.
When the Surface Editor is invoked, the Surface menu is added to Avizo’s menu bar and a new toolbar
is placed just below Avizo’s viewer toolbar. The Surface/Tests menu contains 8 specific tests which are
useful for preparing a tetrahedral grid generation. Each of the tests creates a buffer of triangles which
can be cycled through using the back and forward buttons.
• Select Intersection test from the Surface/Tests menu. The total number of intersecting triangles is
printed in the viewer window. Intersections shouldn’t occur too often if toggle fast was switched
off during surface simplification. In case they occur, the first of the intersecting triangles and its
neighbors are shown in the viewer window.
• You can manually repair intersections using four basic operations: Edge Flip, Edge Collapse,
Edge Bisection, and Vertex Translation. See the description of the Surface Editor for details.
• After repairing, invoke the intersection test again by selecting it from the Surface/Tests menu or
by pressing the Compute button.
• When the intersection test has been successfully passed, select the Orientation test from the
Surface/Tests menu. After surface simplification, the orientation of a small number of triangles
may be inconsistent, resulting in a partial overlap of the materials bounded by the triangles. In
case of such incorrect orientations, which should occur quite rarely, there is an automatic repair.
If this fails, the detected triangles will be shown, and you can use the above mentioned manual
operations for repair.
Note: There are two prerequisites for the orientation test: the surface must be free of intersec-
tions, and the outer triangles of the surface must be assigned to material Exterior. If the surface
does not contain such a material or if the assignment to Exterior is not correct, the test will
falsely report orientation errors.
A successful pass of the intersection and orientation test is mandatory for tetrahedral grid generation.
These tests are automatically performed at the beginning of grid generation. So you can directly enter
the Generate Tetra Grid module (see below) and try to create a grid. If one of the tests fails, an error
message will be issued in the console window. You can then go back to the Surface Editor and start
• Select Aspect ratio from the Surface/Tests menu. This computes the ratio of the radii of the
circumcircle and the incircle for each triangle. The triangle with the worst (i.e. largest) value is
shown first, and the actual value is printed in the viewer window. The largest aspect ratio should
be below 20 (better below 10). Fortunately there is an automatic tool for improving the aspect
ratio included in the Surface Editor.
• Select Flip edges from the Surface/Edit menu. A small dialog window appears. In the Radius
ratio area, set the value of the ”Try to flip an edge if ratio is worse than” field to 10. Select mode
operate on whole surface. Press button Flip. All triangles with an aspect ratio larger than 10 will
be inspected. If the aspect ratio can be improved via an edge flip, this will be done automatically.
The console window will tell you the total number of bad triangles and how many of them could
be repaired. Press the Close button to leave the Flip edges tool.
• Select again Aspect ratio from the Surface/Tests menu. Only a small number of triangles with
large aspect ratio should remain after applying the Flip edges tool.
• Select Dihedral angle from the Surface/Tests menu. For each pair of adjacent triangles, the
angle between them at their common edge will be computed. The triangle pair including the
worst (i.e. smallest) angle is shown and the actual value is printed in the viewer. The smallest
dihedral angle should be larger than 5 degrees (better larger than 10).
• For a manual repair of a small dihedral angle proceed as follows: select the third points of both
triangles (i.e. the points opposite to the common edge) and move them away from each other.
For moving vertices you must enter Translate Vertex mode by clicking on the first icon from the
right on the top of the viewer window or by pressing the "t" key. If the viewer is in viewing
mode, switch it into interaction mode by pressing the ESC key or by clicking on the arrow icon
(the first icon from the top) on the right of the viewer window. Click on the vertex to be moved.
At the picked vertex a point dragger will be shown. Pick and translate the dragger for moving
the vertex.
• In some cases an edge flip might also improve the situation. Enter Edge Flip mode by clicking
on the third icon from the right on the top of the viewer window or by pressing the "f" key.
Switch the viewer into interaction mode. Click on the edge to be flipped.
• Select Tetra quality from the Surface/Tests menu. For each surface triangle the aspect ratio of
the tetrahedron which would probably be created for that triangle will be calculated. The aspect
ratio for a tetrahedron is defined as the ratio of the radii of the circumsphere and the inscribed
sphere. The triangle with the worst (i.e. largest) value is shown and the actual value is printed
in the viewer. The largest tetrahedral aspect ratio should be below 50 (better below 25). If
all small dihedral angles have already been repaired, the tetra quality test will mainly detect
configurations where the normal distance between two triangles is small compared to their edge
lengths. Again, the vertex translation and the edge flip operation are best suited for a manual
repair of large tetrahedron aspect ratios.
• Leave the Surface Editor by again clicking on the Surface Editor button in the Properties Area.
• Connect a Generate Tetra Grid module to the motor.labels.surf surface by choosing Compute
Generate Tetra Grid from the popup menu over the motor.labels.surf icon. You can also choose
to start by loading the motor.simplified surface from the tutorial directory.
• Leave toggle improve grid switched on and toggle save grid switched off at the Options port.
The improve grid option will invoke an automatic post-processing of the generated grid, which
improves tetrahedral quality by some iterations that move inner vertices and flip inner edges and
faces. See the description of the Grid Editor for details.
If toggle save grid is selected, an additional port Grid appears, where you can enter a filename.
The resulting tetrahedral grid will be stored automatically under that name. If you want to run
grid generation as a batch job, you must select the save grid option.
• Press the Meshsize button of the Action port. An editor window will appear. It allows you to
define a desired mesh size, i.e., mean length of the inner edges to be created, for each region.
For this you must enter the bundle of that region, and select parameter MeshSize. Then you can
change the value in the text field at the lower border of the editor. There are some predefined
region names in Avizo for which a default mesh size will be automatically set. Make sure that
the default values are suitable for your application. If you are not sure about a suitable value,
set the desired mesh size to 0. In this case the mean edge length of the surface triangles will be
used.
• Press the Run now button at port Action. A pop-up dialog appears asking you whether you really
want to start the grid generation. Click Continue in order to proceed.
Once grid generation is running, the progress bar informs you about the number of tetrahedra which
already have been created. In some situations grid generation may fail, for example, if the input surface
intersects itself. Then an error message will occur at the Console Window. In this case go back to the
Surface Editor to interactively fix any intersections.
After the tetrahedral grid has been successfully created, a new icon called motor.labels.grid will be
put in the Project View. You can select this icon in order to see how many tetrahedra the created grid
contains. If grid generation takes too long, you may also load the pre-computed grid motor.tetragrid.am
from the data/tutorials directory.
As the very last step you may want to have a look at the fruits of your work:
The Tetra Grid View module maintains an internal buffer and displays all tetrahedra stored in this
buffer. By default the buffer is empty, but all tetrahedra are highlighted, i.e., they are displayed using
a red wireframe representation. The Add to button causes the highlighted tetrahedra to be added to
the buffer. You may easily visualize a subset of all tetrahedra using a 3D selection box or by drawing
contours in the 3D viewer.
Similar to the Surface Editor, there is a Grid Editor which can be invoked by selecting the green icon of
the tetrahedral grid and clicking on the pencil icon (first from the right in the title bar) in the Properties
• 3D mesh generation for numerical simulation applications such as flow, stress, or thermal anal-
ysis,
• Export of surfaces or 3D meshes to numerical solvers,
• Post-processing of result data coming from solvers,
• Powerful visualization and analysis of scalar, vector, and tensor fields, coming from either sim-
ulation or measurements.
Avizo Wind Edition is the software suite including standard feature set and all extensions required
for visualizing, post-processing, analyzing, and presenting results from CAE and CFD simulations.
For extended support for numerical data - import/export, analysis, and visualization - please refer to
chapter 14 Avizo Wind Edition User’s Guide.
Avizo Standard Edition provides a first level of support summarized in the following sections:
For convenience, in Avizo Standard Edition, the Avizo XMesh Pack gathers modules providing basic
support for visualization of FEA and CFD data. For a complete overview of features that can com-
plement analysis and presentation of numerical data, please refer to Features overview section and
Chapter 14 Avizo Wind Edition User’s Guide.
The recommended tutorials for post-processing using Avizo Wind Edition can be found in Chapter 14
Avizo Wind Edition User’s Guide.
The online version of this chapter contains tutorials for the following topics using Avizo Standard
Edition:
Avizo supports visualization of triangular surfaces with attached numerical data (Surface View). Sur-
faces can be directly imported (see File Formats in the Reference Guide), or generated from 3D image
labels (Generate Surface) or point clusters (Delaunay Triangulation and Point Wrap Triangulation).
It is possible to simplify, smooth and edit surfaces, compute surface curvature and surface distances,
align and warp surfaces, export surfaces and much more.
Avizo XMesh Pack provides additional features such as surface registration (Align Surfaces), quality
control (Triangle Quality), processing and visualization of vector data over surfaces (Displace Vertex,
Magnitude, Vectors Slice, Stream LIC Surface, Line Streaks), data interpolation (Interpolate) and 3D
grid generation (Generate Tetra Grid).
82 Chapter 6: Visualization and Analysis of 3D Models and Numerical Data with Avizo
6.2 Supported grids in Avizo XMesh Pack
Avizo supports a wide range of 3D meshes. Display and compute modules may be dedicated to a
specific kind of grid. This is specified in the module help.
In Avizo Standard Edition you can work on:
• Regular grids,
• Unstructured tetrahedral grids,
• Unstructured hexahedral grids.
• Unstructured models grids (abritrary sets of tetrahedron, hexahedron, wedge and pyramid ele-
ments).
Note: If an Avizo Wind Edition license is detected at run-time, whenever loading files with format
AVS, Fluent, Ideas, Tecplot, or any format supported in Avizo Wind Edition (see File Formats index
for a complete list), an unstructured model grid is created automatically that can be connected to Avizo
Wind Edition modules. This is true even if the file contains only tetrahedra, or only hexahedra or if the
mesh is a regular grid.
Regular grids include four types of grids:
• Uniform grids, the simplest form of regular grids because all grid cells are axis-aligned and of
equal size;
• Stacked grids, that are composed of a stack of uniform 2D slices with variable slice distance;
• Rectilinear grids, where the grid cells are aligned to the axes, with distance between cells that
may vary in each direction;
• Curvilinear grids, each node of which has its position stored as a 3D vector and is numbered one
after another.
For more details, please refer to section 21.5.2.2 for regular coordinate types.
Section 21.5.3 for tetrahedral grids and section 21.5.4 for hexahedral grids contain information on
these grid properties and on their coordinates or data storage systems.
Figure 6.1: Motor grid representation colored with respect to the diameter ratio of the tetrahedral cells.
84 Chapter 6: Visualization and Analysis of 3D Models and Numerical Data with Avizo
6.4 Scalar fields visualization
The volumetric visualization tools discussed in section 6.3 can also be used to visualize scalar fields
on the whole volume since most of these modules have a pseudo-coloring functionality.
Figure 6.2: Density used as colorfield for the pseudo-coloring of the hexahedral grid of a helicopter combustion chamber
section.
Field Cut for tetrahedral grids has the same pseudo-coloring capability for visualizing cross sections
of a 3D scalar field.
Isosurfaces (e.g. Isosurface for tetrahedra) are powerful display tools to aid in the understanding of
physical phenomena and they are available for every kind of grid supported by Avizo XMesh Pack.
The most intuitive way to display a vector field is to plot the vectors as arrows. With the Vectors Slice
module, you can plot vector fields defined on any grid type supported by Avizo XMesh Pack on a plane
cut of the domain.
A volumetric representation is available for vector fields defined on tetrahedral grids with the Tetra
Vectors module.
The Particle Plot module represents vector fields (for all kind of grids supported by Avizo XMesh
Pack) by particles (cones) pointing in the direction of the local flow. The particle plot can also be
animated to show the flow motion.
Drawing the pathlines of particles is a good way to represent and understand the behavior of a flow,
for example for turbulent flows with many recirculations. To do so, you can use the Stream Ribbons
module or the Illuminated Streamlines module. The choice of the seed points can be done in different
ways, for example using the Seed Surface module.
Finally, the Stream LIC Surface module visualizes a vector field defined on an arbitrary 3D triangular
surface using a line integral convolution (LIC) algorithm which generates a surface texture that reveals
the directional structure of the vector field. A similar 2D algorithm is implemented by the Stream LIC
Slice module.
Please refer to tutorial Air flow around an airfoil, especially for Line Integral Convolution and Illumi-
nated Streamlines techniques applications. This tutorial is available in the online documentation.
Figure 6.3: Stream LIC Slice display of the air velocity vector field behind an airfoil.
86 Chapter 6: Visualization and Analysis of 3D Models and Numerical Data with Avizo
6.6 Time dependent data visualization
The visualization features previously mentioned can be efficiently combined with the Time Series
Control module from Avizo. After loading data via the Open Time Series Data... option in File menu,
one can connect display or compute modules to the data and use Time Series Control to obtain and
play an animation sequence of, e.g., a flow behavior in time.
This technique is especially appropriate for the Particle Pathlines display module. Combined with the
Time Series Control, it represents a vector field by a set of particles that move in time according to the
vector direction and velocity.
Please refer to the Flow around a square cylinder tutorial for suggestions on other Avizo XMesh
Pack modules to use for time dependent data visualization. This tutorial is available in the online
documentation.
Avizo XMesh Pack provides some computational and visualization support for symmetric second order
tensors.
88 Chapter 6: Visualization and Analysis of 3D Models and Numerical Data with Avizo
Chapter 7
Once you have learned how to define an animated demo sequence, you can further learn how to record
the demonstration into a movie file in Section 7.2.
orange diamond symbol in the timeline panel, this will activate a small input field where you can
adjust the time and the accompanying value for the port that it is associated with. In order to adjust the
schedule you can simply drag the diamond icon to the desired position on the timeline.
With this operation we have defined the beginning of the animation of the slice position. Next we want
to define the time where the animation should end. To do this we drag the master time slider to the
desired time on the timeline, e.g., to 00:04.000, which means 4 seconds. As a next step, we set the
slice position of the Ortho Slice module by either setting the Slice Number port in the properties of the
module or by positioning the slice interactively in the viewer window. Using either method, set the
value of the Slice Number port should be set to 127. After you click the stopwatch button again, the
keyframe is created in the timeline:
You can test your first animation by positioning the master time slider back to 00:00, either by click-
ing on the Jump To Start button or by entering the desired time into the Current Time control
Figure 7.6: start event keyframe and end stop event keyframe in timeline
30 seconds won’t run for last exactly 30 seconds but will run 30 seconds or longer.
As an exercise, adjust the master time slider to the time 00:12, set the position of the Slice Number of
the Ortho Slice to the value 0, and click the stopwatch button again. This will create another keyframe
in the timeline. Restart the animation again as described above. The slice should first move from slice
number 64 up to 127 during 4 seconds and then decrease down to the value 0 within the next 8 seconds.
Note: As described above you can edit the time and the value of single keyframes by hovering the
mouse cursor above the keyframe icon and by clicking in its user interface after it has been become
visible (hover dialog box). Alternatively you can modify the time of the keyframe by dragging it on the
timeline. In order to change the value of the associated port, you can position the master time slider
on the time of the keyframe and then adjust the value of the port by using the user interface in the
You can now shift all selected keyframes forwards or backwards by dragging the dark gray bar.
To test the newly added event, set the master time slider of the Animation Producer back to the be-
ginning by using one of the methods described above. As you have may noticed, another event has
been automatically added at time 00:00 to consider the surface model as invisible by default. Start the
animation. As before, the slice moves back and forth. When the master time slider reaches 00:12, the
surface model is switched on.
Note: You can change the time when the Surface View becomes visible by simply dragging the appro-
priate keyframe diamond on the timeline.
To look at the 3D model from all sides, let’s add a camera rotation to our demo sequence. From the
Project >Create Object... menu, select Animations And Scripts / Camera Orbit. Try the rotation by
playing the time slider in the Camera Orbit module. If you do not like the axis of rotation, reset the
time slider to 0, navigate to a good starting view in the viewer window, and click on recompute in the
Camera Orbit module. Note that the values of the Camera Orbit time slider range from 0 to 360.
Once you are satisfied with the camera rotation, add it to the timeline:
Now play the demo to see the result. After moving the slice and switching on the surface model, the
view is rotated so that the surface can be seen from all sides.
• Attach a second Surface View module to the motor.labels.surf data set. Since Exterior and All
are selected as the default materials, this brings up the exterior surface.
• Click on the second SurfaceView module. It should be called SurfaceView 2.
• Select transparent from the Draw Style port.
• It will be helpful to show the inside surfaces underneath the exterior surface, so jump to time
step 00:14 or later in the Animation Producer module.
• Adjust the grade of transparency using the BaseTrans slider in SurfaceView 2.
• Smooth out the outer surface by clicking on more options in the Draw Style port and selecting
Vertex normals.
Like we did with the inside surfaces model, we can switch on the outer surface model at some point in
the animation sequence:
• Set the master time slider to the time where our surface should become visible, e.g., 00:14.
• Click on the top most stopwatch icon in the properties area of the SurfaceView 2 module.
• Select Visibility in Viewer 0 from the drop-down menu.
• Move the master time slider to the time that you selected to make the Surface View2 module
visible (e.g., 00:14).
• Click on the Surface View2 module.
• Click on the top most stopwatch icon in the properties area of the Surface View2 module.
• Select Clip using Ortho Slice from the drop-down list.
• Move the mouse cursor over the newly created keyframe in the timeline and wait until the user
interface for this keyframe has become visibile.
Figure 7.11: selecting Clip using Ortho Slice and enabling the clipping in the timeline
In order to make the outer surface visible, we finally must animate the Ortho Slice towards the bottom
of the scene:
• Set the master time slider to the position where you have set the keyframe to make Surface View2
visible e.g. 00:14.
• Select the Ortho Slice module in the Project View.
• Click on the small stopwatch icon of the port Slice Number to set a new keyframe in the timeline.
• Move the master time slider to the time where you want the animation to be finished, e.g., 00:22.
• Move the Slice Number value to the value 127.
• Click again on the small stopwatch icon of the Slice Number port.
Start the animation either from the beginning or from 00:14 and watch the result.
As a last step, you might want to rotate the view again while the outer surface is appearing. You can
simply reuse the old camera rotation during a second time range:
• Set the master time slider to the time where you started to make the outer surface visible, e.g.,
00:14.
• Select the Camera-Orbit module.
• Click on the stopwatch icon of the port Time. This will insert a new keyframe to the timeline.
• Move the master time slider to the time where you want the camera rotation to be finished e.g.
00:22.
• Set the time value of the port Time to 0.
• Click again in the stopwatch icon of the Time port.
Figure 7.12: How simply invert the orientation of the clipping in Animation Producer
You do not need to use an Ortho Slice module to do clipping. As you may have observed, the Ortho
Slice might occlude parts of what you want to show. In that case, it is better to create an empty Clipping
Plane module by selecting Other / Clipping Plane from the Project >Create Object... menu. Attach
the module to the data set you want to clip (e.g., to motor.labels.surf in our example), and then use the
Clipping Plane for clipping just as you used the Ortho Slice before.
• Set the master time slider to the time when the Surface View appears, e.g., 00:12.
• In the left panel of the Animation Producer click on the + Add special event button.
This way the animation will stop at time 00:12, which is right when the model is switched on. When
you play the animation from the start, you will notice that after the inner structure is switched on, the
animation will stop.
Let us insert a second break at time step 00:14, which is right before the outer surface is starting to
show. Proceed as above, using a trigger time of 00:14 instead of 00:12.
If you run the animation from the very beginning, it will stop after the inside surfaces are displayed.
Click on the Play Forward button or press [F4] to continue the animation.
Try this by pressing the function key [F4]. The demo continues.
Likewise, the animation will stop just before showing the outer surface. Again, you can continue the
demo by pressing [F4]. In general, at any point while the animation is running, you can press the [F3]
key to stop it manually. Pressing [F4] will continue from the point where the animation stopped.
If you have defined breaks as we did above, there are two additional function keys that in a sense allow
you to navigate through the animation segments: pressing [F9] will jump back to the previous break
or to the very beginning of the animation, and [F10] will jump to the next break, or to the very end of
the animation.
Note: If you use [F9/F10], it will just jump, and you need to press [F4] to start playing it from the new
time step.
Please note that you can disable the breaks by checking the skip break toggle in the More Options
panel of the Animation Producer module. You may even disable the definition of function keys by
checking the No toggle in the Activate Function Keys port:
Figure 7.15: Loop options: Play Once, Play Loop, or Play Swing
Now if you play the animation, it will play from beginning to end once (Play Once), start over from
the beginning (Play Loop), or play forwards, backwards, and so on (Play Swing).
However, you may want to define some part of the demo to run in a loop, and then stop the loop
and continue with the animation upon key press. You can easily do this with the Goto feature of the
Animation Producer module:
• In the Animation Producer module adjust the main time control to the time 00:11:950.
When you run the animation sequence now, it will loop in the segment between time 00:04 and 00:12,
only showing the Ortho Slice move up, jump down, move up again and so on... You can stop this by
clicking on the stop button of the Animation Producer control panel or by pressing [F3]. To continue
after the loop, you need to jump to the next segment by pressing [F10], and then start playing again by
pressing [F4].
Just activate the Activate Auto Start functionality by checking the Yes radio button and save the project.
When you load it again, the demo will start running automatically.
The easiest way to create a simple camera path is to use the Camera Orbit module. From the Project
>Create Object... menu, select Animations And Scripts / Camera Orbit and press the play button of the
newly created module. You can watch the scene rotate in the viewer while the time slider is playing.
To record an animated scene into a movie file, you need to attach a Movie Maker module to a module
that possesses a time slider port. The movie is recorded by going through the individual time steps and
taking snapshots of the viewer along the way.
In our example, the Camera Orbit module has a time slider, so we can attach a Movie Maker module
to it by right-clicking on the Camera Orbit icon in the Project View and selecting Movie Maker from
the popup menu.
In the Movie Maker module, first click on the Browse button in the Filename port and enter a movie file
name like C:/tmp/test.mpg. The .mpg suffix suggests that the movie file format will be MPEG,
which is a widely accepted standard format for digital movies achieving a good compression ratio.
Next, adjust the parameters of the Movie Maker module to your liking, e.g., change the number of
frames, the image size, or the compression quality. Please refer to the Movie Maker documentation for
details.
In our example, let us choose 180 frames and leave all other parameters untouched. Since the Camera
Orbit module does a full rotation of 360 degrees, each of the 180 frames will represent a rotation of
two degrees with respect to the previous frame. Press the Apply button to start recording.
Wait for some time while the Movie Maker module drives the Camera Orbit module and accumulates
the snapshots. Please note that the speed during the recording process is different than the play-
back speed of the movie. Now view the resulting movie file test.mpg with a movie player of your
choice (e.g., Windows Media Player or a similar tool). Experiment with the recording parameters until
you get the desired result (e.g., control the file size and image quality by changing the Compression
quality value, choose different image sizes to see up to which image size your computer is capable of
smoothly displaying the movie, and change the number of frames to control the speed of the rotation).
The Animation Producer module internally uses a Movie Maker module to create movies. This mod-
ule is already pre-configured to create a movie that respects the animation settings (duration, frame
rate, filename...) that are defined by the Animation Producer module. However, you can adjust these
parameters if needed. Just click on the Create Movie button to generate the movie.
In this tutorial you will learn how to integrate complex calculus into Avizo using MATLAB (The
MathWorks, Inc) by the means of the Calculus MATLAB module.
In order to use the Calculus MATLAB module, MATLAB must be correctly installed on your com-
puter. In addition, in order to allow this module to establish a connection with the MATLAB compu-
tational engine, you may need to register the MATLAB engine (on Windows), and to set environment
variables for including MATLAB libraries or programs in search paths, depending on your system.
See the documentation of the Calculus MATLAB module for installation details and limitations.
This tutorial, available in the online documentation, covers the following topics through various exam-
ples:
Deconvolution
Avizo XMicroscopy Pack’s deconvolution modules provide powerful algorithms for improving the
quality of microscopic images recorded by 3D widefield and confocal microscopes. Two different
methods are supported, namely a so-called non-blind and a blind deconvolution method, both based
on iterative maximum-likelihood image restoration. In the first case a measured or computed point
spread function (PSF) is required. In the second case the PSF is estimated along with the data itself.
The deconvolution documentation is organized as follows:
Examples:
• Confocal data set
• Widefield data set
where n denotes the refractive index of the object medium and α the aperture half angle as determined
by NA = n sin(α).
For a confocal microscope, both the in-plane sampling distance and the axial sampling distance need
to be in theory approximately 2 times smaller. However, this requirement is far too strict for most
practical cases and even in the widefield case, approximately fullfilling the above requirements is
often sufficient.
As an example we are going to use a confocal test data set (polytrichum.am) provided with the Avizo
deconvolution modules. The data file is located in the directory Avizo-8/data/deconv.
The data set shows four chloroplasts in a spore of the moss polytrichum commune.
The PSF appears as a bright spot located in the middle of the image volume (Figure 9.1). It is important
that the PSF is exactly centered. Otherwise, the deconvolved data set will be shifted with respect to
the original image. Also, it is important that the PSF fades out to black at the boundaries. If this is not
the case, the black level of the PSF image needs to be adjusted using the Arithmetic module. Finally,
neither the PSF nor the image to be deconvolved should exhibit intensity attenuation artifacts, i.e.,
image slices with decreased average intensity due to excessive light absorption in other slices. If such
artifacts are present, they can be removed using the Correct Z Drop module.
The voxel size option means that the PSF will be resampled on a grid with exactly the same voxel
size as the image data set, which is connected to the Reference port. While the original PSF had a
resolution of 12 x 12 x 30 voxels, the resampled one only has 12 x 12 x 16 voxels. However, the extent
Once the deconvolution module is connected to its two input objects, some additional parameters need
to be adjusted (for a detailed discussion of these parameters see also the Deconvolution reference
documentation of the Deconvolution module itself). Figure 9.3 shows these settings:
Border width: For deconvolution the image data has to be enlarged by a guardband region. Otherwise
boundary artifacts can occur, i.e., information from one side of the data can be passed to the other.
There is no need to make the border bigger than the size of the PSF. However, if the data set is dark at
the boundaries, a smaller border width is sufficient. In our case, let us choose the border values 0, 0,
and 8 in the x, y, and z direction.
Iterations: The number of iterations of the deconvolution algorithm. Let us choose a value of 20 here.
Initial estimate: Specifies the initial estimate of the deconvolution algorithm. If const is chosen a
constant image is used initially. This is the most robust choice, yielding good results even if the input
data is very noisy. We keep this option here.
Overrelaxation: Overrelaxation is a technique to speed up the convergence of the iterative deconvo-
lution process. In most cases the best compromise between speed and quality is fixed overrelaxation.
Therefore we keep this choice also.
Method: Selects between standard (non-blind) and blind deconvolution. Let us specify the standard
option here.
The actual deconvolution process is started by pressing the Apply button. Please press this button now.
The deconvolution should take about 10 seconds on a modern computer. During the deconvolution
the progress bar informs you about the status of the operation. Also, after every iteration a message
is printed in the Avizo console window indicating the amount of change of the data. If the change
seems to be small enough, you can terminate the deconvolution procedure by pressing the Stop button.
However, note that the stop button is evaluated only once between two consecutive iterations.
When deconvolution is finished, a new data set called polytrichum.deconv appears in the Project View.
You might take a look at the deconvolved data by moving the Image Ortho Projections connection line
from polytrichum.am to polytrichum.deconv.
The data set has been recorded using a standard fluorescence microscope under so-called widefield
conditions. It shows a neuron from the alpha-lobe of the honeybee brain. Compared to the confocal
data set used in the standard deconvolution tutorial, alphalobe.am is much bigger. It has a resolution
of 248 x 248 x 256 voxels with a uniform voxel size of 1 micrometer. In the xy-plane of the projection
view the structure of the neuron can be clearly identified. However, the contrast of the image is quite
poor because there is a significant amount of out-of-focus light or haze present. With Avizo’s blind
deconvolution algorithm we can enhance the image data without needing to know an explicit PSF in
advance.
• Press the Batch Job button of the Action port. A dialog as shown in Figure 9.6 pops up.
• In the dialog choose a file name under which you want to save the deconvolved data set, e.g.
C:/Temp/alphalobe-deconv.am.
• Modify the text field, so that check point files are written after every 5 iterations.
Check point files are used to store intermediate results. With the above settings the deconvolved
data is written into a file after every 5 iterations. Check point files are named like the final
result, but a consecutive number is inserted just before the file name suffix. For example, if
the result file name is C:/Temp/alphalobe-deconv.am, the check point files are named
C:/Temp/alphalobe-deconv-0005.am, C:/Temp/alphalobe-deconv-0010.am and
so on. Now we are ready to actually submit the batch job.
• Press the Submit button of the deconvolution dialog. After a few seconds the Avizo batch job
dialog appears, compare Figure 9.7.
• Select the deconvolution job and press the Start button.
You now have to wait about 20 minutes until the deconvolution job is finished. Once the job queue
has been started, you can quit Avizo. The batch jobs will be continued automatically. If Avizo is
still running when the deconvolution job exits then the result will be loaded automatically in Avizo.
Otherwise you have to restart Avizo and load the deconvolved data set manually.
Bead Measurements
The PSF is the image of a single point source recorded under the same conditions as the actual spec-
imen. It can be approximated by the image of a fluorescing sub-resolution microsphere, a so-called
bead. Performing good bead measurements requires some practice and expertise. In order to obtain
good results the following hints should be obeyed:
1. Use appropriate beads. It is important that the bead size be smaller than approximately 1/2
full width at half maximum (FWHM) of the PSF. Good sources for obtaining beads suitable
for PSF measurements are Molecular Probes (http://www.probes.com/) or Polysciences
(http://www.polysciences.com/).
2. The beads must be solid. Besides solid beads, there are also beads with the shape of a spherical
shell, allowing to check the focus plane of a mircoscope. Such beads cannot be used as a source
for PSF generation in the current version of Avizo.
3. Don’t record clusters of multiple beads. Sometimes multiple beads may glue together, appearing
as a single big bright spot. Computing a PSF from such a spot obviously leads to wrong results.
4. Note that beads are not resistant to a variety of embedding media. In particular beads will be
destroyed in xylene-based embedding media such as Permount (Fisher Scientific) and methyl
salicylate (frequently used to clear up the tissue). As a substitute you might use immersion oil
instead, which has a refractive index similar to methyl salicylate, for example.
5. Sample and beads should always be imaged as close to the coverslip as possible. When it is not
possible to attach the sample to the coverslip, the beads should also be imaged in a comparable
depth, embedded in the same mounting medium. Imaging the beads with better quality than
the sample will yield a slightly blurred deconvolution result. However, when the PSF used for
deconvolution is too wide, artifacts can arise during deconvolution.
The objective lense should always be selected according to the mounting medium, i.e. if the
sample is attached to the slide and embedded in a buffer of refractive index close to water, a
severe loss of image quality can be expected when using an oil-immersion objective without a
correction collar. Deconvolution of properly imaged data will allways be supperior to deconvo-
lution of data suffering from aberrations.
6. Problems occur if the mounting medium remains liquid. In that case the sample distribution
may not be permanent. If your specimen is to be embedded in water, you can try to immerse
the beads in an agarose gel of moderate concentration instead. Attaching the small beads to the
coverslip (for example by letting them dry) is often also sufficient for immobilization.
An example of an image data set containing multiple beads is provided in the file beads.am in the
directory Avizo-8/data/deconv.
Figure 9.8: Individual beads can be interactively identified using a Projection Cursor module.
The landmarks need not to be located exactly at the center of a bead. The exact center positions can
be fitted automatically later on.
You can remove incorrect bead positions from the landmark set by invoking the landmark set editor.
In order to activate the editor, select the landmark set object and press Landmark Editor button. If you
want to add additional bead positions to an existing landmark set object, make sure that the master port
of the landmark set object is connected to the Cursor module. Otherwise, a new landmark set object
will be created.
The Extract Point Spread Function module provides two buttons called Adjust centers and Estimate
size, which should be invoked in a preprocessing step before the beads are actually extracted.
The first button (Adjust centers) modifies the landmark positions so that they are precisely located in
the center of gravity of the individual beads.
The second button (Estimate size) computes an estimate for the number of voxels of the PSF image
to be generated. This button is only active if no PSF image is connected as a result to BeadExtract.
If there is a result object, the resolution and voxel sizes of the result are used and the port becomes
insensitive.
Any of the actions of the two preprocessing buttons can be undone using the Undo button. This can be
necessary for example if two beads are too close so that no correct center position could be computed.
In general, overlaps between neighboring beads should be avoided. Small overlaps might be tolerated
because during resampling intensities are weighted according to the influence of surrounding beads.
The data type of the resulting PSF will be float, irrespective of the data type of the input image. The
individual beads will be weighted on a per-voxel basis and added to the result. No normalization
will be performed afterwards. You may investigate the resulting PSF image using any of the standard
visualization modules. In Figure 9.10 a volume rendering of the resulting PSF is shown.
In some cases you may want to average multiple beads recorded in different input data sets. This can
be easily achieved by creating a Landmarks object for each input data set. For the first input data set
extract the beads as described above. For the other input data set also use the Extract Point Spread
Function module. However, make sure that the PSF obtained from the first input data set is connected
as a result object to BeadExtract before pressing the Apply button. In order to use an existing PSF as
a result object connect the Master port of the PSF to Extract Point Spread Function (once this is done
the Resolution and Voxel size ports of Extract Point Spread Function become insensitive, see above).
If an existing result is used new beads simply will be added into the existing data set. Therefore data
sets should be scaled in intensity according to their quality prior to bead extraction and summation to
obtain a suitable weighting of the individual extracted beads in the final result.
• 3 working arrays for the non-blind algorithm with no or with fixed overrelaxation
• 5 working arrays for the non-blind algorithm with optimized overrelaxation
• 5 working arrays for the blind algorithm
The number of voxels of a working array is the product of the number of voxels of the input data
set plus the border with along each spatial dimension. The primitive data type of a working array is
a 4-byte floating point number. For example, if the number of voxels of the input data set plus the
border width is 256 x 256 x 256 (as for the alphalobe.am data set in the blind deconvolution tutorial),
each working array will be about 64 MB, irrespective of the primitive data type of the input data set.
Therefore at least 192 MB (3x4x256x256x256 bytes) are required for non-blind deconvolution with
fixed overrelaxation, and 320 MB (5x4x256x256x256 bytes) for blind deconvolution. Keep this in
mind when configuring the computer on which to perform deconvolution! However, also note that for
most platforms it usually doesn’t make sense to have more than 1.5 GB of main memory. For more
memory a 64-bit operating system is required.
Finally, it should be mentioned that the deconvolution algorithm can make use of a multi-processor
CPU board. Although you do not get twice the performance on a dual-processor PC, a speed-up of
almost 1.5 can be achieved. By default, Avizo uses as many processors as there are on the com-
puter. If for some reason you want to use less processors you can set the environment variable
AVIZO DECONV NUM THREADS to the number of processors you actually want to use simultane-
ously.
This chapter contains a description of Avizo interface components, data types, general concepts and
start-up options. No in-depth knowledge of Avizo is required to understand the following sections, but
it is a good idea to have a look at one of the tutorials contained in Chapter 1.7 (First steps in Avizo),
particularly the very first one described in Section 3 (Getting Started).
• File Menu, Edit Menu, Project Menu, View Menu, Window Menu, Help Menu
• Standard Toolbar
• Main Panel, Properties Area, Progress Bar, Viewer Window, Console Window, Online Help
• File Dialog, Job Dialog, Preferences Dialog, Snapshot Dialog, System Information
• Object Popup, Create Object Popup
The Open Data button activates Avizo’s file dialog and lets you import data sets stored in a file. Most
file formats supported by Avizo will be recognized automatically via the file header or the file name
extension. If you try to load a file for which the format couldn’t be detected automatically, an additional
dialog pops up asking you to select the format manually.
A list of all supported file formats is contained in the reference manual. Hints on how to import your
own data sets are given in Section 1.6.
If you select multiple files in the file dialog, all of them will be loaded, provided all of them are stored
in the same format. 2D images stored in separate files usually will be combined into a single 3D data
object. On the other hand, there are some file formats for which multiple data objects will be created.
Finally, you can also import and execute Avizo project scripts using the Open button.
The format of input data can be forced using Open Data As. A format selection dialog will be opened,
allowing you to choose between all of the supported Avizo file formats. All selected files will be
treated as being in the specified format.
This button also activates the file dialog, but in contrast to the ordinary Open option it is assumed that
all selected files represent different time steps of a single data object. When loading such a time series
an instance of a Time Series Control module is created. This module provides a time slider allowing
you to adjust the current time step. Whenever a new time step is selected the corresponding data file
is read, and data objects associated with a previous time step are replaced. The module also provides
a cache so that the data files only need to be read once provided the cache is large enough.
This menu entry works the same way as Open Time Series Data except that the format of the input
data can be forced (same as Open Data As). A format selection dialog will be opened, allowing you
to choose between all supported Avizo file formats. All selected files will be treated as being in the
specified format.
The Save Data button allows you to save a single modified data object again using the same filename
previously chosen under Save Data As. The button will only be active if the data object to be saved is
selected and if this data object has already been saved using Save Data As. A common application of
the Save button is to store intermediate results during manual segmentation in Avizo’s segmentation
editor.
This button lets you write a data object into a file. To do so you must first select the data object (click
on the corresponding green data icon). Then choose Save Data As to activate Avizo’s file dialog. The
file dialog presents a list of all formats suitable for saving that data object. Choose the one you like
and press OK. Note that you must specify the complete file name including the suffix. Avizo will not
automatically add a suffix to the file name. However, it will update the suffix whenever you select a
new format from the file format list. Also, Avizo will ask you before it overwrites an existing file.
Some file formats create multiple files for a single data object. For example, each slice of a 3D image
data set might be saved as a separate raster file. In this case, you can add to the file name a sequence of
hashmarks (for instance <filename>####.jpg). This sequence will be replaced by consecutive
numbers formatted with leading zeros.
If no file format has been registered at all for a certain type of data object, the Save Data As button will
be disabled. It will also be disabled if more than one data object is selected in the Project View.
When selecting this menu entry, a Convert To Large Data Format object will be instantiated and added
to the Project View. This module allows you to convert large image data to LDA file format.
This button does a Remove all objects so that you can start building a new project in the Project View.
It also sets the new project name to ”Untitled.hx”.
The Open Project button activates Avizo’s file dialog and lets you load a project stored in a file. Project
files show up in the dialog as being in the format ”Avizo Project”. A Remove all objects will be done
before the new project is loaded so that effectively the new project replaces the old project in the
Project View. Currently only files with extension .hx can be opened.
This button allows you to save the complete project of icons and connections shown in the Project
View. If the project has not been previously saved, you will need to specify the name of an Avizo
Project script in the file dialog. When executed, the project script restores all data objects and modules
as well as the current object transformations and the camera settings. The feature is useful for resuming
work from a point where you left off previously.
Note that usually all data objects must have been stored in a file in order to be able to save the project.
If this is not the case, a dialog is shown listing all the data objects that still need to be saved. In
This button works like the Save Project button except that in this case you will always need to specify
the name of an Avizo Project script in the file dialog.
This button allows you to save the current Project View as a template project. A template project
consists of a backup of an original project that can be replicated on different data of the same type. See
Section 10.4.1 Template Projects Description.
This button can be used to load recently used files. When choosing this menu entry a submenu appears
listing the five most recent files. If multiple 2D images have been loaded this is indicated with the
name of the first file followed by an ellipsis (...). The number of files displayed in the most recent files
list can be modified in the General tab of the Preferences Dialog.
This button can be used to load recently used project scripts. When choosing this menu entry a sub-
menu appears listing the five most recent project scripts. The number of projects displayed in the most
recent projects list can be modified in the General tab of the Preferences Dialog.
10.1.1.15 Quit
This button terminates Avizo and prompts you to save the current project configuration if there are
unsaved changes.
In the Console, this command cuts selected text and copies it to the clipboard. In the Project View, this
command removes the selected objects.
10.1.2.2 Copy
In the Console, this command copies the selected text to the clipboard. In the Project View, this
command copies the selected objects.
10.1.2.3 Paste
In the Console, this command pastes the text in the clipboard to the current text insertion point. In the
Project View, this command creates cut or copied objects.
10.1.2.4 Delete
In the Console, this command deletes the selected text. In the Project View, this command deletes the
selected objects.
In the Console, this command selects all the text. In the Project View, this command selects all objects.
10.1.2.6 Preferences
This option opens the AvizoPreferences Dialog. This last allows you to adjust certain global settings
of Avizo like the Project View options, the user interface layout, how project scripts are exported,
segmentation, rendering and performances options...
10.1.2.7 Dialogs
This toggle allows you to select the Graph View as current Project View.
This toggle allows you to select the Tree View as current Project View.
The Hide Object button hides all currently selected objects. The object’s icons are removed from the
Project View but the objects themselves are retained. You get the same effect by pressing the Ctrl-H
key. Hidden objects can be made visible again using Show Object or Show All Objects. This option
will be unavailable if the current Project View is the Tree View.
The Remove Object button deletes all selected objects and removes the corresponding icons from the
Project View. You can get the same effect by pressing the Delete key. If you want to reuse a data
object later on, be sure to save it in a file before deleting it. If a data object has been modified but
has not yet been saved to a file, it is marked by a little asterisk in the object icon. In the Preferences
Dialog you can choose whether a warning dialog should be printed if you try to delete unsaved data
objects which cannot be recomputed by an up-stream compute module. If you delete a data object, all
The Duplicate Object button creates copies of all selected data objects. For each copy a new data icon
is put in the Project View. The name of a duplicated data object differs from the original one by one
or more appended digits. The duplicate option is not available if you have selected icons that do not
represent data objects (e.g., display or compute modules).
This button allows you to change the name of a selected object. In Graph View, a small dialog box
will be popped up when the button is pressed. In Tree View, you can directly edit the object item in the
view. If no object is selected or if multiple objects are selected the button is disabled. Note that two
objects in Avizo can’t have the same name. Therefore, the name entered in the dialog may be modified
by appending digits to it, if necessary. You can also rename an object by pressing the F2 key when it
is selected or by double clicking on the item in Tree View mode.
This button allows you to display the Create Object popup in order to create modules or data objects
that cannot be accessed via the popup menu of any other object. Please refer to the Create Object
popup documentation for more details.
The Show button allows you to make hidden objects visible, so that their icons are displayed in the
Project View. Among the hidden objects there are usually some colormaps which are loaded at start-
up. This option will be unavailable if there are no hidden objects or if the current Project View is the
Tree View.
The Show All button makes all currently hidden objects visible, so that their icons are displayed in the
Project View. This option will be unavailable if there are no hidden objects or if the current Project
View is the Tree View.
The Remove All Objects button deletes all currently visible icons and the associated objects from the
Project View. A pre-loaded colormap that is currently visible is also deleted, but all hidden objects are
This button makes all display modules in the Project View pickable. A display module is pickable if
the associated 3D object can be picked.
This button makes all display modules in the Project View unpickable. So, the associated 3D object of
all the display modules in the Project View can’t be picked.
This mode is applicable when multiple modules of the same type will be attached to a single data
object. If the toggle is on, the port values of the first module will be used to initialize the port values
of subsequently attached modules. This can be convenient if you want the modules to have the same
initial port values.
Example: Attach an Ortho Slice to your data object and set the Mapping type to ”Colormap” and the
colormap range to 0-3. If you attach another Ortho Slice to the same data object, its Mapping type will
be ”Colormap” and its colormap range will be 0-3.
This option specifies the default behavior of colormap ports. If this option is checked, the auto adjust
range option of colormap ports will be on.
Note: For some modules, the auto adjust range option of their colormap ports is always checked by
default, independently of the global value.
10.1.4.1 Layout
The Layout button lets you select between one, two, or four 3D viewers. All viewers will be placed
inside a common window using a default layout. If you want to create an additional viewer in a separate
window, choose Extra Viewer. You may create even more viewers using the Tcl command viewer
<n> show. Starting from n=4, viewers will be placed in separate windows.
The Background button opens the background dialog, allowing you to switch between the different
background styles uniform, gradient, and checkerboard. In addition, the dialog allows you to adjust
the two colors used by these styles.
In order to change the background color via the command interface, use the viewer commands
viewer <n> setBackgroundColor and viewer <n> setBackgroundColor2. The
command interface also allows you to place an arbitrary raster image into the viewer background
(see Section 11.3.3.1 Viewer command options).
10.1.4.3 Transparency
The Transparency button controls the way of calculating pixel values with respect to object transparen-
cies during the rendering process.
Note: Antialiasing is not supported by Sorted Layers and Sorted Layers Delayed mode.
10.1.4.4 Lights
The Lights menu lets you activate different light settings for the 3D viewer. By default, the viewer
uses a single headlight, i.e., a directional light pointing in almost the same direction as the camera
is looking. The headlight can be switched on or off in each viewer via the viewer’s popup menu.
Alternatively, the headlight can be switched on or off for all viewers using the headlight toggle in
10.1.4.5 Fog
The Fog button introduces a fog effect into the displayed scene and controls how opacity increases
with the distance from the camera. The fog effect will only be seen on a uniform background. More
fine tuning is provided by the fogRange Viewer command.
10.1.4.6 Antialiasing
The Antialiasing... button opens a dialog with which the antialiasing quality values of all active viewers
can be modified. Antialising is the process of smoothing jagged edges on graphic images by using
intermediate shades.
The dialog provides several different interface components: a checkable group box, a quality slider,
and three buttons.
The checkable group box allows you to turn antialising on or off for all viewers. The slider and
corresponding text field let you set antialiasing quality with a value ranging from 0 to 1, 1 being the
best. The buttons are used to apply, save or reset changes and to quit the dialog. A detailed description
of the interface components is given below.
Antialiasing group box: The group box is composed of a slider and a checkbox. When checked,
antialiasing is applied with the quality value given. Otherwise, antialiasing is disabled.
Quality slider: The antialiasing quality slider presents the quality range. If the slider value changes,
the corresponding antialiasing is applied. This slider is accompanied by a text edit field to view the
exact value of the current antialiasing and to set its numerical value. The component values are always
in the range of 0 to 1.
Antialiasing can be done in two different ways. If full-scene antialiasing is supported via the
ARB multisample and ARB pixel format OpenGL extensions, it is used for rendering. Note that
the number of samples used in the antialiasing computation depends on your graphics hardware and
This toggle allows you to activate/deactivate the shadowing for display modules. For more information
about shadow casting, please refer to the Shadowing documentation.
10.1.4.8 Axis
The Axis button creates an Local Axes module named ”Global Axes” which immediately displays a
coordinate frame in the viewer window. This button is a toggle, so clicking on it again deletes the
”Global Axes” module and removes the coordinate frame from the viewer window. The axes will be
centered at the origin of the world coordinate system. You may also create local axes by selecting the
appropriate entry from a data object’s popup menu.
10.1.4.9 Measuring
The Measuring button creates an instance of a Measurement module that lets you measure distances
and angles on objects within the viewer.
Note: Depending on the Avizo edition, the created Measurement module won’t be the same.
The Frame Counter toggle lets you switch on a frames-per-second counter that will be displayed in the
first viewer (viewer 0).
This toggle allows you to show/hide all the panels of Avizo except the viewers.
This toggle allows you to show/hide the Main panel of Avizo i.e. the one containing the Project View
(Graph View or Tree View) and some other specific tabs like the Segmentation Editor (when activated).
10.1.5.3 Properties
10.1.5.4 Console
10.1.5.5 Colormap
This toggle allows you to show/hide the Colormap Editor panel of Avizo.
This toggle allows you to show/hide the Animation Producer panel of Avizo.
10.1.5.7 Help
10.1.5.8 Toolbars
In addition of these panels, you can also manage the visibility of some Avizo toolbars via the Toolbars
submenu. For the moment, only the Standard Toolbar can be shown/hidden.
This button shows the Help dialog on the Avizo documentation home page. You will have access to
the entire Avizo documentation.
This button shows the Help dialog on the Avizo documentation demos page. You will have access to
the Avizo provided Examples.
This button shows the Help dialog on the Avizo documentation Programmer’s Guide page. You will
have access to the programmer’s documentation which is useful if you have an Avizo XPand Pack
license.
This button launches the AvizoLicense Manager which displays the status of your Avizo licenses.
This button launches the AvizoSystem Information Dialog which displays some information about
your system. This information allows you and the Avizo support team to better analyze software
problems.
This button launches an external web browser on the Technical Support contacts web page of Avizo.
This button launches a dialog containing the latest web news on Avizo. Web news are provided to
inform you about Avizo releases, beta-testing program...
10.1.6.9 About
This button launches a dialog containing Avizo build and copyrights information.
• the Graph View where objects are represented with icons and dependencies between objects are
indicated with connection lines,
• the Tree View where objects are arranged in a tree in which objects are displayed underneath
those objects on which they depend.
To change the current Project View, you can click on the Graph View or Tree View buttons in the Project
Menu.
Note: Other than when attention is being specifically called to highlight the differences between the
Project Graph View and the Project Tree View, Project View will be used throughout the Avizo doc-
umentation to refer generically to the pane of the Avizo main window containing the collection of
objects and modules that define the visualization project.
Concepts
The Project Graph View is displayed if Graph View is selected. This selection is made by clicking on
the using the Graph View button in the Project Menu.
Once a data object has been loaded or a module has been created, it will be represented by an icon
in the Project Graph View. Some objects, especially initially loaded colormaps, may not be visible
here. Such hidden objects are listed in the Project > Show Object menu of the Avizo main window.
View. The blue connection line will become lighter blue if the connection port can be connected to
the chosen object. Reasons for not being able to connect an input to a port can include the following:
incompatible data type (use Convert Image Type to change), incompatible dimensionality of the input
(use Channel Works to change), incompatible grid type of the data (for example, use Arithmetic to
sample a regular grid), or simply that the connection does not make sense, for example, connecting a
display module for surfaces to a volume data set.
In order to disconnect an input object, click on the icon of the module the port belongs to. Data objects
possess a special connection port called Master. This port refers to a computational module or editor
the data object is attached to. It indicates that the computational module or editor controls the data
object, i.e., that it may modify its contents.
Each object has an associated control panel containing buttons and sliders for setting or changing ad-
ditional parameters of the object. The control panel becomes visible once the object has been selected,
i.e. by clicking on its icon with the left mouse button. In order to select multiple objects, you can shift-
click the corresponding icons or select them by using the rectangular selection tool (press and hold
The Project Tree View is displayed if Tree View is selected. This selection is made by clicking on the
using the Tree View button in the Project Menu.
Once a data object has been loaded or a module has been created, it will be represented by a new entry
in the tree view.
Each object has an associated control panel containing buttons and sliders for setting or changing
additional parameters of the object. The control panel becomes visible in the Properties Area once
the object has been selected, i.e., by clicking on its icon with the left mouse button. In order to select
multiple objects, you can shift-click the corresponding icons. Clicking on the icon of a selected object
deselects it again. Clicking somewhere off of the tree view, e.g., beyond the bottom of the tree view,
causes all selected objects to be deselected.
At the top of the Project Tree View is a region containing shortcut (or macro) buttons. The Open Data
button is a shortcut to the File > Open Data menu item. Up to 4 additional buttons are automatically
displayed depending on the currently selected object(s). They provide easy access to the modules that
are most commonly used and/or that have been recently used with the currently selected object.
The tree view display has 5 columns:
Column 1: Contains the actual tree view.
• Organization: The tree is organized into folders containing different kinds of objects: Data,
Display, Compute, etc. Most of the folders are predefined and cannot be modified. A few,
however, such as the Data folder, can have more folders added beneath.
Currently, there are 3 ”templates” that control the organization of the tree view: a default
template for most Avizo users, a ”geoscience” template in the Avizo Earth Edition that includes
predefined folders for 3D surveys, horizons, faults, etc and a ”CFD/CAE” template in the Avizo
Wind Edition where the terminology Models replace the one of Data.
• Connections: If you click on a data object icon with the right mouse button, a menu pops up
• Expand/Collapse: You can click on the + and - icons to expand or collapse portions of the tree.
• Drag-and-Drop: You can use drag-and-drop to move items in the tree view. For example, to
connect an existing visualization module to a different data set, you can drag and drop it from
its current location onto a compatible data set. Drag-and-drop does not work for disconnecting
objects. You must use the connection ports for this.
• Viewer Toggle: The check boxes control the visibility of the object in the currently active
viewer. If there are multiple viewers, e.g., a 4-viewer layout, you can select a viewer, set the
object’s visibility in that viewer, then repeat as often as necessary to set the desired visibility
options for each viewer. However, it will probably be more convenient to control the visibility
in individual viewers by using the viewer toggle button in the object’s control panel in the
Properties Area. The viewer toggle button is the orange square just to the right of the module
name in its control panel. The button is divided into regions corresponding to the current viewer
layout. Click on the region to toggle visibility of the object on/off in the corresponding viewer.
If there are more than 4 viewers, each additional viewer will have it own toggle button.
• Hovering: Hovering the mouse over an item in the tree view displays information about that
item, usually its type, e.g., HxUniformScalarField3.
Column 2: Shows, for certain objects, the current value of a port of interest. Currently, the slice
number is shown for slice modules (Ortho Slice, Inline, etc.) and the time scale factor is shown for the
Seismic Settings module.
Column 3: Shows the current colormap, if any, associated with the module or object. You can right
click on it to show the standard colormap context menu. Or you can left click on it to bring up the
Colormap Editor.
Column 4: Displays the icon of the editor, if any, currently operating on the object. For example, the
Crop Editor, the Parameter Editor, etc.
Column 5: Displays a color-coded marker indicating the kind of object or module, as follows:
Figure 10.3: The Properties Area contains the input controls for objects in the Project View. This example shows the ”control
panel” for the Arithmetic module.
Each object has a specific set of controllable parameters or options. These are described in detail for
each module in the modules index section of the reference manual. Objects (modules, data...) also
provide a question mark button which lets you access the documentation of that object directly.
The Apply button is active (green) for modules that require you to explicitly initiate their action. Typi-
cally this is the case for modules whose action may take a significant amount of time, such as some of
the compute modules.
Check the auto-refresh check box to automatically force an apply for any change in the project.
An object’s name is displayed at the top of its control panel along with various control buttons. All
data objects and display modules have one or more orange viewer buttons for each 3D viewer. These
buttons control whether any graphical output of an object is displayed in a particular viewer or not. For
example, if you have two viewers and two Isosurface modules you may want to display one Isosurface
in each viewer.
Display modules of slicing type (orange ones like Ortho Slice) provide a clip button. Clicking this
button will cause the graphical output of any other module to be clipped by that slice. Clipping does
not affect modules with hidden geometry or modules that are created after the clip button has been
Figure 10.4: Some visualization module will show the ”Shadow” button in the Properties Area.
• hold down the left mouse button and move the mouse to rotate the camera around its current
focal point (the focal point can be changed by doing a seek operation), hold down the left mouse
button + [SHIFT] to constrain this rotation around the X or Y axis, and the left mouse button
+ [CTRL] for the Z axis.
Figure 10.6: Default state of the Progress Bar: ”Ready” is displayed and the Stop button is disabled.
• Hold down the left + middle mouse buttons to zoom / dolly, or [CTRL] + the middle mouse
button, or [CTRL] + [SHIFT] + the left mouse button
• Click the right mouse button to open the popup menu (see Viewer popup description for more
details).
• Press the [S] key, then click on an object with the left mouse button to ”seek” to that position.
• Press the [P] key, then click the left mouse button to pick a 3D Object in the viewer. The
corresponding module will be selected.
• Press the [ESC] key to switch between ”interaction” mode and ”trackball” mode.
The virtual trackball controlled by the left mouse button allows for free rotation of the camera.
Some viewer gadgets may be displayed in one of the corners of the display:
• camera trackball: used for constrained rotation of the camera about the screen-aligned X, Y, or
Z axes. Click on the vertical wheel (it becomes red when you select it) and move the mouse
up/down (while the left mouse button is pressed) to rotate about the X axis. Click on the hori-
zontal wheel (it becomes green when you select it) and move the mouse left/right (while the left
mouse button is pressed) to rotate about the Y axis. Click on the third wheel (it becomes blue)
and move the mouse up/down (while the left mouse button is pressed) to rotate about the Z axis.
• 3D compass: indicates the current camera viewing direction. It is an indicator only; you cannot
use it to control the viewing direction.
The Edit > Preferences > Layout dialog can be used to control the visibility, auto-hide option, and
position of the trackball and the compass. Refer to the Viewer gadgets section for more details.
Sometimes you need to manipulate objects directly in the 3D viewer. For example, this technique,
called 3D interaction, is used by the Transform Editor. You can swith on this editor with the transform
editor button in the properties of a data object. The editor provides special draggers that can be picked
and translated or rotated in order to specify the transformation of a data object. Before you can interact
with these draggers, you must switch the viewer into interaction mode. This is done by clicking on
the arrow button in the upper left corner. If the viewer is in interaction mode, the mouse cursor will be
an arrow instead of a hand symbol. You can use the [ESC] key in order to quickly switch between
interaction mode and viewing mode. If the viewer is in interaction mode, use the [Alt] key to
temporarily switch to viewing mode.
More than one viewer can be active at a time. Standard screen layouts with one, two, or four viewers
can be selected via the View menu. Additional viewers can be created using the Tcl command viewer
<n> show, where <n> is an integer number between 0 and 15. While viewers 0 to 3 will be placed
in a common panel window, viewers 4 to 15 will create their own top-level window. For more specific
control, the viewer provides an extensive command set, which is documented in Section 11.3.3.1
Viewer command options.
The toolbar of the main viewer window provides several buttons and controls, allowing you for exam-
ple to switch between viewing mode and interaction mode, to choose certain orientations, or to take
snapshots. The precise meaning of these controls is described below.
Interact:
Switches the viewer into interaction mode. You can also use the [ESC] key to toggle between viewing
mode and interaction mode.
Trackball:
Switches the viewer into viewing mode. You can also use the [ESC] key to toggle between interaction
mode and viewing mode. The left mouse button is used to change the view direction by means of a
virtual trackball.
Translate:
Same as Trackball except that the left mouse button is used for panning (translation).
Zoom:
Same as Trackball except that in this mode vertical motion of the left mouse button controls zooming.
Rotate:
Rotates the camera around the current view direction. By default, a clockwise rotation of one degree is
performed. If the [SHIFT] key is pressed while clicking, a 90 degree rotation is done. If the [CTRL]
key is pressed, the rotation will be counterclockwise.
Seek:
Pressing the seek button and then clicking on an arbitrary object in the scene causes the object to be
moved into the center of the viewer window. Moreover, the camera will be oriented parallel to the
normal direction at the selected point. Seek mode may also be activated by pressing the [S] key in
the viewer window.
Important note: When using front face culling mode on an object, Seek will work on the hidden faces
unless you move the camera ”through” front hidden faces. This limitation will be solved in the future
Avizo releases.
Home:
Toggles between a perspective and an orthographic camera. By default, a perspective camera is used.
You may want to use an orthographic camera in order to measure distances or to exactly align objects
in 3D space.
Note: Only one of these buttons will be visible at a time, the button indicating the currently active
camera type.
Pick:
Pressing the pick button and then clicking on an arbitrary object in the scene causes the corresponding
module to be selected. Picking mode may also be activated by pressing the [P] key in the viewer
window.
View All:
Repositions the camera so that all objects become visible. The orientation of the camera will not be
changed.
YZ-, XY- and XZ-Views:
Adjusts the camera according to the specified viewing direction. The viewing direction is parallel
to the coordinate axis perpendicular to the specified coordinate plane. The opposite view direction is
used if the [SHIFT] key is pressed.
Note: In the some Editions, these buttons will be replaced by the geographic view orientation buttons.
Geographic View Orientation:
Adjusts the camera according to the specified viewing direction: from top, from bottom, from west,
from east, from south, from north.
Note: In the some Editions, these buttons replace the XYZ view buttons.
Stereo:
Allows you to enable or disable stereo viewing, as well as specify various stereo viewing parameters
via the Stereo Preferences dialog.
Measuring:
Takes a snapshot of the current rendering area and saves it to a file. The filename as well as the desired
output format must be entered through the Snapshot dialog. Snapshots may also be taken using the
viewer command snapshot.
Z-Scale:
Offers the possibility to enhance the scale on the Z axis by a given factor.
The default value is 10.0 and can be specified by the user in the toolbar of the viewer. Note: This
buttons is visible in some Editions.
Layout:
Selects the viewer layout: a single view, two viewers side-by-side, two viewers stacked, or four
viewers.
Fullscreen:
Selects fullscreen mode. In this mode, the viewer occupies the entire screen and no other windows
will be visible. To exit fullscreen mode, click the right mouse button and uncheck Fullscreen in the
popup menu.
Link objects visibility:
Links the visibility of objects between all viewers. When checked, it means that changing the visibility
(viewer mask) of an object in one viewer will change it in all viewers.
In addition to these buttons, the Avizo viewers provide an extensive set of Tcl commands, which are
All viewers include a popup menu that allows you to configure various options. A right mouse button
click opens this popup menu. The following menu options are available:
Functions:
Contains a sub-menu with items which are respectively shortcuts to Home, Set Home, View All and
Seek icons.
Viewing:
Switches between viewing mode and interaction mode (see Interact and Trackball icons for more
details). Same as pressing the [ESC] key.
FullScreen:
Shortcut to the Fullscreen icon.
HeadLight:
Activate and deactivate the headlight (see Lights section for more details).
Preferences:
Contains the following menu items:
• Auto clip planes: Adjusts the camera near and far plane at each camera move.
• Stereo: Shortcut to the Stereo icon.
• Spin animation: When spin animation is enabled, if the mouse is moving while you release it,
the trackball will continue to spin afterwards. By default, spin animation is disabled.
• Rotation axes: Displays rotation axes at the center of the viewer.
Show trackball:
Show/hide the camera trackball (see Viewer gadgets section for more details).
Show compass:
Show/hide the compass (see Viewer gadgets section for more details).
Link camera to:
This menu option creates a camera link from the current viewer to the one you select (by clicking it
after you select the menu option); pressing the [ESC] key before selecting a viewer aborts the link
operation. When the cameras of two viewers are linked, they view both scenes from the same 3D point
and looking in the same direction. The section Unlink camera below explains how to remove a camera
link.
Unlink camera:
This menu option removes a camera link between two viewers by selecting the viewer to unlink.
Show objects in extra viewer:
This menu option allows showing objects from the current viewer in the extra viewer using the same
Identify:
This menu option briefly displays the viewer identifier in the viewer.
Identify all viewers:
This menu option causes each viewer to briefly display its viewer identifier.
Figure 10.9: Avizo’s Console window displays info messages and lets you enter Tcl commands.
Avizo’s Console commands are based on the Tcl script language (Tool Command Language). Exam-
load C:/MyData/something.am
viewer 0 setSize 200 200
viewer 0 snapshot C:/snapshot.tif
The Avizo scripting syntax and the specific commands are described in the Chapter 11 (Scripting). To
execute a single Console command just type in its name and arguments and press Enter. If you select
an object and then press the [TAB] key on the empty command line, then the name of the object will
be automatically inserted.
You can also type the beginning of a command word and type the [TAB] key to complete the word.
This only works if the beginning is unique. Pressing [TAB] a second time will show the possible
completions. Often, this saves a lot of typing. Commands provided by data objects and modules
are documented in the reference section of the users guide. Pressing the [F1] key for such a com-
mand without any arguments pops up the help text for this command. This is also true for commands
provided by the ports of an object.
Additionally the Console window provides a command history mechanism. Use up arrow and down
arrow to scroll up and down in the history list.
To execute a file containing many Tcl commands use source <filename> or load the script
file via Avizo’s file dialog from the file menu. Avizo Project files are usually identified by
the extension .hx. For advanced script examples take a look at Avizo’s demo files located in
$AVIZO ROOT/share/demo.
• modules,
• data types,
• editors,
• file formats,
• and other components.
You can access the documentation of any such object via a separate index page accessible from the
home page of the online help browser. Avizo modules also provide a question mark button in the
Properties Area. Pressing this button directly pops up the help browser for the particular module.
By default, the help browser is displayed in its own top-level window, but you can easily integrate it
where you want into the Avizo main window since the help browser is a dock widget.
Commands
help
Makes the help dialog appear and loads the home page of the online help.
help getZoomFactor
Returns the zoom factor of the browser.
help setZoomFactor <ZoomFactor>
Sets the zoom factor of the browser.
help load file.html
Load the specified hypertext document in the file browser. Note that only a subset of HTML is
supported.
help reload
Reload the current document.
For each job a temporary directory is created containing any required input data, scripts, state
information, and log files. On Unix systems this directory is created at the location speci-
fied by the environment variable TMPDIR. If no such variable exists, /tmp is used. On Win-
dows systems the default temporary directory is used. Typically this will be C:/TEMP or
%USERPROFILE%/AppData/Local/Temp.
A job’s state may be manipulated using the action buttons shown above the job list. In order to start
the job queue select the first job waiting for execution and then press the Start button. Note that only
one job can be executed at a time. In order to kill a running job, select it in the job list and press the
Kill button. You may delete a job from the job queue using the Delete button. When deleting a job the
temporary job directory will be removed as well.
Once you have selected a job in the job queue, more detailed information about it will be displayed
in the lower part of the dialog window, notably the state of the job, the temporary job directory, the
submit time, the time when the job has been started, the run time, and the name of the command to be
executed. Any console output of a running job will be redirected to a log file located in the temporary
job directory. Once such a log file exists and has non-zero size you may inspect it by pushing the View
output button.
network issues
Job success and failure notifications require that Avizo open a TCP/IP port. Depending on your net-
work configuration it is possible that you will not be able to receive these notifications. In these cases
contact your system administrator or change your firewall settings if you have sufficient permissions.
job run
Starts the first job in job queue pending for execution. When a job is finished, execution of the next
job in the queue starts automatically, thus all jobs in the queue will be executed consecutively by
job run.
Windows
These items allow you to configure the layout of the Avizo windows.
Save window layout on exit
The window layout is saved when Avizo is closed. The default is on.
Show viewer in top-level window
The main Viewer window will be displayed in a top-level window. This gives you additional flexibility
in managing the ”real-estate” of your graphics display. For example, on a dual-head display it can
be interesting to display the Viewer window on one display and the rest of the Avizo interface on the
other. The default is off.
Show ”DoIt” buttons
Some modules have a button, usually labeled ”DoIt”, to initiate the action of the module. By con-
venience, these ports are not displayed in the Properties Area. This last provides green Apply button
which is used to initiate the action of all selected objects. If this box is checked, the ”DoIt” button will
be displayed in the Properties Area. The green Apply button will still be available for use as well.
Show projection buttons
This option gives you the possibility to view or not the projection buttons displayed in the module
header in the Properties Area. The default is off.
Tools buttons style
This options allows you to change the way tools buttons are displayed in the Standard Toolbar. There
are 5 different choices:
• Tool button icon only: only the tool button icon is displayed
• Tool button text only: only the tool button text is displayed
• Tool button text beside icon: the tool button text is displayed beside its icon
• Tool button text under icon: the tool button text is displayed under its icon
• Tool button follow style: the tool button is styled according to the style of your platform
The default tools buttons style is Tool button text under icon for Mac and Tool button text beside icon
for other platforms.
Finally, you have the choice to Restore current layout, and Save current layout.
Viewer gadgets
There are two viewer gadgets, a camera trackball and a compass.
The camera trackball, used for constrained rotation of the camera about the screen-aligned X, Y, or Z
axes, is described in Section 10.1.11.
The 3D compass indicates the direction from which the camera is viewing the scene. See Section
10.1.11 for more details on the compass.
These options allow you to control what conditions are checked for in the projects when Avizo exits.
Color Schemes
These check boxes allow you to chose alternate color schemes: CPK for atoms, and RasMol for amino
acids.
Selection Info
These items control how much information is printed into the console when parts of a molecule are
selected. Activate Molecule name if the name of the molecule should be printed. Activate Group name
if the name of the selected group should be printed. If you activate Group attributes, all attributes of
the selected group are printed. If Explicit attributes is activated, the printed attributes are restricted to
those explicitly named in the corresponding text field.
Atom Expressions
ID case sensitive
Specifies if atom identifiers are case sensitive or not.
Conversion
Out-of-core threshold
Specifies the size above which data sets will be treated as out-of-core data.
Compression
Specifies the type of data compression. It enables to generate smaller lda files, however it could be a
little bit slower at the loading stage because of the decompression process.
Sampling
Specifies the algorithm of data sampling. Available options are :
Tile Size
Sets the size of the tiles to be compressed.
Rendering Quality
Main Memory Amount
Sets the maximum allowed main memory in MB (megabytes) for all the out-of-core and in memory
3D Draw Style
This option lets you choose the material draw style used in the 3D viewer.
Selection Draw Style
This option lets you choose the draw style used to highlight the voxels selection.
Labels Draw Style
This option lets you choose the default draw style used to render a material in the material list. Note
that you can also individually change the draw style for a particular material in the Segmentation
Editor.
See the Segmentation Editor documentation for more details.
Quality
CPU
Here you can decide to specify the maximum number of threads for compute modules or to let Avizo
automatically choose the number of threads.
Note that this tab will be only available if you have an Avizo Fire Edition license. Even with an Avizo
Fire Edition license, it will be unavailable if you launch Avizo in its Avizo Standard Edition.
Calibration at load
When enabled, automatic computation of calibration on data loaded and generated by Avizo is acti-
vated. Then you can choose to impose the number of regions that must be found or to let the calibration
algorithm detect it automatically.
See the Range Calibration Editor documentation for more details.
Units Management
Select None to deactivate the units management or Spatial information to activate it and use coordinates
and angle units information.
Show units dialog when loading data
This checkbox activates the units editor dialog when loading spatial data objects.
Automatically determine working units
When this checkbox is set Avizo automatically determines the working coordinates unit.
Lock display units on working units
Setting this checkbox ensures that the units displayed in the interface components are the same as the
ones used internally by Avizo.
Tcl commands
Use the Working units and Display units radio buttons to configure Tcl commands to interpret values
in working or in display units.
See the description of available options linked with units management, the Units chapter and the Units
Editor documentation for more details.
• Output: Specifies the output device. With to file the grabbed image is saved to a file, with to
printer the image is sent directly to the printer, and with to clipboard it is sent to the clipboard.
In the to printer mode you first must select and configure a printer by pressing the Configure
printer button. In addition, you may enter an arbitrary text string which is printed as an
annotation text below the snapshot image.
• Offscreen: Lets you grab images larger than the actual screen size. When this option is
checked, the output dimensions can be specified in the width and height text fields up to a
maximum of 2048 x 2048 pixels.
• Render tiles: Use this option to render snapshots of virtually unlimited resolution (e.g. for
high quality printouts). In this mode the scene is divided into n x m tiles where n and m can be
entered into the adjacent text fields. Then the camera position is set such that each tile fills the
current viewer and a snapshot is taken. Finally the tiles are internally merged to a single image
and sent to the device specified in the Output port.
• Filename: Lets you specify the filename if the to file option is set. The Browse button allows
you to browse to a desired location within the filesystem.
• Format: The format option lets you select the file format to be produced for file output.
The following formats are supported: TIFF (.tif,.tiff), SGI (.rgb,.sgi,.bw), JPG
(.jpg,.jpeg), PPM (.pgm,.ppm), BMP (.bmp), PNG (.png), DCM (.dcm), Encapsu-
lated PostScript (.eps), JPEG2000 (.jp2) and PDF (.pdf). In addition, this port offers three
radio buttons to choose between grayscale, rgb, and rgb alpha type of raster images. If rgb al-
pha option is set, images are produced such that the viewer background is assigned to the alpha
channel. This option is not available for file formats that do not support an alpha channel.
Options:
• -stereo
If this option is used, the stereo mode image is created. In this case filename2 file can be used
to specify where the second image of the stereo image is stored.
• -alpha
If this option is used, the snapshot image is created with a transparent background.
• -tiled nx ny
If this option is used tiled rendering is used with nx number of tiles in the horizontal direction,
and ny number of tiles in the vertical direction.
• -offscreen [witdh height]
If this option is used offscreen rendering is used where width and height are width and height
of rendered image.
To create an object like a Bounding Box, select the Annotate category and, then, double-click (or press
[Enter]) on the Bounding Box item.
For a quicker access, it is also possible to use the search field and start to enter the ”Bounding Box”
string. A search will be done on the categories tree to find the modules and data objects which name
begin with the entered string and the search results are automatically displayed within a completion
popup. You can instantiate the requested object by clicking on the associated completion result.
10.1.19.1 Explorer
This component is used to browse the categories of modules which can be attached to the object. The
categories tree is represented using cascading panels allowing you to navigate through the categories,
visualizing the modules hierarchy.
Once a category is selected (items with a folder icon), the next panel is automatically updated with
the category contents (note that a horizontal scrollbar can be displayed when the sub-categories level
exceeds three). Specific categories are listed before the other:
• Favorites: lists the modules which have been set as favorites (using the star button within the
preview panel). This category contains default favorites modules at the first start of Avizo.
• Recents: lists the modules which have recently been created on the object. By default, this
category is empty but its contents are saved from one Avizo execution to another, allowing you
to retrieve the modules created during the last session.
• Editors: lists the editors which can be attached on the object. Note that this category is not
displayed when no editor is available.
• Templates: lists the template modules which can be attached on the object. Note that this cate-
gory is not displayed when no template module is available.
Once an object item is selected, the preview panel is displayed on the right, displaying information
about the selected object. To create the selected object, double-click (or press [Enter]) on the item,
or click on the button within the preview panel.
This component is displayed when an object item is selected within the categories explorer. It provides
information about the selected object such as a short description, the object’s type and its former
name(s).
This component is used to search a specific object without navigating through the categories explorer.
When entering a search string, the objects which name contains the entered string will be displayed
within a completion popup, allowing you to quickly create an object. Note that, when the search
string exceeds 3 characters, an item is displayed at the end of the list of completion results to search
the entered string within the Avizo documentation (the results will be displayed within the AvizoHelp
dialog).
Once the completion popup is displayed, you can create the requested object by double-clicking on it
or pressing [Enter] after selecting it.
By default, the search is performed on:
It is possible to filter the completion results by selecting the search filters via a menu displayed when
clicking on the search field arrow button.
When clicking on the object’s icon, a menu is shown providing different actions on the object:
• Hide Object: to hide the object from the Project View (only in Graph View mode).
• Remove Object: to delete the object.
• Duplicate Object: to create a copy of an object and add it to the Project View.
• Rename Object...: to rename the object (will pop up a renaming dialog).
When clicking on the save button arrow icon, a menu is shown to save (or save as) the data object.
The Create Object popup menu lets you create modules or data objects that cannot be accessed via the
popup menu of any other object. The Create Object popup menu contains:
• An explorer used to browse the different categories of modules and data objects.
• A preview panel displaying information about the selected module or data object.
• A search field used to search an item within the categories tree.
This popup menu looks and works like the popup menu of objects within the Project View. For more
details about the popup menu components, please refer to the Object Popup documentation.
To create an object like a Caption, select the Annotations category and, then, double-click (or press
[Enter]) on the Caption item.
For a quicker access, it is also possible to use the search field and start to enter the ”Caption” string.
A search will be done on the categories tree to find the modules and data objects which name contains
the entered string and the search results are automatically displayed within a completion popup. You
can instantiate the requested object by clicking on the associated completion result.
The icon of a newly created object usually will not be connected to any other object in the Project
View. In order to establish connections later on, use the popup menu over the small white square on
the left side of the object’s icon.
You can also put in links to scripts in the Create Object popup menu. Details are defined in Section
11.5 (Configuring popup menus).
A 3D scalar field is a mapping R3 → R. The base class of all 3D scalar fields in Avizo is HxS-
calarField3. Various sub-classes represent different ways of defining a scalar field. There are a num-
ber of visualization methods for them, for example pseudo-coloring on cutting planes, iso-surfacing,
or volume rendering. However, many visualization modules in Avizo rely on a special field represen-
tation. Therefore, they can only operate on sub-classes of a general scalar field. Whenever a given
geometry is to be pseudo-colored, any kind of scalar field can be used (cf. Color Wash, Tetra Grid
View, Isosurface).
The class HxTetraScalarField3 represents a field which is defined on a tetrahedral grid. On each grid
vertex a scalar value, e.g., a temperature, is defined. Values associated to points inside a tetrahedron
are obtained from the four vertex values by linear interpolation. This class does not provide a copy of
the grid itself, instead a reference to the grid is provided. This is indicated in the Project View by a line
which connects the grid icon and the field icon. As a consequence, a field defined on a tetrahedral grid
cannot be loaded into the system if the grid itself is not already present.
As for scalar fields Avizo provides a number of vector field classes, these are derived from the base
classes HxVectorField3 and HxComplexVectorField3. While ordinary vector fields return a three-
component vector at each position, complex vector fields return a six-component vector. Complex
vector fields are used for encoding stationary electromagnetic wave pattern as required by some appli-
cations. Usually complex vector fields are visualized by projecting them into the space of reals using
different phase offsets. The Vectors Slice module even allows you to animate the phase offset. In this
way a nice impression of the oscillating wave pattern is obtained.
A regular grid consists of a three-dimensional array of nodes. Each node may be addressed by an index
triple (i,j,k). Regular grids are further distinguished according to the kind of coordinates being used.
The most simple case comprises uniform coordinates, where all cells are assumed to be rectangular and
axis-aligned. Moreover, the grid spacing is constant along each axis. A grid with stacked coordinates
may be imagined as a stack of uniform 2D slices. However, the distance between neighboring slices
• Colormap name
This specifies the name of the default colormap used to visualize the data. Some modules auto-
matically search the Project View for this colormap and for example use it for pseudocoloring.
• LoadCmd cmd
This parameter is usually set by import filters when a data object is read. It is used when saving
the current project into a file and it allows the object to be restored automatically. Internal use
only.
10.2.8 Shadowing
Real time shadow casting is enabled through the Rendering tab of the Preferences Dialog (accessible
via the Preferences button in the Standard Toolbar or the Edit > Preferences menu entry).
Once enabled, most of display modules can cast or receive shadows.
Different modes are available, and switching from one to another is possible by clicking on the shadow
icon of a display module
•
No Shadows: the displayed shape neither cast or receive shadows
•
Cast Shadows: the displayed shape only cast shadows
•
Receive shadows: the displayed shape only receive shadows
•
Cast & Receive shadows: the displayed shape both cast and receive shadows
Restrictions:
At least the Multi-Texture and Texture Environment Combine OpenGL
extensions
R must be supported
by your graphics board. Otherwise no shadows will be computed. These extensions are now standard
in OpenGL
1.3R and later.
The Shadow and Depth Texture OpenGL
extensions
R (standard in OpenGL
1.4)
R are used if they are
available and generally improve performance.
Some aliasing artifacts can appear if you zoom in very close to the scene. You can then increase the
quality in the Preferences Dialog.
Transparent objects are treated as follows, depending on the transparency type:
Shadowing may impact performance and is only fully supported by some display modules/modes
(such as Volume Rendering). Setting the environment variable AVIZO FORCE SHADOW MAP, en-
ables to activate a less restrictive shadowing mode (i.e. more modules supports it but not the Volume
Rendering)
• -help
Prints a short summary of command line options.
• -version
Prints the version string of Avizo.
• -no stencils
Tells Avizo not to ask for a stencil buffer in its 3D graphics windows. This option can be set to
In this example, first the system’s default start-up script is executed. This ensures that all Avizo objects
are registered properly. Then some special settings are made. Finally, a hot-key procedure is defined
for the function key [F3]. You can define such a procedure for any other function key as well. In
addition, procedures like onKeyShiftF3 or onKeyCtrlF3 can be defined. These procedures are
executed when a function key is pressed with the [SHIFT] or the [CTRL] modifier key being pressed
down.
To create a template project choose Save Project As Template from the File menu. An input selection
dialog appears and lists all the possible template inputs (all the current data objects). A template
input stands for a data set that must be supplied when the template is executed. For each selected
template input you can change the label. This label should be general and meaningful since it will be
displayed during template execution. The default label is the original data object name. Note: Unused
data objects are filtered by default, but you can include them in the template project by selecting the
Include unused data option.
If the template contains exactly one input, a dialog will ask if you wish to associate the template with
data of this type. If you click OK, then the template will be available in the right-click menu (Templates
submenu) for all data objects of the same data type.
Figure 10.24: Data Type association is possible if template has only one input.
Finally, a file dialog will appear to name the output file. The file name is also the name of the template,
i.e. the name that will appear in the Templates menu. Built-in template projects are stored in the folder
share/templates, but you may not have sufficient privileges to create new files in that directory.
You can save custom templates in any directory. They will be automatically reloaded on each Avizo
start-up.
Built-in template projects and known custom user template projects are loaded automatically on Avizo
start-up. Loading a template does not mean instantiating the template project. Template projects are
only created on user demand, for example using the Project >Create Object... menu. One exception: if
user loads a template file via the Open Data dialog, the template resource is loaded, and then executed.
Each template input is shown with its template input name and a combo box to select the data set to be
used for that input. The candidates listed in each combo box are filtered according to their data type.
You can disable this filter and display all data present in the Project View by unselecting the Check
input type option. If there are no appropriate data objects, the combo box will be empty. You can
always select the ”<load file...>” item to display a file open dialog and choose a data file.
A special treatment for colormaps: by default, color maps that are already in the Project View are
re-used as is. This means, for instance, that objects in the template project may be affected by range
changes. You can also choose not to share color maps with existing objects by selecting the Indepen-
dant color maps option.
Scripting
11.1 Introduction
This chapter is intended for advanced Avizo users only. If you do not know what scripting is, it is very
likely that you will not need the features described in this chapter.
Beside the interactive control via the graphical user interface, most of the Avizo functionality can also
be accessed using specific commands. This allows you to automate certain processes and to create
scripts for managing routine tasks or for presenting demos. Avizo’s scripting commands are based
on Tcl, the Tool Command Language. This means you can write command scripts using Tcl with
Avizo-specific extensions.
Avizo commands can be typed into the Avizo console window, as described in Section 10.1.12. Com-
mands typed directly into the console window will be executed immediately. Alternatively, commands
can be written into a text file, which can then be executed as a whole.
This chapter is organized as follows:
Section 11.2 (Introduction to Tcl) gives a short introduction to the Tcl scripting language. This section
is not very Avizo specific.
Section 11.3 (Avizo Script Interface) explains Avizo-specific commands and concepts related to script-
ing. This includes a reference of global commands.
Section 11.4 (Avizo Script Files) explains the different ways of writing and executing script files in-
cluding references to script objects, resource files, and function-key bound Tcl procedures.
Section 11.5 (Configuring Popup Menus) describes how the popup menu of an object can be configured
using script commands, and how new entries causing a script to be executed can be created.
Section 11.6 (Registering pick callbacks) describes how script callbacks can be attached to objects or
viewers and be invoked on user pick events.
Section 11.7 (File readers in Tcl) describes how to register a custom file reader implemented in Tcl.
The section Data Type: Script Module in the User’s Reference Guide describes how to use Tcl scripts
for defining custom modules that have their own graphical user interface and can be used like the
built-in Avizo objects.
This will output the string Hello World. Note that Tcl commands can be separated by a semi-colon
(;) or a newline character. If you want to execute two successive echo commands, you can do it this
way:
or like this:
# this is a comment
echo Hello World
e.g.
set i 1
set myVar foobar
Note that in Tcl internally all variables are of string type. Since the set command requires exactly one
argument as the variable value, you have to quote values that contain spaces:
or
In order to substitute the value of a variable with name varname, a $ sign has to be put in front of
that name. The expression $varname will be replaced by the value of the variable. After the above
definitions,
echo $Output
would print
Hello World
would yield the output 1.) Hello World. Note that variable substitution is performed for strings quoted
in ", while it is not done for strings enclosed in braces {}. Even newline characters are allowed in a {
} enclosed string. Note however that it is not possible to type in multi-line commands into the Avizo
console.
expr 5 / ( 7 + 3)
expr $i + 1
In order to use the result of a command like expr for further commands, an important Tcl mechanism
has to be used: command substitution, denoted by brackets []. Any list enclosed in brackets [] will
be executed as a separate command first, and the [...] construct will be replaced with the result of
the command. This is similar to the ‘...‘ construct in Unix command shells. For example, in order to
increase the value of the variable i by one you can use:
set i [expr $i + 1]
Of course, command expressions can be arbitrarily nested. The order of execution is always from the
innermost bracket pair to the outermost one:
source C:\test.txt
We start with the if-then mechanism. It is used to execute some code conditionally, only if a certain
expression evaluates to ”true” (meaning a value different from 0):
set a 7
set b 8
if {$a < $b} {
echo "$a is smaller than $b"
} elseif {$a == $b} {
echo "$a equals $b"
} else {
echo "$a is greater than $b"
}
set i 1
while {$i < $100} {
echo $i
set $i [expr $i * 2]
}
foreach x {1 2 4 8 16 32 64} {
echo $x
}
This will generate the same output as the previous example. Note that the expression enclosed in
braces is a space-separated list of words.
proc computeAverageA {a b} {
return [expr ($a+$b)/2.0]
}
proc computeAverageB {a b c} {
return [expr ($a+$b+$c)/3.0]
}
As you can see in the example, the argument list defines the names for local variables that can be used
in the body of the procedure (e.g. $a). The return command is used to define the result of the
procedure. This result is the value that is used in the command bracket substitution [].
If you want to define a procedure with a flexible number of arguments, you must use the special
argument name args. If the argument list contains just this word, the newly defined command will
accept an arbitrary number of arguments, and these arguments are passed as a list called args:
In this example, the llength command returns the number of elements contained in the args list.
Note that the variable result defined in the procedure has local scope, meaning that it will not be
known outside the body of the procedure. Also, the value of globally defined variables is not known
within a procedure unless that global variable is declared using the keyword global:
set x 3
proc printX {} {
global x
echo "the value of x is $x"
}
There is much more to be said about procedures, e.g., concerning argument passing, evaluation of
commands in the context outside of the procedure, and so on. Please refer to a Tcl reference book for
these advanced topics.
You can think of lists as simple strings in which the list elements are separated by spaces. This means
that you can achieve the same result as in the previous example without using the list commands:
The append command is similar to lappend, but it just adds a string at the end of an existing string. List
manipulation becomes much more involved when you start nesting lists. Nested lists are represented
using nested pairs of braces, e.g.
set input {1 2 {3 4 5 {6 7} 8 } 9}
foreach x $input {
echo $x
}
1
2
3 4 5 {6 7} 8
9
Please note that Tcl will automatically quote strings that are not single words when constructing a list.
Here is an example:
set i [list 1 2 3]
lappend i "4 5 6"
echo $i
1 2 3 {4 5 6}
set i [list a b c d e]
echo [lindex $i 2]
For example, if an object called ”Global Axes” exists (choose View/Axis from the Avizo menu) then
you can use commands like
Remember to use the completion and history functions provided by the Avizo console, as described in
Section 10.1.12 (console window) to save typing.
If you have already used Avizo you have noticed that the parameters and the behavior of an Avizo
module are controlled via its ports. The ports provide a user interface to change their values when the
module is selected. All ports can also be controlled via the command interface. The general syntax for
that is
<object-name> allPorts
Almost all ports provide a setValue and a getValue command. The number of parameters and
the syntax, of course, depend on the ports.
Commands of the type <object-name> <port-name> setValue ... make up more than
90% of a typical Avizo script. However, besides the port commands, many Avizo objects provide
additional specific commands. The command interface for a particular module is described in the
User’s Reference Guide. You can quickly find the corresponding page by clicking the ? button in the
Properties Area when the module has been selected.
As a quick help, entering an object’s name without further options will display all commands available
for that object. Note that this will also show undocumented, unreleased, and experimental commands.
In order to get more information about a particular module or port command, you can type it into the
console window without any arguments and then press the F1 key. This opens the help browser with a
command description.
Avizo objects are part of a class hierarchy. Similar to the C++ programming interface, also script
commands are inherited by derived classes from its base classes. This means that a particular object
like the axis object will beside its own specific commands also provide all the commands available in
its base classes. Links to the base class commands are given in a module’s documentation.
where <object> refers to the name of the object and <command> denotes the command to be
executed. Each module or data object may define its own set of commands in addition to the commands
defined by its base classes. The commands described in the Object section are provided by all modules
and data objects.
In the following section Global commands are described.
Commands
viewer [<number>] snapshot [-offscreen [<width> <height>]]
[-stereo] [-alpha] [-tiled <nx> <ny>] <filename> [filename2]
This command takes a snapshot of the current scene and saves it under the specific filename.
• the viewer is in top level and the given size is too small (ex: (10, 10))
• the viewer is not in top level and the main window can’t be resized to a smaller size (Example:
a widget is blocking the main window resize like the unified title and tool bar on Mac or a
dock widget with a minimal width).
The last option does the same as the rotate button of the user interface. In most cases the m option
is most adequate. For backward-compatibility the default is u.
viewer [<number>] setDecoration <state>
Deprecated.
viewer [<number>] saveScene [-b] [-r] [-z] <filename>
Saves all of the geometry displayed in a viewer in Open Inventor 3D graphics format. Warning:
Since many Avizo modules use custom Open Inventor nodes, the scene usually can not be displayed
correctly in external programs like ivview. The following options are available:
Commands
theMain snapshot filename
Creates and saves a snapshot image of the main window. The format of the image file is determined
from the file name extension. Any standard image file format supported by Avizo can be used, e.g.,
.jpg, .tif, .png, or .bmp.
theMain setViewerTogglesOnIcons {0|1}
Enables or disables the display of the orange viewer toggles on object icons in the Avizo Project
View.
theMain ignoreShow [0|1]
Enables or disables the special purpose no show flag. If this flag is set, subsequent mainWindow
The command theMsg allows you to access and control the Avizo console window. Besides the
specific command options listed below also all sub-commands listed in Section 11.3.3.4 (Common
commands for top-level windows) can be used.
Commands
theMsg error <message> [<btn0-text>] [<btn1-text>]
[<btn2-text>]
Pops up an error dialog with the specified message. The dialog can be configured with up to three
different buttons. The command blocks until the user presses a button. The id of the pressed button
is returned.
theMsg warning <message> [<btn0-text>] [<btn1-text>]
[<btn2-text>]
Pops up a warning dialog with the specified message. The dialog can be configured with up to three
different buttons. The command blocks until the user presses a button. The id of the pressed button
is returned.
theMsg question <message> [<btn0-text>] [<btn1-text>]
[<btn2-text>]
Pops up a question dialog with the specified message. The dialog can be configured with up to
three different buttons. The command blocks until the user presses a button. The id of the pressed
button is returned.
theMsg overwrite <filename>
Pops up a dialog asking the user if it is ok to overwrite the specified file. If the user clicks Ok, 1 is
returned, otherwise 0.
These commands are available for all Avizo objects which open a separate top-level window. In par-
ticular, these are the Avizo main window (theMain), the console window (theMsg), and the viewer
window (viewer 0). For example, you can set or get the position of these windows using the corre-
sponding global command followed by setPosition or getPosition.
The command workArea allows you to access the progress bar located in the lower part of the Avizo
main window. You can print messages or check if the stop button was pressed.
Commands
workArea setProgressInfo <text>
Sets an info text to be displayed in the progress bar. The text can be used to describe the status
during some computation.
workArea setProgressValue <value>
Sets the value of the progress bar. The argument must be a floating point number between 0 and 1.
For example, a value of 0.8 indicates that 80% of the current task has been done.
workArea startWorking [<message>]
Activates the stop button. After calling this command the Avizo stop button becomes active. In
your script you can check if the stop button was hit by calling workArea wasInterrupted.
When the stop button is active you can’t interact with any other widget unless you call workArea
stopWorking in your script. Therefore you must not enter this command directly in the console
window, but you should only use it in a script file or in a Tcl procedure.
workArea stopWorking
Deactivates the stop button. Call this command when the compute task started with workArea
startWorking is done or if the user pressed the stop button. This command also restores the
progress info text which was shown before calling startWorking.
workArea wasInterrupted
Checks if the user pressed the stop button. You should only use this command between workArea
startWorking and workArea stopWorking. If there are multiple nested compute tasks
and the user presses the stop button, all subsequent calls to wasInterrupted return true until
the first level is reached.
Commands
app version
Returns the current Avizo version.
app uname
Returns simplified name of operating system.
app arch
Returns Avizo architecture string, e.g., arch-Win32VC8-Optimize, arch-LinuxAMD64-Optimize...
app hostid
Returns host id needed to create an Avizo license key.
app listen [port]
Opens a socket to which Tcl commands can be sent. The TCP/IP port can be specified optionally.
WARNING: This can create security holes. Do not use this unless behind a firewall and if you know
what you are doing.
app close
Closes the Avizo Tcl port.
app port
Returns port number of Avizo Tcl port. Returns -1 if socket has not been opened.
app send <command> [<host> [<port>]]
Sends a Tcl command to a listening Avizo. If no host or port are specified, the Avizo instance will
send the command to itself.
app opengl
Retrieve information about the used OpenGL driver including version number and supported exten-
sions. This is useful information to send to the hotline if reporting rendering problems.
app cluster
Returns the current node status which can be ”master” or ”slave” if some cluster mode is active or
simply ”single” if is not the case.
Commands
addTimeout msec procedure [arg]
Schedules a Tcl procedure for being called after msec milliseconds. If arg is specified, it will
clear
Clears console window.
dso options
Controls loading of dynamic libraries (”dynamic shared objects”). The following options are pro-
vided:
• addPath path ...: Adds a path to the list of directories to be searched when loading a
dynamic library.
• verbose {0|1}: Switches on and off debug information related to dynamic libraries.
• open <package>: Trys to load the specified dynamic library. It is enough to specify the
package name, e.g., hxfield. This name will be automatically converted into the platform
dependent name, e.g., libhxfield.so on Linux or hxfield.dll on Windows.
• unloadPackage <package>: Unloads (if possible) the specified dynamic library.
• execute <package> <function>: Executes the function defined in the specified dy-
namic library.
echo args
Prints its arguments to the Avizo console. Use this rather than the native Tcl command puts which
prints to stdout.
help arguments
Without arguments this opens the Avizo help browser.
# Avizo Script
There are some Tcl files that are loaded automatically when Avizo starts. At startup, the program
looks for a file called .Avizo in the current directory or in the home directory (see Section 10.3.3
(Start-up script) for details). If no such user-defined start-up script is found, the default initialization
script Avizo.init is loaded from the directory $AVIZO LOCAL/share/resources/Avizo
or $AVIZO ROOT/share/resources/Avizo. This script then reads in all files ending with .rc
from the share/resources subdirectory. The .rc files are needed to register modules and data
types. Therefore one can customize the startup behavior of Avizo by simply adding a new .rc file to
that directory or by modifying the Avizo.init file.
Another way of executing Tcl code is to define procedures that are associated with function keys. If
predefined procedures with the names onKeyF2, onKeyF3, ..., onKeyShiftF2, ...,
onKeyCtrlF2, ..., onKeyCtrlShiftF2, ... exist, these procedures will be automat-
ically called when the respective key is pressed in the Avizo main window, console window, or
viewer window. To define these procedures, write them into a file and source it or write them
into Avizo.init or in one of the .rc files. An example is
proc onKeyF2 { } {
echo "Key F2 was hit"
viewer 0 viewAll
}
Note:
Some of these functions can be reserved for Avizo specific actions. For example, [F1] is always
reserved for help and [F2] is reserved for object renaming when pressed in the Project View or the
Tree View.
• The option -name specifies the name or label of the module as it will be printed in the popup
menu.
• The option -primary says that this module can be attached to data objects of type
HxUniformScalarField3 or HxStackedScalarField3. This means that Multi-
Thresholding will be included in the popup menu of such objects only.
• With -check an additional Tcl expression is specified which is evaluated at run-time just be-
fore the menu is popped up. If the expression fails, the module is removed from the menu.
In the case of the Multi-Thresholding module, it is checked if the input object provides a
HxLabelLattice3 interface, i.e., if the input itself is a label field. Although a label field
Besides these standard options, additional Tcl commands to be executed after the module has been
created can be specified using the additional option -proc. For example, imagine you are working in
a medical project where you have to identify stereotactic markers in CT images of the head. Then it
might be a good idea to add a customized version of the Multi-Thresholding module to the popup menu,
which already defines appropriate material names and thresholds. This could be done by adding the
following command either in a new resource file in $AVIZO ROOT/share/resources or directly
in hxlattice.rc:
The variable $this used in the Tcl code above refers to the newly created module, i.e., to the Multi-
Thresholding module. Note that the commands are executed before the module is connected to the
source object for which the popup menu was invoked. Some modules do some special initialization
when they are connected to a new input object. These initializations may overwrite values set using Tcl
commands defined by a custom -proc option. In such a case you can explicitly connect the module
to the input object via the command sequence
Of course, it is also possible to execute an ordinary Avizo script or even an Avizo script object with a
-proc command.
Only one callback can be attached to a given module or viewer. In order to detach the callback, just
call the register command with no parameter:
<module> setPickCallback
viewer <n> setPickCallback
• object, the name of Avizo object the picked geometry belongs to,
• x, the x coordinate of picked point,
• y, the y coordinate of picked point,
• z, the z coordinate of picked point,
• idx, the index of picked element,
• stateBefore, the modifier state just before event occurs,
• stateAfter, the modifier state just after event occurs.
The procedure should return 0 if the picking event was not handled, in which case other callback
procedures could be invoked. Here is an example:
Note that any module is free to add specific information to this argument array. All elements can be
displayed with:
Then, the Tcl reader function must be registered into the wanted file format declaration with the fol-
lowing template:
You indicates the custom Tcl reader function with ’-loadArgs’. The arguments ’-package hxcore -load
hxReadByTcl’ must be filed as is, without change. This sets the internal wrapper that will call the Tcl
interpreter.
You can declare your custom reader in a Tcl script, or include it in a resource file to be loaded when
the application starts up.
Units in Avizo
This chapter contains a description of how Avizo can be configured to work with spatial data objects
with associated coordinates unit information.
This chapter is organized as follows:
• Presentation:
this section describes globally the units management in the entire product.
12.1 Presentation
When activating the units management in Avizo, you will be able to:
• associate a coordinates unit with each spatial data object, retrieving it directly from the data
files (depends on readers and file formats) or setting it manually with a Units Editor.
• store coordinates values of all loaded spatial data object with the same coordinates unit (eg.
meters). The coordinates unit storage in Avizo and used internally is called working units.
Working units could be specified by the user or automatically determined (see Automatically
determine or manually set the working coordinates unit).
• display values related to coordinates information in the Avizo user interface (such as bounding
box, length...) in the coordinates unit you want.
The units used to display values in the Avizo user interface are called display units.
To know how to activate/deactivate the units management in Avizo, you can refer to the following
section: Activate/desactivate units management in Avizo.
In the most possible cases, Avizo readers will try to extract the coordinates unit directly from the
information stored in the data file. This is the case for instance with Avizo or MCAD readers (like
IGES).
If the coordinates unit can’t be determined by the reader (the information is missing or not supported
by the file format), it will be specified via the Units Editor. This editor is launched at data loading but
is also accessible after the data has been registered into the Project View, in the same way as the other
editors.
Once a coordinates unit has been assigned to the spatial data object, its coordinates values can possibly
be converted. This will happen if the specified coordinates unit for this data is not the same than the
one used internally by Avizo to store coordinates values for all spatial data objects (i.e. named working
units). In this case, the coordinates values will be converted from the specified coordinates unit to the
working one.
Note:
Manually setting a coordinates unit to a spatial data object (via the editor) will mark the object as
modified. Indeed, this implies that the original file format of the data does not support coordinates
unit information. After associating it a coordinates unit, the data has to be saved in a file format
that can support this information. For convenience, you can easily save data in the Avizo file format
• in the Units Editor, where you can see and modify the original coordinates unit of a spatial data
(i.e. the one specified ad data loading) after that the data has been loaded
• in the Parameter Editor on the spatial data where the coordinates unit of the spatial data is
specified under a Units bundle. In fact, under this bundle are displayed 2 informations:
• the current (working) coordinates unit of the spatial data stored in the Coordinates param-
eter (the one in which are currently stored the coordinates in memory),
• the original coordinates unit of the spatial data stored in the OriginalCoordinates param-
eter (the one specified via the Units Editor at data loading or edited furtherly).
12.3 How to modify the coordinates unit used for displaying in-
formation
Even if the coordinates unit used to internally store spatial data objects coordinates (i.e. named working
unit) is fixed, values related to coordinates information that are displayed in the product user interface
can be expressed in any coordinates unit.
For example, you can load a spatial data object with coordinates stored in meters (i.e. working unit),
connect it a Bounding Box module and freely modify the coordinates unit used to display the coordi-
nates (i.e. named display unit) of the corners in the info tags of this module (by selecting millimeters
for instance).
In this case, the displayed coordinates values will be converted from the working unit (in which are
internally stored coordinates values) to the display unit (in which are displayed these values in the
Avizo user interface).
To specify what coordinates unit is used for displaying coordinates values in the user interface:
A quickest way to modify this display unit is accessible on the main viewer toolbar between Measure
button and snapshot button (see Viewer toolbar description).
Display unit button is enable if the option ”Lock display units on working units” is unchecked.
With this button, you can select the display unit you want for coordinates information not only for the
active viewer but for all unit displayed in Avizo.
How to modify the coordinates unit used for displaying information 229
12.4 Available options linked with units management
Several options linked with units management are available and allow you to customize the way you
are using units in the product.
These options are the following:
All these options can be modified via the Avizo Preferences dialog.
To access the preferences linked with units management:
• In the Units management section, select None to deactivate the units management or Spatial
information to activate it and use coordinates and angle units information
12.4.4 Activate/deactivate the units editor dialog when loading spatial data ob-
jects
As explained before, when the units management is activated, some readers can launch a specific
dialog used to specify the coordinates unit of the loaded spatial data.
This dialog will be launched only if the reader has failed to automatically retrieve the coordinates unit
from the information stored in the data file.
Note that you have the option to prevent the dialog from being displayed. In this case, the loaded
To deactivate the units editor dialog when loading spatial data objects:
Units management is not yet available for all the components of Avizo. The components (data types,
files formats, modules) for which the units management has been implemented are listed here.
When units management is activated in the product, it is possible to assign a coordinates unit and
potentially make units conversion on coordinates values for all data objects for which the type is listed
below.
For all other data types, coordinates values can’t be converted so these are always stored internally
using original values. In this case, the coordinates unit is set to the working coordinates unit.
12.5.3 Modules
The following modules have been modified to support units management in case it has been activated:
Module Units management support
Local Axes axis tick values and labels
Bounding Box coordinates of the lower left front and upper right back corners of the box
ROI Box minimum and maximum port values
Spline Probe point coordinates, length value and plot window
Line Probe point coordinates, length value and plot window
Measurement length and angle values
Scalebars axis tick values and labels
Avizo Fire Edition is the software suite for visualizing and analyzing advanced qualitative and quan-
titative information on 2D and 3D industrial and scientific images, in areas such as Materials Science,
Non-Destructive Testing and Industrial Inspection, or Geosciences and Oil & Gas.
Avizo Fire Edition extends Avizo Standard Edition with advanced image manipulation, processing,
segmentation and quantification capabilities including:
You may use this tutorial as a quick start for visualizing and manipulating 3D images with Avizo Fire
Edition. However to take full advantage of this tutorial you should be familiar with the basic concepts
of Avizo. In particular you should be able to load files, to interact with the 3D viewer, and to connect
modules to data modules. All these issues are discussed in Avizo chapter 3 - Getting started. To
complement this tutorial, you may also review section 4.2 (Visualizing 3D images) of Avizo Standard
Edition about basic 3D image visualization techniques.
You can now try some interaction. You can refer to Section 3 (Getting Started) in 3D navigation with
viewer windows.
• In the 2D viewers, you can zoom by dragging the mouse with the left button pressed, or pan the
view with the middle mouse button. For this the mouse cursor shape should be a 2-sided arrow
or 4-sided arrow, otherwise press the [ESC] key or use a toolbar button to switch to viewer
navigation mode.
1. an Ortho Views managing the display of three orthogonal slices in a 4-viewers window layout.
The next section describes it in more details.
2. a Range Calibration Contours overlay module displaying over the orthogonal slices a set of
contours corresponding to intensity levels defined by intensity range calibration, a concept ex-
plained later in this chapter.
3. a Volume Rendering module displaying the 3D image in the top-left viewer window.
4. an Isosurface Rendering module, initially invisible in the viewer windows.
When a module is selected in the Project View (by clicking on the module icon in the Project View),
its control parameters - called ports - are shown in the Properties panel. To select multiple modules,
hold down the shift key while clicking.
Tip: You can refer to chapter 10.4.1 (Template Projects) for learning how to create template projects.
• In the Properties panel, click on the clip button (the little cube split by a blue line, see Figure
13.3) of the Slice Number Z ports of the Ortho View (if the slider is not visible in Properties
panel, select the Ortho Views module in the Project View). You will then see a cut in the 3D
volume rendering representations (see Figure 13.4).
• Move the Z slice by any means explained above and see the updated 3D view.
• Rotate the 3D view (see above about navigation). The clipped side is always facing the camera.
Note that this is as specific feature of Ortho Views, in contrast with the standard behavior for
clipping planes in other slice modules in Avizo.
Visibility of slices in the 2D and 3D viewers can be controlled in the standard way with Avizo by
clicking on the orange square buttons in the icon in Project View, or beside the module title in the
Properties panel. See chapter 10.1.8 about Main panel and Project Views.
Figure 13.3: Visibility buttons and clip button in Ortho Views module
• You can hide slices, calibration contours, and crosshair, and show volume rendering, as shown
in Figure 13.5. You will need to use visibility buttons of Ortho Views, Bkg Properties, Range
Calibration Contours and Volume Rendering modules as shown in Figure 13.6.
Going further: here are some more hints for using Ortho Views, see the related reference help for
more details.
• To quit Ortho Views mode, you can simply delete the Ortho Views module. You can also click
on the viewer toolbar button to set the active viewer (with white frame) as Single Viewer. Ortho
Views is then still active: click again on Single viewer button to cycle through the different
Note: There can only be one Ortho View in use in the Project, so you can’t attach a second Ortho
View from a data object menu. It is however possible to change data visualized by Ortho View by
changing the connection from one image to another. For this you can either drag the connection line in
the Project Graph View, drag the Ortho Views icon to another data item, or change the data connection
port in the Properties panel.
Whereas, in CT scans of industrial parts, intensities may differentiate materials such as:
Avizo’s calibration tools let you define these intensity ranges so that visualization and computation
modules can take advantage of this pre-defined identification. Calibration is used at several location in
Avizo. For example, it allows adjusting the range depicted by a port to a particular range (which most
of the time represents a material). It also greatly simplifies visualization setup. It is possible because
the calibration contains an ”exterior” property which can be set to any range. Then, it’s easy to define
the ”usable” range to be everything not in the ”exterior” ranges.
In this tutorial, you will learn how to define and use intensity range calibration and how it affects
visualisation using as an example the Volume Rendering representation of a CT scan of an engine
block part already used in previous tutorials.
• Let’s start from scratch and create a new Project (choose New Project in the File menu).
• Select the entry Preferences in the Avizo Edit menu, and make sure that Range Calibration
options are set according to the defaults shown on Figure 13.8: automatic guess of two material
densities in the loaded image data (i.e. void and solid ranges/regions in the intensities scale).
• Load the file motor.am located in subdirectory data/tutorials of Avizo installation di-
rectory.
• Attach a Volume Rendering to the data: right-click on the green data icon appeared in the Project
View, click on Volume Rendering and press on Create, see Figure 13.9
As outlined in section 4.2 (Visualizing 3D images), the Volume Rendering module displays the inten-
sities of input data voxels with color and opacity depending on the colormap port. With colormaps like
the default (volrenWhite.am), the voxels with intensity values below the lower bounds (less than the
minimum) of the colormap port are fully transparent, see Figure 13.10. Changing this minimum is an
easy way to filter out parts of the 3D volume image that are void or low density materials. Here the
colormap bounds have been set according to range calibration presets on data as explained below.
• Select the Volume Rendering module in the Project View and view its colormap port in the
Properties panel (see Figure 13.11).
• Change the minimum boundary in the colormap port: the Volume Rendering is adjusted accord-
ingly. Tip: Use the virtual slider to change value continuously: hold down the Shift key while
you click and drag the mouse in the numerical text field.
Intensity range calibration intends to provide presets matching to some intensity ranges. This ranges
can be easily selected to display a given dataset. Avizo can automatically guess thresholds separating
different densities of phases or materials, by analysing the intensity distribution histogram of the input
data. In the example above, Avizo identified an optimal threshold separating void and solid.
You can see: the actual min-max of data intensities, the data window defining intensity boundaries
for exterior to be hidden and used by the colormap port of the Volume Rendering, and the number of
ranges that have been defined for this data.
• Invoke the Range Calibration Editor by clicking its toggle button (with an histogram ruler sym-
bol) beside data title in the Properties panel as shown below. You can see the defined ranges for
the dataset (see Figure 13.13).
• Press the Show range distribution button to display the data histogram, separated here in two
regions/ranges as shown in Figure 13.14.
As you can see, separations between phases/materials are found at local minima of the histogram.
Tip: Other tools are available for automatic threshold determination. See Auto Thresholding module.
Note: Range Calibration is helpful for making visualizations more easily. For ideal quality images
with respect to the features of interest, that can be enough for quantitative analysis. For accurate iden-
tification of different phases/materials, in particular with noise, inhomogeous background or artifacts,
image filtering and segmentation tools may be needed. See the next chapters for more about image
segmentation.
The engine block used in this example is actually made of at least two materials of significantly differ-
ent density and X-ray absorption: aluminum and steel inserts.
Modify the range calibration as follows:
• Set the Number of ranges to 3, and press Detect. You can see a new slider port and an updated
histogram with a new region/range as shown on Figure 13.15.
• Change names in Ranges port: Exterior Aluminum Steel
• Set Aluminum as an Exterior range : it will be excluded from the data window defined above
and used as default bounds by display modules. The first range named Exterior was set by
default as an exterior range.
• Press the Apply button at the bottom of the Properties panel. data info and editor should be
updated as shown in Figure 13.16.
• Now you can close the editor by clicking again on the Range Calibration Editor toggle button.
• Remove the Volume Rendering module from the current project: select the Volume Rendering
Settings module; press the delete key or drag the icon to the trash can in the Project View.
• Attach a Volume Rendering module to the data once again: the aluminum part is hidden now,
leaving only higher density steel visible, as shown in Figure 13.17.
• In the colormap port of the Volume Rendering module, you can press the Edit button or right-
click in color shaded area to choose a specific range in menu: entire data min-max, data window
excluding exterior ranges, or specific range defined (see Figure 13.18). For instance, choosing
Aluminum will get the entire block back.
More hints:
• In the Preferences, you can disable Calibration if you wish to get the behavior of the previous
Avizo’s version and use the default range for data min-max (or Data Window if defined as data
parameter).
• You can use the Preferences to set a number of phases/materials to be detected in your data.
Keep in mind that detection relies on the shape of the image histogram. Avizo can automatically
guess the number of ranges that may be detected, but you may prefer to override this if Avizo
fails to find the expected ranges.
• All modules using colormaps or range slider ports such as Isosurface can take advantage of
Range Calibration.
• Tip: The data window and ranges are defined as persistent data parameters when you save your
data to an Avizo format (see Section 10.2.7 Data parameters).
1. Image enhancement
2. Features extraction
3. Data measures and analysis
Getting started with Image Processing and Analysis in Avizo Fire Edition 247
• Analysis and measures
• Interactive selection
• Measure filters
• Sieves
• Label images
• Processing images in memory (in-core) and on disk (out-of-core)
• Scripting
To follow this tutorial you should be familiar with the basic concepts of Avizo. In particular you should
be able to load files, to interact with the 3D viewer, and to connect modules to data modules. All these
issues are discussed in Avizo chapter 3 - Getting started. For routine use of Avizo Fire Edition, you
may benefit from familiarity with Avizo image filtering and segmentation (see chapter 4 - Images and
volumes visualization and processing).
• Attach a Median Filter module to the data. (Use the search field and type the first letters of
Median Filter, then select the module in the list.)
• Select 3D in the Interpretation port of Median Filter.
• Press on the Apply button.
Once computed, the result is stored in a new image object foam.filtered (see Figure 13.20).
• Attach the three Ortho Slice to the resulting image. To do so, change the Data of each slice in
the Properties panel. See the resulting display on Figure 13.21.
Getting started with Image Processing and Analysis in Avizo Fire Edition 249
13.2.2 Interpretation as 3D image or 2D image stack
Sometimes it can be useful to interpret the input data of an image processing algorithm as a 3D volume,
or as a sequence of 2D planes. For instance, a number of image filters and image processing algorithms
can be performed either on each XY-slice of the volume using a 2D kernel or on the whole volume
using a 3D kernel. In some cases, it may be preferred to use 2D algorithm, either for performance or
for more appropriate effect depending on the data and the desired outcome.
In many Avizo Fire Edition modules, an interpretation port shows the state of the current module
(i.e XY planes or 3D ). If the state of the port is XY planes, it means that the module will perform
on each XY-slice. If the state of the port is 3D, it means that the module will perform on the entire
three-dimensional image at once.
In some cases, the intepretation port cannot be changed (it is greyed), for instance, when processing
can only be applied in XY planes.
13.2.4 Binarization
Binarization means transforming a grayscale image into a binary image (i.e. a label image with only
interior and exterior materials). Threshold binarization is used when the relevant information in the
grayscale image corresponds to a specific gray level interval. Thresholding is a simple segmentation
method - more sophisticated automatic, semi-automatic or manual segmentation tools are also avail-
able in Avizo. Threshold binarization can be done with the Interactive Thresholding module which
prompts you to set the levels with a visual feedback.
You can interactively modify the threshold values with immediate 2D or 3D visual feedback. The
selected pixels appear in blue in the displayed image.
• In the Properties panel of the module, you can set the threshold values to the range 0-30 for
instance.
• Check and uncheck the 3D option in the Preview Type port to get a 2D only or 3D preview (see
Figures 13.22 and 13.23).
• Press the Apply button to start the module.
The output binary image named foam.thresholded is generated in the Project View (see Figure
13.24).
In the output binary image, all pixels with an initial gray level value lying between the two bounds are
set to 1, all the other pixels are set to 0.
The Interactive Thresholding module has created a binary image. For binary images the Avizo Fire
Edition displays the voxels of intensity 1 with a blue color. If you attach an Ortho Slice to the resulting
image, an appropriate colormap is selected by default.
• Hide the Interactive Thresholding preview by switching of the orange visibility button in the
module icon in the Project View or next to the module name in the Properties panel.
• Connect the first Ortho Slice to the thresholded data. See the resulting display on Figure 13.25.
Getting started with Image Processing and Analysis in Avizo Fire Edition 251
Figure 13.25: Binary image displayed with an Ortho Slice
Extensive tools are available in Avizo Fire Edition for effective data binarization and segmentation
of images. The process can be automated in many cases, possibly by combining a number of steps,
sometimes requiring user input. In some cases, it may be necessary or easier to proceed to semi-
automatic or manual segmentation: in particular, the AvizoSegmentation Editor is designed for that
purpose (note that the Segmentation Editor only supports 8-bit label images). Also keep in mind that
improving image acquisition might be much easier than analyzing bad images.
Here are some of the Avizo Fire Edition modules that can facilitate automated binarization:
• Auto Thresholding automatically computes a threshold. You can choose the criterion best suited
to your data, generally factorisation.
After binarization, it may be necessary to separate some objects, as shown in the next section.
13.2.7 Separation
In the example dataset, some of the pores in the foam appear to be touching but ideally should be
separated for proper analysis. Thresholding cannot avoid this type of output when the acquisition data
is too coarse or noisy, because the gray levels of the considered objects are not uniform enough across
the volume, or because the resolution is too low to distinguish some objects’ boundaries. You can use
the Separate Objects module to separate connected particles.
The principle of the Separate Objects module is to compute watershed lines on a distance map. The
Separate Objects module is a high-level combination of the watershed, distance map and H-Maxima. It
can be used as a simple and straightforward separation tool, satisfying in many cases. You may notice
however that some separation may be missing or unwanted, in particular with non-convex shapes (con-
sidering also 3D). For more details and advanced separation, see Example 3: Separating, Measuring,
and Reconstructing Individual Objects - Pores in Foam.
Loading the project data/tutorials/fireedition/GettingStartedBasics-4-Separation.hx will complete the
steps above.
Getting started with Image Processing and Analysis in Avizo Fire Edition 253
Figure 13.26: The particles are now separated
13.2.8 Analysis
You can then use an analyze module to get the volume, surface area, mean value, number of voxels,
etc., individually for each separated particle. This analysis on the stack of images is undertaken by
using the Label Analysis module to extract statistical and numerical information, including the measure
of objects.
A new label image data object foam.label is created in the Project View, and the Tables panel is
displayed, showing a spreadsheet-style table of results: the analysis foam.Label-Analysis, also created
in the Project View (see Figures 13.27 and 13.28).
The basic measures (as selected in the Measures port of the module) are displayed in the Tables panel
as shown below (Volume3d, Area3D, etc.).
Getting started with Image Processing and Analysis in Avizo Fire Edition 255
Figure 13.30: Volume3d histogram
• Click on the label tracking button of the analysis panel toolbar (see Figure 13.31). A new Ortho
Slice is automatically attached to the separated image and displayed in the 3D viewer, as well as
a point dragger (see Figure 13.32).
• Select a cell of the analysis lower table. The point dragger will move to the corresponding object
location in the 3D view. If the histogram of one of the analysis measures is displayed, a vertical
line appears that displays the position and value of the selected row, as shown on Figure 13.33.
• In the viewer window, you can move the dragger using the rectangular handles, then upon button
release the analysis table will highlight the corresponding object row. In order to move the
dragger, you must set the viewer into interaction mode (press the ESC key). Then move the
mouse over one of the dragger’s crosshairs and press the left mouse button. The color of the
picked crosshair changes. The movement of the dragger is restricted to the corresponding plane.
• You can also click with the middle mouse button over a pickable object in the scene displayed
in the 3D viewer, for instance, over a particular pore on a displayed slice: the dragger will move
to the picked point and the corresponding spreadsheet row will also be highlighted.
Getting started with Image Processing and Analysis in Avizo Fire Edition 257
• You can verify that fewer objects have been created by connecting the Ortho Slice to the new
label image foam.label-filtering, as shown on Figure 13.35.
Tip: Filtering driven by measures can be a powerful tool for data segmentation. It allows you to select
or eliminate regions based for instance on size, shape factor, orientation, or combinations of several
criteria.
Loading the project data/tutorials/fireedition/GettingStartedBasics-6-FilterAnalysis.hx will complete
the steps above.
Getting started with Image Processing and Analysis in Avizo Fire Edition 259
Loading the project data/tutorials/fireedition/GettingStartedBasics-7-SieveAnalysis.hx will complete
the steps above.
In the label image created along with the result spreadsheet, each particle has been identified and
assigned a unique index. This label data is stored in this case as a 16-bit label field. Such images are
displayed by default using a cyclic colormap so that particles in close proximity are more likely to be
shown in a different color, as shown on Figure 13.38.
Figure 13.38: Each particle has been identified and assigned a unique index
The Convert Image Type Editor should be used to change the precision of a label image. For instance,
some Avizo Fire Edition modules require 8-bit per voxel label images as input and won’t take 16-bit
per voxel label images. In such cases, it is mandatory to convert a 16-bit per voxel label image into a
8-bit per voxel label image.
Note: Avizo label field images coming from the Segmentation Editor and Multi-Thresholding modules
are 8-bit per voxel label images.
13.2.14 Scripting
A complete processing sequence can be put in a script in order to automate analysis for routine tasks.
For details about scripting with Avizo Fire Edition, see the chapter 13.4 - Example 3: Separating,
Measuring and Reconstructing.
13.2.15 Conclusion
This tutorial has introduced you to:
These concepts can be extended in countless ways to tackle new challenges. Try to relate your image
processing problems back to this simple workflow:
This introduction has highlighted how Avizo Fire Edition can be used to perform sophisticated seg-
mentation and analysis of 3D data, but there are many more processing operations and measurements
in addition to those presented here. Avizo Fire Edition gives you this extensive toolkit so that you can
map the appropriate tools to any processing challenge that confronts you.
Getting started with Image Processing and Analysis in Avizo Fire Edition 261
13.3 Example 2: Measuring a Catalyst
This tutorial illustrates more techniques using Avizo Fire Edition:
To follow this tutorial, you should have read the first tutorial chapter 13.2 - Getting started with Image
Processing and Analysis in Avizo Fire Edition and be familiar with basic manipulation of Avizo.
Display module visibility can be managed in the usual way with Avizo by clicking on the orange
square button in the icon visible in Project View, or beside the module title in the Properties panel. See
chapter 10.1.8 about Main panel and Project Views.
The 3D image used in this example is acquired by microtomography: an almost spherical support
contains catalyst and pores. The catalyst appears with dark levels in the image (low intensity voxels).
The pores and background appear with bright levels (high intensity voxels). Intermediate gray levels
correspond to the support.
The goal of this example is to get a distribution of distances between the catalyst voxels and the back-
ground (exterior). Here, a difficulty is the exterior intensity is close or identical to the intensity within
the pores, which prevents to use simply thresholding to isolate exterior. Moreover, some pores are con-
nected with exterior, which prevent to use ’flood fill’ approaches like magic wand of the Segmentation
Editor, or the Reconstruction From Markers module.
Note: in this tutorial, you will find hints on how to manage an arbitrary region of interest. Another
common example of a similar problem is to isolate the pore space of a rock core sample from core
exterior, in order to compute rock porosity for instance.
The process is split in several steps/sections that describe a step-by-step measurement workflow:
Now, you can start with the first step used in this example for detection of the object: thresholding,
then closing in order to ’fill’ the object and prepare a mask. The next section will give more hints on
possible ways to create masks and arbitrary region of interest for your data.
Thresholding
Applying the Interactive Thresholding module will create a binary image (image label with only inte-
rior and exterior materials) as described below:
• Select the Interactive Thresholding module in the Project view, then change the Threshold values
to the range 0-225 by using the slider handles or the text areas of this port.
• Changes the Preview Slice Number port to 45 by dragging the slider of this port.
• Press the Apply button to start processing.
• You can check 3D in the Preview Type port to get a 3D preview and uncheck 3D to undo this
preview.
• Attach the Ortho Slice currently linked to Catalyst.am to the resulting image, by click on
and dragging the link of Ortho Slice to Catalyst.thresholded; an appropriate colormap
will be selected by default.
• Hide the Interactive Thresholding preview by clicking on the orange square of this module in
the Project view.
The Closing module actually makes a dilation of the binarized regions, followed by an erosion: in-
tuitively, the dilation fills holes and reconnects separated regions, then the erosion restores original
exterior shape.
Loading the project CatalystDistribution-3-Closing.hx will complete this tutorial step (see Figure
13.44).
Note: The artifact you may notice on the right side of image above is due the dilation too close to
image border. To prevent this, the background border around the object should be larger than the size
of closing. That could be easily solved by using the image Crop Editor: in this example, you could
set for instance Adjust to 10, then uncheck Replicate for Add mode and set Pixel value to background
intensity (i.e. 0); then pressing the Enlarge button would add a 10-voxel border. However, you can
ignore this enlargement step in this tutorial.
• Many modules support a Region Of Interest (ROI) input. You can attach a Display/ROI Box
module to your data, then connect the ROI input of the display or compute module to the ROI
Box module.
• The image Crop Editor can cut or extend your data.
• The Extract Subvolume module copies a portion of your data in memory, possibly sub-sampled.
If you need an arbitrary mask or region of interest - for instance a cylindrical ROI, you can use the
following tools:
• A number of modules sorted into Image Processing/Image Morphology from the pop-up menu
of every binary image can be used to create or combine masks like the one shown above. Other
examples include Convex Hull (applies slice by slice), Fill Holes, Reconstruction From Markers.
• The Volume Edit module is used to modify a volume with interactive tools like cylinder. It may
also be used by script.
• The Segmentation Editor has a number of useful tools that can be used to quickly create masks,
like brush, shaped lasso, Selection/Interpolate.
• Attach a new Chamfer Distance Map module (Image Processing/Distance Map folder) to
Catalyst.closing.
• Set the Interpretation to 3D and click on Apply.
• Attach a new Ortho Slice to the result (Catalyst.distmap) to see the object’s distance map.
Loading the project CatalystDistribution-4-DistanceMap.hx will complete this tutorial step (see Figure
13.45).
Masking
• each black voxel of the mask image is set to 0 in the output image,
• each blue voxel of the mask image is set to the initial level from the gray image.
Masking the distance map image by the catalyst image gives a gray image where:
• Apply a Mask module: the first input is Catalyst.distmap (the distance map
image), and the second input is the catalyst binary image obtained previously
Catalyst2.thresholded.
• Attach a new Ortho Slice to the result to see the object’s distance map. To get a better ren-
Loading the project CatalystDistribution-6-Masking.hx will complete this tutorial step (see Figure
13.47).
• Use the Multiply By Value on Catalyst.masked as first input (Input Image 1 port). Set the
Value port to 5 (assuming a voxel size of 5 micrometers).
• Click on Apply to get Catalyst.mult as result.
• Retrieve the maximum value with the Info port displayed in the Properties panel when selecting
the image icon in the Project View.
• Attach an Histogram module on Catalyst.mult to compute and plot for each gray level
i, the number of voxels at intensity i. The number of points per each level will be graphed
as a histogram. Set the Range port to {3,400} and the Max Num Bins port to 80. Uncheck
logarithmic in the Options port and click on Apply to display the histogram window. Using the
File menu, you can take a snapshot of the histogram or save the histogram data to a csv file.
• Applying an Histogram module on the catalyst distance map generates a graph showing the
number of catalyst voxels located at a given distance from the object envelope.
Loading the project CatalystDistribution-7-Histogram.hx will complete this tutorial step (see Figure
13.48).
4. Separation Troubleshooting
5. Filtering Individual Objects
6. Geometry Reconstruction
To follow this tutorial, you should have read the first tutorial chapter 13.2 - Getting started with
Image Processing and Analysis in Avizo Fire Edition and be familiar with basic manipulation of Avizo.
The 3D image used in this example was generated using data from several slices of foam.
The aim of the example is to isolate and quantify these bubbles, in a more detailed way than the Getting
started example, for better controlling on the results. Separation is essential in a number of cases for
compensating too low image resolution, noise, or intensity variations across the image.
1. A label image containing labeled marker regions that are used as seed areas for the flooding.
There will be at the end of the process as many separated object as markers labeled differently.
These are like rivers for which one want to retrieve the catchment area.
2. A gray image playing the role of the landscape height field or altitude map that controls the flood
progression and finally the location of watershed separations. These separations are located on
the crest lines between valleys of our landscape.
Different applications can be achieved by carefully choosing both inputs: markers and priority map.
An example is the Separate Objects module used for separating foam pores in the Getting started
tutorial. It first computes a distance map (see the chapter 13.3 - Measuring a Catalyst tutorial for more
about distance maps). This distance map provides the priority map input for a watershed process.
Maxima regions of the distance maps - the most inner areas of the pores - provide the markers input
used for the watershed. The process is described in details in the next section.
Loading the project WatershedSeparation-1-Thresholding.hx will complete this tutorial step (see Fig-
ure 13.51).
By dragging the cursor of the Slice Number port, you may notice some artifact holes (e.g. in slices 4,
5, 6), mostly related to higher intensity rings crossing the pores that appear on the gray image. Attach
an Ortho Slice to the gray image and set Mapping type to histogram to highlight these. Hide or remove
the previous Ortho Slice.
Rather than doing upstream correction of gray image or even acquisition, it may be more effective in
some case to correct the binary image, for instance filling holes.
Loading the project WatershedSeparation-2-DistanceMap.hx will complete this tutorial step (see Fig-
ure 13.52).
• Attach a H-Maxima module. Leave the Contrast port to default value (4) and click on Apply.
• Attach an Ortho Slice to foam.hMaxima and set the Transparency type to Alpha.
This module creates a binary image containing the regional maxima of the input distance map image,
which are ”merged” within the contrast variation given as parameter. Since distance map is used as
input, the result is the set of most inner regions within objects.
Figure 13.54: Principle of H-Maxima (merged maxima) shown on a image profile sample
The watershed algorithm requires a unique label for each region finally separated. Two regions with
same value in input image would be merged.
Loading the project WatershedSeparation-4-Markers.hx will complete this tutorial step (see Figure
13.55).
The distance map also needs to be inverted, as the watershed algorithm will expand the markers towards
increasing values of the input priority map (i.e. landscape altitude).
Loading the project WatershedSeparation-6-SeparationLines.hx will complete this tutorial step (see
Figure 13.57).
To complete the separation, you can subtract separation lines from the binary image of pores:
Loading the project WatershedSeparation-7-SeparatedPores.hx will complete this tutorial step (see
Figure 13.58).
• If you look to markers image on a particular slice, markers may seem missing in some pores just
because they lay somewhere else in 3D.
• In some case however a marker can be really missing because two objects are considered merged
from the standpoint of distance map regional maxima, then a separation will also be missing.
You can try lowering the contrast factor of H-Maxima (or Separate Objects) to make markers
smaller and more separated.
• The number of objects is not satisfying: in this case, you must work on markers.
• The lines of separation are not satisfying: you must work on the priority map, the ’landscape
height field’.
For markers, the Separate Objects solution is to work on the distance map. In this case, you take into
account the geometry (most inner regions), but markers may be obtained by other ways. Sometimes it
may be interesting to use the grayscale image (intensity) if the centers of grains are darker or lighter.
If the objects are fairly homogeneous, you must stick with geometric information. One may need to
adjust the contrast factor setting of H-Maxima. Basically the H-Maxima parameter corresponds to the
minimum depth of between two maxima. With geographic analogy: the difference in height between
the collar and a summit so that you keep the two distinct peaks.
It can be easier to make trials on a cropped dataset showing object(s) that should not be split and
tune settings in order to make sure that only one marker is inside each object. One possibility for
improvement is to do a H-Maxima and then mask the result with a threshold image of the distance map.
This avoids keeping markers for small connected parts, since you keep only markers corresponding to
a maximum of distance map with a minimal value for distance.
Once satisfied with markers, corresponding to the number of objects, you can also improve the lines of
separation. Once again, the process described above (Separate Objects) relies on the geometry, you can
also use as a function of depth - either directly grayscale intensity or the gradient of intensity. It may be
a little difficult to combine geometrical information and intensity information. In some cases, you can
get by with a combination of the distance function and a function of intensity, for example, with the
Blend With Image, Blend With Value or Arithmetic module, somehow simulating the complex way the
human eye can combine both informations. Note that the watershed seeks for lines peak separations,
therefore local maxima - as for distance map you may need to use the negative of function to bring to
this case.
• isolate the added separations: get the difference between original and separated image using the
AND NOT Image module for instance,
• label these separations with the Labeling module,
• use the Label Analysis module to do some measurement in each separation, for instance, the
maximum of distance map value within a separation region could indicate whether a separation
goes too deep inside an object.
You will find more example applications of watershed in next tutorials, using different methods to
create the markers and the priority map.
Loading the project WatershedSeparation-8-SegmentedPores.hx will complete this tutorial step (see
Figure 13.60).
Secondly, you want to filter unwanted small objects, and finally measure the volumes of individual
In one of the next tutorials (chapter 13.5 - Further Image Analysis), you will find more example appli-
cations of measurement and advanced analysis.
Loading the project WatershedSeparation-9-FilteredPores.hx will complete this tutorial step (see Fig-
ure 13.61).
• Attach a Generate Surface module to the result label image (foam3.labels), uncheck Adjust
Coords in the Border port, and press Apply to generate foam3.surf.
• Display the resulting surface by attaching a Surface View module.
Loading the project WatershedSeparation-10-Reconstruction.hx will complete this tutorial step (see
Figure 13.62).
As the result image already contains integer values for material labels, it can be used directly for
surface reconstruction. Other image types may require conversion to Avizo label data (for instance by
using the Convert Image Type module). Notice that the Generate Surface module can work with more
than 256 labels.
• pore detection,
• pore post-processing,
• custom measure group definition to determine the distribution of pore diameters,
• custom measure definition to compute the sphericity of pore.
The image used in this example is acquired by microtomography. It represents foam that consists of
material and pores. Pores appear with dark levels in the image (low intensity voxels). Material appears
with luminous levels (high intensity voxels).
• Press Apply.
• Hide the Interactive Thresholding module and connect the Ortho Slice to the output
FoamPoro.thresholded.
As shown on Figure 13.64, thresholding the image between 0 and 50 gives a binary image where:
intensity level 1 = porosity, intensity level 0 = support (material).
Applying morphological opening on the previously computed pores binary image gives a filtered image
where noise and artifacts are reduced, as shown on Figure 13.65.
The Separate Objects module detects surfaces that separate agglomerated particles. These surfaces are
subtracted from the initial image, see Figure 13.66.
13.5.3 Third step: custom measure group definition to determine the distribu-
tion of pore diameters
The Avizo Fire EditionLabel Analysis module allows computation of a set of measures for each particle
of a 3D image. Once the individual analysis is performed, a histogram of a given measure may be
In the Measures port of the module, basic is a group of pre-selected native measures. It might
happen that you don’t need all the measures of the basic measure group, or you would like to bundle a
different set of measures in the analysis table. For these cases, you can create your own measure group.
For a given particle, the equivalent diameter measure computes the diameter of the spherical particle
of same volume. So the equivalent diameter is given by the following formula:
r
3 6 × V olume3d
EqDiameter =
π
• Press on the configuration button of the Measures port (the button with 3 dots). A panel opens
for the selection of measure groups (see Figure 13.68).
• Create a new measure group by pressing the dedicated button next to the measure group selector
(1).
• In the pop-up window, name the new group diameter and press OK.
• Select EqDiameter in the native measures list (2) and use the arrow button to add it to the group
The new diameter group, containing only the equivalent diameter measure, is now selected in the
Measures port of the Label Analysis module.
A new label image data object FoamPoro.label is created in the Project View, and the Tables panel
is displayed, showing a spreadsheet-style table of results: the analysis FoamPoro.Label-Analysis, also
created in the Project View (see Figures 13.69 and 13.70).
This can be expressed, with respect to Avizo Fire Edition measures, as:
(pi**(1/3)*(6*Volume3d)**(2/3))/Area3d
• Enter the shericity formula in the dedicated field of the panel (see Figure 13.73).
• Press Close.
• Select Sphericity in the user measures list and use the arrow button to add it to the diameter
group.
• Press OK.
This tutorial shows how to compute the thickness of material in a foam sample.
To follow this tutorial, you should have read the first tutorial chapter 13.2 - Getting started with Image
Processing and Analysis in Avizo Fire Edition and be familiar with basic manipulation of Avizo.
At the end of this tutorial you will find a link to a corresponding demo script.
• Porosity Detection
• Detection of the Separation Surfaces
• Distance Map of the Material
• Calculation of the Material Average Thickness
Apply the Influence Zones module on the binary image of porosity FoamPoro.separate.
Loading the project PorosityThickness-2-InfluenceZones.hx will complete this tutorial step (see Figure
13.76).
The NOT module inverts the levels of a binary image. Applying NOT on an skeleton by influence zone
(SKIZ) gives a binary image where:
• each black voxel of the output image is closer to the object located at the center of the zone in
the input image,
• each blue voxel is equidistant from at least two closer objects.
So the Influence Zones and NOT combination provides a binary image of surfaces that separate pores
through the material.
• each black voxel of the output image represents a background or porosity voxel,
• each blue voxel represents a material voxel.
The Chamfer Distance Map module applied on a binary image gives a gray level image where each
voxel intensity represents the minimal distance in voxels from the object boundary. For a given voxel
intensity:
Apply a Chamfer Distance Map module with 3D Interpretation on the material binary image
FoamPoro2.not.
Loading the project PorosityThickness-4-DistanceMap.hx will complete this tutorial step (see Figure
13.79).
The Mask module:
Apply a Mask module to the distance map image FoamPoro2.distmap and set the Input Binary
Image to the separation surfaces image FoamPoro.not.
Masking the distance map image by the separation surfaces image gives a gray image where:
Loading the project PorosityThickness-5-Mask.hx will complete this tutorial step (see Figure 13.80).
2 × Vsize × Σi
µ(T hk) =
N bV oxSep
where:
The Volume Fraction module with 3D Interpretation gives on the column ”Label Voxel Count” the
number of labeled voxels for each label in a 3D image. A binary image has only one label so ”Label
Voxel Count” returns N bV oxSep.
The Intensity Integral module with 3D Interpretation gives on the column ”Volume” the sum of the
voxels intensities in a 3D image i.e. Σi .
Loading the project PorosityThickness-6-Thickness.hx will complete this tutorial step.
• Correct or unique threshold cannot be easily or accurately determined with edges blurred by
noise and partial volume effect. Partial volume effect is caused by resolution limits in image
acquisition, which blurs the transition between phases and features, i.e. voxels do not map
single homogeneous physical volumes.
• When segmenting more than two phases, a transition between high and low intensity phases
may introduce artifacts with unwanted intermediate ”coating” phase.
• Variations in illumination or intensity across image may lead to different thresholds on different
regions.
The watershed technique provides an effective solution for these issues in many cases. See documen-
tation about watershed principle. In this tutorial you will learn how to used watershed for segmentation
using different Avizo tools:
13.7.1 Segmenting sand pack with watershed tool in the Segmentation Editor
For this tutorial we will use a subset image of a compacted silica sand sample, partially saturated with
water (see Figure 13.81). This sample was acquired by X-ray micro-tomography with a voxel size of
about 11.2 µm (data courtesy Mr. Felix Kim and Dr. Dayakar Penumadu, University of Tennessee,
Knoxville, TN, USA).
Figure 13.81: Compacted silica sand sample, partially saturated with water.
There are actually 3 phases that can be clearly distinguished in this dataset:
• Air
• Water
• Silicate grains, with a few higher density areas in places
For this tutorial we are interested here only in pores space vs. grains.
The threshold may look too low and leave unselected areas, but a higher threshold might capture noise
within the grains, or select voxels across the actual phase boundary. We want here a ”safe” selection,
which will be filled and expanded to the actual phase boundaries later on thanks to the watershed tool
(see Figure 13.82).
• In the Materials list, select ”Pore Space”, then in the Selection group, press the button with a
large ”+” or press key ’A’. The current selection voxels are then labeled as the ”Pore Space”.
• Set bounds of Threshold Tool to 10000-51000. All Slices should still be checked.
• Select ”Grains” in Materials list, use the large ”+” button in the Selection group or press key ’A’
to assign the selection to ”Grains” material (see Figure 13.83).
The labels we have defined will now be used as seed markers for watershed expansion.
A gradient magnitude image is calculate using quick Cany method, that will provide the landscape
image controlling the expansion of markers.
Tip: Depending on your application, you might select instead any image previously loaded or created
in your project, such as a smoother or more accurate gradient image, or a distance map for watershed
separation (see related tutorial in Avizo Fire Edition User’s Guide).
• One can choose the materials used as markers for watershed in the ”Marker” column in the
materials list, which appeared when you invoked the Watershed Tool. You can just leave all
materials checked by default for now.
• Leave the option Output catchment bassins to default value side-by-side in order to get contigu-
ous labels instead of labels separated by exterior voxels.
• Press Apply and create new label (see Figure 13.84).
A new label field is created with markers expanded to the edges of the landscape image (i.e. maxima
of gradient magnitude gradient). This becomes the current label field being edited in the Segmentation
Editor, instead of the original marker labels. The boundaries are fitting the optimal location in the
transition between phase intensities, based on the seed markers and the gradient image.
Tips:
1. When not satisfied by result, you may easily cancel the watershed step by deleting the current
label: this will take you back to the original marker labels, that you could then adjust or complete
before applying again the watershed tool (see Figure 13.85).
2. You may also use the Label field: selector menu to simply go back and forth between markers
and watershed results or different segmentation results.
3. You may also use the Image: selector menu to temporarily change segmented image used as
background, then go back to actual image being segmented. This also allows the user to display
in the background of the labels the landscape image created using Create a new gradient image.
You may need to adjust the data for better visualization.
4. You can notice that grains may not be separated as one could expect: that could happen because
of truly consolidated grains with an intermediate intensity phase in some case, or because of
image resolution and partial volume effects. This could then require improving the seed markers
(see for instance TopHat tool) and/or gradient (see Image Gradient module), or this could be
solved by separating particles using for instance Separate Objects.
5. After using the watershed tool, you may want to polish the segmentation for instance by us-
ing Smooth labels... or Remove islands in Segmentation menu (illustrated in the tutorial about
advanced meshing).
• Open data/tutorials/motor.am.
One could try first segmenting the 3 phases (air, aluminum, steel) using for instance Multi-
Thresholding, or the Segmentation Editor. We will try using Auto Thresholding: this module analyses
the image histogram to guess 1 or 2 threshold(s) separating voxels classes statistically. This module
provides a quick way to segment images automatically.
The ”cup-like” steel insert in dark blue looks fully ”coated” with aluminum (light blue): the aluminum
layer between exterior and steel is actually an artifact due to partial volume effect (see Figure 13.86).
Adjusting the thresholds will not solve that issue.
We will use the Watershed Segmentation wizard module to solve this. This wizard is a script module
that will simply guide you step by step through the following segmentation process:
• Remove Auto Thresholding module and its result data, leaving only motor.am in the Project
View.
• Attach Watershed Segmentation wizard module to motor.am.
The wizard module being selected in the Project View, you can see in the Properties panel the module’s
ports showing the current step with possible options and parameters (see Figure 13.87). You can go
back and correct previous actions at any step.
Tip: The wizard keeps intermediate data for going back in the steps. For large data that might exceed
available memory, you may want to show and remove intermediate when going to next step (use object
menu ”show”). Unrolling the steps will then no longer be possible.
• At any time you can move the slice or change its orientation. The current view is XY slice
number 64.
• At first step, you need to input the number of separate materials or phases to segmented: let the
number of phases to 3 for air (exterior), aluminum and steel.
• Press the Apply button (in the port Action).
The next step is intended to allow attaching optionally a pre-computed gradient image (port Gradient)
(see Figure 13.88).
• Simply press Apply to trigger computation of gradient magnitude for the images.
At the next step ”Threshold Gradient Magnitude”, you can use a slider to adjust a threshold to mark
sharp edges based on gradient obtained at previous step.
• You can set the Gradient Threshold value to 82 for a masking the air-steel transition areas.
• At this point you may verify proper marking by changing the slice number or orientation.
• You may select the module MainOrthoSlice and adjust the colormap range of the edges area or
transparency for better seeing the edge areas (see Figure 13.89).
• Then select again the Watershed Segmentation module (see Figure 13.90).
• Press Apply in Action port of Watershed Segmentation.
The three next steps ”Threshold Phase...” allow you to define marker labels for each material.
First, you need to set a marker range for air (phase 0). We do no attempt fitting accurately to the object
edge at this point, but rather safely avoid areas when the actual material transition might occur.
In the next step, you can set the range for phase 1 (aluminum).
• You can use 130-150 as range here. Again, the goal is to mark inner areas of the given material
(see Figure 13.92).
• Press Apply to complete this step.
Finally, in the next step, you can set the range for phase 2 (steel).
In the next step you can trigger watershed computation and get the final label image result.
You may want to get rid of the air phase that has been segmented as label 1 by the wizard. To do this,
you can simply use the Subtract Value module with value 1, or the more general Arithmetic module
with expression ”A-1” (see Figure 13.95).
1. Distinguish the different types of image fiters available in Avizo, and the main filters typically
used.
2. Use image filters effectively to tune parameters and compare results.
3. Compose application of several image filters.
To follow this tutorial, you should have read the first tutorial chapter 13.2 - Getting started with Image
Processing and Analysis and be familiar with basic manipulation of Avizo. In particular, in the Getting
started tutorial, you can see how to apply an image filter and the complete quantification workflow
afterwards.
13.8.1.1 Smoothing
This is the most important category for preparing data for image segmentation. These filters help
smooth noisy images. Some users call these ”denoising” filters. They can effectively reduce noise, but
may require to be used with care not to alter information contained in image, especially for quantifica-
tion purposes. The most commonly used smoothing filters in Avizo are:
• Median Filter - a basic filter preserving edges. Very effective on salt-and-pepper noise (scatter
dots).
• Bilateral Filter - filter balancing smoothing and edge preserving (in particular sharp angles)
• Non-Local Means (GPU accelerated). This filter is extremely effective on noisy data while pre-
serving edges (best with white noise). It is generally the first choice for noisy images. However
it can be very time consuming. In practice it is used in 2D mode. Reducing the search window
will decrease computation time, but it may also reduce the smoothing efficiency (depending on
the noise distribution). Edge enhancement should preferably not be applied before this filter.
Tip: Make sure that the filter parameters such as contrast thresholds for edge preserving diffusion are
set according to your data range. Default ranges are usually intended for 8-bit data, and need to be
dramatically increased for higher dynamics of 16-bit images.
13.8.1.2 Sharpening
These filters help reinforce the contrast at edges and make details appear sharper. Commonly used
sharperning filters are:
• Unsharp masking
• Delineate - also acts as smoothing filter
These filters highlight boundaries between different materials or phases. They can be used for instance
to extract directly feature contours and edges, or in watershed-based segmentation (see tutorial 13.7.1
- Advanced segmentation). Here are the most commonly used modules in that category:
• Sobel Filter - quick basic edge detection, that can be used as approximation of gradient magni-
tude
• Image Gradient - comprehensive module supporting quick approximation (Cany) or noise re-
ducing gradient (Cany Deriche, Gaussian)
• FFT - Fourier transform, basis module for many image filtering techniques
• Deconvolution - specific module for deconvolution of 3D light microscopy images
Modules in that category are not strictly speaking image filters. Filters mentioned above usually oper-
ate on pixels by examining a neighborhood of intensity values around each pixel. Grayscale transforms
independently act on pixels, i.e. without considering neighboring pixel values. The following modules
can be useful to correct globaly image grayscale or shading:
• Shading Correction, Shading Correction Wizard, Correct Z Drop, Background Detection Cor-
rection - these modules can help to compensate non-uniform background in images
It is always a good practice to adjust first a processing workflow on a limited subset of the data. Image
filters do not make an exception, especially since it is very useful to adjust interactively parameters
with visual feedback. Here are some methods that can help to adjust faster the image filters:
Here is how to use the Filter Sandbox module. The Filter Sandbox can be very helpful to choose a filter
and adjust its parameters. Note however that this convenience script module proposes only a selection
of the most commonly used filters, among the filters available in Avizo Fire Edition.
An Ortho Slice is displayed in the 3D viewer, with an overlaid preview box surrounded by a dragger
with blue tabs.
• In the properties panel, set the Filter port to Median. You can see that the filter is applied in the
preview area.
• You may pick and drag or resize the preview box (first press ESC key to set the 3D viewer in
interaction mode). Keeping a small size at first may save time when trying filters.
• You can change filter parameters such as filter size. Note that when setting interpretation to
3D, the filter is applied to a 3D slab with a depth depending on parameters. 3D filtering can be
significantly slower, even on a limited preview area.
• You can temporarily hide preview (port Show) to see original vs. filtered.
• Still using the port Show, you can display histograms calulated on original and filtered preview
area, in order to see how the filter helps to better separate peaks. You can right-click in the
histogram plot to switch plot scaling between linear and logarithmic. A statisics summary is
displayed in the Properties panel.
• Change Preview type to Interactive Thresholding: you can then adjust a threshold and verify the
impact of the filter on such a threshold segmentation.
• Pressing the Apply button will apply the filter to the whole input image and create or udpate a
result image.
About how to compare results of image filters, see also the tutorial chapter 13.9.2 Data fusion, com-
paring and merging data, in particular the example showing how to synchronize views and display
modules.
Sometimes the best results may be derived by applying two or more filters sequentially. The Slice
module allows the user to optionally apply a sequence of filters (2D) to the displayed slice: this can
The following example illustrates possible techniques for filter combination, however it is not intended
to show the prefered solution in a specific realistic case, nor a general solution. In general, filters such
as Bilateral or Non-Local Means can achieve a good job at smoothing while preserving edges and
should still be tried first.
The process is split in several steps:
Now, you will use an Arithmetic module to basically compose the filtered image using the bilateral-
filtered image (B) for the edge areas and the median-filtered image (C) for the uniform areas. Both
images are blend linearly using the normalized Sobel-filtered image (A) as follows:
B ∗ A + C ∗ (1.0 − A)
• Industrial inspection of products with respect to reference models and nominal/actual analysis
and reverse engineering,
• Multi-modality image acquisitions such as CT/ MRI (Computed Tomography, Magnetic Reso-
nance Imaging),
• FIB-SEM/µ-CT (Focused Ion Beam-Scanning Electron Microscope, micro-tomography),
• Correlative microscopy,
• 3D image reconstruction from 2D cross-sections,
• Imaging of physical experiments or processes - e.g. samples subjected to heat, flooding, com-
pression,
• 3D montage assembly - merging 3D volumes with small overlap.
The following tutorials and examples provide the basics for typical registration tasks.
• Getting started with spatial data registration using the Transform Editor
• Data fusion, comparing and merging data
• Registration with landmarks, warping surfaces and images
• Registration of 3D image data sets
• Registration of 2D image and 3D image data sets
• Alignment of 2D images stacks
• Alignment and pre-processing of FIB/SEM images stacks using the FIB Stack Wizard
• Registration of 3D surfaces
• Registration of 3D image and surface, nominal-actual analysis
To follow these tutorials you should be familiar with the basic concepts of Avizo. In particular you
should be able to load files, to interact with the 3D viewer, and to connect modules to data modules. All
of these topics are discussed in Avizo chapter 3 - Getting started. The tutorial section 13.9.1.1 Using
the Transform Editor is recommended as a starting point in most cases. You can then jump to the topic
for your specific task. In particular the 2D Slice Alignment tutorial may be read independently.
These tutorials cover common use cases. For specific requirements or applications that differ from
these use cases, you may contact FEI Hotline for further discussion.
13.9.1 Getting started with spatial data registration using the Transform Edi-
tor
In this section you will learn how to: change the spatial position of data objects interactively using
various manipulators; how to specify numerically a geometric transformation as a combination of
Spatial data visualized within Avizo are placed in a virtual three-dimensional world. That world has
a unique coordinate system. Every spatial object in Avizo can be arbitrarily translated relative to the
world origin; likewise it can be rotated with respect to the global axes, and it can be independently
scaled (enlarged or shrunk).
You can use menu View > Global Axes to display the global coordinate axes. Global axes are centered
at the origin of the world coordinates. By default, the x-, y-, and z-axes are drawn in red, green, and
blue, respectively. You can also use the viewer’s compass to see 3D space orientation. Use menu Edit
> Preferences > Layout to change Compass settings.
• Start a new Avizo Project (menu File > New Project, or press Ctrl-N).
• With menu File > Open Data, load the motor.simplified surface from the
data/tutorials subdirectory in the Avizo installation directory.
• Attach a Surface View module to motor.simplified data set (i.e., choose Surface View
entry from the popup menu of the data set).
• Duplicate the data object. For this, you can select motor.simplified and press Ctrl-D or
right-click and use data menu Object > Duplicate. The result is motor2.simplified.
• Attach a Surface View module to the copy motor2.simplified. You can still only see one
engine shape in the viewer for now since the two data sets are overlaid.
• Select motor2.simplified in the Project View.
• In the Properties Area, invoke the Transform Editor by clicking on the dragger box button. A
manipulator appears around the engine surface in the viewer window: it allows you to change
the transformation in 3D. The white square on the left of the data object icon in the Project View
is changed to blue, indicating that an editor is active.
• Make sure to switch the viewer to interaction mode: press the arrow button in the upper left
corner of the viewer, or toggle between viewing mode and interaction mode using the ESC key.
• Then click and drag a side face of the manipulator: one of the two surfaces that are currently
displayed is translated along the face plane. The data object label is then displayed in italics to
indicate that the data or its attached information has been modified. A manipulator has several
dragger gadgets for controlling the transformation in various ways. Details of how to interact
with the manipulator draggers can be found at the end of this Transform Editor tutorial.
In the Properties Area, the active Transform Editor adds several button ports to the data object.
• The Manipulator port lets you choose among several interactive manipulators, or select a Dialog
to input numerical values. These are described later in this tutorial.
• The Reset button list lets you restore the independent components of a transformation, e.g.,
• Press the Copy button in the Transform Editor’s Action port of motor2.simplified.
• At this point you can optionally deactivate the Transform Editor by clicking on its dragger
box button.
• Select the first loaded data set, motor.simplified, and activate its Transform Editor.
• Press button Paste in the Action port of motor.simplified: both data sets are again
overlaid in the same location, the latest position of motor2.simplified.
In order to copy transformation from one data set to another, you could alternatively use the module
Copy Transformation from the object menu Geometry Transforms. The Geometry Transform menu
contains most of the tools related to registration, alignment, and transforms.
The Apply Transform button that you may have noticed in the dialog, commits the transformation.
This topic is explained in more detail in next section.
To facilitate visual control during interactive transformations, you may create an additional viewer,
adjust the camera for convenient interaction, and control transformation in the other viewer.
At this point, there is an important concept to know about geometric transformations in Avizo. The
geometric transformation associated with a data object is taken into account by display modules and
some other modules. However it does not modify the original coordinates of data unless explicitly
requested. That is to say, how the object is positioned in the 3D world is updated with transformations,
but the coordinates stored in the data object are not updated. For instance, the bounding box of a
3D volume or the point coordinates of a triangulated surface - sometimes referred to as data ”local
coordinates” - as stored in memory remain unchanged by the geometric transformation. This geometric
transformation simply ”presents”, when needed, the transformed world coordinates to the attached
modules.
It is necessary in some cases to actually apply the transformation in order to change the data’s initial
local coordinates into world coordinates. For instance:
1. Before exporting data to non-Avizo file formats. When saving data to Avizo format and a few
other formats, the geometric transform is stored at the same time in the file and can therefore
be restored when reloading the data. However, be careful when saving or exporting transformed
data sets. Most file formats do not allow to store geometric transformations. In this case you
must apply the current transformation to the data prior to saving it. Nevertheless, when saving a
project, the project file stores transformations for the referred data.
2. When some data processing or manipulation does not support geometry transformation and
requires transformed data coordinates. For instance the lattice of a transformed volume image
Here is a first example showing how to apply a transformation to the surface data that you already used
in previous section:
• If needed, load the supplied motor.simplified surface data file from the
data/tutorials directory; attach a Surface View module to motor.simplified;
and display the global axes with menu View > Global Axes.
• Attach a Local Axes module to the data object (right-click and choose entry from the popup
menu Annotate of the data set).
• Use the Transform Editor to transform the surface motor.simplified with at least some
rotation. For instance, pick and drag one of the green spherical knobs of the transformer manip-
ulator.
• Press the Apply Transform button of the Transform Editor. Note that this operation cannot be
undone. In case of vertex set objects like surfaces, the transformation is applied to all vertices.
Old coordinates are replaced by new ones, and the transformation matrix is reset to identity
afterwards, i.e., there is no longer any transformation set for the modified surface. After a
transformation has been applied to a data set, the transformation can no longer be easily unset.
Let’s now see how to apply a transformation to a volume data. As in the example above, this will
make the volume data appear to stay at the same location, although without any transformation set.
The Transform Editor’s Apply Transform button is not available for images, regular volumes, or scalar
fields. You must instead use the Resample Transformed Image module as in the following example:
The Resample Transformed Image module can be used for sampling a volume data onto a reference
lattice connected as input. Another useful feature of this module is to reorient volume data along a
given plane by sampling the data on a lattice parallel to this plane. The plane can be set using a Slice
or Surface Cross Section module, by arbitrary rotations, by picking three points, or by a point set to be
fitted.
Applying transformations can also be performed by using the Tcl command applyTransform in
the Avizo console or in a script. Tcl commands relating to transformations are introduced in the next
section.
(This section is optional and is not required reading for completing the subsequent registration tutori-
als.)
For inputting a precise spatial transformation, it is often necessary to access the numerical values of
the transformation. The Transform Editor also lets you check or enter transformations numerically.
• The Dialog... button of the Transform Editor pops up the transform dialog.
Advanced users can alternatively retrieve the numerical values of a transformation, by using the Tcl
command getTransform in Avizo console (see spatial data reference for more details on available
commands). The transformation is then printed in the console as the list of matrix values. For instance:
>"motor.simplified" getTransform
1 0 0 0 0 0.866025 0.5 0 0 -0.5 0.866025 0 -0.052375 0.381033 -0.681443 1
This provides another way to copy/paste transformation between objects. It can be done using a single
command as follows:
The components of the transformation can be obtained in human-readable form in the Transform Editor
dialog, or by using the getTransform command with the option -d:
>"motor.simplified" getTransform -d
translation: -0.0503399 -0.200653 0.32586
rotation: 1 0 0 30
scaleFactor: 1 1 1
scaleOrientation: 0 0 1
center: 0.281196 0.399071 0.212251
As explained in the previous section, the transformation is at first set transiently and can be stored by
saving the project, but is not a property of the object. To make the transformation permanent, enter:
<data> applyTransform
and then save the data object. A module is also available for this purpose: Geometry
Transforms>Resample Transformed Image. For instance, type in the Avizo console:
The motor.am data is changed to a resampled volume and the transient transformation is reset to zero.
In order to provide more flexibility on the resolution of the output grid and the type of resampling, use
the module Resample Transformed Image introduced in previous section.
(This section is optional and is not required reading for completing the subsequent registration tutori-
als.)
In the Transform Editor, many manipulators are available. Interaction with the different manipulators
is detailed hereafter.
• The default manipulator is the Transformer. It allows translations, rotations, and scaling. It is
the most general manipulator for doing an approximate registration.
Figure 13.112: Transformer: Click-drag a corner cube to scale (hold Shift key to constrain direction, hold Ctrl key to fix
opposite corner or face). Click-drag any face to translate (hold Shift key to constrain direction, hold Ctrl key for perpendicular
translation). Click-drag a green ball to rotate one way (hold Shift key for free rotation, hold Ctrl key to change center).
• The Jack manipulator is convenient for translations along an axis and uniform scaling.
Figure 13.113: Jack: Click-drag rectangle or cylinder rod to translate. Press Ctrl key to change axis. Click-drag cubes to scale.
Click-drag axial lines to rotate.
• The TransformBox is a simplified version of the Transformer that allows translation, rotation
and uniform scaling.
Figure 13.115: Trackball: Click-drag stripes to rotate. Click-drag anywhere to rotate freely. Hold Ctrl key to scale. Hold Shift
key for user axis and stripe.
Figure 13.116: Centerball: Click-drag circles to rotate. Click-drag anywhere to rotate freely. Click-drag green arrows to
translate rotation center (Hold Shift key to constrain translation axis).
Figure 13.118: TabBox: Click-drag any face to translate. Click-drag green vertex to modify the bounding box.
• Color Wash
• Ortho Views
• Mapping a 3D volume overlaid on a surface
• Side-by-side viewers, synchronized views and objects
• More about Data Fusion
The Color Wash module, attached to an Ortho Slice, helps you to visualize two arbitrary images or
volumes in combination. The representation of one data set is overlaid with another data set, taking
In image fusion it is sometimes necessary to observe all three orthogonal directions simultaneously.
For this we can use the powerful Ortho Views module. See also the related tutorial section 13.1
(Getting started with Avizo Fire Edition and 3D images) for learning more about Ortho Views.
• You can hide the Transform Editor manipulator in some views, while keeping the data visi-
ble: toggle the visibility of the data object off - this will make invisible both the slice and the
manipulator, then toggle the slice visibility on.
The Surface View module, used to display surface data, can also display a surface ’immersed’ in a
volume data set (3D scalar field), mapping the volume values as colors over the surface.
It is often convenient to visualize different data sets side by side in a synchronized way.
• Load the files motor.am from and motor.labels.am from directory data/tutorials.
The data set motor.labels.am contains labeling of different regions, obtained by a segmen-
tation of the grayscale image.
• Attach an Ortho Slice module to motor.am and to motor.labels.am.
For now only one Ortho Slice is visible since the data sets overlap.
• In the viewer toolbar, toggle on the Two-Viewers (vertical) button, and make sure that the viewer
button ”Link Object Visibility” is off.
• Toggle the visibility of Ortho Slices to make motor.am visible, for instance, only in the left
viewer and motor.labels.am visible only in the right viewer.
• Right-click in the left viewer to open its popup menu then select ”Link camera to...”, then click
inside the right viewer to select it.
You can then at any time Unlink the viewers in the viewer’s popup menu (right-click in viewer). You
can also disconnect the ports by right-clicking on the link-chain icon of one of the interconnected ports
and selecting ”disconnect” in the popup menu. This technique can be useful to compare a data set
before and after processing, as shown in the following example:
• Load motor.am, attach to motor.am an image filter module Gaussian Filter. In the Properties
Area, set the Gaussian Filter to 3D interpretation, and Kernel Type to Standard, then press Apply.
• Attach an Ortho Slice to the result data motor.filtered, then proceed as above to set up
linked viewers.
Note: See also modules Image Processing > Filter Sandbox and Slice to display on-the-fly effects of
image filters.
Avizo offers many ways to compare or merge surface or scalar field data. Here are some further hints.
• You can superimpose surfaces using transparency. Here are some useful settings to tradeoff
quality and performance. Best results can be achieved with the default options fancy alpha and
sorting in the Draw Style port of Surface View. You may want however to deactivate one of these
options for better performance. You can also change the transparency mode in the main menu
View > Transparency for different quality/performance tradeoffs. The Sorted Layers options -
supported by modern graphics hardware - may give best results to prevent artifacts with complex
transparent objects. See Surface View and View Menu for more details.
• For comparing surfaces, see also Measure And Analyze > Surface Distance, Measure And
Analyze > Shortest Edge Distance, Compute > Interpolate, Compute > Vertex Difference,
Compute > Arithmetic (for comparing data attached to surface, or mapping distance map image
on surface).
• Landmarks and warping can be used for comparing data. See the related tutorial.
• You can superimpose image data using Color Wash with Ortho Slice, Ortho Views, Height Map
Slice (height field + color field), Volume Rendering, Isosurface, etc.
• For comparing images see also the modules Compare Image, Correlation Histogram, Arithmetic,
Subtract Image, AND NOT Image, Blend With Image.
• Here is an example for computing difference between images using the Arithmetic:
• Connect the Arithmetic module (Compute submenu) to one data set (Input A). Connect
the second data set as Input B.
• Type ”a-b” or ”abs(a-b)” in Expr field. Press Apply. The result as same dimension as
Input A.
• The powerful module Compute > Arithmetic can attach to surface, grid, or image, and can be
used to interpolate and map values from one data set to another or to a regular grid.
• The Merge module is available for blending images that can be arbitrarily overlapping.
• Measure > Correlation Histogram can be used for creating a label field from correlated regions
in two images sets, typically after registration.
• Multi-Channel Field can group multiple grayscale images of same size for convenient display
with Ortho Slice or Volume Rendering. Multi-channel objects are created automatically when
reading some file formats containing multi-channel information. Alternatively, channels can be
manually attached to a multi-channel object created via the Project >Create Object... menu
(category Images And Fields).
To follow this tutorial you should know how to load files, how to interact with the 3D viewer, how to
use the two-viewer layout and the viewer visibility toggles.
Registration with landmarks in this tutorial applies to 3D images and triangulated surfaces. For align-
ing 2D images or slices see tutorial in section 13.9.6 (Alignment of 2D images stacks). See also section
13.9.1.2 (Applying Transforms) on how to align a volume with an arbitrary plane or Slice defined by
picking or point sets.
The data sets we will be working with in this tutorial are the labeled motor surface
(motor.labels.surf) and the simplified labeled motor surface (motor.simplified). All
steps can also be applied on images, using, for instance, Isosurfaces as the display module.
Let’s open and display two surface data sets.
• From the Project >Create Object... menu, select Points And Lines / Landmarks (2 sets).
in order to create an empty landmark object. A new green icon will show up in the Pool. Since we
are going to match two objects by means of corresponding landmarks we had to select the landmark
object containing two sets of landmarks (Landmarks (2 sets)).
• Launch the Landmark Editor by clicking on the Landmark Editor button in the Properties Area.
When the editor is started, a Landmark View module is automatically created and connected to the
Landmarks data object. As indicated on the info line, two empty landmark sets are available now. We
• Right-click on the Landmarks object and add a second Landmark View module to it.
• In the first Landmark View module properties, set ”Point set” port to ”Point Set 1”.
• In the second Landmark View module properties, set ”Point set” port to ”Point Set 2”.
• Set the viewer toggles of the two LandmarkView modules so that the first landmark set will be
displayed in the left viewer, and the second landmark set will be displayed in the right viewer.
• Make sure that the Landmarks object is selected in the project view, and check in the Properties
Area that Edit Mode is set to Add. Note that landmarks can be edited in the viewer windows
only if the Landmarks object is selected.
Note: When editing landmarks, make sure that no transparent object, such as a Transform Editor
manipulator, is intercepting the mouse click instead of the expected visible surface. You may not
immediately notice that the landmark has been added at the wrong location.
Once landmarks have been created, the next step is to transform the two objects into each other. The
Landmarks object can calculate a rigid or linear transformation that best fits one landmark set to an-
other (you will see later below how to retrieve it), or you can attach a compute module that can trans-
form a surface or image data object into a new one according to the landmark sets.
The module Landmark Surface Warp can be used to create a transformed copy of an input object,
either with a rigid transformation or with warping.
Let’s use it for registration of motor.part2.simplified.surf, corresponding to
the 2nd landmark set, with a rigid transformation towards the 1st landmark set and
motor.part2.simplified.surf.
• Attach a Compute > Landmark Surface Warp module to the Landmarks-2-sets object created in
previous steps.
• In its properties area, set the Surface data port to motor.part2.simplified.surf,
choose the Direction 2>1 and Rigid Method with uniform scale.
• Press Apply.
• Attach Surface View 2 to motor.part2.simplified.Warped.
The Landmark Surface Warp module creates a new surface copy from motor.simplified, with
coordinates already transformed. You can verify with the Transform Editor that no geometric trans-
formation is set for motor.part2.simplified. Therefore it cannot be used to retrieve the reg-
istration transform. The method for doing this, without creating a copy of data, is given in a later
section.
In some cases a rigid transformation (translation and rotation) is not enough, for instance if there is a
difference in scale.
• Try setting Transformation type to rigid+scale, or affine (different scale along x, y, z, possibly
with shear). Press the Apply button, or toggle on ”auto-refresh” for automatic apply upon port
change. Depending on the landmarks that were set, you may observe small differences in the
result.
In some cases it is useful to deform an object for the best fit with the landmarks. For instance, you
may want to compare shape variations relative to some fixed anchor points, or warp a 3D image to fit
a predefined shape.
If a deformation is required to obtain a better fit to the landmark sets, we can use another transformation
method of the Landmark Surface Warp module.
• Attach a Landmark Surface Warp module to the Landmarks set (see Registration via Rigid
Transformation section).
• Choose Bookstein method, press Apply, and visualize the result.
Depending on the landmarks you place, the surface may have been slightly deformed to best fit the
transformation from landmark set 2 to landmark set 1. You can try different methods and options.
You can then try warping the image data as described in next section.
You will now transform a volume according to the transformation from landmark set 1 to landmark set
2.
• Remove the Landmark Surface Warp module and the previous result
motor.part2.simplified2.Warped.
• Switch back to single-viewer mode: click on left viewer to select it (a white frame surrounds the
viewer area), then press the ”Single view” toolbar button.
• Load motor.am.
• Attach a Bounding Box module and a Volume Rendering module to motor.am. You can see it
is overlapped by motor.part1.simplified.surf.
You can see that volume has been moved and warped following the transformation from landmarks set
1 to landmarks set 2. However, the result volume looks cropped within the extent of the initial input
volume motor.am. By default the result of Landmark Image Warp is sampled over the same lattice
as input. To overcome this, you could extend the input volume using the Crop Editor. Or you could
attach another image to the Master port of Landmark Image Warp as a reference for bounding box and
resolution, overlapping the expected destination area. An Arithmetic module can be used to prepare
such reference (main window’s menu Project >Create Object..., select Images And Fields / Arithmetic,
then choose regular result type, resolution and volume box location).
• You may then try different methods and options. See Landmark Image Warp reference for more
detail.
It can be useful to set the computed rigid or linear transformation without creating a transformed copy
of a data set.
You can retrieve the transformation by using Tcl commands in the console or in a script. In the Avizo
console, type:
>"Landmarks-2-sets" computeRigidTransform
0.939504 -0.0555508 -0.338004 0 0.0390105 0.997694 -0.0555385 0 0.34031
0.0389928 0.939505 0 -0.0165833 0.212631 0.110712 1
This computes a rigid transformation that moves the points of the first set as close as possible onto the
points of the second set (the sum of the squared distances between corresponding points is minimized).
The result is returned as a 4x4 transformation matrix, which, for example, can be used to transform
some other data object using the setTransform command. For instance, type:
By default computeRigidTransform transforms the 1st landmark set into the 2nd one. You can specify
which sets and order to use in the command. The command computeLinearTransform is available to
compute transformations with scaling. See reference Data Type: Landmarks for more detail.
To follow this tutorial you should know how to load files, interact with the 3D viewer, use modules
and Transform Editor basics.
The Register Images module is mainly used to refine that process. It provides automatic registration via
optimization of a quality function of the matching between a transformed model image and a reference
image.
For success and best efficiency with the automatic registration optimization, the two 3D data volumes
should already be positioned fairly close to their optimized alignment. Otherwise processing could take
too much time because of the larger parameter space to be searched, despite the optimized hierarchical
algorithm used in Register Images. Therefore the method for image registration generally proceeds in
The following example shows step by step how to quickly register two 3D images of the same object.
A later section in this tutorial will show you an even simpler workflow using the convenience script
module Image Registration Wizard.
Let’s now set up some convenient visualization for the data. You could simply attach Ortho Slices and
Bounding Box modules to each data object. You may prefer to observe the data simultaneously in all
three directions as described in the tutorial on section 13.9.2.2 (Data Fusion, Ortho Views).
• Attach an Ortho Views module to motor.am; then attach a Slice module to the Ortho Views
module; then connect Slice’s input port Data to motor.labels.am.
• Set Colormap port of Slice module to labels.am. Choose ”binary” for Transparency port in
order to simply make transparent the ’exterior’ area (labeled with 0).
• Activate the Transform Editor for motor.labels.am and arbitrarily change the position and
orientation for this image as shown in figure below. You can then deactivate the Transform
Editor, and attach a Bounding Box module to motor.labels.am.
• Attach a module Geometry Transform > Register Images to motor.labels.am, which is
therefore considered as the model to be transformed.
• Attach the Reference input port of Register Images to motor.am.
• Make sure that the Register Images module is selected in the Project View in order to display its
control ports in the Properties Area.
You are now ready to experiment with registration following the steps below. The Register Images
ports Metric, Transform, and Extended options basically control the matching quality measure used,
the degrees of freedom for the transform, and other advanced options. They will be detailed later.
Let’s focus for now on the Action port, exposing two pre-alignment methods and the actual optimized
registration.
• Press first the ”Align Centers” button. The centers of gravity of both data sets are computed
considering voxel values as weights. The model’s transform is then changed to a translation
aligning both centers of gravity. The two images then become close, yet you can notice some
remaining shift: this is due to the gravity centers not being located at the same relative position
in both data sets.
• Press then the ”Align principal axes” button. The centers of gravity and moment of inertia of
both data sets are computed, again taking voxel values as mass density. The corresponding
principal axes are used to change the model transform. The best of 24 possible alignments of
the principal axes is determined according to the image-matching quality measure (Metric port).
The two images are then nearly matching again, but there is some orientation drift, in addition to
translation shift: the principal axes of both data sets do not align exactly because of the different
spatial distributions of voxel intensities.
• Last, press the ”Register” button. This starts the actual iterative registration optimization, which
may take a few seconds depending on your hardware. You can then see a best-fit matching of
the label field segmentation to the grayscale image.
Depending on the data sets characteristics and location, orientation, scale, you might be able to perform
a successful refined registration directly by clicking on the button ”Register”, without pre-alignment.
However, the registration may happen to fail to find the optimal position as illustrated below.
• Activate the Transform Editor for motor.labels.am, and then change both its orientation
by 90 degrees and its scaling by a factor of 2 (by Dialog, or by dragging green spherical knobs
and white cubic knobs).
• Then select the Register Images Module. In the Properties Panel, check ”Iso-” in the Transform
port, to enable search of scaling in addition to ”Rigid” transform.
• Press the ”Register” button. The registration clearly fails (with extended parameters left to
default values). The position was not close enough in order to guarantee the expected optimal
solution. The search stopped as it could not find a way to improve further.
• Press the ”Align principal axes” button, then the ”Register” button. The registration succeeds.
Before using the ”Register” button, it is often necessary to first move the data sets closer together by
some other means, pre-aligning, for instance, by using the Transform Editor, by setting an approxi-
mate transform with parameters known in advance, or by using Landmarks as described in a previous
tutorial.
The easiest way for fully automatic registration, applicable in many cases, is simply to pre-align the
data sets using Align Centers and/or Align principal axes before doing ”Register”. This may not always
work, though, depending on the data sets, which can then require special handling.
1. When differences between the model and reference data set are such that the voxels moment of
inertia can’t match enough anymore. E.g., some added components, particles or parts changed
the model’s principal axis significantly.
2. When the model and the reference have some symmetry in voxel intensity distributions that
makes the moment of inertia ambiguous. E.g., a cylindrical core sample without significant
mass asymmetry.
Here are further guidelines for using the Register Images module. More details are given in later
sections of this tutorial.
1. Make sure your data sets have identifiable references for pre-alignment, or keep track of
information about the approximate location of the model relative to the reference. In some
cases, especially if you want fully automated registration, you may need to consider adding
physical markers, radio-opaque paint, or fiduciaries to your samples before acquiring images.
2. Use as few degrees of freedom as possible, if only to shorten computation. That is, prefer to
set the Transform port to Rigid rather than Rigid+Iso, etc. You can also restrict the registration
search to a 2D plane if appropriate (see below extended options). Whenever possible, set the
correct voxel sizes for reference and models (see Crop Editor), then set the Transform port to
”Rigid” instead of searching also for an isotropic scaling.
3. You can select a range of voxel intensities to be considered in registration (see extended options
in later section). Register Images provides robust image matching metrics with respect to
different modalities and voxel intensity ranges. However, it can be very useful to ignore the high
and/or low intensity voxels of data set components that would otherwise affect the registration.
4. You may need to tune metrics and extended parameters, depending, for instance, on the data
set modality, voxel intensity distribution, dimensions, and aspect ratio. More on this in a later
5. Use reduced data when necessary. Register Images uses an efficient hierarchical algorithm.
However, in some cases you can accelerate processing by subsampling the input data without
losing significant precision. Also, you can reserve registration for the most relevant subset or
derivative of your data set, e.g., cropped, resampled, filtered, masked or segmented, instead of
processing the full original data. You can then copy the transformation from such registered
”proxy” model to the original data. As a special example, the next section shows how to register
data sets that are partly overlapping.
13.9.4.3 Using the Image Registration Wizard - example with partially overlapping images
It is sometimes needed to assemble 3D images taken separately. Unless a careful acquisition recorded
the accurate image locations, you may need to take advantage of image overlapping to register pre-
cisely the images. The overlapping regions must still contain enough information for successful reg-
istration. The Register Images module gives most flexibility for addressing this. Here is the method
outlined:
For convenience you can use the Image Registration Wizard that helps to register 3D volumes. It allows
you to select the image subvolumes to be registered and manages for you the registration process.
(Advanced users familiar with scripting may look at the Image Registration Wizard as an example of
a workflow-driven script module.)
• Since you have already set up the data display, you can press the Skip button. Otherwise if you
press Apply, the wizard will set up Ortho Views for you.
In the next two steps, you will specify overlapping subvolumes from the model and the reference vol-
umes, with optional subsampling. The subvolumes should correspond approximately to the common
region between the model and the reference. Subsampling may be useful for large data.
Note that if you leave the default options, the full volumes will be used directly. It is then possible to
use the Image Registration Wizard to register fully overlapping volumes.
You can also register images that are not fully loaded in memory, stored on disk using the LDA file
format. When attached to such an ’out-of-core’ data set, the subsampling rate is set to 4 by default.
To better visualize the subvolume location with axis-aligned display, you may find it convenient to use
the viewer’s orthographic projection mode.
• For instance, in the viewer toolbar click on thePerspective/Orthographic button, then click on the
YZ button (or press X key), then Ctrl-Shift+click on Rotate button for 90 degrees rotation. Click
again the Perspective/Orthographic button when you want to go back to perspective display.
Note: The Ortho Views module is another useful display alternative.
You are now ready to proceed to registration. Some of the Register Images options are exposed (further
explanation of the Register Images options is provided in the next section).
Since the overlapping regions we have selected are suitable for principal axes pre-alignment, you can
simply leave the default options.
• You can go back to previous steps with the wizard to experiment different options.
• Once you obtain a satisfactory result, you can remove the Image Registration Wizard. The
ancillary modules and temporary data objects will be removed at the same time.
As a final additional step, you can now merge the registered volumes into a single data set.
This section gives more details about the key options and advanced parameters that may be useful to
set when using the Register Images module:
1. Degrees of freedom
2. Image comparison metrics
3. Optimization control
Let’s first outline how the iterative optimization of image registration works. The algorithm considers
a model data set to be transformed, and a reference data set to which the model is registered.
1. The first step is to resample internally both data sets, using an adjustable resampling rate.
2. A measure of similarity between images is calculated depending on the selected metric.
3. The model transformation is modified with a variable incremental step, depending on the degrees
of freedom and the optimization strategy trying to maximize similarity.
4. The process is repeated then hierarchically to higher resolutions.
Degrees of freedom
The number of transformation parameters can be selected. Four different transformations are available:
Figure 13.147: Degrees of freedom: rigid (translation+rotation), uniform scaling, anisotropic scaling, shearing
2D constrained registration
In addition, you can restrict the search to transformations within the same plane. For this, check the
Extended options and toggle the Register 2D mode.
Note that if the model or reference input is a 2D image (1 slice only in z direction), the Register port
is automatically set to 2D, which constrains the search space to one plane.
You can work around this by resampling the 2D slice on a slab with at least 2 voxels depth as dimen-
sion, keeping the bounding box size to 1 voxel. Then a 3D degree of rotational freedom can be applied.
This can be done with the Crop Editor, as follows: Note the bounding box extent in z direction, set
Image crop max z index to 1 or more, leaving the Add mode: replicate option enabled. Make sure that
the bounding box extent is set to the same extent as before (i.e., the voxel size in z direction).
Similarity metrics
The Metric port specifies the similarity measure between the two data sets.
• (Normalized) Mutual Information uses model and reference histograms to compute an en-
ergy/entropy. The goal is to minimize the entropy, so as to maximize the mutual information
• Euclidean Distance: computes the distance between the gray values of the two images. It is well
suited for data sets with similar histograms (or similar signal response). For instance, images
acquired using the same modality and intensity calibrations, or overlapping parts of the same
image
• Correlation: computes a correlation value between the model and the reference, suited for data
sets whose histograms (or signal response) are similar via a linear transformation, i.e., images
acquired using the same modality but possibly not the same intensity calibration.
• Label Difference, for labeled images, measures difference between two connected labels.
Optimizer control
You may need to adjust optimization parameters in order to balance improved accuracy, search robust-
ness, and processing time.
• Optimizer Step: set the initial and final value for the step width applied in the optimization. The
greater the initial value, the larger will be the transformation tested. The smaller the final value,
Two different optimization strategies are applied, depending on the resampling level. At the finest
level, the Quasi Newton optimizer is applied. In the other levels, the optimizer can be chosen between:
• The Extensive Direction or Best Neighbor, well suited for coarse resolution levels;
• Quasi Newton or Line Search, suited for finest resolution, or when information overlap is re-
duced due, for instance, to flat aspect ratio;
• Conjugated Gradient.
13.9.5.1 Guidelines
The method for 2D-to-3D image registration proceeds in two stages, as indicated in previous section:
1. Pre-alignment with manual or automatic approximate registration. It is preferable for the ap-
proximate location and orientation of the 2D slice to be known in advance. Landmark-based
registration from some identifiable or automatically segmented markers can also be an option.
Last, a systematic search can be employed as shown in next section, possibly using subsampled
data.
2. Refined registration. The registration settings may need to be adjusted to take into account the
limited information overlap within the 2D slice.
Let’s start with an example of searching for an extracted slice within an image stack. A possible
strategy is to register the 2D slice at different locations within the 3D stack, and use the best similarity
score to retrieve the best slice location. We will now use a script module that manages for us the search
process.
• Open the following files in the in data/core directory: the 3D image file Plug.am, the 2D
image file Plug-slice93.am, and the script file SearchSlice.scro.
• For convenient display, you may split the viewer using the ’Two viewer’ toolbar button. Then
attach a Bounding Box module to the 3D image, and an Ortho Slice module to each image. Set
the visibility of the 3D image to the left viewer, and display the 2D image in the right viewer.
• For quicker trial, you can restrict the slices considered for search to 90-95.
• Press the Apply button at the bottom of the Properties Area.
It may take a few seconds for the script to computes image similarity for best registration at different
z-position in the 3D image and store the results in a Spreadsheet object. For each selected slice position
in z, different initial orientations can be used for registration.
In this example, the script extract all slices between the search window defined at Slices Consid-
ered port. At each extraction step, the extracted slice, named Plug.view, is registered with
Plug-slice93.am using the Register Images module. For each slice, four initial positions are con-
sidered, consisting in 90 degrees rotation about the z-axis. Four values are obtained, which correspond
to the distances between the extracted slice and the reference slice, measured with the transformation
computed at the end of the registration and the metric chosen. The minimal and the maximal distances,
or similarity values, are saved in the Spreadsheet for each extracted slices.
You can check the best score, corresponding to the higher maximal distance value, in the spreadsheet.
It corresponds to the slice with the best similarity value. Note that the slices are numbered starting
from one by this script, unlike the Ortho Slice module slice, which numbers starting from zero.
Advanced users familiar with scripting may extend this script for specific purposes. See chapter 11
(Scripting Guide) for guidance on how to extend scripts.
The approximate registration is done: you know approximately the slice position. Now, an accurate
registration can be computed in order to compute the right transformation in the XY plane, and possibly
adjust for some tilt. The steps for this example are the following:
the Align Slices module for alignment of serial sections. Align Slice can be used, for instance, with
histological slices, or milled or polished material surface layers, images at different focal planes, cap-
tured with cameras, light, confocal or electron microscopes, etc.
Note that we do not address here the specific case of alignment of projection images collected by vari-
able tilt tomography, which is a prerequisite to tomographic reconstruction. While Avizo algorithms
could be used for such alignment to some extent, this is beyond the scope of this tutorial.
Align Slices is used for aligning 2D slices of a 3D image stack. The module Register Images, which
can be also used to register 3D or 2D images, is described in a separate section. Alignment with Align
Slices module can be manual, automatic, or semi-automatic. The following topics will be discussed:
In this tutorial we want to align 10 microscopic cross-sections of a leaf showing a stomatal pore. The
images are located in the data directory in the subdirectory align. Each slice is stored as a separate
JPEG image. The file leaf.info defines a 3D image stack consisting of the 10 individual slices. It
is a simple ASCII file as described in the stacked slices file format section.
Note that this example data set is a stack of color images (RGBA). See also the section ”More about
align slices” at the end of this tutorial for issues to be considered when using grayscale images.
The slice aligner window opens in place of the 3D viewer, allowing you to interactively align the
slices of the 3D image stack. To facilitate this task, usually two consecutive slices are displayed
simultaneously. One of the two slices is editable, i.e., it can be translated and rotated using the mouse.
By default the upper slice is editable. This is indicated in the tool bar of the align window (the ”upper
slice” button is selected).
• If necessary, press the zoom out button to allow the entire slice to be visible in the viewer.
• Translate the upper slice by moving the mouse with the left mouse button pressed down.
• Rotate the upper slice by moving the mouse with the left mouse button and the Ctrl key pressed
down. Alternatively, slices can be rotated using the middle mouse button.
• Make the lower slice editable by selecting the ”lower slice” tool button. Translate and rotate the
lower slice.
• Hold down key number 1. While this key is hold down only the lower slice is displayed.
• Hold down key number 2. While this key is hold down only the upper slice is displayed.
• Pressing key number 1 and 2 also changes the editable slice. Note how the slice tool buttons
change their state.
Other pairs of slices can be selected using the slider in the upper left part of the align window. Note
that the number displayed in the text field at the right side of the slider always refers to the editable
slice. The next or the previous pair of slices can also be selected using the space bar or the backspace
key, respectively. The cursors keys are used to translate the current slice by one pixel in each direction.
• Browse through all slices using the space bar and the backspace key. Translate and rotate some
slices in an arbitrary way.
• Translate all slices at once by moving the mouse with the left mouse button and the Shift key
pressed down.
• Rotate all slices simultaneously by moving the mouse with the left mouse button and the Shift
and Ctrl key pressed down. Moving all slices simultaneously can be useful in order to move the
region of interest into the center of the image.
Besides manual alignment, four automatic alignment options are supported: alignment using a gravity
centers and principal axes transformation, automatic optimization of a quality function, edge detection-
Alignment via landmarks first requires you to interactively define the positions of the landmarks. This
can be done in landmark edit mode.
• Activate landmark edit mode by pressing the landmark alignment mode button.
In landmark edit mode only one slice is displayed instead of two. Two default landmarks are defined
in every slice.
• Once you have activated the landmark edit mode (arrow mouse cursor), click on one of the
default landmarks. The landmark gets selected and is drawn with a red border.
• Click somewhere into the image in order to reposition the selected landmark.
• Click somewhere into the image while no landmark is selected. This causes the next landmark
to be selected automatically.
• Click at the same position again in order to reposition the next landmark.
The double click method makes it very easy to define landmark positions. Of course, additional land-
marks can be defined as well. Landmarks can also be deleted, but the minimum number of landmarks
is two.
Once all landmarks have been set, we can align the slices. It is possible to align only the current pair
of slices, or to align all slices at once. Note that all alignment actions, as well as landmark movements,
can be undone by pressing Ctrl-Z.
• Switch back to transform mode by pressing the manual alignment button. Two slices should be
displayed again.
• Align the current pair of slices by pressing the align current slice pair button.
• Align all slices by pressing the corresponding button.
• Move and rotate the whole object into the center of the image using the mouse with the Shift
key hold down.
In most slices the alignment now should be quite good. However, looking at the pairs 3-4 and 4-5
(displayed in the lower left corner of the align window) you’ll notice that there is something wrong. In
fact, slice number 4 has been accidentally inverted when taking the microscopic images. Fortunately,
• Select slice pair 3-4 and make sure that the upper slice, i.e., slice number 4, is editable.
• Invert the upper slice by pressing the mirror editable slice button.
• Realign the current pair of slices by pressing the corresponding button.
• Select slice pair 4-5 and realign this pair of slices as well.
Figure 13.163: (1) Mirror editable slice button; (2) Align current slice pair
Alternatively, you could have aligned all slices from scratch by pressing the first button from the right.
• Click on the slice in the viewer. The quality of the alignment is displayed in the status bar at the
bottom of the window. Remember the current quality measure.
• Activate the optimization mode by pressing the least-squares alignment mode button. Remem-
ber the current quality measure.
• Align the current pair of slices by pressing the corresponding button. Observe how the quality
is improved.
Figure 13.164: (1) Least-squares alignment button; (2) Align current slice pair
Automatic alignment is an iterative process. It may take quite a long time depending on the resolution
of the images and of the quality of the pre-alignment. You can interrupt automatic alignment at any
• Automatically align all slices by pressing the first button from the right.
If you are satisfied with the alignment you can resample the input data set in order to create a new
aligned 3D image suitable for further visualization or processing. This is done using the Resample
button of the Align Slices module.
• Press the Resample button of the Align Slices module. The images are resampled using an
accurate interpolation method. Note that the Align Slice’s port ’Resample Method’ lets you
alternatively choose a fast preview mode.
• Before visualizing the result, you could open an extra viewer (menu View>Layout>Extra
Viewer). For now simply press the Close button of Align Slice module in the Properties Area
to close the slice aligner window and display again the main viewer window. When closing the
Align Slice edit mode, you can confirm to save the modified transformation information into the
data parameter section of the input object (next section shows how this can be used).
• Attach an OrthoSlice module to the resulting object leaf.align and verify how the slices are
aligned.
By default the dimensions of the resampled image result are the same as the dimensions of the input
image. When Align Slice editor is active, you can choose menu Align > Options and select Output
tab, then you can define a different output size, including automatic fit for all slices. See Align Slice
help for more details.
Completing alignment
Sometimes you may want to improve an alignment later on. In this case it is a bad idea to align
the resampled data set resulting from initial alignment, since this would require a second resampling
operation, cumulating interpolation errors. Instead, you could write the transformation data into the
original image object and store this object in Avizo format. After reloading the Avizo file you can
attach a new Align Slices module and continue with the stored transformations.
• Make sure that the slice aligner window was closed as described in previous steps, so that the
slice transformations are recorded in the data parameters of the input object leaf.info. Note
that you can Choose Save transformation from the Options menu of the slice aligner at any time
while you are modifying slice alignment.
• Delete the Align Slices module.
• Save leaf.info in Avizo format. For this use menu File > Save Data As, then make sure an
Avizo native format is selected.
In the label field the guard cells of the stomatal pore are marked. Segmentation has been performed
before the images were aligned. Now we want to apply the same transformation defined for the image
data to the labels.
• Connect port Reference of Align Slices to leaf.am - this is done by activating the popup
menu over the small rectangular area at the left side of the leaf.am icon. Observe how the
transformations are applied to the label field.
• Export an aligned label field by pressing the Resample button.
Note about color image segmentation: The image volume used in this tutorial is an RGBA color field.
You can use Interactive Thresholding or some Quantification Tools for color image segmentation.
However other tools such as the Segmentation Editor only support grayscale images. Therefore you
must convert the color field into a scalar field using Convert Image Type or into separate channels
using Channel Works before you can invoke such segmentation tools for the resampled labels.
Grayscale images
When attaching Align Slice module to grayscale image, a Data Window port is available to select the
range of intensity used for display and for computing alignment. It is important to make sure that the
selected range contains the intensity values you want to be considered in alignment. By default, the
data window is determined automatically by image histogram (see tutorial section 13.1.3 on Range
Calibration for more information).
Selecting data used for alignment
In some cases, automatic alignment can be distorted by anomalies that cannot be tracked consistently
across all slices, such as bright spots or artifacts appearing on individual slices. Here are some hints to
solve this:
• When using grayscale image input, selecting an appropriate data window is a way to filter out
• If alignment of a full stack fails, you may save time by trying to identify the first slices that fail
and improving alignment for those slices at first.
• In the ”General” tab, uncheck the Allow Rotation checkbox to disable rotation in the alignment.
• In the ”Least Squares” tab, you can increase the Max number of iterations (e.g., to 5000) if the
alignment process stops before correct match.
• In the ”Least Squares” tab, you can reduce the Resample size ’scale factor’ if a slice ’flees’ out
of the canvas. This may happen if there is not enough information or overlapping for meaningful
quality measure at the coarse resolution that is used to speed up the first steps of the process.
• You can fix the reference slice used for alignment across the whole stack with menu Options >
Fix Reference. This could be used in combination with an input Mask image to select a limited
image area as a fixed reference.
slice044 6 4 -16.3025 -1
indicates that slice ] 44 was translated 6 voxels in X, 4 voxels in Y, and rotated -16.3025 degrees about
Z. The -1 means that the slice was not mirrored (If 1, it would mean that the slice has been mirrored).
13.9.7 Alignment and pre-processing of FIB/SEM images stacks using the FIB
Stack Wizard
The capture of image stacks using FIB/SEM devices (Focused Ion Beam / Scanning Electron Micro-
scope) may require alignment and other pre-processing such as foreshortening, shear, and shading
correction. A script module FIB Stack Wizard is available to assist this workflow.
FIB/SEM is a powerful technique for imaging samples in 3D at the nanometer scale, optionally with
compositional information. A FIB/SEM dual beam device combines a Focused Ion Beam for milling
serial cross-sections in the sample, and a Scanning Electron Microscope for imaging the milled 2D
sections. A variety of detectors (SE, low kV BSE, EDX, EBSD, etc.) can be used for analyzing the
sample’s materials and structure.
After such a FIB serial sectioning acquisition, a 3D model can be reconstructed from the 2D images.
Depending on the input data and purpose, some pre-processing including alignment and other steps
may be required, in particular to ensure the accuracy of the 3D model for further quantitative analysis.
The angle between the ion beam and the electron beam is typically 52 degrees. Because of angle be-
tween milled surface and imaging axis is not 90 degrees, the raw captured images shows a geometrical
artifact compared to real sections:
• Apparent vertical shift upward that grows with each image in the stack
• Foreshortening: vertical size (y axis relative to capture) appears compressed.
You may get images already corrected for these effects, but in some cases it may be necessary to
compensate them with downward shift, i.e., stack shearing and stretching.
Another unwanted artifact is lateral drift that may occur, especially during long acquisitions, yet even
shorter ones can show some jittering drift between images, due to environment vibration for instance.
In addition to geometrical artifacts, some further image processing may be needed to correct for noise
or non-uniform illumination (sometimes described as shadowing).
Avizo provides a number of tools for processing and analyzing FIB/SEM image, including a conve-
nience script module that steers you along the most common processing steps: the FIB Stack Wizard.
In this tutorial you will learn in particular how to use the FIB Stack Wizard and other Avizo tools for:
Advanced users familiar with scripting may look at the FIB Stack Wizard as an example of a workflow-
driven script module.
The data set used in this tutorial is derived from images of a sample of molybdenum disilicide (MoSi2),
a material used in furnace heating elements, by courtesy of C. Kong, University of New South Wales,
Australia. The original images (2048x1768 x 300 slices) have been modified for the purposes of this
tutorial.
Figure 13.167: MoSi2 sample - courtesy C. Kong, University of New South Wales
• With menu File > Open Data, load the data file MoSi2-shear-corrected.am located in
subdirectory data/fib in Avizo installation directory. This image stack was saved as a native
Avizo file. About loading stacks of image files, see the tutorial section 4.1 (How to load image
data).
• You can attach one or two Ortho Slice modules to MoSi2-shear-corrected.am to exam-
ine the data, or use the Ortho Views module to set up 4-view display.
The full data set extent is 64 micrometers in width and 36 micrometers in depth, i.e., for the resampled
images about 0.125µm pixel size (X-Y field-of-view) and 0.486µm slice thickness (Z voxel size).
Depending on the input file format, you can specify the pixel size and slice thickness as ’voxel size’
when loading the data if information could not be retrieved from the file. You can always check and
adjust it afterwards by using the Crop Editor.
• Activate the Crop Editor for MoSi2-shear-corrected.am to see the bounding box extent
and corresponding voxel size in the dialog box. You can then deactivate the Crop Editor.
Note: Indicating ”nm” as Display units in the Preferences will output measurements in nm. To learn
about unit management in Avizo, see the chapter 12 (Units in Avizo) in Avizo User’s Guide.
Raw image stack display showing vertical shift of the serial sections. A clipping oblique Slice is used
to highlight the sample slope.
We’ll see later in this tutorial how to address this case using data set MoSi2-sheared.am.
The data set MoSi2-shear-corrected.am was already corrected for electron beam angle as
you can see below. The sample sections are aligned horizontally, while the surrounding trench looks
sheared in turn since it is fixed relative to the microscope raw images.
Drift correction
Cropping
Cropping is necessary to remove unwanted areas in the 3D reconstruction, such as the trench surround-
ing area, or textual information that may be located at the bottom of the images.
The FIB Stack Wizard, accessible from the menu Geometry Transforms >FIB Stack Wizard, can be
used for alignment/shearing correction as well as for shading correction. The wizard module guides
• You can now remove any remaining Ortho Slice or other display modules in the project: the FIB
Stack Wizard automatically sets up an Ortho Slice display.
• Attach the module FIB Stack Wizard to MoSi2-shear-corrected.am.
An Ortho Slice with a tight Color Wash module is attached to the data set, and a Crop Editor dialog is
displayed.
Once the FIB Stack Wizard is selected in the Project View, its control ports are displayed in the Prop-
erties Area.
A Mask input connection port lets you attach a label image serving as a mask during alignment. This
will be detailed later.
• You can use the Slice Number port to change the displayed slice along current axis.
• You can change the Slice Orientation.
The Info port indicates the current processing step. Buttons are available to proceed to next step,
possibly skip it, or go back to previous step.
Step 1: Crop before alignment
This step lets you crop the input data before applying the alignment. For now you will select a region
contained within the serial sections.
• Drag the green corners of the tab box in the viewer, or index values in the Crop Editor dialog.
• You can use the Slice number and orientation ports to control the selected region.
• Be sure to slice all the way from the front of the stack to the back of the stack to verify that you
are not cropping out desired regions. You may also change temporarily the Slice orientation.
• Once set, click on the Apply button in order to go to the next step.
Step 2: Alignment
In this step, the wizard will use automatically the Align Slices module. The wizard exposes the fol-
lowing alignment options:
• For this example our case let’s keep the default values: least squares alignment method without
rotation.
Important note: when processing grayscale images, the visible gray values for display and for align-
ment can be restricted to a ”data window” defined for the data set. Only the values between the two
bounds of the data window are used by the gray value-based alignment algorithm. You can check if an
appropriate data window is defined in the data information displayed in the Properties Area. For editing
the data window, see the Range Calibration Editor and tutorial section 13.1.3 on Range Calibration.
• Press on the Apply button in order to go to the next step. The Align Slice editor window is
displayed showing the alignment progression. You can see how slices are aligned relative to
each other. Depending on the distribution and the orientation of shapes across the slice stack,
some smooth drift may occur.
• Change slice number to browse slices. You can see black uncovered area as slices have been
translated.
• You can select a new crop region to exclude these black areas.
• Once set, click on the Apply button in order to go to the next step.
• For now, alignment has been performed, so click on the Skip button in order to go to the next
step.
• Change the Low mask threshold value. You can see the non-uniform distribution of background
intensity. See the figure 13.177 below to adjust values.
• Change both thresholds to cover as much as possible the area to be approximated for back-
ground, excluding as much as possible the dark or bright features that could alter the background
estimate. See the figure 13.177 below to adjust values.
• The ’shading correction’ parameter is a factor applied to the voxel values normalized according
to the estimated background.
• You can click on the Back button in order to go to previous steps and modify some processing
parameters.
• Remove the FIB Stack Wizard in order to delete intermediate modules and data objects.
With previous steps you could achieve quickly reasonable results, with limited image drift. However
in some cases, you may need to select more precisely the image information to be considered for
alignment.
1. The overall image structure may induce drift, in particular if there are few large or oriented
structures. Subsets of images might better drive the alignment.
2. You may want to take advantage of fixed markers or fiducials. If the volume and resolution you
wish to capture allow for it, you can keep such markers in the field of view for the purpose of
accurate alignment.
3. You may have raw images with uncorrected upward shift. For best results you should normally
apply first a shearing before aligning the sections area so that images are roughly axis aligned.
You can use the AvizoShear module for this. Alternatively, you could instead align images based
on the fixed area surrounding the sections.
• Load MoSi2-sheared.am
We now need to create a mask to be used as input by the FIB Stack Wizard. For this one could use
the Segmentation Editor or any other tools creating a label field. Using the Volume Edit module is
convenient here.
• Attach the result mask MoSi2-sheared.mask as Mask input for the FIB Stack Wizard.
• Press the Apply button to trigger alignment. The Align Slice editor window shows the image
masked by the region you defined.
• Press Apply to keep all volume at Crop step.
More image processing may be required to further improve FIB/SEM images, for compensating for
instance noise or curtaining effects. Filtering can be applied either before or more usually after align-
ment such as processing by FIB Stack Wizard. In particular if you want to apply image filters in 3D
mode, images should be properly aligned.
See section 13.8 for hints about image filtering. In particular the Non-Local Means image filter is
usually effective with FIB/SEM image. See also Filter Sandbox for trying conveniently image filters.
In order to introduce some differences between the surfaces before experimenting with alignment, we
will use the Surface Simplification Editor. This tool reduces the number of triangles by edge collapsing
and vertex shifting to approximate the original surface. This operation can also be very useful to reduce
the computation time for alignment, especially for large surfaces.
• Select motor2.simplified in the Project View. Then in the Properties Area, activate the
Simplification Editor.
• In the port Faces, set the desired number of faces to 10000. You can check ”fast” toggle for
quicker computation.
• Attach the Geometry Transforms > Align Surfaces module to motor2.simplified, i.e.,
the surface to be transformed.
• Then connect the Reference surface port to motor.simplified. Leave the default parame-
ters for now.
Let’s focus for now on the Align port, exposing two pre-alignment methods and the actual optimized
registration.
You can see that the surfaces are now centered. However the model orientation does not match the
The model and reference are now almost aligned. You can still notice some discrepancy.
• Press ”Surfaces” button in the Align port. This starts the iterative alignment optimization.
Note: you could alternatively use an Ortho Views module for display, for instance to overlay cross
sections or cross contours of the surfaces.
The Align Surfaces module based on an Iterative Closest Point algorithm, repeating the following
steps:
Despite optimized search for nearest neighbors, this can be time consuming especially for large sur-
faces. The center of mass and principal axes can be aligned quickly.
Like for image registration, in order to limit computation time and risk for mismatch, it is recom-
mended to perform the surface alignment in two steps.
Pre-alignment could be done using the Transform Editor or Landmarks. For automatic alignment, you
can more simply attempt in order:
1. Centers
2. Principal Axes
3. Surfaces
• Attach an ROI box to surface1.simplified (or surface1). The Region Of Interest must delimit the
common region between the two data sets. It should not be much larger.
• Attach the module Geometry Transforms > Align Surfaces to surface2.simplified. Set the refer-
ence surface to surface1.simplified, and the ROI to the created ROI box. Select rigid + uniform
scale transformation, and set the ”max iter” port to 100.
• Click on the ”Surfaces” button in the Align port. At most 100 iterations will be computed for
the alignment. If the relative RMS is smaller then 0.001, the algorithm will end too. You can
press the Stop button to interrupt the registration. You can repeat this step if the alignment is not
accurate enough: the relative RMS should be reduced.
Once you obtained an optimized registration, you can optionally check the surface distance using a
Surface Distance module.
In the following steps, you will compute and display the map of distance between the two surfaces.
The Measure > Surface Distance module computes several different distance measures between two
triangulated surfaces based on closest points.
The computed distance statistics and distance field may depend on the distribution of vertices over the
two surfaces. You may want to choose the two-sided Direction for a symmetric distance calculation.
You could also remesh the surfaces using the Surface Simplification Editor or the Remesh Surface
module to redistribute vertices uniformly.
A Surface Thickness module and a Shortest Edge Distance module are also available.
Note: For checking surface distance from objects in a 3D volume, one could compute a 3D distance
map from the segmented 3D image (using Image Morphology > Distance Map), then use the result
as a color field with Surface View, as shown in Data fusion tutorial, or use Compute > Surface Scalar
Field to attach the distance measures to the surface.
Figure 13.193: Distance between the surfaces - Surface View and Surface Distance
Note about file formats: Beside the many 2D and 3D images format that are supported by Avizo,
Avizo can also directly import a number of geometric and surface data formats such as STL or Open
Inventor. Additional readers for CAD files formats such as CATIA 5, IGES, and STEP are available in
the Avizo XReader pack. The Avizo Wind edition and bundle provides import capability for surfaces
and meshes in a number of standard or commercial numerical simulation formats.
We will now use a wizard module that manages for you the registration and comparison process.
You then see the NominalActualComparison object icon in the Project View. Its user interface appears
in the Properties Area.
• In the Properties Area press Apply. You are then prompted for loading the reference CAD
geometry file.
• In the Open dialog, choose Pump-bracket-CAD-model.surf (in
data/pump-bracket directory), then press the Open button.
The CAD surface is displayed in green. The next step is to load the model’s CT scan 3D volume.
• Press Apply, then in the Open dialog select Pump-bracket-CT-scan.am, and press the
Open button.
Note: This data set corresponds to the CT scan acquisition of the raw casting prior to machining. This
is used below to better highlight the obvious differences between reference and model. You may try
also the included file Pump-bracket-machined-CT-scan.am, for a more relevant comparison between
the CAD model and the actual machined part.
The 3D CT volume is displayed in addition to the CAD surface at a different location. You can rotate
and move the scene in the 3D viewer window for a closer look.
The 3D volume is displayed using internally an Isosurface module with an automatically calibrated
threshold to show the object boundaries See tutorial section 13.1.3 on Range Calibration for more
details.
In the Properties Area, you could optionally control simplification parameters for faster computation.
Let’s now proceed to the registration of the scanned part with respect to the reference CAD geometry.
A model boundary surface is extracted from the 3D volume using the automatic calibration mentioned
above. Then a few seconds are required to prepare the surfaces, simplifying the surfaces according to
options, and to register the surfaces after automatic principal axis pre-alignment. You can then see the
two surfaces overlaid.
The last step computes and displays a map of nominal-actual distances. You can optionally define a
simplified surface resolution for faster processing.
We outline here two approaches available in the current version of Avizo for aligning a 3D image and a
3D surface. For more details, please refer to sections about Registration of 3D Images and Registration
of 3D Surfaces.
Approach 1: Align a surface generated from the 3D image with the reference surface.
1. Create a surface from the image using Isosurface and Extract Surface, or Generate Surface from
segmented image.
2. Use Align Surfaces module for pre-alignment and refined registration.
This method is the most robust with respect to possible topological inconsistencies in surfaces imported
from the CAD model, i.e., holes. This is the approach used in example above. Advanced users familiar
with scripting may look at the NominalActualComparison wizard as an example of a workflow-driven
script module.
Approach 2: Register the 3D image with another 3D image generated from the reference surface
1. Turn the surface into a 3D image using Convert > Scan Surface To Image. The input triangulated
surface is then required to be watertight (have no holes).
2. Use the Register Images module or the Image Registration Wizard for pre-alignment and refined
registration.
This method can be effective for fast or repeated registration of 3D images with a single reference.
Avizo Fire Edition is used for geometry modeling from 3D images in a wide range of areas: industrial
inspection and reverse engineering, digital rock physics, characterization of materials and design such
as fuel cells, concrete, catalysts, metals, composites, carbon nanotubes, etc.
In this tutorial you will learn how to:
• Extract 3D surfaces and grids with image-driven accuracy and consistency for single or multi-
materials.
• Simplify and refine meshing for manageable mesh size and controlled mesh quality.
You may skip the last two steps if you are only interested in surface extraction and not in grid genera-
tion.
To follow this tutorial you should be familiar with the basic concepts of Avizo. In particular you should
be able to load files, to interact with the 3D viewer, and to connect modules to data modules. All these
issues are discussed in Avizo chapter 3 - Getting started.
To apply this tutorial to your data, the image filtering and segmentation steps may be critical: you
will find important information about this in Avizo Fire Edition tutorials (see their list on Avizo Fire
Edition User’s Guide introduction page).
For the purpose of numerical simulation, Avizo Fire Edition can be complemented with Avizo Wind
Edition in order to export and import data to standard and commercial software file formats such as
Abaqus, ANSYS, CGNS, OpenFOAM, etc. Avizo Wind Edition provides advanced visualization and
post-processing of numerical simulation results. See chapter 14 - Avizo Wind Edition User’s Guide
for more information.
Avizo Fire Edition actually provides support for different numerical simulation approaches (see Fig-
ure 13.204): FEA/CFD solvers as illustrated in this tutorial, but also pre-processing for Pore Network
Modeling (see chapter 18 - Avizo XSkeleton User’s Guide), and direct simulation add-on for Avizo
Fire Edition (see chapter 17 - Avizo XLab Pack User’s Guide). Avizo XLab Pack does not require
geometry pre-processing and provides experiment simulation and effective property tensor calcula-
tion for properties such as absolute permeability, molecular diffusivity, electrical resistivity (formation
factor) and thermal conductivity.
• SandPack128.labels.am is the dataset from which are obtained all the pictures in this
tutorial,
• SandPack50.labels.am is a smaller dataset, extracted from the previous one, that you can
use to complete the tutorial steps in a shorter time.
In order to build a 3D mesh made of 3D elements or cells, you need first to build 3D surfaces repre-
senting the boundaries of the volumes you want to mesh. In order to do this you can use the Generate
Surface module onto the label field. However, you may first want to clean up the label field by remov-
• With Open Data in File menu, load SandPack128.labels.am from the data/sandpack
subdirectory in the Avizo installation directory.
• In the label field property area, invoke the Segmentation Editor in order to access the tools
necessary to clean up the labels (see Figure 13.206).
The Label Filters tools, available in the Segmentation menu of the menu bar, provide means to modify
the current labeling.
There may be small islands in the label field, that are not meaningful for the material visualization or
for the simulation to come.
• In the top-right viewer, use the cursor to move the XY slice to position 107.
Looking at this slice, you can observe a small island that needs to be cleaned in order to generate a
suitable surface. If you move the slider back and forth, you will see that the island is part of a small
bubble and not of a large material. The Segmentation Editor provides a tool to detect and remove
automatically such disconnected regions.
Notice that if you select Current slice or All slices, the size is defined as the area of contour in a 2D slice
and you may remove thin material that may have a large and meaningful volume, possibly connected
in 3D.
In order to correct contour roughness due to voxel aliasing, the Smooth labels tool can be used. This
smoothing process can be iterated until the desired level of smoothness is reached. Smoothing slightly
changes the labeling, but also assigns probability weights to voxels that can be used later on by Gen-
erate Surface for generating smoother surfaces.
Note: Smoothing can alternatively be performed during the surface generation in the Generate Surface
module as discussed in the next section.
Tip: The smoothing and islands removing tools will work along one direction unless ”3D volume”
option is selected in the tool’s dialog box. The direction will then be the one corresponding to the
currently selected view in the 3 orthogonal views of the Segmentation Editor. In some case you may
want to repeat the smoothing or removing islands process in all of the 3 directions, instead of applying
the tools to ”3D volume” at once.
Tip: The Segmentation Editor is especially appropriate for fine control of the segmentation with visual
feedback. For some workflows you can also consider filtering the label image by using modules such
Label Analysis and Analysis Filter, Filter By Measure, or Axis Connectivity (binary label image).
• Connect a Generate Surface module to the label field (see Figure 13.211).
• Check that the Smoothing Type is set to Existing Weights. This option is only available if the label
field contains probability weights information, which was created when applying smoothing in
the Segmentation Editor in the previous steps.
• In the Border port, check the Fit To Edges option. This will cause the resulting surface to sharply
fit to the edges of its bounding box.
• Press Apply.
• Attach a Surface View display module to the resulting surface (see Figure 13.212).
You have now a 3D surface object that consists of three patches corresponding to the number of ma-
terials identified in the label field (including the Exterior). The number of triangles resulting from the
Generate Surface module may be very large and not suitable for visualization or simulation. The trian-
gles generated through this first step may also not be suitable for simulation, considering the triangles
aspect ratio for instance.
For the purpose of meshing the 3D volume from the generated surface, some quality checks for the
surface are available with the Generate Tetra Grid module. This is useful to see if some improvements
are required to perform the grid generation instead of directly running a grid generation that would fail
or result in a bad quality grid.
• Connect a Generate Tetra Grid module to the surface (see Figure 13.213).
• Press on the Check button in port Action.
A report opens in the Tables panel, containing quality information about the two materials patches.
You can observe that the largest triangle aspect ratio is highly critical, i.e. superior to 30.
You can correct this by remeshing the surface so you have simulation quality triangles. First you will
simplify the number of triangles through a decimation or surface simplification process.
Note: The Simplification Editor will do in-place simplification, so the exact initial surface will be lost.
As a consequence it is recommanded to duplicate the surface prior to simplification. A shortcut for
Look at the Simplification Editor documentation for a full description of all parameters. Default pa-
rameters will simplify the surface and generate large triangles in flat areas while generating smaller
ones in areas of high curvature, so details are preserved. This is suitable to speed up visualization of a
large surface, or to export a lightweight triangular surface file (see Figure 13.215).
Figure 13.215: Rough simplification of the surface, displayed using Surface View’s ”outlined” draw style.
For simulation purpose, most of the time, one wants balanced triangles, so instead of using the default
option of decimating to a given number of faces, you can use the max dist field in the Simplify port to
tell the editor what edge maximum length you are trying to achieve.
Tip: A good estimate of max dist can be to initialize this port to roughly 1% of the minimum dimension
of the volume. You can use Local Axes to display the actual dimension of your volume.
Note: The resulting number of triangles should be targeted to be around twice the number of triangles
targeted for simulation because in a next step (the remeshing step), this number will be reduced by
half. So if a suitable surface for simulation is containing around 100.000 triangles, you need after this
simplification step to have a surface twice as complex so around 200.000 triangles.
Notice that a too aggressive simplification can result in intersecting triangles.
At this point you can perform quality checks again thanks to the Generate Tetra Grid module.
Now you have a simplified surface and you can use the Surface Editor to check for possible surface
anomalies (such as intersections or bad aspect ratio) and to enhance triangle meshing.
When the Surface Editor is activated, a tool bar and a new menu Surface are available (see Figure
13.218).
• Open the Surface menu and in the Tests submenu, select Intersection test. You can alternatively
pick the Intersection test in Selector tool of the tool bar (see Figure 13.219).
On top of the 3D viewer, the result of the test is displayed. In the current case, there is no intersection,
so you can skip to next test. However, be aware that intersections can be fixed automatically using
the Fix intersections... tool in the Edit submenu (see Figure 13.220) or manually by using the Surface
Editor tools in tool bar.
The triangle with the highest aspect ratio is displayed in the 3D viewer and the value of the aspect ratio
is given in the top left corner (see Figure 13.221). It is possible to observe the next highest aspect ratio
triangle by pressing on the right-pointing arrow in the Surface editor tool bar.
Figure 13.221: Testing the aspect ratio of triangles. A triangle with bad aspect ratio is highlighted.
Prepare Generate Tetra Grid combines the Flip edges..., Fix small dihedral angles..., and Fix tetra
quality... tools.
Figure 13.223: Editing a triangle with the Translate Vertex tool to improve its quality.
Another way to improve the quality of triangles is to collapse one edge of the triangle using the Con-
tract Edges tool:
• Run the Aspect ratio test to get the next bad triangle.
• Switch to interaction mode (press [Esc]).
• Select the Contract Edges button in the Surface Editor toolbar (or press shortcut O key) (see
Figure 13.224).
Figure 13.225: Editing a triangle with the Contract Edges tool to improve its quality.
At this step you may want to re-run the Prepare Generate Tetra Grid tool.
You can ask now Avizo to remesh the surface using Remesh Surface module.
In the Desired size port of the module, it is possible to set the targeted number of triangles as a per-
centage of the original surface number of triangles.
• Keep the percentage value of 50% in the Desired size port (see Figure 13.226).
If the surface is quite simple, the rest of the default parameters can be used but if the surface is not so
simple, for example if it includes multiple patches, tuning the parameters in advanced mode will be
useful.
An important parameter in the advanced options is the smoothness one. This parameter allows for
controlling how sharp you want to keep angles between triangles. This is important if you want to
keep sharp edges for instance in your surface (see Figure 13.227).
Figure 13.227: Surface remeshed with two different values for smoothness parameter: 0 (left) and 0.6 (right).
As the current surface includes multiple patches with a lot of common interfaces, in order to mini-
mize intersections near contours, between the generated triangles, the process should be split in two
remeshing steps.
• Toggle on the fix contours toggle in the Remesh Options (1) port.
• Press Apply to run the remesher a first time.
At this step, there are no intersections, but the contours have shorter edge lengths than the rest of the
mesh. This might be undesired. The next step will adjust the edge length of the contours.
Figure 13.228: From left to right: initial surface, fix contours remeshing, remeshing around contours only.
The triangle based surface can then be exported to various formats including STL, using Save Data
As... in File menu.
At this point, you may want to go through the Surface Editor process again to finalize cleaning of the
surface, check for intersections and check for aspect ratio.
The module is generating a report showing some information about the quality of the mesh (see Figure
13.229). The generated tetrahedral grid can be visualized with a Tetra Grid View display module.
If you look at the Meshsize parameters for the two phases (pore space and grains), the value is set to
the default value 0, which will trigger automatic sizing of tetrahedra according to triangles size (see
Figure 13.230). You can change this mesh size parameter per material, so the grid generator will try
to generate tetrahedra with this edge size while going away from the surface interface (see Figure
13.231). The edge size on the surface interface will always be the size of the edges of the shared
triangles.
Figure 13.231: Left: Mesh size set to default (0), right: mesh size set to 2 for pore space and 6 for grains.
Note: If you want to change the size of the tetrahedra on the surface, you can use the Surface Editor
before the grid generation in order to refine or simplify a particular surface patch. You can for
instance select a material in the Surface Editor (that will be highlighted in red) and then refine this
patch using the Refine faces command in the Edit submenu of the Surface Editor menu (see Figure
13.232).
• Select the remeshed surface you used to generate the tetrahedral grid.
• Open the Surface Editor.
• Switch to interaction mode (press [Esc]).
• Press on the Magic Wand tool.
The Magic Wand tool can be used in order to select a patch of coplanar triangles. You have to define
the crease angle, which is the criteria used to define coplanarity of triangles and will be used by the
Magic Wand to select neighboring triangles.
• Set the Degrees parameter to a value small enough, such as 10 (see Figure 13.233).
• Select a patch by picking any triangle from this particular patch.
• Open the Surface menu, select the Set boundary ids... in the Edit submenu.
• In the right column, select the type of boundary condition you want to assign to the patch and
then press on Set.
• Repeat the operation as many times as needed to have no face left undefined (see Figure 13.234).
Using the Selector tool from the Surface Editor, you can also select different patches on the whole
surface and assign for instance a Wall boundary condition to all of the grain walls.
The Surface View module can be customized to display the surface colored by material but also by
type of boundary conditions.
Once boundary conditions have been assigned to the surface, you can re-assign them to the 3D grid that
was generated previously, so that if saved, these boundary conditions will be exported to the simulation
solver.
• Connect an Assign Boundary Conditions module to the grid (see Figure 13.236).
• In the Surface port, select the remeshed surface on which you just assigned boundary ids.
• Press Apply.
A new grid is created, with boundary conditions assigned. It is suitable for simulation and can be
exported to FEA/CFD software using the File / Save Data As... menu (see Figure 13.237). FEA/CFD
software format export is available with Avizo Wind Edition.
You can then use Avizo Wind Edition to post-process results of simulation back from the solver (see
chapter 14 - Avizo Wind Edition User’s Guide).
Note: For fluid dynamics in porous media, you can use Avizo XLab Hydro Pack modules to assess
the absolute permeability of your sample. Avizo XLab Hydro Pack directly relies on mask identifying
porous phase and solid phase and does not require surface or 3D Mesh generation.
The default groups basic and basic2D are not editable (Yet you can copy it with a new name and edit
it).
• basic group, used for 3D images, contains the measures Volume3d, Area3d, BaryCenterX/Y/Z
and Mean.
• basic2D group, used for 2D images, contains the measures Area, BaryCenterX/Y and Mean.
Selecting measures
Left panels list user and native measures. The right panel lists the measures selected in the current
group. To add a measure to the selection group or remove it, just double-click on it in the list panels.
To add or remove several measures at once, select them and use the central buttons [¿] and [¡]. The em
Suppr key shortcut is also available to remove the selected measures.
• Feret angles for Feret 2D measures which perform measurements on XY plane along a given
numbers of diameters of each cell. Angles are uniformly sampled on the range [0,180[. By
where I(x,y) is the image greylevel at coordinates (x,y). This formulation means that for a given
cupple (i,j), M(i,j) contains the number of pixels verifying I(x,y) = i and I(x+dx,y+dy) = j. This
matrix is made symmetric and normalized such as :
N
X
∀(i, j), M (i, j) = M (j, i) and M (i, j) = 1 with N the number of grey levels of the image
i,j=1
These operations allow to be independent to the image size and to hold properties on a direction
and its symmetry.
• Histogram parameters for measures based on the computation of the grey level histogram of
each labels. Configurable attributes are the range of grey values to consider and the size of the
bins to generate. By default, those settings are computed automatically.
• Quantile values for configurable HistoQuantile measures.
• Breadth 3D sampling for Breadth 3D measure which search for the biggest orthogonal Feret to
the major axis found with Feret 3D. The Breadth 3D value defines the sampling which will be
used on each orthogonal plan after Feret 3D has been used. The sampling of Feret 3D should be
set to the desired value before using this measure.
IMPORTANT: Attributes values are common between measures. This means that when you edit the
number of Feret angles for the measure FeretShape for example, all other measures based on the Feret
angles will use this new value.
Note that only the attributes supported by the edited measure are enabled in the dialog.
This is fine in console since user can control output in console, but this may cause hidden dependencies
issues when used in scripts if a measure named ”mymeasure” already exists for instance. In scripts,
prefer:
Avizo Wind Edition is the software suite including Avizo Standard Edition feature-set and all its exten-
sions for analyzing, visualizing and presenting numerical solutions from CAE and CFD simulations.
Avizo Wind Edition provides advanced support for:
A model contains:
• the mesh of the domain under study, with 2D or 3D cells depending on the dimension of the
model,
• the different regions the domain might be composed of (e.g. the rotor and the stator of a pump),
• the boundaries which are the physical limits of the domain,
• the material the domain is made of.
A dataset attached to a model contains one or more scalar, vector or tensor fields defined on the mesh
and/or the boundaries of the model. These are the physical quantities that have been computed during
the simulation and need to be visualized and analyzed.
Display modules will be listed in the Display folder and compute modules in the Compute folder.
Shortcuts to the input and output data of a module appear below the module, with green and red
arrows indicating inputs and outputs respectively.
In the Colormaps folder you will find the default colormaps and also any colormaps you have loaded.
You can alternatively use the Avizo Standard Edition version of the Project Tree View (in the main
• Abaqus
• ANSYS
• CGNS
• Ensight
• Fluent/UNS
• NASA/Plot3D
• Nastran Bulk Data
• Nastran Output2
• SDRC/IDEAS Universal
• STAR-CCM
• Tecplot
Please refer to the file formats index of the User’s Guide for details.
We will start this tutorial by loading a Fluent data set.
The Datasets selector pops up. Many scalar and vector fields can be attached to a given model and it
might be very memory-consuming to load them all. It can also be space-consuming in the tree view
and make it difficult to read. The Datasets selector allows you to load only a part of the solution and,
if necessary, to unload some data and load additional data later.
Select Pressure in the data column and click Add-> then OK. The Pressure now appears in the
Project Tree View under the model it is attached to and its colormap is displayed.
In the 3D viewer you can see the Bounding Box of the model. This display module is connected by
default to the model when you load it.
• Remove the bounding box by right-clicking on the module in the Project Tree View and selecting
Object / Remove Object (or press on [Del]).
We do this because the bounding box encloses the entire data set and we will initially focus on a specific
region of the model. Removing (or simply hidding) the bounding box makes it more convenient to
”zoom in” on this smaller region.
If you want to load other data from the same model, you can access the Datasets selector at any time
by clicking on its button in the Properties area of the model (aircraft mach.cas).
The Boundary View module now appears in the Display folder of the Project Tree View and the green
arrow shows its input is the aircraft model. Its properties are displayed in the Properties area. You
now see the boundaries of the model in the 3D viewer. Remember that boundaries are the limits of the
domain under study, here they delimit the air flow. In Avizo Wind Edition, boundaries are classified
according to their type, which is the physical condition imposed on a boundary for the simulation
(boundary condition).
The types of boundaries are listed in the Properties area of the module in the multi-selection port
Boundary types.
Only the boundaries of type Wall remain and they delimit half of a YF-17 Cobra aircraft.
• Click in the 3D viewer window and press the [SPACE] key to enlarge the aircraft view (this
does a View All operation).
You can also zoom in and out more accurately by using your mouse wheel, moving your mouse
while simultaneously pressing the left and middle buttons, or by clicking the zoom mode button
and moving your mouse up and down. If necessary, go back to viewing mode by clicking
on the trackball button .
• Rotate the aircraft to see it the right way up.
To do this, press the left mouse button in the 3D viewer and move the mouse until you reach the
desired orientation.
• Select Pressure in the Colorfield port of Boundary View.
• Select Data Mapping in the Coloring section of the Rendering port.
• Select node values in the Options port.
You can make a snapshot by selecting the camera in the toolbar of the 3D viewer. Please refer to
Snapshot Dialog description for more details.
Figure 14.5: Pressure field on the boundaries of a YF-17 Cobra plane, with legend.
The legend is displayed in the 3D viewer and a Data Legend module is created in the Display folder
in the Project Tree View. Use the Properties area of the module to set the legend properties (position,
size...) as desired.
In case of any problems or uncertainties you can find the same project predefined in your tutorial folder
under the file name data/tutorials/windedition/wind firstvisu.hx.
In case of any problems or uncertainties you can find the same template project predefined in your
tutorial folder under the file name data/tutorials/windedition/wind templatenetwork.hxtemplate (load
it by selecting Open Data... in the Project Tree View).
Now that the template is saved, you can easily make the same kind of visualization on any Fluent
model connected to a scalar field.
• Select the new model aircraft mach2.cas and the scalar field Pressure2.
• Click OK.
The Boundary View visualization of the second model has now appeared in the 3D viewer and should
be perfectly identical to the previous one (see Figure 14.5, appart from the zooming and rotation).
This project was rather simple and was reloaded on the same model, to keep the example simple, but
keep in mind that template projects become very useful and will save you time if you have several
modules to connect in the same way to different models and data sets.
In the Compute directory of the Project Tree View, a time Sequence Controller module has appeared.
• Create a Boundary View module as before (right-click on the model in the Project Tree View).
• In the Boundaries port, click on the Deselect all button and then select only wall-7.
• Set the Colorfield port to Pressure.
• In the Rendering port, choose Data Mapping.
• Select node values in the Options port.
• Rotate the display.
In case of any problems or uncertainties you can find the same project predefined in your tutorial fan
folder under the file name data/tutorials/windedition/fan/wind timeseries.hx.
Use the time sequence controller module to animate the display of pressure over time. Select the
controller in the Project Tree View.
• Keep the Time mode port on time step. The physical time stands for the physical time associated
to each time step.
• Move the slider in the Time step port rightwards. With the step button next to the time slider
You might have noticed that the range of the Colormap port of the Pressure dataset does not change
with each time step. This is because the colormap range is set by default to the global range of the first
time step dataset. You can change it by setting the minimum and maximum to the values you want and
the colormap range will remain set to this range during the animation.
• Select the model in the Project Tree View. Details about it appear in the Properties area.
In the Properties area of the model you can find the grid type (volume or surface), the number of nodes
of the mesh, the number of cells and their type.
The Parameter Dialog window pops up. In this window you will find additional information about
the model, including the boundary and region names, id numbers and types, physical details about the
material(s) under study and solver information about the model. Close this dialog.
Data field
• Now select the Pressure scalar field in the Project Tree View. Details about it appear in the
Properties area.
14.2.2 Colormaps
In the Properties area of the Pressure field, you can see that a colormap is connected. For conve-
nience a default colormap is defined for each type of data field. The colormap connected to the data
field will (initially) be used by all the display modules connected to the field. And therefore modifying
the data field colormap affects all the connected display modules. It is also possible to use a different
We will now see in detail what you can do with the options of the Edit menu of the Colormap port.
In case the range has been changed and you want to adjust it back to the data field range:
• Select Adjust range to in the Edit menu of the Colormap port and select the data.
Tip: The range of the colormap is set to Local and adjusted to the field global range (except for the
time series data, as seen in the Time Animation section of the Getting Started chapter). You can switch
between the global and local range modes by selecting and deselecting Options->Local range. In the
global range mode, the coordinates used to map data values to colors are taken from the colormap
itself. If the same colormap is used by two different fields and if the range is modified, both fields
colormap ranges are updated. In contrast, in the local range mode the coordinates are defined by the
port itself. Thus, although the same colormap is used by two different fields, the ranges can still be
different. As many fields may share the same colormap in the Avizo Wind Edition, we advise you to
be very careful when using the global range mode.
Two new ports appear that allow you to select and deselect regions and/or materials. In the present case
there is only one of each so this option is not useful but keep in mind that it exists for more complex
geometries (e.g. a pump with a rotor and a stator).
In this view you can observe the mesh on the boundaries of the model.
Model color editor
In the Rendering port, the Coloring option is set to Per Region. This means that each region of the
model (here there is only one) is rendered using the color associated with it in the Model Colors Editor.
We will now change this color.
• Select the model and open the Model Colors Editor (click on the button ).
• Click on the color of the gridelements part.
• The Color Dialog window pops up. Define a new color and press OK.
• Back in the Model Colors Editor, click Apply. The color is updated in the 3D viewer. Now click
Close.
In case there are several regions in the model and you want them all to have the same color, you can
choose a uniform coloring.
Select the Grid View module then:
• Select Uniform in the Coloring section of the Rendering port. A Uniform color port appears.
• Click on the color sample. The Color Dialog window pops up.
• Define a new color and click OK. The color is updated.
Cell information
• Click in the 3D viewer window (to change focus) and press the [ESC] key to switch the viewer
Information about the cell will appear in the upper left corner of the 3D viewer and a spreadsheet
window will appear (also a Spreadsheet In Viewer module appears in the Project Tree View). The
behavior is controlled by the On left mouse click port of the Grid View module. This way you can
retrieve, for the selected cell:
The pressure contour is now displayed on the boundaries of the model. The colormap that is used is
the Pressure field’s colormap. If you want to modify the colormap or its range, do that in the data
Properties area of the Pressure field.
Tip1: If the Boundary View is currently selected, you can quickly select the Pressure field by
clicking the right-arrow button in the Colorfield port.
Tip2: For convenience you can keep the Pressure field’s Colormap port visible in the Properties
area even when the Boundary View (or other display module) is selected. Select the Pressure field,
then click on the pin to the left of the Colormap port. Select the Boundary View again.
In case of any problems or uncertainties you can find the same project predefined in your tutorial folder
under the file name data/tutorials/windedition/wind boundariesview01.hx.
Boundaries filtering
The previous view is not very interesting. We would rather see the pressure on the aircraft boundaries
than far from it.
The boundaries of the aircraft are of type Wall. The rest of the boundaries of the model are of type
Symmetry or Pressure Far Field. Select the Boundary View.
• In the Boundary types port, deselect Symmetry and Pressure Far Field types.
• Enlarge the view and rotate it in order to get a better image of the aircraft.
You can see that in the Boundaries port, the boundaries that are of type Symmetry and Pressure
Far Field are now deselected. So you could have achieved the same effect by deselecting non-wall
boundaries one by one in this port.
In case of any problems or uncertainties you can find the same project predefined in your tutorial folder
under the file name data/tutorials/windedition/wind boundariesview02.hx.
• Click the create button in the Create surface port of the Boundary View.
In the Properties area of the module you can see some ports that we have studied in Chapter 14.2.
• Options port: The cell filtering option allows restricting the Cross Section to selected regions of
the model.
The node values and cell values options specify if a value of the field under consideration will
be affected to each node of the mesh and interpolated along the cells or if a constant value will
be associated to each cell.
Select node values in the Options port.
• On left mouse click port: Display cell info allows you to left click on cells and get cell infor-
mation.
• Rendering port: Draw Style allows you to set different draw styles. Solid Outline and Wireframe
display the intersection of the mesh with the section plane. Keep (or come back to) the Solid
setting.
Several coloring modes are available in the Rendering port. The default setting is Data Mapping
which means the representation of the scalar field using its colormap with local range. You have
already seen the Uniform mode and the Per Region mode that colors the parts of the cross section
according to the region of the model they belong to.
• Now select the Iso Contouring mode in the Coloring section of the Rendering port.
• The Uniform distribution port has appeared. Set the count value to 30.
This option virtually transforms the colormap into a colormap with 30 steps (the actual attached col-
ormap is not modified).
In case of any problems or uncertainties you can find the same project predefined in your tutorial folder
under the file name data/tutorials/windedition/wind crosssection01.hx.
In case of any problems or uncertainties you can find the same project predefined in your tutorial folder
under the file name data/tutorials/windedition/wind crosssection02.hx.
Two coupled objects were added to the Project Tree View: a Clipping Plane that defines the plane in
which the isolines are plotted, and the Isocontour Slice module itself. We want the Clipping Plane to
coincide with our existing Cross Section plane.
In the Clipping Plane module:
• Select xz as Orientation.
• Set the slider in the Translate port to 0.
In case of any problems or uncertainties you can find the same project predefined in your tutorial folder
under the file name data/tutorials/windedition/wind isolines01.hx.
The colormap, the range, the data name and the data unit are now displayed in the 3D viewer. You can
set the size, position... of the legend in the Properties area of the module.
Caption
We will now give a title to our display.
In case of any problems or uncertainties you can find the same project predefined in your tutorial folder
under the file name data/tutorials/windedition/wind isolines02.hx.
(To hide the Isocontour Slice you must actually hide the Clipping Plane.)
• Right-click on the Pressure scalar field.
• Select Isosurface in the Display menu.
• Set the Isovalue port to 1000.
• Select Data Mapping as coloring mode.
• Choose the Pressure as Colorfield.
• Change the title to ”Pressure isosurfaces: P = 1000 Pa” in the Text port of the Caption.
We would like to see the Mach cones from different points of view. In order to see the aircraft too, we
will use the opacity factor of the Isosurface.
In case of any problems or uncertainties you can find the same project predefined in your tutorial folder
under the file name data/tutorials/windedition/wind isosurfaces.hx.
You can see a wing in the 3D viewer. We will study the air flow around this wing.
Remember that you must be in interaction mode, indicated by the arrow cursor, to affect the ROI.
Switch modes by pressing the [ESC] key or clicking the buttons in the viewer menu bar.
Tip: You often need to switch between interaction mode and trackball mode multiple times while
performing tasks like resizing and positioning an ROI box. While in interaction mode, you can tem-
porarily switch to trackball mode by holding down the [ALT] key. When the key is released, the
viewer returns to interaction mode.
Animated Particles
What we can learn by observing the Properties area of the Animated Particles module is that 10 parti-
cles are seeded randomly accross the ROI every 10 time steps. They are colored by age, which means
the longer a particle remains in the model, the more red it becomes.
The behavior of the particles indicates the presence of a region of vorticity close to the wing: indeed
• Move the ROI closer to the wing. To do so, switch to interaction mode and drag the ROI by
clicking on one of the faces of the box and holding while you move the mouse.
• Right-click on Velocity and select Illuminated Streamlines in the Display menu.
• In the Seed ROI port, select the ROI Box ROI.
• Set the number of lines in Num Lines to 400.
• Set the lines Length to 100.
• Set the Step size to 0.001.
• Click Apply.
• Hide the ROI.
In case of any problems or uncertainties you can find the same project predefined in your tutorial folder
under the file name data/tutorials/windedition/wind displayisl.hx.
Tip: You might want to seed the ISLs from a given boundary (a velocity inlet for example). To do
so, first extract the chosen boundary (use the Create surface option of the Boundary View module as
explained at the end of Chapter 14.2). Then connect the created surface to the Distribution port of
the Illuminated Streamlines module. Be aware though that a line will be seeded from each node of the
surface mesh and that, therefore, the display might take a while to appear in the viewer.
Two other modules use illuminated streamlines: Illuminated Streamlines Slice, visualizes a surface
vector field using ISLs, and Illuminated Streamlines Surface, intersects an arbitrary 3D vector field and
visualizes its directional structure in the cutting plane using ISLs. A demonstration of these modules
is given at the end of Chapter 14.6.
• Go back to only one viewer (click on the one viewer button in the 3D viewer menu).
• Create a new ROI that contains the wing and a part of the domain behond it.
Tip: You already know how to create a new ROI by right clicking the model and using the
Display sub-menu. However this results (as before) in a ROI the same size as the bounding box,
meaning that you have to zoom out to manipulate it down to the desired size. It may be more
convenient to duplicate the existing ROI that is already close to the desired size. Right click on
the ROI Box in the Project Tree View and select Object/Duplicate Object in the popup menu.
Tip: You can move the plane using the Translate port in the Properties area or by dragging the plane in
the Viewer window (switch to interaction mode if necessary). After moving the plane, click the Apply
button in the Properties area to recompute the LIC.
In case of any problems or uncertainties you can find the same project predefined in your tutorial folder
under the file name data/tutorials/windedition/wind planarlic.hx.
• Right click on Velocity in the Project Tree View and select Magnitude from the Compute sub-
menu. The Magnitude module appears in the Project Tree View in the Compute folder, showing
its input (green arrow) is Velocity and its output (red arrow) is Velocity.Magnitude.
The new velocity magnitude data set appears in the Project Tree View underneath the model
(see Figure 14.2).
• Display a legend for Velocity.Magnitude.
• In Vector Plane, set the Rendering coloring mode to Data Mapping and the Colorfield to
Velocity.Magnitude.
Similar to the Stream LIC Slice you can move the plane using either the Translate port or direct
dragging. Unlike Stream LIC Slice the vectors are dynamically recomputed as the plane moves.
In case of any problems or uncertainties you can find the same project predefined in your tutorial folder
under the file name data/tutorials/windedition/wind vectorplane.hx.
A dragger appears for the line from which the streamlines are seeded.
In case of any problems or uncertainties you can find the same project predefined in your tutorial folder
under the file name data/tutorials/windedition/wind streamribbons.hx.
• Hide or remove the previous display modules, keep only the Boundary View.
• Right-click on Velocity and select Critical Points in the Display menu.
• Reduce the Icons size to 0.05.
• Click Apply.
• Select the show option to display the illuminated streamlines seeded from the critical points.
In case of any problems or uncertainties you can find the same project predefined in your tutorial folder
under the file name data/tutorials/windedition/wind cp3d.hx.
The results of the computation are printed to a spreadsheet that pops up. It contains the total area of
all the boundaries of the model under study.
In the Boundaries filter port, all the boundaries are selected, which means that the computation is
done on all the boundaries. The globally option is selected in the Compute port, which means that the
area that is computed is the sum of the areas of all the boundaries.
You can now see that the area of each boundary has been printed to the spreadsheet.
You can see that the area of the half aircraft (composed of boundaries 2, 4, 5, 6, 7, 9, 10 and 11) is
equal to approximately 83.61 square meters.
Volume computation
A new spreadsheet pops up and you can see that the volume of the flow domain is equal to approx-
imately 1024215 cubic meters. In case the model is composed of several regions, you can use the
Regions filter port to restrict your computation to some regions the same way we did for boundaries.
Note that for convenience only boundaries of type Wall are preselected in this module.
The Force module computes the pressure force vector generated on the aircraft surface and the pressure
moment about the moment center which is here set to the origin. Notice that the Pressure scalar
field was identified and automatically selected in the Pressure port.
As new if integral type is new is checked by default in the Table port, a new table opens, which title is
mean in accordance with the field integral type.
Many other types of volumetric and surfacic integrals and statistics can be computed from the Volume
Integrals and Surface Integrals modules. Computations on data fields can always be restricted to
regions or boundaries using the appropriate filter.
Pressure surface integral computation on a sequence of cross sections
Surface integrals can be computed not only on 3d unstructured grid boundaries, but also on 2d unstruc-
tured grids, on 2d unstructured surfaces and on triangulated Surfaces. We will study here a convenient
way to use the Surface Integrals module to compute integrals on several parallel cuts of a 3d model.
An Animate Ports module is created in the Project Tree View. We will use this module to animate the
value of the Translate port of the Cross Section.
Note there is a new port Surfaces in the Properties area of the module. This port is displayed because
a surface (the Cross Section) has been detected in the Project Tree View.
The spreadsheet is updated at each step of the animation with the value of the integral computed on
each new plane. This highlights the important pressure raise in the environment of the aircraft.
In case of any problems or uncertainties you can find the same project predefined in your tutorial folder
under the file name data/tutorials/windedition/wind arithmetic.hx.
Regular data field generation
You can also use the arithmetic module to generate a data field on a regular grid and then use some other
Pressure.Regular is the pressure field generated on a regular grid of size 100 per 50 per 100.
Volume rendering
• Use a Boundary View on the model to display the aircraft boundaries (display only walls).
• In the Display right-click submenu of Pressure.Regular, select Volume Rendering.
• In the Properties area of the Volume Rendering module, select physics VolRend.am in the Col-
ormap port.
• Set the colormap range to -5000, 0.
• Open the Colormap Editor (through the Window menu or the Standard Toolbar shortcut).
• Click on the edit button for values superior to max range . The Color Dialog opens.
• Set alpha (A) to 0.
• Click OK.
In case of any problems or uncertainties you can find the same project predefined in your tutorial folder
under the file name data/tutorials/windedition/wind volrend.hx.
In the Properties area of the compute module you can see the Category port that lists the main cate-
gories of the secondary variables Avizo can compute.
In the Variable port, several vorticity related quantities that can be computed from the velocity vector
field are listed. The velocity vector field has been retrieved by Avizo and set by default in the Velocity
port. The vorticity related variables might be used to find vorticity regions, by plotting cross sections
or by delimiting regions with isosurfaces for example.
Some examples of the most common criteria that can be computed and used to identify vortices:
As previously, several turbulence related quantities are listed. They might also be used to find voriticity
regions.
Some examples of the most common criteria that can be computed and used to identify vortices:
Example 2: lambda2
The Isosurface of LambdaTwo isolates a region with negative lambda2 where there are likely to be
vortices. Sub-regions with high vorticity are located close to the wing.
In case of any problems or uncertainties you can find the same project predefined in your tutorial folder
under the file name data/tutorials/windedition/wind secondaryvariables.hx.
• Hide the Isosurface, the Cross Section and the Data Legend.
• Plot Illuminated Streamlines using a ROI Box positioned close to the leading edge of the wing
as explained in Chapter 14.4.
• Right-click on the Velocity vector field.
• Select Vortex Corelines in the Compute submenu.
• Click Apply.
A Line Set has been created in the Models directory, under the name VortexCorelines. We will
now display the result.
• Select the VortexCorelines object and connect a Line Set View in the Display submenu.
You can see that there are some very small lines and some noisy lines. If we want to focus only on the
main core line, we should filter those lines. Filtering tools are provided for this purpose in the Vortex
Corelines module.
• First we will remove lines that are too small : set the minimum line size to 35.
• Click Apply.
The Line Set View is updated. All lines with less than 35 core points are deleted. There remains three
lines among which one is obviously outside of the previously plotted lambda2 isosurface.
Again, the Line Set View is updated. All core points where lambda2 is bigger than -500 are removed,
that is to say all points outside of the volume delimited by the Isosurface previously studied. The
filtering has been effective and there remain only the core line of the illuminated streamlines swirls. If
you select the VortexCorelines line set, you will see in its Properties area that there are actually two
lines composed of a total of 115 core points.
• Click several times on the smooth button of the Line Set port if you want the line to appear
smoother.
• Select the Line Set View module.
• Choose Circle in the Shape port.
• Set the Scale Factor to 0.02.
Figure 14.42: Filtered core line and the swirling flow close to the wing.
In case of any problems or uncertainties you can find the same project predefined in your tutorial folder
under the file name data/tutorials/windedition/wind vcl.hx.
You can complete this visualization with the display of the 3D critical points (see Chapter 14.4). The
illuminated streamlines seeded from them (with the show option) swirl around the core line.
• Hide or delete Illuminated Streamlines or Critical Points that might remain in the Project Tree
View.
• Select the Boundary View. Only the wing should be selected in the Boundaries port.
• Press the create button in the Create surface port. A wing.surf surface is created and added
to the Project Tree View.
• Right click on the new surface and select Illuminated Streamlines Surface in the Display sub-
menu.
• Select the Illuminated Streamlines Surface module and set the Vector field to Velocity.
• Uncheck the early termination option in Options port.
• Set the Seed port to 1.
• Press Apply.
Figure 14.43: Surface illuminated streamlines on the wing and main core line.
Streamlines on the wing are displayed and vortical phenomena appear pretty well. A main swirl
corresponds to the starting point of the main core line and smaller swirls correspond to small core lines
we noticed in the first core lines display and then filtered.
In case of any problems or uncertainties you can find the same project predefined in your tutorial folder
under the file name data/tutorials/windedition/wind surfaceISL.hx.
The Clipping Plane is now orthogonal to the core line. If you use the Position slider of the Trajectory
module, the plane will slide along the core line, remaining orthogonal. As the core line is actually
composed of two lines, you have to use the Line slider to slide the plane along the other part of the
core line.
Tip: You could do the same with a Stream LIC Slice module for example. The LIC technique is also a
good tool to visualize the swirl of the flow around the core lines.
You can also animate the streamlines to see them swirl around the core line by selecting animate in the
View options port.
In case of any problems or uncertainties you can find the same project predefined in your tutorial folder
under the file name data/tutorials/windedition/wind planarISL.hx.
14.7.1 3D measurements
You can access measuring tools via the View / Measuring menu or via the measuring tool button
(and its pulldown menu - click on the little arrow) at the top of the viewer.
You now have a Measurement object in the Display folder of the Project Tree View. This module
provides access to two-dimensional and three-dimensional measuring tools.
3D length measurement
We will measure the leading edge of the wing. A line measurement (3D length) is already selected.
• In the 3D viewer, click on one end of the leading edge of the wing.
Notice that cursor changes to indicate when a valid object can be selected.
• Click on the other end of the wing edge.
• To adjust the position of a measurement line,
You can measure that the wing has a leading edge of approximately 4.44 meters and a side edge of
approximately 1.55 meters.
3D angle measurement
• In the Properties area of the Measurement module, click on the ”eye” icons of the two lines to
hide them in the 3D viewer.
• In the Add port, click the Angle button.
• In the 3D viewer, click on the intersection of the attack edge of the wing and the fuselage.
• Click on the other end of the attack edge (intersection with the side edge).
• Click on the other end of the side edge.
14.7.2 Histograms
The Histogram module computes the histogram of a scalar field in 3D cells. We will use it on the
Pressure scalar field.
A window pops up, that contains a histogram in logarithmic scaling. The mean value (approx. 1849 Pa)
and the standard deviation (approx. 23187 Pa) of the Pressure field are displayed in the Properties
area.
• for all cells where the pressure is in the new range, the mean value is approximately 10646 Pa
and the standard deviation is approximately 26432 Pa,
• in this same range, 2.29 percent of the cells have a pressure greater than 100000 Pa,
• in this same range, 50 percent of the cells have a pressure lower than 5483 Pa (and 50 percent
greater).
• Right-click on Pressure.
• In the Measure menu, select Spline Probe.
To position the control points within the bounding box of the given geometry you can either type in
the coordinates in the Points port (see below) or you can move the points dragger interactively with
the mouse. (You may have to zoom out to see the points dragger.)
• In the Points port, the coordinates of the first control point are displayed. Change them to 4, 2,
0.
• In the Points port, use the spin box to select the second point and set its coordinates to 0, 2, 0.
• Select the third point and set its coordinates to 0, 2, 0.3.
Figure 14.48: Pressure values against the spline probe line length.
A plot window appears where the sampled pressure values are plotted against the length of the probe
line. In case of any problems or uncertainties you can find the same project predefined in your tutorial
folder under the file name data/tutorials/windedition/wind splineprobe.hx.
Probing along a surface path
For probing purposes, it is often useful to have tools to define specific lines on a surface. The Surface
Path Editor and the Surface Intersector module are designed to this end.
The Surface Path Editor allows creating paths on surfaces. Paths can be useful to cut surfaces, define
regions or features of a surface, probe, etc. The editor can be accessed from the Properties area of a
Surface Path Set by clicking on the editor button . Two types of editor are then provided:
• the Generic Path Editor allows defining paths arbitrarily across the surface mesh,
• the Vertex Path Editor allows defining paths only along the surface mesh edges.
Note that the Vertex Path Editor can be accessed directly from the Surface Path submenu of a surface.
The Surface Intersector module intersects two surfaces, computes a path along the intersection and
attaches it to each of the surfaces.
• Remove all objects from the Project Tree View (use [Ctrl+N] or right click in the Project
Tree View and select Remove All Objects).
• Open fan-0070.cas from the tutorials/windedition/fan folder.
We will plot the Pressure along a radial line section of the fan surface. We have to create a cylin-
drical surface first, in order to intersect it with the fan and then get the intersection line.
• Right click on the surface fan-0070.surf and create a Surface Intersector from the Surface
Path submenu.
In the Surface Intersector Properties area, the second surface still has to be set. When the Surface
Intersector is selected, a macro button appears in the upper part of the Project Tree View and gives
quick access to the Parametric Surface module. We will use this module to create the intersecting
surface we need.
Two paths along the intersection are created, one attached to each of the surfaces.
• Hide the Parametric Surface and connect a Line Set View display module to
IntersectionPath2. The path is displayed on the fan surface.
• In the Measure submenu of Pressure, select Line Set Probe.
• Attach the Line Set Probe to IntersectionPath2 in the Line set port and press the Show
button.
A window displaying the Pressure along the line probe appears. We will improve the display.
Figure 14.49: Pressure values along the radial 0.12m line section of the fan surface.
Avizo Green Edition pack is an extension to Avizo and provides special modules for visualizing climate
oriented data sets.
By following the tutorials provided in Avizo Green Edition online documentation, you will learn how
to use these modules on your own climatology data sets.
The tutorials cover the following topics:
Acknowledgements
The Avizo Green Edition has been developed in cooperation with DKRZ, the German Climate Com-
puting Center (http://www.dkrz.de). All the content of this tutorial is based on the work done at the
DKRZ. NetCDF CF-1.0 data set used in this tutorial are supplied with the courtesy of MPI-M/DKRZ.
494 Chapter 15: Avizo Green Edition User’s Guide
Chapter 16
Avizo Earth Edition is the software suite including Avizo and all its extensions for interactive explo-
ration, visualization, analysis, comparison, and presentation of geoscience data. Avizo Earth Edition
includes the whole Avizo Standard Edition feature-set plus an advanced SEG-Y data importer (Avizo
XReadSEGY Pack) and the Avizo XLVolume Pack, which manages and visualizes very large amounts
of volume data, up to terabytes.
Avizo Earth Edition integrates in the full spectrum of visual applications, including seismic data QC,
pre-processing, and interpretation, reservoir modeling, characterization, and simulation, drilling plan-
ning, flow simulation, and engineering, 3D petrography, core sample analysis, and borehole imaging
and engineering design, training, and simulation.
This chapter, available in Avizo Earth Edition online documentation, is organized into the following
sections:
Avizo XLab Pack is a generic term encompassing several extensions of Avizo Fire Edition that pro-
vide numerical simulation capabilities to calculate physical properties of materials from the 3D image
of a sample (for instance, scanned with CT, FIB/SEM, MRI, etc.). Material properties are directly
computed from the segmented 3D image.
The extensions and corresponding materials properties are:
Note: see section 1.4 System Requirements about system requirements and hardware platform avail-
ability.
For each of these properties, two different modules are available, corresponding to two different sim-
ulation approaches. The first approach consists of estimating a given property as the result of an ex-
periment performed in a laboratory. To do that, the external conditions of an experiment are simulated
by imposing boundary conditions resembling those existing in a laboratory. This way it is possible to
compare the module results to actual experimental results. The second approach is an effective prop-
erty calculation. In that case, the material is considered as representative of an infinite medium from
which it is extracted. By imposing spatially periodic boundary conditions, it is possible to obtain the
effective property of the macroscopic medium.
Experiment simulation is designed to be close to realistic laboratory experiment. It considers very
perturbing boundary conditions: the sample is hermetically closed on four faces and constant values
are imposed on the remaining two. The transport phenomenon is highly constrained by this kind of
conditions.
Tensor calculation is based on a mathematical approach which considers the sample to be represen-
tative of an infinite or macroscopic material. Periodicity is a lot softer boundary condition and the
transport phenomenon is more free. Tensor calculation is usually the preferred method when the Rep-
resentative Elementary Volume is reached.
Provided modules are:
The following sections provide, for each property, an overview of the theory on which the computation
modules are based, and tutorials for getting started with the modules.
In the tutorials, some steps are mandatory: you must folow them for successful completion of the
tutorial. Other steps are optional: you should at least read them, because their content could be useful
later. Whether a step is optional or mandatory is indicated at the beginning of each section of the
Acknowledgements
Avizo XLab Pack has been developed in cooperation with Dr. Bernard, Research Director at ICMCB-
CNRS (Pessac, France)
A demo script is also provided. This script will automatically perform all the steps detailed in the
tutorial.
• Q is the global flow rate that goes through the porous medium (unit: m3 .s−1 );
• S is the cross section of the sample which the fluid goes through (unit: m2 );
• k is the absolute permeability (unit: m2 );
• µ is the dynamic viscosity of the flowing fluid (unit: P a.s);
• ∆P is the pressure difference applied around the sample (unit: P a);
• L is the length of the sample in the flow direction (unit: m).
Q
S is often noted v and accounts for the superficial or mean fluid flow velocity through the porous
medium or Darcy’s velocity.
Only single-phase fluids are considered for absolute permeability. Multi-phase flows are concerned by
relative permeability.
The last point is equivalent to considering flow at a low Reynolds number (see [2] for the first appear-
ance of Reynolds numbers).
Once this equation system is solved, estimating the permeability coefficient consists of applying
Darcy’s law. All the values of this equation can be deduced from the solution of the equation system
The permeability tensor is extracted from the solution of this problem by calculating the mean value
→
−
→
−
of D over the volume V on which the system was solved:
→
−
→
− 1
Z → −
→
−
k = D dV
V V
This permeability tensor gives additional information about the intensity of permeability along any
direction of space. It can give rise to the anisotropy of a porous medium - i.e., the dependence of the
permeability intensity on the direction of the flow. It is computed by the Absolute Permeability Tensor
Calculation module.
Boundary conditions
Avizo XLab Hydro Pack extension provides two approaches to estimate absolute permeability.
The first is an experiment simulation based on Stokes equations resolution; this is done in Absolute
Permeability Experiment Simulation module. The boundary conditions are specified as:
The second approach solves the closure problem derived from Stokes equation by volume averaging.
This is done in the Absolute Permeability Tensor Calculation module. The tensorial problem that is
→
−
− →
→ −
solved in this case is closed by imposing periodic boundary conditions to D, d and the geometry. A
no-slip condition is imposed at the fluid-solid interfaces. The sample represents a macroscopic, infinite
material and must thus be representative of this porous medium.
Artificial compressibility
The equation systems cannot be solved using fully implicit methods (matrix inversion) because the
matrices of this kind of system are singular. This is why an artificial compressibility coefficient and
some time derivative terms are introduced in the system. The method of artificial compressibilty was
first described in [5].
Introducing these terms in the equation systems allows an iterative resolution of the problem. The
unique solution is attained when the time derivatives tend to zero. The time that is introduced in the
equations has no physical sense.
Bibliography
1. Darcy, H., Les fontaines publiques de la ville de Dijon , V. Dalmont, Paris, 1856
2. Reynolds, O., An experimental investigation of the circumstances which determine whether the
motion of water shall be direct or sinuous, and of the law of resistance in parallel channels ,
Philosophical Transactions of the Royal Society 174 (0): 935-982, 1883
3. Whitaker, S., The Method of Volume Averaging, Kluver Academic Publishers, 1999
4. Gray, W. G., A derivation of the equations for multiphase transport , Chemical Engineering
Figure 17.1: (1) In the Edit > Preferences... dialog, select the Units tab. (2) Select Spatial information only and (3) keep all the
boxes checked.
Once activated, whenever loading a dataset the unit management tool will ask for the length unit to
use for voxel size. For more details about this feature, please refer to the Units in Avizo chapter in the
reference guide.
Note: The file 10mc3_200.vol.am has embedded unit information, therefore length unit is auto-
matically set for this data. However, the file 10mc3_400.vol.am doesn’t have such unit informa-
tion. Since the Avizo units management tool was activated at step 1, you will need to specify the length
unit every time the file is opened. The dialog presented by Figure 17.4 will appear each time a data
set without length unit information is loaded. For instance, for the file 10mc3_400.vol.am, please
select micrometer [µm] as the coordinates unit for the data set of the tutorial.
Note: If a data set is saved after the length unit has been selected, this information is stored in Avizo
format and will be reused at its next loading. Length unit then can be modified using the Units Editor
(see Figure 17.5) and a dialog box appearing, which looks like Figure 17.4.
The voxel size is stored in Avizo format, for example, but not all data format save this information. In
case the stored values are wrong, Avizo provides an editor allowing modification of the voxel size of
the loaded data set.
• Open the Crop Editor by clicking on the highlighted button in Figure 17.7.
• The voxel size of the data set can be modified in the dialog that appeared (see Figure 17.8).
Figure 17.3: Open Data... dialog to load the data set of this tutorial. Choose the path to the data set, then select and open it.
For the data set of this tutorial, the correct voxel size is 3.8, which is set by default.
If the Avizo units management is not activated, the voxel size indicated in the data set will be consid-
Figure 17.5: The Units Editor button is in the red square (visible only when a data set is selected in the Project View).
ered to be in microns. Otherwise, the length unit was set at data set loading time.
Note: Isotropic - i.e. cubic - voxels are mandatory for Avizo XLab Hydro Pack computations.
• Right click on 10mc3_200.vol.am in the Project View and select Image Filters > Smooth-
ing: Median.
• Set the Filter option to 3D (see Figure 17.9).
• Click on Apply.
• Right click on the result of the filtered image (10mc3_200.vol-filtered) in the Project
View and select Display > Ortho Slice (see Figure 17.10).
Figure 17.7: Finding the Crop Editor button when the data set is selected in the Project View.
Figure 17.9: Modified parameter of the Filter > Smoothing: Median module is highlighted by a red arrow.
• Right click on 10mc3_200.vol-filtered in the Project View and select Image Segmen-
tation > Multi-Thresholding.
• The default option should be the same as in Figure 17.11. The most important parameter to
Figure 17.11: Modified parameter of the Segment > Multi-Thresholding module is highlighted by a red arrow.
verify is the value of the Exterior-Inside slider, which must be set to 114.
• Click on Apply.
• Right click on the result of the threshold operation (10mc3_200.Labels) in the Project View
• Right click on 10mc3_200.Labels in the Project View and select Image Processing > Log-
ical Operations > Invert.
• Click on Apply.
• Right click on the result (10mc3_200.Invert) in the Project View and select Display >
Ortho Slice (see Figure 17.13).
Figure 17.13: Visualization of the negative data set. The viewer and Project View should look like in this picture.
• Right click on 10mc3_200.Invert in the Project View and select Image Processing > Image
Morphology > Axis Connectivity.
• Click on Apply.
• Right click on the result (10mc3_200.Axis-Connectivity) in the Project View and se-
lect Display > Ortho Slice (see Figure 17.14).
Figure 17.14: Visualization of the percolating porosity in data set. The viewer and Project View should look like in this picture.
Figure 17.15: Modified parameters of the Display > ROI Box module are highlighted by the red rectangle.
This ROI defines a cube with 50 voxel edges centered in the complete volume (see Figure 17.16). It
will be used in this tutorial to compute permeability on small volumes. It can be moved through the
data set at will during the tutorial, although its initial position will be used for illustrating purposes.
Figure 17.17: Modified parameters of the XLab Simulations > Absolute Permeability Experiment Simulation module are high-
lighted by red arrows. (1) Connect the ROI Box module to reduce the computation domain. (2) Select the label 1 as it represents
the void space between the spheres.
The default parameters simulate an experiment along the Z axis with the input pressure at 1.3 × 105
Pa and the atmospheric pressure at output. The default viscosity is the viscosity of water. The options
can be modified to simulate several experiments. For example, the direction of the main flow can be
adjusted to X, Y or Z direction (default is Z). If several directions are selected, the computations will
be done successively. The boundary conditions of the experiment can also be modified, so that the
velocity and pressure fields are scaled with these values. Two values among three can be imposed:
input pressure, output pressure, flow rate. Modifying these values will not change permeability, which
is intrinsic to the porous medium. It will only modify the output fields.
The spreadsheet containing all results and related information can be visualized by selecting it in the
project view and clicking on the Show button (in the Properties area). See Figure 17.18.
Figure 17.18: Spreadsheet containing the main results of the Absolute Permeability Experiment Simulation computation.
A spreadsheet can be exported into several formats (CSV, XML, txt for example).
• Hide Bounding Box and the the five Ortho Slice by clicking on their viewer toggle.
• Right click on 10mc3_200.VelocityZ and select Compute > Magnitude.
The resulting visualization and Project View are described by Figure 17.20.
Figure 17.19: Modified parameters for Illuminated Streamlines representing the velocity field in the experiment simulation are
highlighted by red arrows.
Note: The experimental setups are automatically designed after the calculation is initiated. Figure
17.23 describes their shape. On the faces perpendicular to the flow direction, a simple shape is added.
It is composed of:
• a channel with a square section to stabilize (from a numerical point of view) the flow in the
On the other faces of the sample, a one-voxel-wide solid plane is added, to be sure that the fluid is
contained in the system.
With these parameters, the module will compute the full intrinsic permeability tensor. A full tensor
computation requires three computations equivalent in time and memory consumption to the experi-
ment simulation.
Figure 17.24: Modified parameters of the XLab Simulations > Absolute Permeability Tensor Calculation module are high-
lighted by red arrows. (1) Connect the ROI Box module to reduce the computation domain. (2) Select the label 1 as it represents
the void space between the spheres.
Figure 17.25: Spreadsheet containing the main results of the Absolute Permeability Tensor Calculation computation.
A spreadsheet can be exported into several formats (CSV, XML, txt for example).
The resulting visualization and Project View are described by Figure 17.27.
The other velocity fields can be visualized by replaying the same procedure for each.
We work here with the complete volume, high-resolution version of the data set. It
can be found in the same directory as the resampled data set used in this tutorial:
data/tutorials/xlab/10mc3_400.vol.am.
Mean diameter of the spheres could be determined using Avizo Fire Edition toolset, following a proce-
dure similar to tutorial Example 4: Further Image Analysis - Distribution of Pore Diameters in Foam.
Using the experimental parameters, the spheres diameters are between 100 and 120µm.
Porosity can also be estimated with Avizo Fire Edition (with Quantification Tools > volume3d con-
nected to 10mc3_400.Axis-Connectivity), and the value is 36.35%.
From these two elements, the permeability value calculated from the Kozeny-Carman equation is be-
tween 6.59d and 8.00d.
These values can be compared to the permeabilities obtained with Avizo XLab Hydro Pack modules
on the complete geometry (without the region of interest used in this tutorial). Experiment simulation
As the subject of data preparation for simulation has been addressed in the previous tutorial for Avizo
XLab Hydro Pack, it will only be shortly evoked here:
A demo script is also provided. This script will automatically perform all the steps detailed in the
tutorial.
where:
VR ∂C∂t
in (t) ~ ndS
R
=D Sin
∇c.~
where Sin and Sout the faces of the sample where the reservoirs are connected.
Once the diffusion process starts, the concentration in the sample quickly evolves and the exchanges
with the reservoirs are dissymmetrical. This transient state is then replaced by an established state,
when the exchanges with the reservoirs are equal.
This established state is characterized by the fact that ∂C∂t
in (t)
= − ∂Cout
∂t
(t)
. Once this state is attained,
the concentration in the reservoirs will continue to vary until they reach the equilibrium concentration
c∞ . The difference of these concentrations, Cout (t) − Cin (t), follows an exponential law:
√λ −1
cos
! !
Dapp λ λ 2
c (X, t) = A cos X + sin exp −λ t + c∞
X
p p
Dapp Dapp
sin √ λ
Dapp
where c (X, t) is the local concentration at position X and time t, A is a constant coefficient.
Knowing this solution must verify the previous hypothesis of flux equality ( ∂C∂t
in (t)
= − ∂Cout
∂t
(t)
), the
following equation is derived:
√ λ
cos −1
Dapp λ
−λ2 = Dapp β p
Dapp
sin √ λ
Dapp
which links the λ2 coefficient to the apparent diffusivity Dapp of the sample.
To sum up:
1. A first transient state during which the diffusion process starts must be achieved before an es-
tablished state appears.
2. Once the established state has begun, the difference of the reservoirs concentration follows an
exponential law. Therefore, the slope of the linear curve followed by ln (Cout (t) − Cin (t)) can
be estimated easily.
3. This slope is λ2 , the exponential coefficient, which is related to the apparent diffusivity Dapp .
A change of scale to get equations valid on the entire volume is necessary. The method of volume aver-
aging is a technique that accomplishes a change of scale. Its main goal is to spatially smooth equations
by averaging them on a volume. The interested reader will find relevant details and references in
[Whitaker, S., The Method of Volume Averaging, Kluver Academic Publishers, 1999].
This theory performs to develop a closure problem that transforms the Fick’s equations to a vectorial
problem; closure variable ~b is used to state the concentration perturbation in a new problem:
∇2~b = 0
where:
• is the porosity,
• Dsolution is the bulk solution diffusivity,
• Vf is the volume of fluid,
• Sf s is the area of the fluid-solid interface,
• −
n→f s is the normal to the fluid-solid interface directed from the fluid to the solid phase.
Boundary conditions
Avizo XLab Diffusion Pack extension provides two approaches to estimate molecular diffusivity.
The first is an experiment simulation based on Fick’s equations resolution. As said previously, this
is done in the Molecular Diffusivity Experiment Simulation module. The rate of reaction of the solid
is assumed to be zero: there is no reaction occuring at the fluid-solid interface. Then the boundary
condition at fluid-solid interface is:
→
−
−−n→f s . ∇c = 0
where −n→ is the normal to the fluid-solid interface directed from the fluid to the solid phase.
fs
Besides this fluid-solid interface condition, a one-voxel-wide plane of solid is added on the faces of the
image that are not perpendicular to the main diffusion direction. This allows isolation of the sample
from the outside.
Boundary conditions at inlet and outlet require knowledge of the concentrations in the reservoirs.
These concentrations evolve over time:
→→ −
Z
∂Cin −
Vr = n−Sin . ∇cds
∂t Sin
−→ → −
Z
∂Cout −
Vr =− n−Sout . ∇cds
∂t Sout
when Sin and Sout are respectively the input and output face of the sample; −n− → −−−→
Sin and nSout are
respectively the normal to the input and output face.
The second approach solves the closure problem derived from the Fick’s equation by volume averag-
ing. This is done in the Molecular Diffusivity Tensor Calculation module. The vectorial problem that
is solved in this case is closed by imposing periodic boundary conditions to ~b and the geometry. The
fluid-solid interface condition has the following similar form:
−→
→ −
−−n→ −→
f s . ∇ b = nf s
As mentioned in the previous step, units management is not mandatory here. However, refer to step 2
of Avizo XLab Hydro Pack tutorial to learn more about editing the length units.
Purpose Set the edge size of the voxels in the uniform data set.
Mandatory step No.
Again, as mentioned in the previous steps, correctly setting the dimension of the voxels is not manda-
tory here. However, to learn more about using the Crop Editor to set the voxel size, please refer to step
3 of Avizo XLab Hydro Pack tutorial.
Note: Isotropic - i.e., cubic - voxels are mandatory for Avizo XLab Diffusion Pack computations.
Purpose Use basic segmentation tools to create a label field from the data set.
Mandatory step Yes.
This step consists of creating a label field from the initial data set that is smoothed and thresholded,
using some of the segmentation tools provided by Avizo.
Please follow the instructions described in step 4 of Avizo XLab Hydro Pack tutorial.
Please follow the instructions given in step 6 of Avizo XLab Hydro Pack tutorial and define a ROI
cube with 50 voxels on a side centered in the sample (see Figure 17.31). The ROI will be used in this
tutorial to compute properties on small volumes. It can be moved through the data set at will during
the tutorial, although its initial position will be used for illustration purposes.
For convenience and because it will save time during this tutorial phase, we compute the molecular
diffusivity on a sub-region of the sample. However we will see in the validation phase how resampling
and using ROI affects the quality of the computed results.
The default parameters simulate an experiment along the Z axis with a concentration in the input reser-
voir at initial time of 1711 mol.m−3 and the concentration in the output reservoir at initial time being
null. The default solution bulk diffusivity is 1 m2 .s−1 . The options can be modified to simulate several
experiments. For example, the direction of the molecular diffusion can be adjusted to X, Y, or Z direc-
tion (default is Z). If several directions are selected, the computations will be done successively. The
concentration values used as boundary conditions of the experiment can also be modified. Modifying
these values will not change the molecular diffusivity, which is intrinsic to the porous medium. It will
only modify the output concentration field.
Figure 17.32: Spreadsheet containing the main results of the Molecular Diffusivity Experiment Simulation computation.
The resulting visualization should look like Figure 17.33. One can notice that the input and output
concentrations are far from having reached the end concentration (described as C∞ in the theory
pages). As explained in the theory pages, the computation is stopped once the behavior of the logarithm
of the difference between the input and end concentrations becomes linear w.r.t. time.
• Hide all current display modules, such as Bounding Box or Ortho Slice, by clicking on their
viewer toggle.
• Right click on 10mc3_200.ConcentrationZ and select Display > Ortho Slice.
• In the Ortho Slice properties, change the selected colormap to temperature.icol from the Edit
menu.
• Select the Edit menu of the colormap again, select Adjust range.
• In the Orientation port, select the yz orientation.
• Zoom on the slice to visualize it.
The resulting visualization should look like Figure 17.34. You can observe the decrease of the con-
centration from the input reservoir (at the bottom of the slice, in yellow), to the output reservoir (at the
top of the slice, in light blue).
With these parameters, the module will compute the full intrinsic diffusivity tensor. A full tensor
computation requires three computations, each equivalent in time and memory consumption to one
experiment simulation.
A spreadsheet can be exported into several formats (CSV, XML, txt for example).
Figure 17.35: Tables of the spreadsheet containing the main results of the Molecular Diffusivity Tensor Calculation computa-
tion.
Finaly, Vrettos (1989) and Quintard (1993) obtained numerical results on Voronoi networks and on
cubic configurations.
All these results are displayed on Figure 17.36.
We compare these values to the values computed with Avizo XLab Diffusion Pack modules on the
data set used in this tutorial, which is a random packing of spheres. We work here with the complete
geometry of the complete volume, high-resolution version of the data set (that is to say a label field
obtained from data/tutorials/xlab/10mc3_400.vol.am, without any ROI Box).
Porosity can be estimated with Avizo Fire Edition (with Quantification Tools > volume3d connected
to 10mc3_400.Axis-Connectivity), and the value is 36.35%.
Experiment simulation in each direction gave the following results:
DX
• Dsolution = 0.249
DY
• Dsolution = 0.255
DZ
• Dsolution = 0.257
These values are also displayed in Figure 17.36. One can see that Avizo XLab Diffusion Pack results
are in good agreement with the different studies results.
A second demo script is also provided, which runs the steps of this tutorial on the full resolution data
set, restricted to a region of interest.
Bibliography:
1. Carman P.C., Flow of Gases through Porous Media, Butterworths, London, 1956
2. Currie J.A., Gaseous diffusion in porous media. Part I - a non-steady state method, Brit. J.
Appl. Phys., II, 314-324, 1960
3. Hoogschagen J., Diffusion in porous catalysts and absorbents, Ind. Eng. Chem., 47, 906-913,
1955
4. Kim J.-H., Ochoa J.A., Whitaker S., Diffusion in Anisotropic Porous Media, Transport in Porous
Media, 2, 327-356, 1987
5. Maxwell J.C., Treatise on Electricity and Magnetism, Vol. I, 2nd edn., Clarendon Press, Oxford,
1881
6. Quintard M., Diffusion in Isotropic and Anisotropic Porous Systems: Three-Dimensional Cal-
culations, Transport in Porous Media, 11, 187-199, 1993
7. Saez A.E., Perfetti J.C., Rusinek I., Prediction of Effective Diffusivities in Porous Media using
Spatially Periodic Models, Transport in Porous Media, 6, 143-157, 1991
8. Torquato S., Effective electrical conductivity of two-phase disordered composite media, J. Appl.
Phys., 58, 3790-3797, 1985
As the subject of data preparation for simulation has been addressed in the previous tutorial for Avizo
XLab Hydro Pack, it will only be shortly evoked here:
A demo script is also provided. This script will automatically perform all the steps detailed in the
tutorial.
where:
As we consider conductive solution, there is no charges accumulation. Ohm’s law and conservation of
charge lead to the following equation:
~ ~j = 0
∇.
and as we consider only one homogeneous fluid phase, the electrical conductivity σ does not vary in
space, which leads to:
∇2 v = 0
The experiment that is simulated in the Formation Factor Experiment Simulation module consists of
applying a constant electrical potential difference between two opposite faces of the material sample
(direct current is used). The other faces of the sample are enclosed with an electrical insulator. When
the final state is attained, input and output current fluxes are equal, and by using the Ohm’s law on the
entire volume, the apparent electrical conductivity is estimated by:
jtotal Vin − Vout
=σ
S L
where
• jtotal is the total electrical flux going through the input face,
• S is the area of the input face,
• σ is the electrical conductivity of the material,
• Vin and Vout are the input and output imposed potentials,
• L is the length of the material sample.
The total electrical flux going through the input face jtotal can be computed by locally applying Ohm’s
law : Z
jtotal = ~ ds
−σsolution ∇v. ~
S
where σsolution is the electrical conductivity of the free solution.
The formation factor is directly linked with the electrical conductivity through its inverse: the electrical
resistivity. Indeed, it is ”the ratio of the resistivity of a rock filled with water to the resistivity of that
water” (Schlumberger Oilfield Glossary: formation factor, 2009).
When the problem is solved, it is possible to compute the dimensionless electrical conductivity tensor
defined as:
→
−
→
− →
−
!
→
− →
−
Z
σ 1 −→
= I + nf s b ds
σsolution Vf Sf s
where:
• is the porosity,
• σsolution is the solution electrical conductivity,
• Vf is the volume of fluid
• Sf s is the area of the fluid-solid interface,
• −
n→f s is the normal to the fluid-solid interface directed from the fluid to the solid phase.
The inverse of the conductivity tensor is the formation factor tensor and the formation factor scalar is
the average value of the eigenvalues of this last tensor. All this is computed by the Effective Formation
Factor Calculation module.
Boundary conditions
Avizo XLab Electro Pack extension proposes two approaches to estimate electrical conductivity.
where −n→ is the normal to the fluid-solid interface directed from the fluid to the solid phase. Besides
fs
this fluid-solid interface condition, boundary conditions are:
• one-voxel-wide plane of electrical insulator added on the faces of the image that are not per-
pendicular to the electrical flux main direction. This allows isolation of the sample from the
outside.
• the input and output (the faces that are perpendicular to the flux main direction) designed as
one-voxel-wide plane where the potential is imposed.
The second approach solves the closure problem derived from Ohm’s equation by volume averaging.
This is done in Effective Formation Factor Calculation module. The vectorial problem that is solved
in this case is closed by imposing periodic boundary conditions to ~b and the geometry. The fluid-solid
interface condition has the following similar form:
−→
→ −
−− n→ −→
f s . ∇ b = nf s
System resolution
Once discretized, the equation systems can be written as Ax = b, A being a sparse, symmetric matrix.
The equation systems are solved using a fully implicit method (matrix inversion). PETSc (Portable,
Extensible Toolkit for Scientific Computation) library is used for the direct resolution of the linear
systems.
An iterative resolution with conjugate gradient and ILU preconditioner is performed. The convergence
criterion used is the relative decrease of the residual l2 -norm.
As mentioned in the previous step, units management is not mandatory here. However, refer to step 2
of Avizo XLab Hydro Pack tutorial to learn more about editing the units of length.
The default parameters simulate an experiment along the Z axis with an input potential of 1 V and the
output potential being null. The default solution electrical conductivity is 0.0001 S.m−1 . The options
can be modified to simulate several experiments. For example, the direction of the electrical flux can
be adjusted to X, Y or Z direction (default is Z). If several directions are selected, the computations
The spreadsheet containing all the relevant information can be visualized by selecting it in the Project
View and clicking on the Show button (in the Properties area). See Figure 17.41. A spreadsheet can
be exported into several formats (CSV, XML, txt for example).
Figure 17.41: Spreadsheet containing the main results of the Formation Factor Experiment Simulation computation.
• Hide all current display modules, such as Bounding Box or Ortho Slice, by clicking on their
viewer toggle.
• Right click on 10mc3_200.PotentialZ and select Display > Ortho Slice.
The resulting visualization should look like Figure 17.42. You can observe the decrease of the potential
from the input of the device (at the bottom of the slice, in yellow), to the output of the device (at the
top of the slice, in light blue).
Figure 17.42: Visualization of potential field in an experiment simulation with electrical flux in Z direction.
With these parameters, the module will compute the full intrinsic conductivity tensor. A full tensor
computation requires three computations, each equivalent in time and memory consumption to one
experiment simulation.
→
−
Note that the potential field output is not selected by default. This output corresponds to the b vec-
tor, solution of the vectorial problem derived from the Ohm’s equations with the volume averaging
approach (see Avizo XLab Electro Pack theory pages). It is used in the computation of the effective
electrical conductivity but its visualization is hard to interpret.
As the formation factor tensor is computed as the inverse of the conductivity tensor, the second table
is generated only if all the three directions have been selected and the full conductivity tensor has been
computed.
Figure 17.43: Tables of the spreadsheet containing the main results of the Effective Formation Factor Calculation computation.
• Archie’s law (1942): F = A−m where A is often assumed to be 1 and m depends on the
geometry of the porous medium (m usually belongs to range [1,3]),
• Sen et al (1981): F = −3/2 which is a good approximation for sintered packings of glass
spheres for > 0.2.
• Berryman (1983): F = 2/((1 + )) which is well adapted to materials with a large porosity.
It appeared that the experimental values measured on mixtures of glass spheres by Lemaitre et al were
in a range defined by the values obtained from the theories of Sen et al and Berryman and were well
fit by Archie’s law with m=1.46.
We compared these values to the values computed with Avizo XLab Electro Pack modules on
data/tutorials/xlab/10mc3_400.vol.am.
Experiment simulation in each direction gave the following results:
• FX = 4.599
• FY = 4.602
• FZ = 4.623
1. Archie G.E., The electrical resistivity log as an aid in determining some reservoir characteris-
tics, Petroleum Transactions of AIME, 146, 54-62, 1942
2. Berryman J.G., Effective conductivity by fluid analogy for a porous insulator filled with a con-
ductor, Phys. Rev. B 27, 7789-7792, 1983
3. Lemaitre J., Troadec J.P., Bideau D., Gervois A. and Bougault E., The formation factor of the
pores space of binary mixtures of spheres , J. Phys. D: Appl. Phys., 21, 1589-1592, 1988
4. Sen P.N., Scala C. and Cohen M.H., A self-similar model from sedimentary rocks with applica-
tion to dielectric constant of fused glass beads, Geophysics, 46, 781-795, 1981
As the subject of data preparation for simulation has been addressed in the previous tutorial for Avizo
XLab Hydro Pack, it will only be shortly evoked here:
A demo script is also provided. This script will automatically perform all the steps detailed in the
tutorial.
∂Tα
(ρcp )α − λα ∇2 Tα = 0
∂t
where:
We consider that the steady state is reached. Then the equation we now want to solve is:
λα ∇2 Tα = 0
The experiment that is simulated in the Thermal Conductivity Experiment Simulation module consists
of applying a constant heat flux between two opposite faces of the material sample. For example, the
input and output temperatures might be maintained constant by a heating resistor for the input and a
freezing bath for the outut. The other faces of the sample are perfect thermal insulator planes. When
the final state is attained, input and output heat fluxes are equal and Fourier’s law writes on the entire
volume:
ϕtotal Tin − Tout
=λ
Sin L
where
The apparent thermal conductivity λ can be computed thanks to the previous expression, provided that
we know the other terms. The experimenter controls the temperatures Tin and Tout and it is easy to
determine the total heat flux through the input face by locally using Fourier’s law:
→
−
Z
ϕtotal = −λα ∇Tα .ds ~
Sin
where λα and Tα are the thermal conductivity and temperature of any phase α of the material in contact
with the input surface Sin .
−→
→ − →
−
→
−
∇(λα ( ∇ b α + I )) = 0
→
− →
−
where b might be considered as a perturbation of the temperature field. b also verifies:
−
−−
−→→ 1 X
Z
−→
→ − →
−
→
−
λef f = λα ∇ b α + I dv
V α Vα
where:
−
−−−→
→
• λef f is the effective thermal conductivity tensor,
• V is the total volume of the sample,
• α is a conducting phase,
• Vα is the volume occupied by each phase α.
The interested reader will find relevant details and references in [Auriault, J.-L., Boutin, C. and Gein-
dreau, C., Homogénéisation de phénomènes couplés en milieux hétérogènes 1, Lavoisier, 2009].
Boundary conditions
As said previously, most materials are not homogeneous and contain more than one phase. Charac-
teristics of each phase can be completely different and the interfaces between the components of the
material play a major role in the global thermal conductivity.
λξ ∇2 Tξ
=0 for ξ = α, β
Tα = Tβ at α − β interface
−−→ → − → → −
−nαβ .λα ∇Tα = −−
n−αβ .λβ ∇Tβ at α − β interface
where −
n−
→
αβ is the unit vector normal to the interface between the two phases and oriented from α to β.
These boundary conditions specifie that the temperature and the normal component of the heat flux are
continuous at the interface between the phases.
Avizo XLab Thermo Pack extension proposes two approaches to estimate thermal conductivity.
The first is an experiment simulation based on Fourier’s equations resolution. As said previously, this is
done in Thermal Conductivity Experiment Simulation module. Besides the phases interface condition,
boundary conditions are:
• one voxel wide plane of thermal insulator is added on the faces of the image that are not perpen-
dicular to the heat flux main direction. This allows isolating the sample from the outside.
• the input and output (the faces that are perpendicular to the flux main direction) are designed as
one voxel wide planes where the temperature is imposed.
• two among the following three conditions can be imposed by the user, the third being estimated
from the chosen two: input temperature, output temperature, heat flux.
The second approach solves the canonical problem derived from Fourier’s equation by homogeneiza-
tion on an infinite periodic domain. This is done in the Thermal Conductivity Tensor Calculation
module. Two boundary conditions result from the condition of continuity of the temperature and of
the normal component of the heat flux at a two-phases interface:
( →
− →
−
bα = bβ
−→
→ − →
−
→
− −→
→ − →
−
→
−
−λ → −
n .( ∇ b + I ) = −λ →
α αβ α
−
n .( ∇ b + I )
β αβ β
→
−
A periodic boundary condition is imposed to b α and to the geometry.
System resolution
Once discretized, the equation systems can be written as Ax = b, A being a sparse, symmetric matrix.
Figure 17.46: Removal of voxels belonging to a conductig material but surrended with insulator material.
• Right click on 10mc3_200.Labels and select XLab Simulations > Thermal Conductivity
Experiment Simulation.
The default parameters simulate an experiment along the Z axis with an input temperature of 298 K
and an output temperature of 273 K. The options can be modified to simulate several experiments.
For example, the direction of the thermal flux can be adjusted to X, Y or Z direction (default is Z). If
several directions are selected, the computations will be done successively. The boundary conditions
of the experiment can also be modified. Two values among three must be imposed: input temperature,
output temperature, heat flux. Modifying these values will not change the thermal conductivity, which
is intrinsic to the material. It will only modify the output temperature field.
The spreadsheet containing all the relevant information can be visualized by selecting it in the Project
View and clicking on the Show button (in the Properties area). See Figure 17.48. A spreadsheet can
be exported into several formats (CSV, XML, txt for example).
• Hide all current display modules, such as Bounding Box or Ortho Slice, by clicking on their
viewer toggle.
• Right click on 10mc3_200.TemperatureZ and select Display > Ortho Slice.
• In the Ortho Slice properties, change the selected colormap to temperature.icol from the Edit
menu.
• Select the Edit menu of the colormap again, select Adjust range.
• In the Orientation port, select the yz orientation.
• Zoom on the slice to visualize it.
The resulting visualization should look like Figure 17.49. You can observe the decrease of the temper-
ature from the input of the device (at the bottom of the slice, in yellow), to the output of the device (at
the top of the slice, in light blue). You can also guess that the heat front is moving forward faster in
the phase with the greatest thermal conductivity.
To emphasize this phenomenon, we will use some other display tools.
Now it is easier to visualize the particules of phase Inside and the influence of their higher thermal
conductivity on the heat front.
The aspect of the isosurface contours highlights the fact that the heat front is moving forward faster in
the particules of phase Inside. (If this is not obvious, you can use a Volume Rendering to help visualize
the particules in 3D).
• Set the Clipping Plane Orientation to yz and the position to 51 in the Translate port.
• In the Properties area of the Isocontour Slice, set the Values range to 273, 298 and the number
of lines to 30.
• Set the line width to 1 from the Parameters port.
Again, the heat front, represented by the isolines, obviously moves faster in the particules of phase
Inside.
The resulting visualization should look like Figure 17.50.
• Right click on 10mc3_200.Labels and select XLab Simulations > Thermal Conductivity
Tensor Calculation.
• Connect the ROI Box to the ROI input connection of the Thermal Conductivity Tensor Calcula-
tion module.
• In the Conducting Materials port, check the boxes for both of the two phases.
• Set the thermal conductivity of phase Inside to 1000 W.m−1 .K −1 in the Thermal Conductivity
port, and leave the thermal conductivity of phase Exterior (corresponding to the void space) to
the default value 1 W.m−1 .K −1 .
• Click on Apply.
With these parameters, the module will compute the full intrinsic thermal conductivity tensor. A full
tensor computation requires three computations, each equivalent in time and memory consumption to
one experiment simulation.
Note that the temperature field output is not selected by default. This output corresponds to the ~b
vector, solution of the vectorial problem derived from the Fourier’s equation with the homogeneization
approach (see Avizo XLab Thermo Pack theory pages). It is used in the computation of the effective
thermal conductivity but its visualization is hard to interpret.
A spreadsheet can be exported into several formats (CSV, XML, txt for example).
Figure 17.51: Tables of the spreadsheet containing the main results of the Thermal Conductivity Tensor Calculation computa-
tion.
The first model we study is a periodic array of non-touching 3d cylinders, as displayed on Figure 17.52.
The cylinders are refered to as the β-phase and the material surrending the cylinders as the α-phase.
In Ochoa-Tapia et al. (1994), the following analytical estimation of the effective thermal conductivity
of an array of non-touching cylinders in series distribution (where the two phases are thermally in
series with respect to the direction of the heat flux) is given:
2Λ − α (Λ − 1)
Λef f =
2 + α (Λ − 1)
In Perrins et al. (1979), analytical estimations of the effective thermal conductivity are gathered in a
table of values of conductivities for square arrays of cylinders with various conductivities ratio Λ and
volume fractions.
We apply the formula by Ochoa-Tapia et al. to our model, where α = 0.49, and we compare it with the
results obtained from both Avizo experiment simulation and tensor computation and with the values
of thermal conductivity given in Perrins et al. for α = 0.5 (as 0.49 is not in the table):
We observe a good agreement between the analytical estimations and the simulations.
Λef f = α + (1 − α )Λ
We apply the formula to our model, where α = 0.49, and we compare it with the results obtained from
Avizo experiment simulation and tensor computation:
Again, we observe a good agreement between the analytical estimation and the simulations.
Whitaker (1999) reports the results computed by Nozad et al. (1985) for a simple two-dimensional
square unit cells periodic array and shows that the results obtained are similar to those of Perrins et
al. (1979). On Figure 17.53 we compare Nozad et al. results of Λef f w.r.t. Λ for various α values
with Avizo simulations and see that this last curve is well located and has a correct behavior. Only one
curve is displayed for both Avizo experiment simulation and tensor computation as their results are
almost equal.
Figure 17.53: Comparison between Avizo simulation and Nozad et al. computation of thermal conductivity.
The second model we study is a periodic array of non-touching 3d spheres, as displayed on Figure
17.54. The spheres are refered to as the β-phase and the material surrending the spheres as the α-
phase.
Maxwell (1881) obtained the following expression for the thermal conductivity of a packed-sphere bed
where the spheres are sufficiently apart that they do not interact:
3Λ − 2α (Λ − 1)
Λef f =
3 + α (Λ − 1)
Meredith and Tobias (1960) gave an analytical expression for the same problem:
We apply the two formula to our model, where α = 0.64, and we compare it with the results obtained
from both Avizo experiment simulation and tensor computation:
We observe a good agreement between the analytical estimations and the simulations.
The third model we study is a periodic array of 3d spheres with particle-particle contact, as displayed
on Figure 17.55. The contact surface is controled by the ratio between the contact size and the spheres
radius. The spheres are refered to as the β-phase and the material surrending the spheres as the α-
phase.
Figure 17.55: Two spheres in particle-particle contact extracted from a periodic array.
Whitaker (1999) reports the results computed by Nozad et al. (1985) on a two-dimensional square
array with particle-particle contact. In there study Nozad et al. compared those results with experi-
mental measurements on a narrow range of porosities (α in [0.39, 0.41]). The theory and experiment
agreed well, despite the important differences between their characteristics. Based on this observation,
we compare Nozad et al. computational results with Avizo simulations on our model, where α =
0.51. Only one curve is displayed for both Avizo experiment simulation and tensor computation as
their results are almost equal.
We observe that Avizo curve behavior is correct and its position w.r.t. the other curves is mostly
acceptable.
The last model we study is a periodic bilaminar composit material, as displayed on Figure 17.57. The
thinest layers material is refered to as the β-phase and the other material as the α-phase. We define r,
the thickness ratio between the layers. The stratification is supposed to be in the Z direction.
Auriault (2009) presents an analytical expression of the effective thermal conductivity tensor for such
a bilaminar material:
rλα + (1 − r)λβ 0 0
→
−
→
−
λ ef f = 0 rλα + (1 − r)λβ 0
λα λβ
0 0 rλα +(1−r)λβ
We compare the analytical expression with the result of Avizo tensor computation for two pairs of
thickness ratio and thermal conductivity ratio:
The results obtained through Avizo tensor computation are in perfect agreement with the analytical
expression.
Bibliography:
1. Maxwell J.C., Treatise on Electricity and Magnetism, Vol. I, 2nd edition, Clarendon Press,
Oxford, 1881
2. Meredith R.E., Tobias C.W., Resistance to potential flow through a cubical array of spheres, J.
Applied Phys., Vol. 31, 1270-1273, 1960
3. Nozad I., Carbonell R.G., Whitaker S., Heat conduction in multiphase systems I: Theory and
experiment for two-phase systems, Chem. Engng. Sci. 40, 843-855, 1985
4. Ochoa-Tapia J.A., Stroeve P., Whitaker S., Diffusive transport in two-phase media: Spatially
periodic models and Maxwell’s theory for isotropic and anisotropic systems, Chem. Engng.
Avizo XSkeleton Pack gathers a set of powerful tools for analysis of network or tree-like structures in
3D images such as porous, dentritic, vascular, fractured or fibrous networks.
The 3D image must first be segmented into a label or binary image. Avizo offers for this a rich set
of tools, including the Segmentation Editor, as well as advanced image processing tools available in
Avizo Fire Edition. With skeletonization tools, the labeled regions can then be thinned to a 1-voxel
thickness skeleton, equidistant to shape boundaries according to a Distance Map that can be computed
by Avizo. The image skeleton can be converted into a geometrical Spatial Graph for further analysis.
In this chapter you will learn how to:
To follow the tutorial below you should be familiar with the basic concepts of Avizo. In particular
you should be able to load files, to interact with the 3D viewer, and to connect display modules to
data modules. All these issues are discussed in the chapter 3 - Getting Started. For actual use of
skeletonization with your data, you may need also to be familiar with image filtering and segmentation
(see chapter 4 - Images and Volumes Visualization and Processing in Avizo). Further related tools can
also be found in Avizo Fire Edition (see Avizo Fire Edition User’s Guide).
18.1 Getting started with Avizo XSkeleton Pack: the Auto Skele-
ton module
The Auto Skeleton module extracts from image data the centerline of interconnected regions such as
filamentous structures. The module works on segmented images (label fields) as well as on grayscale
images, in which case the image is segmented on the fly with a user defined threshold value. The
module basically wraps up a couple of single compute modules that have to be executed in sequence. It
first calculates a distance map of the segmented image (Distance Map For Skeleton), and then performs
a thinning of the labelfield such that finally a string of connected voxels remains (Thinner).
Let’s extract the skeleton of porosity network in a fractured rock core sample dataset:
• Choose File / Open Data... from the File menu and load the file
data/core/coreSample.am from the Avizo root directory
• Attach an Auto Skeleton module to the dataset by selecting Image Morphology / Auto Skeleton
in the data context menu.
• Adjust the Threshold port of Auto Skeleton module to 27. Leave other ports to their default
settings. See Figure 18.1.
• Press the Apply button to start the processing.
• You may also attach some Display module to coreSample.am such as Image Ortho Projec-
tions.
The Auto Skeleton module automatically converts the voxel skeleton to a Spatial Graph object. A
Spatial Graph consists of nodes and segments where nodes are the branching points and endpoints,
and segments are the curved lines connecting the nodes. The three dimensional course of a segment is
given by a sequence of points in 3D space. A set of nodes connected by segments is called a graph.
A Spatial Graph data object can store several graphs. Furthermore, Spatial Graph objects can hold
scalar values such as the thickness.
The Spatial Graph is created by Auto Skeleton with a Trace Lines module. Lines may appear jagged
because they connect centers of voxels. By default, Auto Skeleton smoothes the graph lines with a
Smooth Line Set module. Smoothing can be adjusted or disabled. With the default Option port setting
Create SpatialView, a Spatial Graph View module is attached to display it.
The distance to the nearest boundary (boundary distance map) is stored at every point in the Spatial
Graph object as he thickness attribute (using Eval On Lines).
Note: The thickness attribute is computed by the Auto Skeleton module as a discrete chamfer distance
multiplied (by default) by 1/3 of voxel size, with a minimum of half voxel size. This may be used
as an estimate of the local thickness. Optionally a distance map data can define a data parameter
ChamferMapScaleFactor used to adjust thickness attribute (see details in Eval On Lines).
Tip: It may be useful to resample the data to an isotropic voxel size, before using Auto Skeleton module
Getting started with Avizo XSkeleton Pack: the Auto Skeleton module 575
(Resample). This optional step may improve the result of the distance map and skeletonization process,
and may lead to a smoother spatial graph. Depending on the initial voxel aspect ratio, this may however
increase significantly the data size, unless subsampling is used in some direction.
Note: You may notice some star-shaped sets of connected segments in the spatial graph. This may
happen, for example, when the segmentation resulted in a background boundary surrounding a very
small area - like a solid region hanging fully surrounded by void. This may be the sign of too much
noise in the data which would require cleanup processing, such as a Gaussian filter, median filter, or
more advanced filters of Avizo Fire Edition. Such solid islands in segmentation may also be eliminated
by using the segmentation editor or morphological tools.
Tip: In the case of a strict tree topology it may be advantageous to restrict the search to a tree. You
may want to use the module Centerline Tree to extract a graph with guaranteed tree topology. Note that
Centerline Tree cannot apply directly to a gray image but only to segmented image data: it requires a
label field as input.
• For this, select the data module and select Save Data As... in File menu or data object context
menu.
Parameters {
ContentType "HxSpatialGraph"
}
0 0
0 1
<...>
@3
7
4
<...>
@4
0.637795 0.188976 0.0472443
0.635375 0.183291 0.0472443
<...>
@5
0.00393701
0.00393701
<...>
You can get some statistics directly from the Spatial Graph data:
Spatial graph statistics can be saved in several file formats (CSV, XML, TXT).
• Attach a Convert / Spatial Graph To Line Set module to the Spatial Graph data
coreSample.Smt.SptGraph.
• Press the Apply button to create a Line Set.
• Select the created Line Set. In the properties panel, click on Line Set Editor button (see picture
18.6).
Figure 18.6: Properties of a Line Set. The button allowing starting the Line Set Editor is highlighted.
• Hide the Spatial Graph View attached to coreSample.am. This step is necessary due to the
fact that the lines drawn by this module are overlapping the line drawn by the Line Set Editor. It
could cause problems for picking lines and points during the next step.
• Set the 3D viewer window to interaction mode (press ESC or click on the arrow button). You
can now select segments and points of the line set. Corresponding information is displayed in
the console.
• You may also want to see coordinates and image intensity value when picking a point. For this
attach a Measure / Point Probe module to the image data coreSample.am. Disable Show Dragger
in Point options. Make sure that the Point Probe module remains selected in the Project View.
Then, when clicking with middle mouse button on the line set’s displayed points and segments,
the Point coordinates and Current value of input field are displayed. You could also attach the
Point Probe to the distance map data to display the estimated thickness. See the section below
on how to display the distance map data object.
During visualization of large data sets there is often the need to restrict the displayed geometry to a
subvolume of the total data set. The ROI Box can help for that. You can attach it to any spatial data
object. A number of display modules have an input connection called ROI that can be attached to the
ROI Box module to restrict the view.
Figure 18.8: Visualization of the Line Set View reduced to the ROI Box and associated project view.
Figure 18.9 shows an example and the parameters of the Line Set View module.
Figure 18.9: Visualization of the Line Set View reduced to the ROI Box and the parameters of the Line Set View module.
In the viewer, the lines are now displayed as tubes. The thickness is scaled with the data associated
with the lines.
• Right click in the Project View, then on Create Object... and select Images And Fields / Analytic
Scalar Field.
• Select the newly created icon.
• Type z into the Expr field. The Range info is updated to -0.9...0.9.
• Select the Line Set View object,
• Attach its Scalar field 1 input port to the Analytic Scalar Field data object.
• Set the Color Mode port of Line Set View module to Analytic-Scalar-Field
• Use the Colormap port to change colormap and data range. See Figure 18.10 for more details
about the parameters to modify.
Figure 18.10: Parameters modified in the Line Set View module for coloring the tubes.
The Line Set object also provides a Tcl script interface to inquire or modify the data. See chapter 11
for an introduction to Tcl scripting.
It is possible to convert a Line Set back to a Spatial Graph.
• Delete the Line Set View module, the coreSample.Smt.SptGraph-LS spatial graph
(which should also remove the ROI Box), the Analytic Scalar Field data created in
previous steps, the Spatial Graph Statistics module, the Point Probe module, the
coreSample.Smt.statistics data and the Spatial Graph To Line Set module.
• Select Auto Skeleton module.
• In the Properties panel, Expose Objects port, check Distance Map
• In the Properties panel, Options port, uncheck Create SpatialView
• Press the Apply button to process again skeletonization.
• Attach an Ortho Slice to the distance map field coreSample.DistField. Result may look
like Figure 18.12.
Note that the distance map - created by Auto Skeleton with a Distance Map For Skeleton module - is
extended with a 15 voxel border as required by the Thinner module in this version when attached to
data in memory.
• Remove all objects from the Project View (you can right click in the project view, then select
Remove All Objects).
• Choose File / Open Data... from the File menu.
• Load the file data/core/coreSample.am from the Avizo root directory.
• Attach a Multi-Thresholding module to the dataset by selecting Image Segmentation / Multi-
Thresholding in the data context menu.
• Adjust the Exterior-Inside threshold port of Multi-Thresholding module to 27.
• Press the Apply button to create a label field coreSample.Labels.
The Auto Skeleton module internally uses a Image Morphology / Distance Map For Skeleton which in
turn internally creates a Image Morphology / Distance Map module with default settings for chamfer
distance. In addition, Distance Map For Skeleton adds to the data a background border, which is
required by the Thinner module.
We will do this step-by-step using here directly the Image Morphology / Distance Map module. Other
distance maps such as those provided by Avizo Fire Edition could be used in a similar way.
Euclidean distance may be more accurate yet much slower to compute than the Chamfer distance.
Chamfer distance is generally fine for most applications. In particular it makes little difference with
the data used in this tutorial.
The result of a Euclidean distance map is a scalar field with floating point values. The Thinner module
expects the distance map input to use positive short integers. An additional 15 voxels border must also
be added in the current implementation. The following steps are needed to adapt the distance map
data:
• Attach a Thinner module to label by selecting Image Morphology / Thinner in the data context
menu of coreSample.Labels.
• Attach the Distmap input of the Thinner module to coreSample.to-ushort.
• You may check Extended Options in order to reduce the number of branches. The default len of
ends value is 5 with Auto Skeleton module. You can also limit execution time with large complex
data by fixing the number of iterations to perform.
• Press the Apply button to create a thinned image data.
Next, we can build a spatial graph from the skeleton and display it with geometrical information:
• Create a Mosaic by selecting Images And Fields / Mosaic from the Project >Create Object...
menu of the Avizo main window.
A green icon appears. When you select it you see that it contains no bricks (0 bricks). The buttons
below the info line are used to add data objects.
The selected file is added to the Mosaic. The Info port shows the single bricks added. You can visualize
the brick outline with a Mosaic Outline module.
• Create a Mosaic Outline module by right clicking on the Mosaic and selecting Display / Mosaic
Outline from the context menu.
• You may save the data.
• You can check information stored by Mosaic object by clicking on its Data Parameter Editor
button in the Properties panel.
The next step is to create a new Large Disk Data object and sample the brick onto it. With multiple
bricks the overlapping regions could be blended with each other. A border can also be added.
Note: The thinning algorithm expects a black border around the data. The border should be at least
of size len of ends used during thinning (see below). By default a border of 15 voxels on each side in
each dimension. Be sure to check this if you manually set len of ends.
• Attach a Mosaic To Large Disk Data to the Mosaic by right clicking on the Mosaic and selecting
You can see several options in the Properties Area. The default options are fine for the tutorial, while
the border could be set to a lower value.
• You need to set the Filename port to a path to output LDD file. Write access is therefore needed.
If you saved the Mosaic data object on disk, a default filename derived from the mosaic file
location is displayed in the Filename port. You might want to override it.
• Leave the other ports as they are by default and press the Apply button.
A new green icon which represents the new Disk Data data object will appear in the Project View.
After this the brick will be loaded one after the other and will be sampled. This may take some time
for large data.
In the Properties Area some information about the data stored on disk is displayed. Next,
The second box is slightly bigger than the bounding box of the Mosaic. This is due to the border added
by the Mosaic To Large Disk Data module.
• It may be a good idea to clean up the Project View now, but it’s not required. The Mosaic object
is no longer needed.
A new green icon that contains the labels will appear. Connect an Extract Subvolume module to this
new data, click on the buttons Max width, Max height and Max depth to fit the volume to extract to the
complete volume. Finally click on the Apply button. Connect an Ortho Slice to the extracted volume
to visualize the result of the threshold.
You might want to correct the result of the segmentation procedure manually. This might be useful
to fill big vessels or remove uninteresting parts. Avizo has a segmentation editor to perform this task.
Due to the size of the data, you will have to work on subblocks of the whole data set.
In the next step we’ll use Auto Skeleton on disk data.
You could also achieve step-by-step skeletonization, computing distance maps with either Distance
Map For Skeleton or Distance Map On Disk Data module, sing Thinner, Trace Lines and Eval On
Lines manually, in a similar way to processing memory data.
Here is an example showing skeletonization, which uses a script object module that can be attached to
any label field: ”Porosity network reconstructed”, located in demo/core/coreSkeleton.hx, that can be
accessed from Exampleshelp menu (in Rock Core Sample Analysis demos).
Avizo XScreen Pack is an Avizo extension designed to create advanced visualization systems such as:
This chapter, available in the online documentation, describes how to take advantages of tiled displays
and immersive Virtual Reality with Avizo XScreen Pack.
600 Chapter 19: Avizo XScreen Pack User’s Guide
Chapter 20
• Essentials
• The Collaborative Session
• The Shared View
• Installing a Standalone Avizo XTeam Pack Server
602 Chapter 20: Avizo XTeam Pack User’s Guide
Chapter 21
This document describes how to develop custom extensions for the Avizo visualization system. Such
extensions may include file read and write routines, new visualization modules, data objects and other
components. In order to be able to develop custom extensions you will need the developer extension for
Avizo, called Avizo XPand Pack for short. In addition you will need a C++ development environment
like Microsoft Visual Studio on Windows (for details see subsection 21.1.2).
To understand the document you need some basic know-how in C++ programming. Also, you should
be already familiar with the standard Avizo system. If you do not know Avizo yet we recommend that
you go through the tutorials in the Avizo User’s Guide.
Avizo is based on a number of external libraries such as Open Inventor, OpenGL, Qt, and Tcl. This
document does not provide a documentation for these libraries. It merely gives some basic hints where
it is needed to understand the examples. In general, this will be sufficient to write your own standard
I/O routines and Avizo modules. For details, we refer to the original documentation of the external
libraries.
Note: The most recent developer documentation can be found online in the Avizo Documentation
section (http://www.vsg3d.com).
21.1 Introduction to Avizo XPand Pack
Avizo XPand Pack allows you to add to Avizo new components such as file read or write routines,
modules for visualizing data or modules for processing data. New module classes and new data classes
can be defined as subclasses of existing ones.
Note that it is not possible (or possible only to a very limited extent) to change or modify existing
modules or parts of Avizo’s graphical user interface.
In the following sections we
Note: an Avizo project is actually a set of interconnected modules and data objects. In Avizo XPand
Pack programming interface, the Avizo project is often referred as the network or module network, or
the object pool. The pool also refers to Avizo Project View, more specifically the Project Graph View.
Avizo is an object-oriented software system. Besides the core components like the graphical user
interface or the 3D viewers, it contains a large number of data objects, modules, readers and writers.
Data objects and modules are C++ classes, readers and writers are C++ functions.
Instead of being compiled into a single static executable, these components are grouped into packages.
A package is a shared object (usually called .so or .sl on Unix or .dll on Windows) which can be
dynamically loaded by Avizo at run time when needed. This concept has two advantages. On the one
hand, the program remains small since only those packages are loaded which are actually needed by
the user. On the other hand it provides almost unlimited extensibility since new packages can be added
any time without recompiling the main program.
Therefore, in order to add custom components to the Avizo developer version, new packages or shared
objects must be created and compiled. A package may contain an arbitrary number of modules and it
The contents of the Avizo root directory may differ slightly from platform to platform. For example,
on Windows there will be no subdirectory lib. Instead, the compiled shared objects are located under
bin/arch-*-Optimize. The online documentation directory (share/devref/) of Avizo C++
classes does not exist on Windows. Instead, a compressed archive file Avizo.chm is provided and
is accessible by shortcut. This is how a typical Avizo installation directory looks like:
AvizoRoot/.............................................................Avizo installation directory
bin/
arch-*-Debug/........................................Avizo debug binaries (Windows only)
Avizomain.exe .................................. Avizo debug executable (Windows only)
arch-*-Optimize/...............................................Avizo binaries (Windows)
• Start Visual Studio and load the solution file AvizoLocal.vc100.sln from the local Avizo
directory. If your local Avizo directory is not called AvizoLocal, the solution file also has
some other name.
• Build all local packages in debug mode by choosing Build Solution from the Build menu.
• Open a Terminal window and change into the local Avizo directory you created before.
• Type in gmake to build all local packages.
Important note: please refer to system requirements for Mac OSX if an error message like
ld: framework not found CUDA is displayed by the compiler.
We are now ready to start Avizo in order to test the example package. However, because we have
compiled the example package in debug mode, we also need to start Avizo in debug mode. Otherwise,
Avizo would not find the correct DLLs or shared libraries. For Linux, start Avizo with the command
line option -debug. On Windows use the Avizo (debug) shortcut in the start menu. on Mac systems
you can even start immediately the application, the new path will be automatically recognized.
In order to check if the example package has been successfully compiled and can be loaded
by Avizo, you can for example choose the entry Other / DynamicColormap from the Project
>Create Object... menu of the Avizo main window. Then a new colormap object should be
created. You can find the source code of this new object in the local Avizo directory under
src/mypackage/MyDynamicColormap.cpp. In the same directory there is also the header
file for this class.
If you want to compile the example package in release mode, you must change the active configuration
in Visual Studio and recompile the code. On Unix, you have to call gmake MAKE CFG=Optimize.
You can also define MAKE CFG as an environment variable.
The workspace and project files for Visual Studio are generated automatically from the Avizo Package
files by the Development Wizard. There should be no need to change the project settings manually.
By default, Visual Studio will compile in debug mode. In order to generate optimized code, you need
to change the active configuration. This is done by choosing Configuration Manager... from the Build
menu. In the Active Solution Configuration pulldown menu, select Release.
In order to execute the debug mode version of your local packages, you must start Avizo with the
debug Avizomain.exe located in the bin/arch-*-Debug folder. For convenience, a link Avizo
(Debug) is provided in the start menu. However, if you want to debug your code, you need to start
Avizo from Visual Studio. Thus you need to specify the correct executable in the project properties
dialog.
You can bring up the project properties dialog by choosing Properties from the Project
menu. Select Debugging from the left pane. In the field Command, choose the file
bin/arch-<version>-Debug/Avizomain.exe located in the Avizo root directory (see Fig-
ure 21.1). Replace <version> with the version of Avizo you have (see system requirements).
You can now start Avizo from Visual Studio by pressing F5 or by choosing Start from the Debug menu.
In order to debug your code you may set breakpoints at arbitrary locations in your code. For example,
if you want to debug a read routine, set a breakpoint at the beginning of the routine, execute Avizo and
invoke the read routine by loading some file.
If the specified directory does not exist the development wizard asks you whether it should be created.
If you confirm, the directory itself together with some subdirectories will be created. You may also
specify an existing empty directory in the text field. Then the subdirectories will be created in there.
Finally, you may choose an existing directory which has been created by the development wizard
before. In this case a simple check is performed to determine whether the specified directory is valid.
In order to unset the local Avizo directory you should clear the text field and press OK. The directory
will not be deleted, but the next time Avizo is started modules and IO routines defined in the local
Avizo directory will not be available anymore.
Once you have set up the local Avizo directory, the name of the directory is stored permanently, so the
next time Avizo is started the .rc-files located in the subdirectory share/resources of the local
Avizo directory can be read. In this way custom components are made known to Avizo. On Windows
the name of the local Avizo directory is stored in the Windows registry. On Unix systems it is stored in
the file .AvizoRegistry in the user’s home directory. In both cases, these setting can be overridden
by defining the environment variable AVIZO LOCAL.
The development wizard also provides a toggle for copying an example package to the local Avizo
directory. You will get a warning if this button is activated and an existing local Avizo directory
already containing the example package has been specified. The exmaple package is copied to the
subdirectory src/mypackage in the local Avizo directory. It contains all read and write routines
and modules presented as examples in this guide.
The name of a package must not contain any white spaces or punctuation characters. When a package
is added, a subdirectory of the same name is created under src in the local Avizo directory. In this
directory the source code and header files of all the modules and IO routines of the package are stored.
In addition in each package directory there must be a Package file from which the build system files
can be generated.
Initially, a default Package file will be copied into a new package directory. This default file adds the
most common Avizo libraries for linking. It also selects all C++ source files in the package directory
to be compiled. In order to generate the build system from the Package file, please refer to subsection
21.2.9.
In addition to the Package file also the file version.cpp will be copied into a new package direc-
tory. This file allows you to put version information into your package, which can later be viewed in
the Avizo system information dialog. Finally, also an empty file package.rc will be copied into
share/resources. In this file later modules and IO routines will be registered.
Moreover, the name of the file format and the preferred file name extension must be specified. The
extension will be used by the file browser in order to identify the file format. The format name will be
displayed next to any matching file.
Finally, a toggle can be set in order to create the template of a read routine supporting the input of
multiple files. Such a routine will have a slightly different signature. It allows you to create a single
data object from multiple input files. For example, multiple 2D image files can be combined in a single
3D image volume. Details are provided in subsection 21.3.2.3.
After you press OK a new file <name>.cpp will be created in the package directory, where <name>
denotes the name of the read routine. In addition, the read routine will be registered in the package
resource file. Some file formats can be identified by a unique file header, not just by the file name
extension. In such a case you may want to modify the resource file entry as described in subsection
21.3.2.1.
Remember, that after you have added a new read routine to a package you need to recreate the build
system files before you can compile it. Details are described in subsection 21.2.9.
After you press OK, a new file <name>.cpp will be created in the package directory, where <name>
denotes the name of the write routine. In addition, the write routine will be registered in the package
resource file.
Remember, that after you have added a new write routine to a package you need to recreate the build
system files before you can compile it. Details are described in subsection 21.2.9.
set LIBS {
hxplot hxtime hxsurface hxcolor hxfield
hxcore amiramesh mclib oiv tcl
}
set SHARE {
share/resources/mypackage.rc
}
In most cases the default file works well and need not to be modified. However, in order to accomplish
special tasks the default values of the variables can be changed or additional variables can be defined.
Here is a detailed list describing the meaning of the different variables:
PACKAGE
The variable PACKAGE indicates the name of the package. This should be the same as the name of the
package directory. The package name must not contain any characters other than letters or digits.
LIBS
Lists all libraries the package depends on. By default, the most common Avizo packages are inserted
here. You can modify this list as needed. For example, if you want to link against a library called
foo.lib on Windows or libfoo.so on Unix, you should add foo to LIBS.
In addition to a real library name you may use the following aliases in the LIBS variable:
oiv - for the Open Inventor libraries
tcl - for the Tcl library
opengl - for the OpenGL library
qt - for the Qt library
If you want to link against a library only on a particular platform, you can set a dedicated variable
LIBS-arch, where arch denotes the platform. You may further distinguish between the debug and
release version of the code. Here is an example:
set LIBS {mclib amiramesh schedule hxz qt oiv opengl tcl}
set LIBS-Unix {hxgfxinit}
set LIBS-Win {hxgfxinit}
set LIBS-Win-Debug {msvcrtd mpr}
set LIBS-Win-Optimize {msvcrt mpr}
SHARE
Lists all files which should be copied from the package directory into the local Avizo directory. By
default, only the package resource file will be copied. However, you may add additional files here
if necessary. Instead of explicit file names you may use wildcards. These will be resolved using the
standard Tcl command glob. For example, if you have some demo scripts in your package you could
copy them in the following way:
As for the LIBS variable you may append an arch string here, i.e., SHARE-arch. The files then will
only be copied on the specified platforms.
INCLUDES
This variable may contain a list of additional include paths. These paths are used by the com-
piler to locate header files. By default, the include path is set to $AVIZO ROOT/include,
$AVIZO ROOT/include/oiv, $AVIZO LOCAL/src, and the local package directory.
COPY
This may contain a list of files which are copied from a location other than the local package directory.
You need to specify the name of the target file followed by the name of the destination file relative to
the local Avizo directory. For example, you may want to copy certain data files from some archive into
the Avizo directory. This can be achieved in the following way.
set COPY {
D:/depot/data/28523763.dcm data/test
D:/depot/data/28578320.dcm data/test
D:/depot/data/28590591.dcm data/test
}
As for the LIBS variable you may append an arch string here, i.e., COPY-arch. The files then will
only be copied on the specified platforms. A common application is to copy external libraries required
on a particular platform into the Avizo directory.
SRC
This variable specifies the source code files to be compiled for the package. The default value of this
variable is
This means, that By default all .cpp and .c files in the local package directory will be compiled. Some-
times you may want to replace this default by an explicit list of source files.
Again, you may append an arch string to the SRC variable, so that certain files will only be compiled
on a particular platform.
INCSRC
This variable specifies the header files to be included into the Visual Studio package project file. The
default value of this variable is
This means that by default all .h and .hpp files in the local package directory will be considered.
Again, you may append an arch string to the INCSRC variable, so that certain header files will only be
considered on a particular platform.
The full source code of the read routine is contained in the example package provided with Avizo
XPand Pack. In order to follow the example below, first create a local Avizo directory using the
Development Wizard. Be sure that the toggle copy example package is activated, as described
in subsection 21.2.2. The read routine can then be found in the local Avizo directory under
src/mypackage/readppm3d.cpp.
Let us first take a look at the commented source code of the reader. Some general remarks follow
below.
#include <hxcore/HxMessage.h>
#include <hxfield/HxUniformScalarField3.h>
#include "api.h"
if (!f) {
theMsg->ioError(filename);
return 0; // indicate error
}
The source file starts with some includes. First, the file HxMessage.h is included. This header file
provides the global pointer theMsg which allows us to print out text messages in the Avizo console
window. In our read routine we use theMsg to print out error messages if a read error occurred.
Next, the header file containing the declaration of the data class to be created is included, i.e., HxUni-
formScalarField3.h. As a general rule, every class in Avizo is declared in a separate header file. The
name of the header file is identical to the name of the C++ class.
Finally, the file api.h is included. This file provides import and export storage-class specifiers for
Windows systems. These are encoded in the macro MYPACKAGE API. On Unix systems this macro
is empty and can be omitted.
The read routine itself takes one argument, the name of the data file to be read. It should return 1 on
success, or 0 if an error occurred and no data object could be created. The body of the read routine
is rather straightforward. The file is opened for reading. The size of the image volume is read. A
new data object of type HxUniformScalarField3 is created and the rest of the data is written into the
data object. Finally, the file is closed again and the data object is put into the Project View by calling
HxData::registerData. In principle, all read routines look like this example. Of course, the
type of data object being created and the way that this object is initialized may differ.
In order to make the new read routine known to Avizo, an entry must be added to the package resource
file, i.e., to the file mypackage/share/resources/mypackage.rc. In our case this entry
looks as follows:
The dataFile command registers a new file format called PPM3D Demo Format. The option
-header specifies a regular expression which is used for automatic file format detection. If the
first 64 bytes of a file match this expression, the file will be automatically loaded using this read rou-
tine. Of course, some data formats do not have a unique file header. In this case, the format may also
be detected from a standard file name extension. Such an extension may be specified using the -ext
option of the dataFile command. Multiple extensions can be specified as a comma-separated list.
The actual C++ name of the read routine is specified via -load. Finally, the package containing the
read routine must be specified using the -package option.
If you have compiled the example in the mypackage example package, you can try to load the example
You can find the full source code of the reader in the local Avizo directory under
src/mypackage/readtrimesh.cpp. Remember that the example package must have been
copied into the local Avizo directory before compiling. For details, refer to subsection 21.2.2. Let
us now look at the complete read routine before discussing the details:
/////////////////////////////////////////////////////////////////
//
// Read routine for the Trimesh file format
//
/////////////////////////////////////////////////////////////////
#include <McStringTokenizer.h>
#include <hxcore/HxMessage.h>
#include <hxsurface/HxSurface.h>
#include <hxsurface/HxSurfaceField.h>
#include "api.h"
if (!fp) {
theMsg->ioError(filename);
return 0;
}
char buffer[256];
fgets(buffer,256,fp); // read first line
if (nPoints<0 || nTriangles<0) {
theMsg->printf("Illegal number of points or triangles.");
fclose(fp);
return 0;
}
surface->points.resize(nPoints);
surface->triangles.resize(nTriangles);
fgets(buffer,256,fp);
McStringTokenizer tk(buffer);
McDArray<HxSurfaceField*> fields;
if (fields.size()) {
// Read data values for all fields
for (i=0; i<nPoints; i++) {
fgets(buffer,256,fp);
tk = buffer;
for (j=0; j<fields.size(); j++) {
int n = fields[j]->nDataVar();
float* v = &fields[j]->dataPtr()[i*n];
for (k=0; k<n; k++)
v[k] = atof(tk.nextToken());
}
}
The first part of the read routine is very similar to the PPM3D reader outlined in the previous section.
Required header files are included, the file is opened, the number of points and triangles are read, and
a consistency check is performed.
Then an Avizo surface object of type HxSurface is created. The class HxSurface has been devised to
represent an arbitrary set of triangles. The triangles are organized into patches. A patch can be thought
Most of the options of the dataFile command have already been explained in the previous section.
However, in contrast to the PPM3D format, the Trimesh format cannot be identified by its file header.
Therefore, we use the -ext option to tell Avizo that all files with file name extensions trimesh or tm
should be opened using the Trimesh reader.
Reading Multiple Images At Once The Avizo file browser allows you to select multiple files at
once. Usually, all these files are opened one after the other by first determining the file format and then
calling the appropriate read routine. However, in some cases the data of a single Avizo data object
are distributed among multiple files. The most prominent example is 3D images where every slice is
stored in a separate 2D image file. In order to be able to create a full 3D image, the file names of all
the individual 2D images must be available to a read routine. To facilitate this, read routines in Avizo
can have two different signatures. Besides the ordinary form
int myreader(const char* filename);
In both cases exactly the same dataFile command can be used in the package resource file. Avizo
automatically detects whether a read routine takes a single file name as an argument or multiple ones.
In the latter case, the read routine is called with the names of all files selected in the file browser,
provided all these files have the same file format (if multiple files with different formats are selected,
the read routine for each format is called with the matching files only). You can create the template of
a multiple files read routine by selecting the toggle create reader for multiple files in the Development
Wizard (see subsection 21.2.7).
The Load Command The current state of the Avizo project with all its data objects and modules can
be stored in a script file. When executed, the script should restore the Avizo project again. Of course,
this is a difficult task especially if data objects have been modified since they have been loaded from
files. However, even if this is not the case, Avizo must know how to reload the data later on.
For this purpose a special parameter called LoadCmd should be defined for the data object. This pa-
rameter should contain a Tcl command sequence which restores the data object on execution. Usually,
the load command is simply set to load <filename> when calling HxData::registerData.
However, this approach fails if the format of the file cannot be detected automatically, or if multiple
data objects are created from a single file, e.g., as in our Trimesh example.
In such cases the load command should be set manually. In case of the Trimesh reader, this could
be done by adding the following lines of code at the very end of the routine just before the method’s
returning point:
QString loadCmd = QString("set TMPIO [load -trimesh %1]\n"
"lindex $TMPIO 0").arg(filename);
surface->setLoadCmd(loadCmd,1);
Using Dialog Boxes in a Read Routine In some cases a file cannot be read successfully unless
certain parameters are interactively specified by the user. Usually this means that a special-purpose
dialog must be popped up within the read routine. This is done, for example, when raw data are read
in Avizo. In order to write your own dialogs, you must use Qt, a platform-independent toolkit for
designing graphical user interfaces. Qt is included with Avizo XPand Pack under LGPL licensing, so
that you can easily use it to create custom dialogs in Avizo.
If you don’t want to use Qt, you may consider implementing your read routine within an ordinary
module. Although this somewhat breaks Avizo’s data import concept, it will work too, of course. You
then can utilize ordinary ports to let the user specify required import parameters.
#include <hxcore/HxMessage.h>
#include <hxfield/HxUniformScalarField3.h>
#include "api.h"
MYPACKAGE_API
int writeppm3d(HxUniformScalarField3* field, const char* filename)
{
if (!f) {
theMsg->ioError(filename);
return 0; // indicate error
}
// Write header:
fprintf(f, "# PPM3D\n");
At the beginning, the same header files are included as in the reader. HxMessage.h provides the global
pointer theMsg which allows us to print out text messages in the Avizo console window. HxUni-
formScalarField3.h contains the declaration of the data class to be written to the file. Finally, api.h
provides import and export storage-class specifiers for Windows systems. These are encoded in the
macro MYPACKAGE API. On Unix systems, this macro is empty and can be omitted.
The signature of a write routine differs from that of a read routine. It takes two arguments, namely a
pointer to the data object to be written to a file, as well as the name of the file. Before a write routine
is called, Avizo always checks if the specified file already exists. If this is the case, the user is asked
if the existing file should be overwritten. Therefore, such a check need not to be coded again in each
write routine. Like a read routine, a write routine should return 1 on success, or 0 if an error occurred
and the data object could not be saved.
The body of the write routine is almost self-explanatory. At the beginning, a check is made whether
the 3D image really consists of byte data. In general, the type of data values of such an image can
be 8-bit bytes, 16-bit shorts, 32-bit integers, floats, or doubles. If the image does contain bytes, a file
The option -save specifies the name of the write routine. The option -type specifies the C++ class
name of the data objects which can be saved using this format. Note that an export format may be
registered for multiple C++ objects of different type. In this case multiple -type options should be
specified. However, for each type there must be a separate write routine with a different signature
(polymorphism). For example, if we additionally want to register the PPM3D format for objects of
type HxStackedScalarField3, we must additionally implement the following routine:
Besides the standard data classes, there are so-called interface classes that may be specified with the
-type option. For example, in this way it is possible to implement a generic writer for n-component
regular 3D fields. Such data is encapsulated by the interface HxLattice3. For more information about
interfaces, refer to section 21.5.
At this point you may try to compile and execute the write routine by following the instructions given
in subsection 21.1.5 (Compiling and Debugging).
#include <hxcore/HxMessage.h>
#include <hxsurface/HxSurface.h>
#include <hxsurface/HxSurfaceField.h>
#include "api.h"
static
int writetrimesh(HxSurface* surface,
McDArray<HxSurfaceField*> fields, const char* filename)
{
FILE *f = fopen(filename, "w");
if (!f) {
theMsg->ioError(filename);
return 0;
}
int i,j,k;
McDArray<McVec3f>& points = surface->points;
McDArray<Surface::Triangle>& triangles = surface->triangles;
fclose(f); // done
return 1;
}
MYPACKAGE_API
int writetrimesh(HxSurface* surface, const char* filename)
{
// Temporary array of surface data fields
McDArray<HxSurfaceField*> fields;
MYPACKAGE_API
int writetrimesh(HxSurfaceField* field, const char* filename)
{
// Check if data is defined on nodes
if (field->getEncoding() != HxSurfaceField::OnNodes) {
theMsg->printf("Data must be defined on nodes.");
return 0;
}
In the upper part of the code, first a static utility method is defined which takes three arguments: a
pointer to a surface, a dynamic array of pointers to surface fields, and a file name. This is the function
that actually writes the data to a file. Once you have understood the Trimesh reader presented in
subsection 21.3.2.2, it should be no problem to follow the writer code too.
In the lower part of the code, two write routines mentioned above are defined, one for surfaces and the
other one for surface fields. Since these routines are to be exported for external use, we need to apply
the package macro MYPACKAGE API, at least on Windows.
Let us now look more closely at the surface writer. This routine first collects all sur-
In order to compile and execute the write, please follow the instructions given in subsection 21.1.5
(Compiling and Debugging).
21.3.4 Use the AmiraMesh API to read and write files in Avizo format
Besides many standard file formats, Avizo also provides its own native format called Avizo format.
The Avizo file format is very flexible. It can be used to save many different data objects including
image data, finite-element grids, and solution data defined on such grids. Among other features it
supports ASCII or binary data encoding, data compression, and storage of arbitrary parameters. The
format itself is described in more detail in the reference section of the users guide. In this section
we want to discuss how to save custom data objects in Avizo format. For this purpose a special C++
utility class called AmiraMesh is provided. Using this class, reading and writing files in Avizo format
becomes very easy.
Below we will first provide an overview of the AmiraMesh API. After that, we present two simple
examples. In the first one we show how colormaps are written in Avizo format. In the second one we
show how such colormaps are read back again.
21.3.4.1 Overview
The AmiraMesh API consists of a single C++ class. This class is called AmiraMesh. It is defined
in the header file include/amiramesh/AmiraMesh.h located in the Avizo root directory. The
class is designed to completely represent the information stored in an Avizo file in memory. When
reading a file first an instance of an AmiraMesh class is created. This instance can then be interpreted
and the data contained in it can be copied into a matching Avizo data object. Likewise, when writing
a file, first an instance of an AmiraMesh class is created and initialized with all required information.
Then this instance is written to file simply by calling a member method.
This method is called whenever the ContentType parameter matches the one the read method is reg-
istered for. The reader should create an Avizo data object from the contents of the AmiraMesh class.
The filename can be used to define the name of the resulting data object. In order to register an Avizo
read routine, a statement similar to the following one must be put into the package resource file:
AvizoFormat -ContentType "MyType" \
-load "readMyAvizoFile" \
-package "mypackage"
AmiraMesh m;
m.parameters = map->parameters;
m.parameters.set("MinMax", 2, minmax);
m.parameters.set("ContentType", "Colormap");
AmiraMesh::Location* loc =
new AmiraMesh::Location("Lattice", 1, &size);
m.insert(loc);
if ( !m.write(filename,1) ) {
theMsg->ioError(filename);
return 0;
}
setLoadCmd(filename);
return 1;
}
In the first part of the routine a variable m of type AmiraMesh is defined. The parameters of the
colormap are copied into m. In addition, two more parameters are set. The first one, called MinMax,
describes the coordinate range of the colormap. The second one indicates the content type of the Avizo
file. This parameter ensures that the colormap can be read back again by a matching Avizo read routine
(see subsection 21.3.4.3).
Before the RGBA data values can be stored, a Location of the right size must be created and
inserted into the AmiraMesh class. Afterwards, an instance of a Data class is created and inserted.
The constructor of the Data class takes a pointer to the Location as an argument. Moreover, a
pointer to the RGBA data values is specified. Each RGBA tuple consists of four numbers of type float.
int HxColormap256::readAmiraMesh(AmiraMesh* m,
const char* filename)
{
for (int i=0; i<m->dataList.size(); i++) {
AmiraMesh::Data* data = m->dataList[i];
if (data->location()->nDim() != 1)
continue;
if (data->dim()<3 || data->dim()>4)
continue;
switch (data->primType()) {
case McPrimType::mc_uint8: {
unsigned char* src =
(unsigned char*) data->dataPtr();
for (int k=0; k<size; k++, src+=dim) {
float a = (dim>3) ? (src[3])/255.0 : 1;
colormap->setRGBA(k, src[0]/255., src[1]/255.,
src[2]/255., a);
} } break;
case McPrimType::mc_float: {
float* src = (float*) data->dataPtr();
for (int k=0; k<size; k++, src+=dim) {
float a = (dim>3) ? src[3] : 1;
colormap->setRGBA(k, src[0], src[1], src[2], a);
} } break;
}
HxData::registerData(colormap, filename);
return 1;
}
return 0;
Compared to the write routine, the read routine is a little bit more complex since some consistency
checks are performed. First, the member dataList of the AmiraMesh structure is searched for a
one-dimensional array containing vectors of three or four elements of type byte or float. This array
should contain the RGB or RGBA values of the colormap. If a matching Data structure is found, a
new instance of type HxColormap256 is created. The parameters are copied from the AmiraMesh
class into the new colormap. Afterwards, the actual color values are copied. Although the write routine
only exports RGBA tuples of type float, the read routine also supports byte data. For this reason two
different cases are distinguished in a switch statement. If the file only contains 3-component data, the
opacity value of each colormap entry is set to 1. Finally, the coordinate range of the colormap is set by
evaluating the 2-component parameter MinMax, and the new colormap is added to the Project View by
calling HxData::registerData.
#include <hxcore/HxCompModule.h>
#include <hxcore/HxPortFloatTextN.h>
#include "api.h"
public:
// Every module must have a default constructor.
MyComputeThreshold1();
#endif
As usual in C++ code, the file starts with a define statement that prevents the contents of the file from
being included multiple times. Then three header files are included. HxCompModule.h contains the
/////////////////////////////////////////////////////////////////
//
// Example of a compute module (version 1)
//
/////////////////////////////////////////////////////////////////
#include <QApplication>
#include <hxcore/HxMessage.h>
#include <hxfield/HxUniformScalarField3.h>
#include <mypackage/MyComputeThreshold1.h>
MyComputeThreshold1::MyComputeThreshold1() :
HxCompModule(HxUniformScalarField3::getClassTypeId()),
portRange(this,"range",QApplication::translate("MyComputeThreshold1", "Range"),2)
// we want to have two float fields
{
}
void MyComputeThreshold1::compute()
{
// Access the input data object. The member portData, which
// is of type HxConnection, is inherited from HxModule.
HxUniformScalarField3* field =
(HxUniformScalarField3*) portData.source();
// Now loop through the whole field and count the pixels.
int belowCnt=0, aboveCnt=0;
for (int k=0; k<dims[2]; k++) {
for (int j=0; j<dims[1]; j++) {
for (int i=0; i<dims[0]; i++) {
// This function returns the value at the specific
// grid node. It implicitly casts the result
// to float if necessary.
float value = field->evalReg(i,j,k);
if (value<minValue)
belowCnt++;
else if (value>maxValue)
aboveCnt++;
}
}
}
Following the include statements and the obligatory HX INIT CLASS macro, the constructor is de-
fined. The usual C++ syntax must be used in order to call the constructors of the base class and the
class members. The constructor of the base class HxCompModule takes the class type of the input
data object to which this module can be connected. Avizo uses a special run-time type information
system that is independent of the rtti feature provided by the newer ANSI C++ compilers.
The second method we have to implement is the compute method. We first retrieve a pointer to
our input data object through a member called portData. This port is inherited from the base
class HxModule, i.e., every module has this member. The port is of type HxConnection and it
is represented as a blue line in the user interface (if connected). The rest of the compute method is
rather straightforward. The way the actual data are accessed and how the computation is performed,
of course, is highly specific to the input data class and the task the module performs. In this case we
simply loop over all voxels of the input image and count the number of voxels below the minimum
value and above the maximum value. In order to access a voxel’s value, we use the evalReg method.
This method is provided by any scalar field with regular coordinates, i.e., by any instance of class
HxRegScalarField3. Regardless of the primitive data type of the field, the result will always be
cast to float.
Compile the mypackage example package and restart Avizo. Instructions for compiling lo-
cal packages are provided in subsection 21.1.5 (Compiling and Debugging). Load the file
motor.am from Avizo ‘s data/tutorials directory. Open the data popup menu and click
This creates a new instance of type HxUniformScalarField3 with the same dimensions and the
same primitive data type as the input data object. Since the output has the same bounding box, i.e.,
the same voxel size as the input, we copy the bounding box. Note that this approach will only work
for fields with uniform coordinates. For other regular coordinate types such as stacked or curvilinear
coordinates, we refer to subsection 21.5.2.
After the output object has been created, its voxel values are not yet initialized. This is done in the
inner part of the nested for-loops. The method set, used for this purpose, automatically performs a
cast from float to the primitive data type of the output field. In summary, the inner part of the for-loop
now looks as follows:
float value = field->evalReg(i,j,k);
float newValue = 0;
if (value<minValue)
belowCnt++;
else if (value>maxValue)
aboveCnt++;
else newValue = value;
output->set(i,j,k,newValue);
Creating a new data object using the new operator will not automatically make it appear in the Project
View. Instead, we must explicitly register it. In a compute module this can be done by calling the
method setResult:
This method adds a data object to the Project View if it is not already present there. In addition,
it connects the object’s master port to the compute module itself. Like any other connection, this
link will be represented by a blue line in the Project View. The master port of a data object may be
connected to a compute module or to an editor. Such a master connection indicates that the data object
is controlled by an ‘upstream’ component, i.e., that its contents may be overridden by the object it is
connected to.
Now that we have created an output object, let us address the progress bar. Although for the test data
set motor.am our threshold operation does not take very long, it is good practice to indicate that the
application is busy when computations are performed that could take long time on large input data.
Even better is to show a progress bar, which is not difficult. Before the time-consuming part of the
compute routine, i.e., before the nested for-loops, we add the following line:
// Turn the application into busy state,
// don’t activate Stop button.
theWorkArea->startWorkingNoStop(QApplication::translate("MyComputeThreshold2",
"Computing threshold"));
We use the global instance theWorkArea of class HxWorkArea here. The corresponding header
file must be included at the beginning of the source file. The method turns the application into
the ‘busy’ state and displays a working message in the status line. As opposed to the method
startWorking, this variant does not activate the stop button. See subsection 21.7.2 for details.
When the computation is done, we must call
theWorkArea->stopWorking(); // stop progress bar
in order to switch off the ‘busy’ state again. Inside the nested for-loops we update the progress bar just
before a new 2D slice is processed. This is done by the following line of code:
// Set progress bar, the argument ranges between 0 and 1.
theWorkArea->setProgressValue((float)(k+1)/dims[2]);
The value of (float)(k+1)/dims[2] progressively increases from zero to one during computa-
tion. Note that you should not call setProgressValue in the inner of the three loops. Each call
involves an update of the graphical user interface and therefore is relatively expensive. It is perfectly
okay to update the progress bar several hundred times during a computation, but not several hundred
thousand times.
Another slight improvement we have incorporated into the second version of our compute module
concerns the range port. In the constructor we have set new initial values for the minimum and
maximum fields. While both values are 0 by default, we now set them to 30 and 200, respectively:
// Set default value for the range port:
portRange.setValue(0,30); // min value is 30
portRange.setValue(1,200); // max value is 200
The getResult method checks whether there is a data set whose master port is connected to the com-
pute module. This typically is the object set by a previous call to setResult. However, it also may
be any other object. Therefore, a run-time type check must be performed by calling the isOfType
member method of the output object. If the output object is not of type HxUniformScalarField3,
the variable output will be set to null. Then a check is made whether the output object has the same
dimensions and the same primitive data type as the input object. If this test fails, output will also
To achieve the desired behavior we finally change our compute method so that it immediately returns
unless the Apply button was pressed. This can be done by adding the following piece of code at the
beginning of the compute method:
// Check whether doIt button was hit
if (!portDoIt.wasHit()) return;
With these changes, the module is already quite usable. Load the test data set motor.am from Avizo’s
data/tutorials directory. Attach the ComputeThreshold3 module from the Local category
inside the data popup menu. Press the Apply button, change the range and press Apply again. Open the
Console window to view results. You may have notice that only one output object has been created in
the Project View. Attach an Ortho Slice module to the result while experimenting with the range (use
the histogram mapping in the Ortho Slice in order to see small changes). Try to detach the connection
between the result and the module and press Apply again: a new ouput is created.
Note: By default, the HxPortDoIt port is not visible in the control panel of its associated module.
Rather, the fact that a module has an HxPortDoIt activates (makes green) the Apply button at the
bottom of the Properties Area. To request display of the DoIt port in the module control panel, check
the Show ”DoIt” buttons box in the Layout tab of the Edit/Preferences dialog.
Finally, some remarks on performance. Although it is probably not critical in this simple example,
performance typically becomes an issue in real-world applications. In the inner-most loop, calling the
#include <Inventor/nodes/SoSeparator.h>
public:
// Constructor.
MyDisplayVertices1();
// Destructor.
˜MyDisplayVertices1();
// Input parameter.
HxPortIntSlider portNumTriangles;
protected:
McHandle<SoSeparator> scene;
};
#endif
The header file can be understood quite easily. First some other header files are included. Then the
new module is declared as a child class of HxModule. As usual, the macros MYPACKAGE API and
/////////////////////////////////////////////////////////////////
//
// Example of a compute module (version 1)
//
/////////////////////////////////////////////////////////////////
#include <QApplication>
#include <hxcore/HxMessage.h>
#include <hxsurface/HxSurface.h>
#include <mypackage/MyDisplayVertices1.h>
#include <Inventor/nodes/SoCube.h>
#include <Inventor/nodes/SoTranslation.h>
HX_INIT_CLASS(MyDisplayVertices1,HxModule)
MyDisplayVertices1::MyDisplayVertices1() :
HxModule(HxSurface::getClassTypeId()),
portNumTriangles(this,"numTriangles",QApplication::translate("MyDisplayVertices1",
"Num Triangles"))
{
portNumTriangles.setMinMax(1,12);
portNumTriangles.setValue(6);
scene = new SoSeparator;
}
MyDisplayVertices1::˜MyDisplayVertices1()
{
hideGeom(scene);
}
void MyDisplayVertices1::compute()
{
int i;
scene->addChild(trans);
scene->addChild(cube);
count++;
q=p[i];
}
}
Of course, we must also include the header file of the class HxPortColormap. This file is located
in package hxcolor. Note that the order in which ports are displayed on the screen depends on
the order in which the ports are declared in the header file. If we declare portColormap before
portNumTriangles, the colormap port will be displayed before the integer slider.
In the compute method of our module we add the following piece of code just after the previous
children of the scene graph have been removed:
SoMaterial* material = new SoMaterial;
material->diffuseColor =
portColormap.getColor(numTriPerVertex);
scene->addChild(material);
With these lines we insert a material node right before all the translation and cube nodes into the sep-
arator. The material node causes the cubes to be displayed in a certain color. We call the getColor
method of the colormap port in order to determine this color. If the port is not connected to a colormap,
this method simply returns the default color. However, if it is connected, the color is taken from the
colormap. As an argument we specify numTriPerVertex, the number of triangles of the selected
vertices. Depending on the value of portNumTriangles, the cubes therefore will be displayed in
different colors. Of course, this requires that the range of the colormap extend from something like 1
to 10 or 12.
Besides the colormap port, we also want to add a Tcl command interface to our module. This is done
by overloading the virtual method parse of HxModule. We therefore insert the following line into
the module’s class declaration:
virtual int parse(Tcl_Interp* t, int argc, char **argv);
In a parse method special commands can be defined which allow us to control the module in a more
sophisticated way. A typical application is to set special parameters which should not be represented
by a separate port in the user interface. As an example, we want to provide a method which allows us
to change the size of the cubes. In the initial version of the module the cubes were adjusted so that each
side was 0.01 times the length of the diagonal of the bounding box of the input surface. The value of
the scale factor shall now be stored in the member variable Scale. In order to set and get this variable,
two Tcl commands setScale and getScale shall be provided. The implementation of the parse
method looks as follows:
int
MyDisplayVertices2::parse(Tcl_Interp* t, int argc, char **argv)
{
if (argc < 2) return TCL_OK;
char *cmd = argv[1];
return TCL_OK;
}
Commands are defined in a sequence of if-else statements. For each command, the macro CMD should
be used. At the end of the if-else sequence the parse method of the base class should be called. Note
that after a command is issued, the compute method of the module will not be called automatically
by default. This is in contrast to interactive changes of ports. However, we may explicitly call fire
in a command like shown above. In this case the size of the cubes then will be adjusted immedi-
ately. You may test the parse method by loading the file mypackage/data/test.surf, attach-
ing DisplayVertices2 to it, and then typing something like DisplayVertices2 setScale
0.03 into the Avizo console window.
The new radio box port lets the user switch between the two display modes. Like the compute method,
the update method takes no arguments and also has no return value.
If you look into the source code file MyDisplayVertices3.cpp you will notice that the radio box
port is initialized in the constructor of the module and that the text labels are set properly. The update
method itself is quite simple:
The slider portNumTriangles is shown or hidden depending on the value of the radio box port.
Note that before the update method is called, all ports are marked to be shown. Therefore you must hide
them every time update is called. For example, the show and hide calls should not be encapsulated
by an if statement which checks if some input port is new.
In order to support the new all-vertices display style, we slightly modify the way the Open Inventor
scene graph is created. Instead of a single SoMaterial node, we insert a new one whenever the
color of a cube needs to be changed, i.e., whenever the number of triangles of a vertex differs from the
previous one. The new for-loop looks as follows:
if (triCount[i]!=lastNumTriPerVertex) {
SoMaterial* material = new SoMaterial;
material->diffuseColor =
portColormap.getColor(triCount[i]);
scene->addChild(material);
lastNumTriPerVertex = triCount[i];
}
scene->addChild(trans);
scene->addChild(cube);
count++;
q=p[i];
}
}
Again, you can test the module by loading the file mypackage/data/test.surf and attaching
DisplayVertices3 to it. If you connect the physics.icol colormap to the colormap port, adjust the
colormap range to 1...9, and select the all-vertices display style, you should get an image similar to the
one shown in Figure 21.10.
#include <hxcore/HxModule.h>
#include <hxcore/HxPortButtonList.h>
#include <hxplot/PzEasyPlot.h> // simple plot window
#include "api.h"
public:
// Constructor.
MyPlotAreaPerSlice();
protected:
McHandle<PzEasyPlot> plot;
};
#endif
The class declaration is very simple. The module is derived directly from HxModule. It pro-
vides a constructor, a compute method, and a port of type HxPortButtonList. In fact, we
will only use a single push button in order to let the user pop up the plot window. The plot
window class PzEasyPlot itself is referenced by a smart pointer, i.e., by a variable of type
McHandle<PzEasyPlot>. We have already used smart pointers in subsection 21.4.2.1, for de-
tails see there.
Now let us take a look at the source file MyPlotAreaPerSlice.cpp:
/////////////////////////////////////////////////////////////////
//
// Example of a plot module (source code)
//
/////////////////////////////////////////////////////////////////
#include <QApplication>
#include <hxcore/HxWorkArea.h>
#include <hxfield/HxLabelLattice3.h>
#include <mypackage/MyPlotAreaPerSlice.h>
HX_INIT_CLASS(MyPlotAreaPerSlice,HxModule)
MyPlotAreaPerSlice::MyPlotAreaPerSlice() :
HxModule(HxLabelLattice3::getClassTypeId()),
void MyPlotAreaPerSlice::compute()
{
HxLabelLattice3* lattice = (HxLabelLattice3*)
portData.source(HxLabelLattice3::getClassTypeId());
int i,k,n;
const int* dims = lattice->dims();
unsigned char* data = lattice->getLabels();
int nMaterials = lattice->materials()->nBundles();
In the constructor the base class HxModule is initialized with the class type ID of the class
HxLabelLattice3. This class is not a data class derived from HxData but a so-called interface.
Interfaces are used to provide a common API for objects not directly related by inheritance. In our case,
MyPlotAreaPerSlice can be connected to any data object providing a HxLabelLattice3 in-
terface. This might be a HxUniformLabelField3 but also a HxStackedLabelField3 or
something else.
Also in the constructor, a new plot window of type PzEasyPlot is created and stored in plot. Then
the method plot->autoUpdate(0) is called. This means that we must explicitly call the update
method of PzEasyPlot after the contents of the plot window are changed. Auto-update should be
disabled when more than one curve is being changed at once.
As usual, the actual work is performed by the compute method. First, we retrieve a pointer to the label
lattice. Since we want to use an interface instead of a data object itself, we must specify the class type
ID of the interface as an argument of the source method of portData. Otherwise we would get a
pointer to the object providing the interface, but we can’t be sure about the type of this object.
The method returns if no label lattice is present or if the plot window is not visible and the show button
has not been pressed. Otherwise, the contents of the plot window are recomputed from scratch. For
this purpose a dynamic array of arrays called count is defined. The array provides a counter for each
material and for each slice of the label lattice. Initially all counters are set to zero. Afterwards, they
are incremented while the voxels are traversed in a nested for-loop.
The actual initialization of the plot window happens subsequently. First, old curves are re-
moved by calling plot->remData. Then, for each material, a new curve is added by calling
plot->putData. Afterwards, plot->update is called. If we had not disabled ‘auto update’
in the constructor, the plot window would have been updated automatically in each call of putData.
The putData method creates a curve with the given name and sets the values. If a curve of the given
name exists, the old values are overridden. The method returns a pointer to the curve which in turn can
be used to set attributes for the curve individually (see below). Finally, the plot window is popped up
and the ‘busy’ cursor we have activated before is switched off again.
To test the module, first compile the example package. For instructions, see subsection 21.1.5 (Compil-
ing and Debugging). Then load the file data/tutorials/motor.labels.am from the Avizo
root directory. Attach PlotAreaPerSlice to it and press the show button. You then should get a
result like that shown in Figure 21.11.
As you would expect, the methods getMinMax, getLabel and getSize are also available with
the same parameter list as their set counterparts.
Finally, it is also possible to have a legend or a grid in the plot. In this case more arguments must be
specified in the constructor of PzEasyPlot:
int withLegend = 1;
int withGrid = 0;
plot = new PzEasyPlot("Area per slice",
withLegend, withGrid);
Like the axis, the legend and the grid are internally represented by separate objects of type
PzLegend and PzGrid. You can access these objects by calling the methods getTheLegend
and getTheGrid. Details about the member methods of these objects are listed in the class refer-
ence documentation.
It will apply 5 times the filter on your data and print the average amount of time required per iteration,
in microseconds.
In order to create a new local Avizo directory, please follow the instructions given in subsection 21.2.2.
In order to compile the example package, please refer to subsection 21.1.5 (Compiling and Debugging).
To create a compute module using CUDA driver API, please refer subsection 21.4.4.2.3.
When a compute module using CUDA API calls is added to an existing package, the LIBS entry of
the Package file must be completed depending on the used API. The keyword to add in the list of
libraries to link with is:
• CUDA C API: cudac;
• CUDA Driver API: cudadrv;
• OpenCL API: opencl;
For example, if the targeted API is CUDA C, the Package file should contain something like:
set LIBS {
hxplot hxtime hxsurface hxcolor hxfield
hxcore amiramesh mclib oiv tcl qt cudac
}
21.4.4.1.1 CPU part Like most other modules, our compute module consists of a header file con-
taining the class declaration as well as a source file containing the actual code (or the class definition).
Let us look at the header file GaussianFilterCudaC.h first:
/////////////////////////////////////////////////////////////////
//
// Example of a convolution filter in CUDA C
//
/////////////////////////////////////////////////////////////////
#ifndef GAUSSIANFILTERCUDAC_H
#define GAUSSIANFILTERCUDAC_H
#include <hxcore/HxCompModule.h>
#include <hxcore/HxPortDoIt.h>
#include "api.h"
// Defined in Convolve2DCudaC.cu
extern "C" cudaError
applyFilter( const unsigned char* h_src,
unsigned char* h_dst,
const float* h_filter,
const int* h_dims,
const int sizeFilter );
public:
// Every module must have a default constructor
GaussianFilterCudaC();
// Destructor
˜GaussianFilterCudaC();
#endif // GAUSSIANFILTERCUDAC_H
As usual in C++ code, the file starts with a define statement that prevents the contents of the file from
being included multiple times. Then two header files are included HxCompModule.h contains the
#include <QApplication>
#include <hxcore/HxMessage.h>
#include <hxcore/HxWorkArea.h>
#include <hxfield/HxUniformScalarField3.h>
#include <mclib/McPrimType.h>
#include "CudaCUtils.h"
#include "GaussianFilterCudaC.h"
HX_INIT_CLASS(GaussianFilterCudaC,HxCompModule)
GaussianFilterCudaC::GaussianFilterCudaC() :
HxCompModule(HxUniformScalarField3::getClassTypeId()),
portAction(this,"action",QApplication::translate("GaussianFilterCudaC", "Action"))
{
portAction.setLabel(0,QApplication::translate("GaussianFilterCudaC", "DoIt"));
}
GaussianFilterCudaC::˜GaussianFilterCudaC()
{
}
void GaussianFilterCudaC::compute()
{
// Check whether Apply button was hit
if (!portAction.wasHit())
return;
// Turn Avizo into busy state, don’t activate the Stop button
theWorkArea->startWorkingNoStop( "Filtering" );
// Register result
setResult( output );
}
Following the include statements, there is the required HX INIT CLASS macro for class initialization.
Next is the constructor definition which calls the constructor of the base class. There are no special
macros for this so the usual C++ syntax is used to call the base class constructor and to initialize the
class members. The constructor of the base class HxCompModule takes the class type of the input
data object to which this module can be connected.
The second method we have to implement is the compute method. We first retrieve a pointer to
our input data object through a member called portData. This port is inherited from the base
class HxModule, i.e. every module has this member. The port is of type HxConnection and it
is represented as a blue line in the user interface (if connected). This filter only accepts unsigned
char images, so we must check the data type.
A new result object is to be created. Whenever the range port is changed afterwards, the existing
result object should be overridden. The output file is of type HxUniformScalarField3. The
getResult method checks whether there is a data set whose master port is connected to the compute
module. However, it also may be any other object. Therefore, a run-time type check must be performed
by calling the isOfType member method of the output object. If the output object is not of type
HxUniformScalarField3, the variable output will be set to null. Then a check is made whether
the output object has the same dimensions and the same primitive data type as the input object. If this
test fails, output will also be set to null. At the end, a new result object will only be created if no result
exists already or if the existing result does not match the input.
Then the Gaussian filter is defined and the applyFilter function is called. The calls
to input->lattice.dataPtr() and output->lattice.dataPtr() allow us to get a
pointer to the data values of the input and output objects. The returned value of this dataPtr
method is of type void*. It must be explicitly cast to the data type the field actually belongs to. The
voxel values itself are arranged without any padding. This means that the index of voxel (i, j, k)
is given by ( k * dims[1] + j ) * dims[0] + i, where dims[0] and dims[1] denote
the number of voxels in the x and y directions, respectively.
After the device computation, the cleanupNoFailure function is called in order to correctly clean
up device memory if there is a CUDA error.
Finally, creating a new data object using the new operator will not automatically make it appear in the
Project View. Instead, we must explicitly register it. In a compute module this can be done by calling
the method setResult. This method adds a data object to the Project View if it is not already present
there. In addition, it connects the object’s master port to the compute module itself. Like any other
connection, this link will be represented by a blue line in the Project View. The master port of a data
object may be connected to a compute module or to an editor. Such a master connection indicates that
21.4.4.1.2 GPU part In GPU programming, it is important to know where a variable is located
in memory (specifically, which section of memory). To make it easier to keep track of this, variable
names are prefixed in the CUDA file with an identifier indicating their memory location:
• h if the variable is in host memory
• d if the variable is in device global memory
• c if the variable is in device constant memory
• s if the variable is in device shared memory
The CUDA file Convolve2DCudaC.cu is the following:
// In constant memory
__constant__ float c_filter[9]; // Convolution filter
__constant__ int c_dims[3]; // Size of data volume
// In shared memory
__shared__ unsigned char s_imageBlock[BLOCK_SIZE + 2][BLOCK_SIZE + 2];
int imageBlockSize = BLOCK_SIZE + 2 * BORDER_SIZE;
// Fill in imageBlock
// Main data
s_imageBlock[iBlock][jBlock] =
getValueDrv(i + threadIdx.x, j + threadIdx.y, d_slice );
if ( iBlock == 1 )
{
// Left border
s_imageBlock[0][jBlock] =
getValueDrv( blockIdx.x * blockDim.x - 1, j + threadIdx.y, d_slice );
s_imageBlock[0][jBlock - 1] =
getValueDrv( blockIdx.x * blockDim.x - 1, j + threadIdx.y - 1, d_slice );
}
else if ( iBlock == BLOCK_SIZE )
{
// Right border
s_imageBlock[imageBlockSize - 1][jBlock] =
getValueDrv( blockIdx.x * blockDim.x + imageBlockSize - 1, j + threadIdx.y,
d_slice );
s_imageBlock[imageBlockSize - 1][jBlock + 1] =
getValueDrv( blockIdx.x * blockDim.x + imageBlockSize - 1, j + threadIdx.y + 1,
d_slice );
}
if ( jBlock == 1 )
{
// Top border
s_imageBlock[iBlock][0] =
getValueDrv( i + threadIdx.x, j - 1, d_slice );
s_imageBlock[iBlock + 1][0] =
getValueDrv( i + threadIdx.x + 1, j - 1, d_slice );
}
else if ( jBlock == BLOCK_SIZE )
This file begins with a definition of two global variables BLOCK SIZE which will be used to size the
grid and blocks and BORDER SIZE. Then, two variables are declared with the constant qual-
ifier, and they will be placed in constant memory. A variable in constant memory must be initialized
by the CPU and it is visible from all threads in read-only. The c filter will contain the convolution
filter and the c dims variable the size of data volume.
Following these declarations, the convolution product is defined in the convolve2D function. This is
a device function, i.e. it must be called from GPU and it is executed on the device. This function
computes the 2D convolution product at the point (i, j) with a 3 ∗ 3 filter.
The getValue function returns the voxel’s value (i, j) of a buffer.
The applyFilterKernel function is called for each voxel. It is defined using the global
qualifier. This means that the function is called from the host and executed on the device. It is a kernel
function, so it must have the void return type.
The initial 3D image is divided in several blocks of size BLOCK SIZE * BLOCK SIZE. Three in-
dexes i, j and k are declared to repair the top left corner of the current slice in d src and to define
d slice.
The s imageBlock buffer is created and placed in shared memory. Then this buffer is filled
in and represents a part of the initial image. The size of this buffer is (BLOCK SIZE + 2) *
(BLOCK SIZE + 2) in order to correctly treat the borders (1 size border around the image because
the convolution filter is a 3 ∗ 3 filter).
The two indexes iBlock and jBlock allow filling in the s imageBlock buffer.
Before using s imageBlock for calculation, we must be sure that this buffer is full, so we use the
syncthreads() function. This function acts as a barrier at which all threads in the block must
wait before any is allowed to proceed. After this, each thread computes one convolution product using
imageBlock.
The last function in this file is the applyFilter function which handles the interaction between the
CPU and GPU.
In order to manage CUDA errors, we first call the cudaGetLastError function which returns the
last error that has been produced by any of the runtime calls in the same host thread and resets it to
CUDA SUCCESS. Several pointers are declared in order to be allocated in GPU memory. They are
allocated in global memory using the cudaMalloc function. The cudaMemcpy function is used
to initialized the d src buffer from host memory. The direction of the transfer is indicated by the
cudaMemcpyHostToDevice flag.
21.4.4.2.1 CPU part A new private function is declared in the header file: applyFilter. This
function allows launching the kernel. In the previous case (CUDA C), this function was defined in
the CUDA file because it used CUDA specified syntax and so must be compiled with nvcc. With the
In the source file, we include cuda.h in order to use the CUDA driver API. All entry points of this
library are prefixed with cu. We also include CudaDrvUtils.h which provides utils for CUDA
driver API use.
#include <cuda.h>
#include "CudaDrvUtils.h"
In the compute method, there is only one modification. In order to launch the kernel, we call the
applyFilter function.
// Compute filtered image
applyFilter( input, output, gaussianFilter );
// Cuda variables
CUdevice cudaDevice; // Cuda device
CUcontext cudaContext; // Cuda context
CUmodule cudaModule; // Cuda module
CUfunction cudaKernel; // Cuda kernel
CUresult cudaError; // Cuda error
int offset = 0;
// Cleanup
cudaError = cuMemFree( d_dst );
cudaError = cuMemFree( d_src );
CudaDrvUtils::cleanupNoFailure( cudaError, cudaContext, CudaDrvUtils::EOL );
We first retrieve the pointer to the data buffers (input and output) and define the nBlocks and
nThreadsPerBlock values which will be used in order to size the grid. The variables begin-
ning with cuda* will be used to create and launch the kernel. We initialize the driver API with the
cuInit function and choose CUDA device with the cuDeviceGet function. In this example, the
selected GPU is the first GPU. The final initialization is performed by the cuCtxCreate function,
which creates a context on the chosen device.
After these initializations, the kernel is loaded from the ptx file. PTX is an intermediate format
which is forward-compatible. To obtain the path to this file, we use the getLocalDir method which
returns the environment variable AVIZO LOCALand the getArchString method which returns the
architecture string, e.g. ”arch-Linux-Optimize”.
Next, the device vectors are declared with the cuMemAlloc function (for the variables which are
in global memory) and the host vectors are copied to device memory. If the variables are placed in
constant memory, they must be declared in the CUDA file and so they must not be allocated here. The
cuModuleGetGlobal function returns the size of these variables which is required to copy vectors
from host to device.
Now, we set up the parameter’s values. The cuFuncSetBlockShape function specifies the x,
y, and z dimensions of the thread blocks that are created when the kernel is launched. Then, the
cuParamSetv function allows copying data into the parameter space of the kernel.We must also
specified the total size needed by the function parameters of the kernel by calling cuParamSetSize
function. The cuLaunchGrid function invokes the kernel grid of blocks whose is given by the
second and third parameters. Each block contains the number of threads specified by the previous call
21.4.4.2.3 Adding a compute module using CUDA driver API It is important to note that in a
same package, you can’t create module using CUDA C and CUDA driver API.
If your package will contained modules using CUDA driver API, you must open the
src/moduleName/Package file in the local Avizo directory and add this line at the end: set
CUDADRV 1.
21.4.4.3.1 CPU part The header file used here is the same as for the previous part (CUDA driver
API).
In the source file, we include CL/opencl.h in order to use OpenCL. All entry points of this library
are prefixed with cl. We also include OpenCLUtils which provides utilities for OpenCL use.
#include <CL/opencl.h>
#include "OpenCLUtils.h"
// OpenCL variables
cl_context clContext; // OpenCL context
cl_program clProgram; // OpenCL program
cl_kernel clKernel; // OpenCL kernel
cl_command_queue clCmdQueue; // OpenCL command queue
cl_platform_id clPlatformID; // OpenCL platform for computation
cl_device_id clDeviceID; // Device ID
cl_int clError;
std::string sourceString;
OpenCLUtils::loadFile( clModulePath.c_str(), sourceString );
const char* clSource = sourceString.c_str();
clProgram = clCreateProgramWithSource( clContext, 1, (const char **) &clSource, 0,
&clError );
OpenCLUtils::cleanupNoFailure( clError, clContext, OpenCLUtils::EOL );
// Launch kernel
clError = clEnqueueNDRangeKernel( clCmdQueue, clKernel, workDim, 0,
nWorkitem, nWorkitemPerWorkgroup, 0, 0, 0 );
OpenCLUtils::cleanupNoFailure( clError, clContext, d_src, d_dst, c_filter, c_dims,
OpenCLUtils::EOL );
// Cleanup
clError = clReleaseMemObject( d_src );
clError |= clReleaseMemObject( d_dst );
clError |= clReleaseMemObject( c_filter );
clError |= clReleaseMemObject( c_dims );
clError |= clReleaseKernel( clKernel );
clError |= clReleaseProgram( clProgram );
clError |= clReleaseCommandQueue( clCmdQueue );
OpenCLUtils::cleanupNoFailure( clError, clContext, OpenCLUtils::EOL );
We first retrieve a pointer to the data buffers (input and output) and define the nWorkitem and
nWorkitemPerWorkgroup which will be used in order to size the grid. OpenCL work-groups are
equivalent to CUDA blocks and OpenCL work-items are equivalent to CUDA threads. OpenCL allows
us to organize work-groups in 3 dimensions, which is better adapted to our use case (i.e. processing
3D data).
The variables beginning with cl* will be used to create and launch the kernel. Then,
we list all the available platforms using clGetPlatformIDs and we choose the first plat-
form with the clGetDevieIDs function. The two functions clCreateContext and
clCreateCommandQueue allows us to initialize the context and the command queue. OpenCL
objects such as memory, program and kernel objects are created using a context. Operations on these
objects are performed using a command queue. The command queue can be used to queue a set of
operations (referred to as commands) in order.
After these initializations, the kernel is loaded from the OpenCL source file. The source code is loaded
using the clCreateProgramWithSource function. In the OpenCL case, the device code is built
on the fly with the clBuildProgram function, so the clModulePath variable contains the path
to the source file Convolve2DOpenCL.cl.
21.4.4.3.2 GPU part Like in CUDA, different memory are available in OpenCL. So, the variables’
names will be prefixed in the openCL file by:
• h if the variable is in host memory
• d if the variable is in device global memory
• c if the variable is in device constant memory
• l if the variable is in device local memory (It is equivalent to the constant memory in CUDA)
This OpenCL code and the previous CUDA code are as much as possible the same. Of course, there are
syntax differences but the structure is nearly the same. The OpenCL file Convolve2DOpenCL.cl
is the following:
/////////////////////////////////////////////////////////////////
//
// Example of a convolution filter in OpenCL
//
/////////////////////////////////////////////////////////////////
#define BLOCK_SIZE 8
#define BORDER_SIZE 1
int idxFilter = 0;
float convolutionProduct = 0;
// (i0, j0, k) repairs the top left corner of the kth slice in d_src
int i0 = get_group_id(0) * get_local_size(0);
int j0 = get_group_id(1) * get_local_size(1);
// In shared memory
__local unsigned char l_imageBlock[BLOCK_SIZE + 2 * BORDER_SIZE]
[BLOCK_SIZE + 2 * BORDER_SIZE]
// Fill in imageBlock
// Main data
l_imageBlock[iBlock][jBlock][kBlock] = getValue(i, j, k, d_src, c_dims);
if ( iBlock == 1 )
{
// Left border
l_imageBlock[0][jBlock][kBlock] =
getValue( i0 - 1, j, k, d_src, c_dims );
l_imageBlock[0][jBlock - 1][kBlock] =
getValue( i0 - 1, j - 1, k, d_src, c_dims );
}
else if ( iBlock == BLOCK_SIZE )
{
// Right border
l_imageBlock[BLOCK_SIZE + 2 * BORDER_SIZE - 1][jBlock][kBlock] =
getValue( i0 + imageBlockSize - 1, j, k, d_src, c_dims );
l_imageBlock[BLOCK_SIZE + 2 * BORDER_SIZE - 1][jBlock + 1][kBlock] =
getValue( i0 + imageBlockSize - 1, j + 1, k, d_src, c_dims );
}
if ( jBlock == 1 )
{
// Left border
l_imageBlock[iBlock][0][kBlock] =
getValue( i, j0 - 1, k, d_src, c_dims );
l_imageBlock[iBlock + 1][0][kBlock] =
getValue( i + 1, j0 - 1, k, d_src, c_dims );
}
else if ( jBlock == BLOCK_SIZE )
{
// Right border
l_imageBlock[iBlock][BLOCK_SIZE + 2 * BORDER_SIZE - 1][kBlock] =
getValue( i, j0 + imageBlockSize - 1, k, d_src, c_dims );
l_imageBlock[iBlock - 1][BLOCK_SIZE + 2 * BORDER_SIZE - 1][kBlock] =
getValue( i - 1, j0 + imageBlockSize - 1, k, d_src, c_dims );
}
barrier(CLK_LOCAL_MEM_FENCE);
This file begin by a definition of two global variables BLOCK SIZE which will be used to size the
grid and blocks and BORDER SIZE. Following these declarations, the convolution product is defined
21.5.1 Introduction
A profound knowledge of the Avizo data objects is essential to developers. Data objects occur as
input of write routines and almost all modules, and as output of read routines and compute modules.
In the previous sections we already encountered several examples of Avizo data objects such as 3D
image data (represented by the class HxUniformScalarField3), triangular surfaces (represented
by the class HxSurface), or colormaps (represented by the class HxColormap). Like modules,
data objects are instances of C++ classes. All data objects are derived from the common base class
HxData. Data objects are represented by green icons in Avizo’s Project View.
Note that you can find an in-depth description of every class in the online reference documenta-
tion: share/devref/Avizo.chm or share/devref/index.html in the Avizo root direc-
tory. The reference documentation not only covers data objects but all classes provided with Avizo
XPand Pack. As you already know, these classes are arranged in packages. For example, all data
classes derived from HxField3 are located in package hxfield, and all classes related to triangu-
lar surfaces are located in package hxsurface.
Accessing the Data To learn what kind of methods are provided by the lattice class, please refer
to the online reference documentation or directly inspect the header file HxLattice3.h located in
package hxfield. At this point, we just present a short example which shows how the dimensionality
of the lattice, the number of data components, and the primitive data type can be queried. The primitive
data type is encoded by the class McPrimType defined in package mclib. In particular, here are
some of the following data types supported by Avizo:
• McPrimType::mc uint8 (8-bit unsigned bytes)
• McPrimType::mc int16 (16-bit signed shorts)
• McPrimType::mc uint16 (16-bit unsigned shorts)
• McPrimType::mc int32 (32-bit signed integers)
• McPrimType::mc float (32-bit floats)
• McPrimType::mc double (64-bit doubles)
• ...
Regardless of the actual type of the lattice data values, the pointer to the data array is returned as
void*. The return value must be explicitly cast to a pointer of the correct type. This is illustrated
in the following example where we compute the maximum value of all data components of a lattice.
Note that the data values are stored one after another without any padding. The first index runs fastest.
HxLattice3& lattice = field->lattice;
switch (lattice.primType()) {
case McPrimType::mc_uint8: {
unsigned char* data = (unsigned char*) lattice.dataPtr();
unsigned char max = data[0];
for (int k=0; k<dims[2]; k++)
for (int j=0; j<dims[1]; j++)
for (int i=0; i<dims[0]; i++)
for (int n=0; n<nDataVar; n++) {
int idx =
nDataVar*((k*dims[1]+j)*dims[0]+i)+n;
if (data[idx]>max)
max = data[idx];
}
theMsg->printf("Max value is %d", max);
} break;
case McPrimType::mc_int16: {
short* data = (short*) lattice.dataPtr();
short max = data[0];
for (int k=0; k<dims[2]; k++)
for (int j=0; j<dims[1]; j++)
for (int i=0; i<dims[0]; i++)
for (int n=0; n<nDataVar; n++) {
int idx =
nDataVar*((k*dims[1]+j)*dims[0]+i)+n;
if (data[idx]>max)
max = data[idx];
}
theMsg->printf("Max value is %d", max);
} break;
...
As a tip, note that the processing of different primitive data types can often be simplified by defining
appropriate template functions locally. In the case of our example, such a template function may look
like this:
template<class T>
void getmax(T* data, const int* dims, int nDataVar)
{
T max = data[0];
for (int k=0; k<dims[2]; k++)
for (int j=0; j<dims[1]; j++)
for (int i=0; i<dims[0]; i++)
for (int n=0; n<nDataVar; n++) {
int idx =
nDataVar*((k*dims[1]+j)*dims[0]+i)+n;
if (data[idx]>max)
Using this template function, the above switch statement looks as follows:
switch (lattice.primType()) {
case McPrimType::mc_uint8:
getmax((unsigned char*)lattice.dataPtr(),dims,nDataVar);
break;
case McPrimType::mc_int16:
getmax((short*)lattice.dataPtr(),dims,nDataVar);
break;
...
Though less efficient, another possibility for handling different primitive data types is to use one of the
methods eval, set, getData, or putData. These methods always involve a cast to float if the
primitive data type of the field requires it.
Accessing the Lattice Interface Imagine you want to write a module which operates on any kind
of regular field, i.e., on objects of type HxRegScalarField3, HxRegVectorField3, and so
on. One way to achieve this would be to configure the input port of the module so that it can
be connected to all possible regular field input objects. This can be done by calling the method
portData.addType() in the module’s constructor multiple times with the required class type
IDs. In addition, all input types must be listed in the package resource file. This can be done by
specifying a blank-separated list of types as the argument of the -primary option of the module
command. In the compute method of the module, the actual type of the input must be queried, then
the input pointer must be cast to the required type before a pointer to the lattice member of the object
can be stored.
Of course, this approach is very tedious. A much simpler approach is to make use of the fact that the
lattice member of a regular field is an interface. Instead of the name of a real data class, the class type
ID of HxLattice3 may be used to specify to what kind of input object a module may be connected
to. In fact, if this is done, any data object providing the lattice interface will be considered as a valid
input. In order to access the lattice interface of the input object, the following statement must be used
in the module’s compute method (also check subsection 21.4.3.1 for an example of how to deal with
interfaces):
Creating a Field From an Existing Lattice When working with lattices, we may want to deposit
a new lattice in the Project View, for example as the result of a compute module. However, since
...
if (coord->coordType() == c_rectilinear) {
HxRectilinearCoord3* rectcoord =
(HxRectilinearCoord3*) coord;
...
}
Uniform Coordinates Uniform coordinates are the simplest form of regular coordinates. All grid
cells are axis-aligned and of equal size. In order to compute the position of a particular grid node, it is
sufficient to know the number of cells in each direction as well as the bounding box of the grid.
Uniform coordinates are represented by the class HxUniformCoord3. This class provides a method
bbox which returns a pointer to an array of six floats describing the bounding box of the grid. The six
numbers represent the minimum x-value, the maximum x-value, the minimum y-value, the maximum
y-value, the minimum z-value, and the maximum z-value in that order. Note that the values refer to
Stacked Coordinates Stacked coordinates are used to describe a stack of uniform 2D slices with
variable slice distance. They are represented by the class HxStackedCoord3. This class provides
a method bboxXY which returns a pointer to an array of four floats describing the bounding box of a
2D slice. In addition, the method coordZ returns a pointer to an array containing the z-coordinate of
each 2D slice.
Rectilinear Coordinates Same as for uniform or stacked coordinates, in the case of rectilinear co-
ordinates the grid cells are aligned to the axes, but the grid spacing may vary from cell to cell in each
direction. Rectilinear coordinates are represented by the class HxRectilinearCoord3. This class
provides three methods, coordX, coordY, and coordZ, returning pointers to the arrays of x-, y-,
and z-coordinates, respectively.
Curvilinear Coordinates In the case of curvilinear coordinates, the position of each grid node is
stored explicitly as a 3D vector of floats. A single grid cell need not to be axis-aligned anymore. An
example of a 2D curvilinear grid is shown in Figure 21.12.
Curvilinear coordinates are represented by the class HxCurvilinearCoord3. This class provides
a method pos which can be used to query the position of a grid node indicated by an index triple (i,j,k).
Alternatively, a pointer to the coordinate values may be obtained by calling the method coords. The
coordinate vectors are stored one after another without padding and with index i running fastest. Here
is an example:
the two types are not derived from a common base class, a special-purpose interface called
HxLabelLattice3 is provided. In fact, this interface is in turn derived from HxLattice3. It
replaces the standard lattice variable of ordinary regular fields (see subsection 21.5.2.1).
The primitive data type of a label field can be McPrimType::mc uint8,
McPrimType::mc uint16 or McPrimType::mc int32. In addition to the standard lat-
tice interface, the label lattice interface also provides access to the label field’s materials. Materials
are stored in a special parameter subdirectory of the underlying data object. While discussing the
plot API, we already encountered an example of how to interpret the materials of a label field (see
subsection 21.4.3.1). Note that whenever a new label is introduced, a new entry should also be
put into the material list. Existing materials are marked so that they can not be removed from the
material list (this would corrupt the labeling). In order to remove obsolete materials, call the method
removeEmptyMaterials of HxLabelLattice3.
In addition to the labels, special weights can be stored in a label lattice. These weights are used to
achieve sub-voxel accuracy when reconstructing 3D surfaces from the segmentation results. A pointer
to the weights can be obtained by calling getWeights or getWeights2 of the label lattice. For
more details about HxLabelLattice3, please refer to the online class documentation.
Figure 21.13: Numbering of points in a tetrahedron with positive volume (left). Numbering of the corresponding triangles
(right).
The three arrays, points, tetras, and materialIds, must be provided by the ’user’. The
triangles of the grid are stored in an additional array called triangles. This array can be constructed
Note that it is possible to define a grid with duplicated vertices, i.e. with vertices having exactly the
same coordinates. This is useful to represent discontinuous data fields. The method createTriangles2
checks for such duplicated nodes and correctly creates a single triangle between two geometrically
adjacent tetrahedra, even if these tetrahedra refer to duplicated points.
Optionally the edges of a grid can be computed in addition to its points triangles, and tetrahedra by call-
ing createEdges. The edges are stored in an array called edges and another array edgesPerTetra
is used in order to store the indices of the six edges of a tetrahedron.
Moreover, the class Tetra Grid provides additional optional arrays, for example to store a dynamic list
of the indices of all tetrahedra adjacent to a particular point (tetrasPerPoint). This and other
information is primarily used for internal purposes, for example to facilitate editing and smoothing of
tetrahedral grids.
The three arrays, points, hexas, and materialIds, must be provided by the ’user’. The faces
of the grid are stored in an additional array called faces. This array can be constructed automatically
by calling the member method createFaces. This method computes the faces from scratch and
sets the face indices of all hexahedra defined in hexas.
Note that, in contrast to tetrahedral grids, in a hexahedral grid degenerate cells are allowed, i.e., cells
where neighboring corners in a cell coincide. In this way grids with mixed cell types can be defined.
The faces of a hexahedron are stored in a small dynamic array called faces. For a degenerate cell
this array contains less then six faces.
Also note that, although non-conformal grids are allowed, i.e., grids with hanging nodes on edges
and faces, currently the method createFaces does not detect the connectivity between neighboring
hexahedra sharing less than four points. Thus, faces between such cells are considered to be external
cells.
For the sake of efficiency, a slightly different interface is used in Avizo. Evaluating a field defined
on tetrahedral grid at an arbitrary location usually involves a global search to detect the tetrahedron
which contains that point. The situation is similar for other grid types. In most algorithms, however,
the field is typically evaluated at points not far from each other, e.g., when integrating a field line.
To take advantage of this fact, the concept of an abstract Location class has been introduced. A
Location describes a point in 3D space. Depending on the underlying grid, Location may keep
track of additional information such as the current grid cell number. The Location class provides
two different search strategies, a global one and a local one. In this way performance can be improved
significantly. Here is an example of how to use a Location class:
float pos[3];
float value;
...
HxLocation3* location = field->createLocation();
if (location->set(pos))
field->eval(location, &value);
...
if (location->move(pos))
field->eval(location, &value);
...
delete location;
First a location is created by calling the virtual method createLocation of the field to be evaluated.
The two methods, location->set(pos) and location->move(pos), both take an array of
three floats as argument, which describe a point in 3D space. The set method always performs a
global search in order to locate the point. In contrast, move first tries to locate the new point using a
local search strategy starting from the previous position. You should call move when the new position
differs only slightly from the previous one. Both set and move may return 0 in order to indicate that
the requested point could not be located, i.e., that it is not contained in any grid cell.
In order to locate the field at a particular location, field->eval( location, &value) is
called. The result is written to the variable pointed to by the second argument. Internally the eval
method does two things. First it interpolates the field values, for example, using the values at the
corners of the cell the current point is contained in. Secondly, it converts the result to a float value if
the field is represented internally by a different primitive data type.
float bbox[6];
SbVec3f originWorld,originB;
SbMatrix matrixA, inverseMatrixB;
Instead of this two-step approach, the two matrices could also be combined:
SbMatrix allInOne = matrixA;
allInOne.multRight(inverseMatrixB);
allInOne.multVecMatrix(origin,originB);
allInOne.multVecMatrix(origin,originB);
Since the transformation could contain a translational part, special attention should
be paid when directional vectors are transformed. In this case the method
HxSpatialData::getTransformNoTranslation( SbMatrix& matrix) should
be used.
In order to add a new parameter or to overwrite the value of an existing one, you may use one of several
different set-methods, for example:
material->set("Transparency",transparency);
Many modules check whether a color is associated to a particular ’material’ in the material list of a
data object. If this is not the case, the color or some other value is looked up in the global material
database Avizo provides. This database is represented by the class HxMatDatabase defined in
hxcore. It can be accessed via the global pointer theDatabase. Like an ordinary data object, the
database has a member variable parameters of type HxParamBundle in order to store parameters
and materials. In addition, it provides some convenience methods, for example getColor(const
char* name), which returns the color of a material, defining a new one if the material is not yet
contained in the database.
\begin{hxmodule}{MyModule}
This command indicates the begin of a description file. MyModule
\begin{hxdescription}
This block contains a general module description.
\begin{hxconnections}
\hxlabel{MyModule_data}
This command sets a label such that this
connection can be referenced in the documentation.
\hxport{Data}{\tt [required]}\\
Here the required master connection is described.
\end{hxconnections}
\begin{hxports}
The module ports are listed here.
\end{hxports}
\end{hxmodule}
Formulas can be included by means of the text processor LaTeX. They must be written in the Latex
21.7 Miscellaneous
This section covers a number of additional issues of interest for the Avizo developer. In particular, the
following topics are included:
• Import of time-dependent data, including the use of HxPortTime
• Important global objects, such as theMsg and theWorkArea
• Save-project issues, making save Avizo project work for custom modules
• Troubleshooting, providing a list of common errors and solutions
In the previous section we discussed how time-dependent data could be imported using special-purpose
control modules. Another alternative is to derive a time-dependent data object from an existing static
one. An example of this is the class MyDynamicColormap contained in the example package of Avizo
XPand Pack. Looking at the header file src/mypackage/MyDynamicColormap.h in the local
Avizo directory you notice that this class is essentially an ordinary colormap with an additional time
port. Here is the class declaration:
class MYPACKAGE_API MyDynamicColormap : public HxColormap
{
HX_HEADER(MyDynamicColormap);
public:
// Constructor.
MyDynamicColormap();
Miscellaneous 707
// This will be called when an input port changes.
virtual void compute();
The implementation of the dynamic colormap is very simple too (see the file
MyDynamicColormap.cpp). First, in the constructor the time slider is initialized:
portTime.setMinMax(0,1);
portTime.setIncrement(0.1);
portTime.setDiscrete(0);
portTime.setRealTimeFactor(0.5*0.001);
The first line indicates that the slider should go from 0 to 1. The increment set in the next line defines
by what amount the time value should be changed if the backward or the forward button of the slider
is pressed. The next line unsets the discrete flag. If this flag is on, the slider value always would be
an integer multiple of the increment. Finally, the so-called real-time factor is set. Setting this factor
to a non-zero value implies that the slider is associated with physical time in animation mode. More
precisely, the number of microseconds elapsed since the last animation update is multiplied with the
real-time factor. Then the result is added to the current time value.
In order to see the module in action compile the example package, start Avizo (use the -debug option
or the debug executable if you compiled in debug mode), and choose Other / DynamicColormap
from the main window’s Project >Create Object... menu. Attach a Colormap Legend module to
the colormap and change the value of the colormap’s time slider. Animate the slider. The speed of
the animation can be adjusted by resetting the value of the real-time factor using the Tcl command
DynamicColormap time setRealTimeFactor.
theController->addTimeOutMethod(
this,(HxTimeOutMethod)timeOut,1000);
Instead of using a member method of an Avizo object class, you can also register an arbitrary static
function using the method addTimeOutFunction of class HxController. The corresponding
remove method is called removeTimeOutFunction. For more information, see the reference
documentation of HxController.
The Avizo XPand Pack example package contains the module MyAnimateColormap which makes
use of the above time-out mechanism. The source code of the module again is quite easy to understand.
After compiling the example package, you can attach to module under the name DoAnimate to an
existing colormap. The colormap then is modified and copied. After pressing the animate toggle of
the module the output colormap is shifted automatically at regular intervals. Note that in this example
the fire method of the module is used as time-out method. fire invokes the modules compute
method and also updates all down-stream objects.
Miscellaneous 709
HxViewer: This class represents an Avizo 3D viewer. There can be multiple instances which are
accessed via the method viewer of the global object theController. Normally you will not not
need to use this class. Instead, you should use the member functions showGeom and hideGeom
which every module and data object provides in order to display geometry.
HxController: This class controls all 3D viewers and Open Inventor geometry. In order to access a
viewer you may use the following statement:
HxViewer* v0 = theController->viewer(0,0);
The first argument indicates the ID number of the viewer to be retrieved. In total there may be up to
16 different viewers. The second argument specifies whether the viewer should be created or not if it
does not already exist.
HxColorEditor: Avizo’s color editor. Used, for example, to define the background color of the viewer.
In a standard module you should use a port such as HxPortColorList or HxPortColorMap
instead of directly accessing the color editor. There is a global instance of this class, which can be
accessed by the pointer theColorEditor.
HxHTML: A window used to display HTML files. This class is used for Avizo’s online help. The
global instance used for displaying the online user’s guide and the online programmer’s guide can be
accessed by the pointer theBrowser.
HxMatDatabase: This class represents Avizo’s global data parameter and material database. The
database can be accessed by the global pointer theDatabase. Details about the material database
are discussed in subsection 21.5.7.3.
Note that this method requires that HxArbitraryCut or some of its parent classes implement the
Tcl command setPlane. Hints about implementing new Tcl commands are given in subsection
21.4.2.2.
Some remarks about how to generate the load command for data objects are given in subsection 21.3.2.
Figure 21.15: When loading this Avizo project, the Resample module recreates the motor.Resampled data object on the fly.
There is a special optimization for data objects created by computational modules. Avizo automati-
cally determines whether data objects which are created by other modules are not yet saved and asks
the user to do so if necessary. However, in some cases, this may not be desired, since saving the data
object consumes disk space and regenerating can sometimes be nearly as fast as loading the object
from disk. As an example, consider the Avizo project in Figure 21.15. In this case the resample
module can automatically recompute the motor.Resampled data object when the Avizo project
is loaded. In order to determine whether a compute module is able to do so, the module must im-
plement the function int HxResample::canCreateData(HxData* data, McString&
createCmd). This function is called whenever an Avizo project containing newly created data ob-
jects is saved and these objects have not yet been saved but are still connected to a compute module.
The method should return 1 if the compute module is able to recreate that particular data object. In this
case the corresponding Tcl command should be stored in the string createCmd. When executed, the
Tcl command should return the name of the newly created data object.
Determining whether a compute module can create a data object may be tricky. Typically, it must be
assured that in the time between the actual creation of the data object by the computational module and
the execution of the save Avizo project command neither the parameters nor the input has changed,
and that the resulting data object had not been edited.
In order to implement this behavior, most compute modules use a flag that they set when they create
a data object and which they clear when the module’s update() method is called, indicating that
some input has changed. In order to check whether the data object was edited, the data object’s
touchTime variable is saved. touchTime is increased automatically whenever a module is edited.
A typical method could look like this:
int HxResample::canCreateData(HxData* data, McString& createCmd)
{
if (resultTouchTime != data->getTouchTime() ||
parameterChanged)
return 0;
Miscellaneous 711
getName(), getName(), getName());
return 1;
}
21.7.4 Troubleshooting
This section describes some frequently occurring problems and some general problem solving ap-
proaches related to Avizo development.
The section is divided into two parts: Problems which may occur when compiling a new package, and
problems which may occur when executing it.
Miscellaneous 713
714 Chapter 21: Avizo XPand Pack User’s Guide
Chapter 22
Avizo XMolecular Pack adds powerful modules for molecular visualization to the Avizo 3D visu-
alization system. The package combines Avizo’s strong capabilities for 3D data visualization like
hardware accelerated volume rendering with specific tools for molecular visualization and data anal-
ysis. Molecular surfaces, molecular interfaces or configuration density computation are only a few
examples. Avizo XMolecular Pack comes with self-running demos and step-by-step tutorials for the
most common molecular visualization tasks.
This chapter, available in Avizo XMolecular Pack online documentation, is organized into the follow-
ing sections:
• Molecule Tutorial, how to get started
• Data Objects, structure and interdependence of the molecular data structures
• Visualization of Molecules, various ways to display a molecule
• Aligning Molecules
• Visualization of Molecular Trajectories, animations and configurational densities
• Atom Expressions
Index
INDEX 717
hardware, 14 Linux system, 14
help load command, 632, 710
for commands, 205 local Avizo directory, 607, 615
help browser, 161 local coordinates, 702
searching, 162 local directory, 605
Help Menu local search, 701
Examples, 143 location class, 701
License Manager, 143
Online Support, 143 Mac system, 14
Programmer’s Guide, 143 MAKE CFG, 612
Programmer’s Reference, 143 material database, 704, 710
Show Last News, 143 material ids, 695, 697
System Information, 143 materials, 694, 704
User’s Guide, 142 maximum-likelihood method, 110
hexahedral grids, 697 McHandle, 652, 659
hidden data objects, 168 McStringTokenizer, 631
hot-key procedure, 194, 220 McVec3f, 654
HxColormap, 655 memory consumption, 126
HxHexaGrid, 697 message window, 709
HxLabelLattice3, 661, 694 microsphere, 121
HxLattice3, 689 module
HxMessage, 627, 634 adding new one, 617
HxParamBundle, 703 example, 650
HxPortButtonList, 659 multi-processing, 126
HxPortFloatTextN, 644 multiple file input, 619
HxPortIntSlider, 652
HxPortRadioBox, 656 no-show-news, 168
HxTetraData, 696 noise, 110, 112
HxTetraGrid, 695 non-conformal grids, 698
HxUniformScalarField3, 646 numerical aperture, 111
Nyquist sampling, 111
immersion medium, 121
in-plane sampling, 111 Object Popup, 176
initial estimate, 115, 118 oil immersion, 121
intensity attenuation, 113 Open Inventor, 605, 651
interface, 635, 688 OpenGL, 14, 605, 606
optical sectioning microscopy, 110
job dialog, 119 out-of-focus light, 110, 117
Job dialog box, 165 overrelaxation, 115, 118
oversampling, 112
label field, 694 overwrite dialog, 634
Lanczos filter, 113
link line, 712 package, 604, 616
718 INDEX
parallel flags, 612 example, 625
parameters, 687, 703 multiple files, 632
parameters of data objects, 188 reampling, 113
parse method, 655 recent-documents, 168
performance, 125, 650 rectilinear coordinates, 693
plot API, 658 refracrtive index, 121
polymorphism, 635 refractive index, 111
Pool, 709 register
Pool Menu data, 627, 631
Auto adjust range of colormaps, 138 read routine, 627
Create Object, 137 write routine, 635, 638
Duplicate Mode, 138 registry, 610, 615
Duplicate Object, 137 regular grid, 186, 688
Graph View, 136 renaming a package, 613
Hide Object, 136 resource file, 605, 627, 635, 638, 712
Make All Display Modules Pickable, 138
Make All Display Modules Unpickable, sampling rate, 111
138 saturation, 112
Remove All Objects, 137 save ports, 710
Remove Object, 136 save project, 168, 220, 710
Rename Object, 137 scalar fields, 185
Show All Objects, 137 scanned volume, 111
Show Object, 137 scene graph, 651
Tree View, 136 script, 204
Port, 150 SCRIPTDIR, 205
portData, 645 SCRIPTFILE, 205
PPM3D format, 625, 633 scripting, 204
preferences, 167 Scripting interface, 197
preferences-and-settings, 168 Shadowing, 189
primitive data types, 689 shared object, 604
procedural data interface, 701 smart pointer, 652, 659
processor, 14 Snapshot dialog box, 174
Progress Bar, 153 Spacemouse, 193
progress bar, 647 SpatialData, 687
Project Graph View, 144 stacked coordinates, 693
PSF, 110, 113 Standard Toolbar, 144
theoretical, 116 start-up script, 193, 220
stereo mode, 193
Qt, 605, 633 storage-class specifier, 627, 634
question dialog, 709 surface, 187, 628
patch, 631
read routine surface field, 628
adding new one, 618 system information dialog, 176
INDEX 719
system requirements Home, 156
development, 14 Interact, 156
Firewall, 16 interaction mode, 155
Linux, 16 Layout, 158
Mac, 18 LinkObjectsVisibility, 158
Windows, 16 Measuring, 157
Perspective/Ortho toggle, 157
table coordinates, 702 Pick, 156, 157
TCL, 204 rotate button , 156
Tcl, 197 Seek, 156
Tcl interface, 655 Set Home, 157
Tcl introduction, 198 Snapshot, 158
Tcl library, 605 Stereo, 157
template function, 690 Trackball, 156
tetrahedral grids, 187, 695 Translate, 156
touch time, 711 View, 156
transformations, 702 View All, 157
Trimesh format, 628, 635 viewing directions (geographic), 157
viewing directions (seismic), 157
undersampling, 112 viewing directions YZ, XZ, XY, 157
uniform coordinates, 692 viewing mode, 155
unknown identifier, 712 Zoom, 156
unresolved symbol, 712 zoom, 153
update method, 656 ZScale, 158
Upgrading to latest version of Avizo XPand viewer toggles, 168
Pack, 612 Visual Studio
debug code, 610
vector fields, 186 release code, 610
VertexSets, 187
View Menu warning dialog, 709
Antialiasing, 140 wavelength, 111
Axis, 141 widefield data, 111
Background, 139 Window Menu, 141
Enable Shadows, 141 About, 143
Fog, 140 Animation Producer, 142
FPS (frames-per-second), 141 Colormap, 142
Frame counter, 141 Console, 142
Layout, 138 Help, 142
Lights, 139 Hide Panels, 141
Measuring, 141 Main Panel, 142
Transparency, 139 Properties, 142
Viewer, 153, 710 Toolbars, 142
Fullscreen, 158 Windows system, 14
720 INDEX
work area, 150, 647, 709
world coordinates, 702
write routine
adding new one, 619
example, 633
XLabDiff, 13
XLabElectro, 13
XLabHydro, 13
XLabThermo, 14
XLVolume, 12
XMolecular, 12
XPand, 11
XReadCATIA5, 13
XReadIGES, 13
XReadSTEP, 13
XScreen, 12
XSkeleton, 12
XTeam, 12
INDEX 721