Beruflich Dokumente
Kultur Dokumente
The Avizo XEarth Extension and the Avizo XLVolume Extension include user protection under license for
Landmark U.S. Patent Numbers 6,765,570.
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 Optional Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.3.3 License keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.4 System Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.4.1 Prioritizing hardware for Avizo . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.4.2 How hardware can help optimizing . . . . . . . . . . . . . . . . . . . . . . . 17
1.4.3 Special considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.5 Avizo License Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.5.1 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.5.2 About Avizo licensing management . . . . . . . . . . . . . . . . . . . . . . . 22
1.5.3 License manager actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.5.4 Licensing troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
1.5.5 Contacting the license administrator . . . . . . . . . . . . . . . . . . . . . . 44
1.6 First steps in Avizo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
1.7 Contact and Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
2 Getting Started 49
2.1 Start the program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.2 Loading Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
2.3 Invoking Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
2.4 Visualizing Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
2.5 Interaction with the Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
2.6 Data Import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
CONTENTS ii
3.2.6 Volume Rendering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
3.3 Combined 3D and 2D views with Ortho Views (Avizo) . . . . . . . . . . . . . . . . . 83
3.3.1 Quick start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
3.3.2 Manage combined 3D and 2D views with Ortho Views . . . . . . . . . . . . 85
3.4 Intensity Range Partitioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
3.5 Segmentation of 3D Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
3.5.1 Interactive Image Segmentation . . . . . . . . . . . . . . . . . . . . . . . . . 95
3.5.2 Volume and Statistics Measurement . . . . . . . . . . . . . . . . . . . . . . . 97
3.5.3 Threshold Segmentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
3.5.4 Refining Threshold Segmentation Results . . . . . . . . . . . . . . . . . . . 98
3.5.5 More Hints about Segmentation . . . . . . . . . . . . . . . . . . . . . . . . . 99
3.6 Deconvolution for light microscopy . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
3.6.1 General remarks about image deconvolution . . . . . . . . . . . . . . . . . . 101
3.6.2 Data acquisition and sampling rates . . . . . . . . . . . . . . . . . . . . . . . 102
3.6.3 Standard Deconvolution Tutorial . . . . . . . . . . . . . . . . . . . . . . . . 104
3.6.4 Blind Deconvolution Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . 109
3.6.5 Bead Extraction Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
3.6.6 Performance issues and multi-processing . . . . . . . . . . . . . . . . . . . . 117
CONTENTS iii
4.1.11 Classifying measures with sieves . . . . . . . . . . . . . . . . . . . . . . . . 135
4.1.12 Label images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
4.1.13 Processing data on disk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
4.1.14 Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
4.1.15 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
4.2 Example 1: Measuring a Catalyst . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
4.2.1 Object Detection and Masks . . . . . . . . . . . . . . . . . . . . . . . . . . 139
4.2.2 More about Region of Interest and Masks . . . . . . . . . . . . . . . . . . . 142
4.2.3 Using Distance Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
4.2.4 More about Distance Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
4.2.5 Measurement Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
4.3 Example 2: Separating, Measuring and Reconstructing . . . . . . . . . . . . . . . . . 148
4.3.1 Principle of the Watershed Algorithm . . . . . . . . . . . . . . . . . . . . . . 148
4.3.2 Prior Segmentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
4.3.3 Separation using Watershed step by step . . . . . . . . . . . . . . . . . . . . 151
4.3.4 Separation Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
4.3.5 Filtering Individual Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
4.3.6 Geometry Reconstruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
4.4 Example 3: Further Image Analysis - Distribution of Pore Diameters in Foam . . . . 161
4.4.1 First step: pore detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
4.4.2 Second step: pore post-processing . . . . . . . . . . . . . . . . . . . . . . . 161
4.4.3 Third step: custom measure group definition to determine the distribution of
pore diameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
4.4.4 Fourth step: custom measure definition to compute the sphericity of pore . . . 167
4.5 Example 4: Further Image Analysis - Average Thickness of Material in Foam . . . . . 170
4.5.1 Porosity Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
4.5.2 Detection of the Separation Surfaces . . . . . . . . . . . . . . . . . . . . . . 171
4.5.3 Distance Map of the Material . . . . . . . . . . . . . . . . . . . . . . . . . . 173
4.5.4 Calculation of the Material Average Thickness . . . . . . . . . . . . . . . . . 175
4.6 Watershed Segmentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
4.6.1 Segmenting sand pack with watershed tool in the Segmentation Editor . . . . 176
CONTENTS iv
4.6.2 Segmenting multiphase using the Watershed Segmentation wizard . . . . . . 180
4.7 More about Image Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
4.7.1 Choosing image filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
4.7.2 Tuning image filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
4.7.3 Compositing image filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
4.8 More about label measures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
4.8.1 The Measures Group Selection dialog . . . . . . . . . . . . . . . . . . . . . 199
4.8.2 User measures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
4.8.3 Configurable native measures . . . . . . . . . . . . . . . . . . . . . . . . . . 201
4.8.4 About project backup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
4.8.5 Scripting tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
CONTENTS v
5.4.3 Avizo XMesh Extension features for 3D grids . . . . . . . . . . . . . . . . . 234
5.4.4 Scalar fields visualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
5.4.5 Vector fields visualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
5.4.6 Time dependent data visualization . . . . . . . . . . . . . . . . . . . . . . . 236
5.4.7 Compute modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
5.5 Skeletonization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
5.5.1 Getting started with Skeletonization: the Auto Skeleton module . . . . . . . . 238
5.5.2 Displaying and exporting skeletonization results . . . . . . . . . . . . . . . . 241
5.5.3 Skeletonization step-by-step . . . . . . . . . . . . . . . . . . . . . . . . . . 249
5.5.4 Skeletonization with large data . . . . . . . . . . . . . . . . . . . . . . . . . 255
CONTENTS vi
6.4.2 Register Images guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
6.4.3 Using the Image Registration Wizard - example with partially overlapping
images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
6.4.4 More about the Register Images module . . . . . . . . . . . . . . . . . . . . 303
6.5 Registration of 2D image and 3D image data sets . . . . . . . . . . . . . . . . . . . . 309
6.5.1 Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
6.5.2 Pre-alignment: Searching for a 2D slice (needle) in a 3D volume (haystack) . 310
6.5.3 Refined alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
6.6 Alignment of 2D images stacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
6.6.1 Basic manual alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
6.6.2 Automatic alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
6.6.3 Alignment via landmarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
6.6.4 Optimizing the least-squares quality function . . . . . . . . . . . . . . . . . . 318
6.6.5 Resampling the input data into result . . . . . . . . . . . . . . . . . . . . . . 318
6.6.6 2D alignment guidelines, more about Align Slice . . . . . . . . . . . . . . . 319
6.7 Alignment and pre-processing of FIB/SEM images stacks using the FIB Stack Wizard 322
6.7.1 Images import, voxel size and foreshortening correction . . . . . . . . . . . . 323
6.7.2 Geometric corrections overview . . . . . . . . . . . . . . . . . . . . . . . . . 326
6.7.3 Getting started with FIB Stack Wizard . . . . . . . . . . . . . . . . . . . . . 327
6.7.4 Selecting what to align using masks . . . . . . . . . . . . . . . . . . . . . . 333
6.7.5 Further processing of FIB Stacks . . . . . . . . . . . . . . . . . . . . . . . . 336
6.8 Registration of 3D surfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
6.8.1 Getting started with Align Surfaces module . . . . . . . . . . . . . . . . . . 337
6.8.2 Align Surfaces guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
6.8.3 Alignment of surface subsets . . . . . . . . . . . . . . . . . . . . . . . . . . 343
6.8.4 Measure and visualize surface distance . . . . . . . . . . . . . . . . . . . . . 344
6.9 Registration of 3D image and surface, nominal-actual analysis . . . . . . . . . . . . . 346
6.9.1 A simple workflow for nominal-actual analysis . . . . . . . . . . . . . . . . . 347
6.9.2 Advanced - Image/surface registration step by step . . . . . . . . . . . . . . . 351
CONTENTS vii
7.1 Creating animations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
7.1.1 Creating a project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
7.1.2 Animating an Ortho Slice module . . . . . . . . . . . . . . . . . . . . . . . . 354
7.1.3 Activating a module in the viewer window . . . . . . . . . . . . . . . . . . . 357
7.1.4 Using a camera rotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
7.1.5 Removing one or more events . . . . . . . . . . . . . . . . . . . . . . . . . . 360
7.1.6 Overlaying the inside surfaces with outer surface . . . . . . . . . . . . . . . . 360
7.1.7 Using clipping to add the outer surface gradually . . . . . . . . . . . . . . . . 360
7.1.8 More comments on clipping . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
7.1.9 Breaks and function keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
7.1.10 Loops and Goto . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
7.1.11 Storing and replaying the animation sequence . . . . . . . . . . . . . . . . . 367
7.2 Creating movie files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
7.2.1 Attaching Movie Maker to a Camera-Path . . . . . . . . . . . . . . . . . . . 368
7.2.2 Creating a movie from an animated demonstration . . . . . . . . . . . . . . . 370
CONTENTS viii
8.1.14 Online Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
8.1.15 File Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
8.1.16 Job Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
8.1.17 Preferences Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
8.1.18 Snapshot Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
8.1.19 System Information Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
8.1.20 Object Popup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
8.1.21 Create Object Popup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
8.2 General Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
8.2.1 Class Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
8.2.2 Scalar Field and Vector Fields . . . . . . . . . . . . . . . . . . . . . . . . . . 431
8.2.3 Coordinates and Grids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
8.2.4 Surface Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
8.2.5 Vertex Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
8.2.6 Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
8.2.7 Data parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
8.2.8 Shadowing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
8.2.9 Units in Avizo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
8.2.10 Automatic Display in Avizo . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
8.2.11 Workroom Concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
CONTENTS ix
9.4.2 Introduction to Tcl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
9.4.3 Avizo Script Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
9.4.4 Global Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
9.4.5 Avizo Script Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
9.4.6 Configuring Popup Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . 478
9.4.7 Registering pick callbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
9.4.8 File readers in Tcl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
9.4.9 How to create recipe-compliant script-object . . . . . . . . . . . . . . . . . . 483
9.5 Python Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
9.5.1 Python Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
9.5.2 Python Tutorials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
9.5.3 Python Tutorial - Extending Avizo functionality with Python tools . . . . . . 509
9.6 Using MATLAB with Avizo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
9.6.1 Using MATLAB Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
CONTENTS x
10.3.4 Removing fibers that are touching the bounding box . . . . . . . . . . . . . . 539
10.3.5 Filtering fibers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
10.3.6 Calculating and visualizing local statistics . . . . . . . . . . . . . . . . . . . 541
10.3.7 Plotting orientations in 3D . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
CONTENTS xi
11.5 Avizo XWind Extension Statistical and Arithmetic Computations . . . . . . . . . . . 582
11.5.1 Surface and volume integrals . . . . . . . . . . . . . . . . . . . . . . . . . . 583
11.5.2 Arithmetic computation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 588
11.6 Avizo XWind Extension Vorticity Identification . . . . . . . . . . . . . . . . . . . . 590
11.6.1 Vorticity-related variables computation . . . . . . . . . . . . . . . . . . . . . 590
11.6.2 Vortex core lines identification . . . . . . . . . . . . . . . . . . . . . . . . . 592
11.6.3 Vortical flow visualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594
11.7 Avizo XWind Extension Measurements . . . . . . . . . . . . . . . . . . . . . . . . . 596
11.7.1 3D measurements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597
11.7.2 Histograms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598
11.7.3 Data probing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600
CONTENTS xii
12.2.7 Step 6 - Molecular diffusivity experiment simulation . . . . . . . . . . . . . . 639
12.2.8 Step 7 - Molecular diffusivity tensor calculation . . . . . . . . . . . . . . . . 643
12.2.9 Step 8 - Molecular diffusivity computation validation . . . . . . . . . . . . . 644
12.3 Getting started with formation factor and electrical conductivity computation . . . . . 647
12.3.1 Theoretical elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
12.3.2 Step 1 - Load the data set . . . . . . . . . . . . . . . . . . . . . . . . . . . . 650
12.3.3 Step 2 - Set the voxel size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651
12.3.4 Step 3 - Create a label image from the data set . . . . . . . . . . . . . . . . . 652
12.3.5 Step 4 - Remove non-percolating void space . . . . . . . . . . . . . . . . . . 652
12.3.6 Step 5 - Selection of a sub-region . . . . . . . . . . . . . . . . . . . . . . . . 653
12.3.7 Step 6 - Formation factor experiment simulation . . . . . . . . . . . . . . . . 654
12.3.8 Step 7 - Effective formation factor calculation . . . . . . . . . . . . . . . . . 656
12.3.9 Step 8 - Formation factor computation validation . . . . . . . . . . . . . . . . 658
12.4 Getting started with thermal conductivity computation . . . . . . . . . . . . . . . . . 660
12.4.1 Theoretical elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 660
12.4.2 Step 1 - Load the data set . . . . . . . . . . . . . . . . . . . . . . . . . . . . 664
12.4.3 Step 2 - Set the voxel size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 664
12.4.4 Step 3 - Create a label image from the data set . . . . . . . . . . . . . . . . . 664
12.4.5 Step 4 - Remove isolated conducting materials parts . . . . . . . . . . . . . . 665
12.4.6 Step 5 - Selection of a sub-region . . . . . . . . . . . . . . . . . . . . . . . . 666
12.4.7 Step 6 - Thermal conductivity experiment simulation . . . . . . . . . . . . . 668
12.4.8 Step 7 - Effective thermal conductivity calculation . . . . . . . . . . . . . . . 671
12.4.9 Step 8 - Thermal conductivity computation validation . . . . . . . . . . . . . 672
CONTENTS xiii
13.1.6 Maintaining Existing Code . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
13.2 The Development Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690
13.2.1 Starting the Development Wizard . . . . . . . . . . . . . . . . . . . . . . . . 691
13.2.2 Setting Up the Local Avizo Directory . . . . . . . . . . . . . . . . . . . . . . 691
13.2.3 Adding a New Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693
13.2.4 Adding a New Component . . . . . . . . . . . . . . . . . . . . . . . . . . . 694
13.2.5 Adding an Ordinary Module . . . . . . . . . . . . . . . . . . . . . . . . . . 694
13.2.6 Adding a Compute Module . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
13.2.7 Adding a Read Routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
13.2.8 Adding a Write Routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696
13.2.9 Creating the Build System Files . . . . . . . . . . . . . . . . . . . . . . . . . 697
13.2.10 The Package File Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698
13.3 File I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 700
13.3.1 On file formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 700
13.3.2 Read Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701
13.3.3 Write Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 710
13.3.4 Use the AmiraMesh API to read and write files in Avizo data format . . . . . 715
13.4 Writing Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721
13.4.1 A Compute Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721
13.4.2 A Display Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
13.4.3 A Module With Plot Output . . . . . . . . . . . . . . . . . . . . . . . . . . . 736
13.4.4 A Compute Module on GPU . . . . . . . . . . . . . . . . . . . . . . . . . . 742
13.5 Data Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 753
13.5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 753
13.5.2 Data on Regular Grids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 756
13.5.3 Unstructured Tetrahedral Data . . . . . . . . . . . . . . . . . . . . . . . . . 762
13.5.4 Unstructured Hexahedral Data . . . . . . . . . . . . . . . . . . . . . . . . . 764
13.5.5 Unstructured Mixed Models . . . . . . . . . . . . . . . . . . . . . . . . . . . 766
13.5.6 Other Issues Related to Data Classes . . . . . . . . . . . . . . . . . . . . . . 768
13.6 Documentation of Modules in Avizo XPand Extension . . . . . . . . . . . . . . . . . 772
CONTENTS xiv
13.6.1 The documentation file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 772
13.6.2 Generating the documentation . . . . . . . . . . . . . . . . . . . . . . . . . 773
13.7 Miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 773
13.7.1 Time-Dependent Data And Animations . . . . . . . . . . . . . . . . . . . . . 774
13.7.2 Important Global Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . 776
13.7.3 Save-Project Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 778
13.7.4 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 779
CONTENTS xv
15.3 Recipes in a TCL Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803
15.4 Recipes Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 804
CONTENTS xvi
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 tri-
angular 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 (Editions and Extensions) briefly describes optional extensions and editions available for
Avizo and for 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 (First steps) provides hints about tutorials included in this guide.
Section 1.7 (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.
Overview 2
1.2.1 Data import
Avizo can load directly different types of data, including:
A large number of file formats are supported in Avizo or through specific optional readers. For an
introduction to data import, see section 3.1. For more details, see section 2.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 Extension. 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 Extension, even very large data sets that cannot be fully loaded in mem-
ory 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 Section 4.7 More about Image Filtering.
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,
Features overview 4
morphological filters for erosion, dilation, opening and closing operations, connected component anal-
ysis, images correlation, objects separation and filtering, etc. See section 3.5 for a tutorial about image
segmentation with Avizo.
Avizo provides tools for probing image data, extracting profiles, value or correlation histogram. It can
extract information from segmented images such as area, volumes, intensity statistics. Avizo provides
an extensive set of tools for image quantification and analysis. See Advanced Image Processing,
Segmentation and Analysis examples.
Once the interesting features in a 3D image volume have been segmented, Avizo is able to create a
corresponding polygonal surface model. The surface may have non-manifold topology if there are lo-
cations where three or more regions join. Even In this case, the polygonal surface model is guaranteed
to be topologically correct, i.e., free of self-intersections. Fractional weights that are automatically
generated during segmentation allow the system to produce optionally smooth boundary interfaces.
This way realistic high-quality models can be obtained, even if the underlying image data are of low
resolution or contain severe noise artifacts. Making use of innovative acceleration techniques, surface
reconstruction can be performed very quickly. Moreover, the algorithm is robust and fail-safe.
Surface simplification is another prominent feature of Avizo. It can be used to reduce the number of tri-
angles in an arbitrary surface model according to a user-defined value. Thus, models of finite-element
grids, suitable for being processed on low-end machines, can be generated. The underlying simplifi-
cation algorithm is one of the most elaborate available. It is able to preserve topological correctness,
i.e., self-intersections commonly produced by other methods are avoided. In addition, the quality of
the resulting mesh, according to measures common in finite element analysis, can be controlled. For
example, triangles with long edges or triangles with bad aspect ratio can be suppressed.
A surface editor is also available for smoothing or refining surface in whole or part, cutting and copy-
ing parts of surfaces, defining boundary conditions for further numerical simulation, checking and
modifying surface triangles.
Surface Path Set can be created interactively - for instance as geodesic contours, edited and used to cut
surface patches. Surface path can also be obtained by intersecting surfaces,
Avizo and Avizo XWind Extension also provide a powerful Remesh Surface module that can be used
for producing high quality surfaces.
Features overview 5
1.2.5.3 Generation of Tetrahedral Grids
Avizo allows you not only to generate surface models from your data but also to create true volumetric
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 Cloud 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 supports
polygonal surfaces such as triangular meshes, 3D lattices with uniform, rectilinear of curvilinear coor-
dinates, 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.
Features overview 6
Beside visualization, data representations such as isosurfaces, grid cuts or contour lines can be ex-
tracted as first class data objects.
Displacement vectors can be visualized on grids or applied as grid deformation that can be animated.
Avizo XWind Extension provides extensive additional support for numerical data import/export, visu-
alization 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 of 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 XWind Extension 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, and gradient tensor.
Avizo XWind Extension 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.
Features overview 7
1.2.7.2 Operating on 3D data
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
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.
Features overview 8
All Avizo components can be controlled via a Tcl command language interface. Tcl scripts are used
for saving your work session. Tcl scripts also allow the advanced user to automate or customize tasks
with Avizo for routine workflows, without the need for C++ programming. Custom Avizo modules
with user interface can even be created as Tcl scripts. Avizo module behaviour and 3D interaction can
be customized by using Tcl. Avizo can also be used for batch processing.
See Chapter 9.4, including a short introduction to the Tcl scripting language.
C++ programming
With the Avizo XScreen Extension, Avizo can also be extended by programmers. The Avizo XPand
Extension 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 Extension 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 the same type. See
Chapter 9.1.1.
1.3.1 Editions
Currently, the following editions are available for Avizo 9.
Avizo Lite Edition. The application for scientific visualization. Avizo is a versatile and flexible
application framework providing powerful 3D visualization capabilities helping understand more
efficiently the meaning of scientific data. Researchers, scientists, Avizo delivers you advanced visual-
ization techniques which allow you to gain detailed insight into your 3D data. It provides exactly the
same level of capabilities as the previous Avizo Standard edition, extended by the enhancements and
new features introduced by version 9, but excluding Avizo advanced image processing, analysis and
quantification features, and other Avizo extension-specific features.
Avizo. The application for Material Sciences. For industrial tomography, crystallography,
material microstructure evolution, modality inspection for nano-structure, non-destructive investi-
gation and surface analysis, Avizo delivers the whole feature-set allowing Material Scientists to see
Avizo Inspect Edition. This is the application for Industrial Inspection and Materials R&D. The
Avizo Inspect Edition streamlines the process of industrial inspection and materials design off-line,
near-line, and in-line, including dimensional metrology with advanced measurements; an extensive
set of inspection workflows, so-called recipes for quantification of indications, porosity, inclusions,
and defects; fiber characterization of parts and materials; ability to do actual/nominal comparison by
integrating CAD models; and reverse engineering workflows for additive manufacturing. The Avizo
Inspect Edition includes all Avizo features as well as the following extensions: Avizo XMetrology
Extension, Avizo XRecipe Extension, Avizo XReporting Extension, and Avizo XLVolume Extension.
• Avizo XWind Extension includes all features previously available in the Avizo Wind edition
for advanced post-processing of simulation data (i.e., ranging from flow to thermal) and stress
data; an extensive array of advanced visualization and analysis tools to CFD and multi-physics;
mechanical and thermal engineering; manufacturing simulation and micro-structural prediction;
and non-linear structural and geotechnical problems.
• Avizo XFiber Extension provides specific support for analyzing fibers, filaments, tunnels, and
other networks or tree-like structures. This extension assists segmentation and analysis with
automatic, semi-automatic, and interactive tools. Advanced modules allow for the detection and
tracing of tube-like structures in various modality acquisitions such as X-ray microtomography.
Various distributions and properties can be calculated and plotted. Segmented fibers can also be
filtered based on properties and attributes.
• Avizo XEarth Extension includes dedicated models and workflows for visualization and com-
putation with a SEG-Y reader for the exploration and analysis of geosciences data. A Geo-
physics profile has been defined to enable all XEarth extension features, such as the dedicated
tree view, modules, colormaps, etc.
• Avizo XGreen Extension encompasses visualization and computation modules; and a set of
geographical projections with a NetCDF reader dedicated to the analysis of climate, oceanogra-
phy, environmental, and earth-mapped data. A Climatology profile has been defined to enable
all XGreen extension features, such as the NetCDF import, dedicated modules, colormaps, etc.
Please refer to the online help for documentation on this extension.
• Avizo XPand Extension allows for the creation of custom components, such as modules for
visualizing or processing data, file readers or file writers for using the C++ programming lan-
guage. New modules and new data classes can be defined as subclasses of existing ones. To
(*) With cluster configurations, Avizo XScreen Extension requires as many licenses as slave rendering
nodes in the cluster configuration. Ex: A configuration with a master node driving a cluster of 4 nodes
will require 4 Avizo XScreen Extension licenses.
For additional information about Avizo and its extensions, please refer to the Avizo web site,
http://www.avizo3d.com.
System Requirements 12
• Avizo XWind Extension: support of Abaqus reader (.odb format) and STAR-CCM reader are
available only on Microsoft Windows and Linux, not on Mac OS X,
• Avizo XScreen Extension is supported only on Microsoft Windows and Linux, not Mac OS X,
• Avizo XPand Extension is supported only on Microsoft Windows and Linux, not Mac OS X,
• Avizo XReadIGES Extension, Avizo XReadSTEP Extension, Avizo XReadCATIA5 Exten-
sion are supported only on Microsoft Windows, not on Linux or Mac OS X,
• Avizo XLabSuite Extension: molecular diffusivity, formation factor and thermal conductivity
computation are supported only on Microsoft Windows, not on Linux or Mac OS X.
• Avizo XMetrology Extension is supported only on Microsoft Windows, not on Linux or Mac
OS X.
• Avizo XRecipe Extension is supported only on Microsoft Windows, not on Linux or Mac OS
X.
• Avizo XGreen Extension: this is the last version of Avizo to support Avizo XGreen Extension
on Mac OS X.
• Avizo XTeam Extension: This is the last version of Avizo to support Avizo XTeam Extension.
The extension will then be removed from Avizo.
This document is intended to give recommendations about choosing a suitable workstation to run
Avizo.
The four most important components that need to be considered are the graphics card (GPU), the CPU,
the RAM and the hard drive.
The performance of direct volume rendering of large volumetric data or large triangulated surface
visualization extracted from the data depends heavily on the GPU capability. The performance of
image processing algorithms depends heavily on the performance of the CPU. The ability to quickly
load or save large data depends heavily on the hard drive performance. And, of course, the amount of
available memory in the system will be the main limitation on the size of the data that can be loaded
and processed.
Because the hardware requirements will widely vary according to the size of your data and your work-
flow, we strongly suggest that you take advantage of our supported evaluation version to try working
with one of your typical data sets.
In this document, the term Avizo refers to all Avizo editions and all Avizo extensions.
The single most important determinant of Avizo performance for visualization is the graphics card.
System Requirements 13
Avizo should run on any graphics system (this includes GPU and its driver) that provides a complete
implementation of OpenGL 2.1 or higher (certain features may not be available depending on the
OpenGL version and extensions supported). However, graphics board and driver bugs are not unusual.
The amount of GPU memory needed depends on the size of the data. We recommend a minimum of
1 GB on the card. Some visualization modules may require having graphics memory large enough to
hold the actual data.
High-end graphics cards have 12 to 16 GB of memory. Optimal performance volumetric visualization
at full resolution requires that data fit in graphics memory (some volume rendering modules of Avizo
are able to go around this limitation).
Avizo will not benefit from multiple graphics boards for the purpose of visualization on a single moni-
tor. However, some of the image processing algorithms rely on CUDA for computation, and while the
computation can run on the single CUDA-enabled graphics board, this computation can also run on a
second CUDA-enabled graphics card installed on the system. A multiple graphics board configuration
can be useful to drive many screens or in immersive environments.
When comparing graphics boards, there are many different criteria and performance numbers to con-
sider. Some are more important than others, and some are more important for certain kinds of ren-
dering. Thus, it’s important to consider your specific visualization requirements. Integrated graphics
boards are not recommended for graphics-intensive applications such as Avizo except for basic visu-
alization.
Wikipedia articles on NVIDIA GeForce/Quadro and AMD Radeon/FirePro cards will detail specific
performance metrics:
• Memory size: This is very important for volume visualization (both volume rendering and slices)
to maximize image quality and performance because volume data is stored in the GPU’s texture
memory for rendering. It is also important for geometry rendering if the geometry is very large
(large number of triangles).
• Memory interface / Bandwidth: This is important for volume rendering because large amounts
of texture data need to be moved from the system to the GPU during rendering. The PCI Express
3 buses are the fastest interfaces available today.
• Number of cores (also known as stream processors): This is very important for volume rendering
because every high-quality rendering feature you enable requires additional code to be executed
on the GPU during rendering.
• Triangles per second: This is very important for geometry rendering (surfaces, meshes).
• Texels per second / Fill rate: This is very important for volume visualization (especially for vol-
ume rendering), because a large number of textures will be rendered and pixels will be ”filled”
multiple times to blend the final image.
System Requirements 14
All driver bugs are submitted to the vendors. A fix may be expected in a future driver release.
• A professional graphics boards will benefit from the professional support offered by the ven-
dors (driver bug fixes).
• Always use a recent driver version for your graphics board.
• With an NVIDIA Quadro board we recommend to use the driver profile ”3D App - Visual
Simulation”. In case of rendering or performance issues you may want to experiment with
different ”3D App” profiles.
• Turning off the Vertical sync feature improves frame rate.
• Visit http://en.wikipedia.org/wiki/List of Nvidia graphics processing units for a complete list
of NVIDIA boards and comparisons.
• Visit http://en.wikipedia.org/wiki/List of AMD graphics processing units for a complete list of
AMD boards and comparisons.
• Some visualization modules like Volume Rendering may not support Intel graphic cards.
System memory is the second most important determinant for Avizo users who need to process large
data.
You may need much more memory than the actual size of the data you want to load within Avizo.
Some processing may require several times the memory required by the original data set. If you want
to load, for instance, a 4 GB data set in memory and apply a non-local means filter to the original
data and then compute a distance map, you may need up to 16 or 20 GB of additional memory for the
intermediate results of your processing. Commonly you will need 2 or 3 times the memory footprint
of the data being processed for basic operations. For more complex workflows you may need up to 6
or 8 times amount of memory, so 32 GB may be required for a 4 GB dataset. Due to the potentially
high memory requirement we highly recommend running on 64-bit computer and operating systems.
Also notice that size of the data on disk may be much smaller than memory needed to load the data as
the file format may have compressed the data (for instance, loading a stack of JPEG files).
Avizo’s Large Data Access (LDA) technology will enable you to work with data sizes exceeding your
system’s physical memory. LDA is an excellent way to stretch the performance, but it is not a direct
substitute for having more physical memory. The best performance and optimal resolution will be
achieved by using Avizo’s LDA technology in combination with a large amount of system memory.
System Requirements 15
LDA provides a very convenient way to quickly load and browse your whole dataset. Note that LDA
data will not work with most compute modules, which require the full resolution data to be loaded in
memory.
Avizo provides another loading option to support for 2D and 3D image processing from disk to disk,
without requiring loading the entire data into memory; modules then operate per data slab. This
enables processing and quantification of large image data even with limited hardware memory. Since
processing of each slab requires loading data and saving results from/to the hard drive, it dramatically
increases processing time. Thus, processing data fully loaded in memory is always preferred for best
performance.
1.4.1.5 CPU
While Avizo mostly relies on GPU performance for visualization, many modules are computational
intensive and their performance will be strongly affected by CPU performance.
More and more modules inside Avizo are multi-threaded and thus can take advantage of multiple CPUs
or multiple CPU cores available on your system. This is the case for most of the quantification mod-
ules provided with Avizo, a number of modules of the Avizo XLabSuite Extension,and also various
computation modules.
Fast CPU clock, number of cores, and memory cache are the three most important factors affecting
Avizo performance. While most multi-threaded modules will scale up nicely according to the number
System Requirements 16
of cores, the scaling bottleneck may come from memory access. From experience, up to 8 cores show
almost linear scalability while more than 8 cores do not show much gain in performance. A larger
memory cache improves performance.
Large geometry rendering such as large surfaces from Isosurface or Generate Surface, large point
clusters, large numerical simulation meshes,...:
• Multiple CPU cores (for many modules, including most image processing modules),
• CPU clock frequency.
Anisotropic Diffusion, Non-Local Means Filter (high-performance smoothing and noise reduction im-
age filters) , Avizo XLabSuite Extension (absolute permeability computation):
System Requirements 17
Multi-display systems with Avizo XScreen Extension: tiled displays, immersive displays, virtual real-
ity:
GPU computing using custom module programmed using Avizo XPand Extension and GPU API:
An internet access is necessary to activate Avizo. Your firewall may prevent the connection to the
license server.
For more information, please refer to licensing troubleshooting (firewall problem).
1.4.3.2 Linux
• Red Hat Enterprise Linux 6.x, the official Linux distribution on which Avizo has been fully
tested.
• Red Hat Enterprise Linux 7.x, using some of the additional libraries from the
$AVIZO ROOT/lib/compat-LinuxAMD64 directory.
• CentOS 6 and Scientific Linux 6.
• 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
System Requirements 18
distribution using the following command:
sudo apt-get install libjpeg62 libstdc++6 libmotif4
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
• Even if Avizo should work with any desktop (like KDE), it has been validated only with
GNOME.
1.4.3.3 Mac OS X
In order to run CUDA enabled modules, Mac OS X requires the most recent CUDA driver for
Mac to be installed. At least version 8.x is required. 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 Extension modules using the CUDA API (even the examples)
will fail.
1.4.3.4 XPand
On Windows, in order to add custom extensions to Avizo with Avizo XPand Extension, you will need
Microsoft Visual Studio 2013 Update 4. The compiler you need depends on the version of Avizo you
have. You can obtain the version information by typing app uname into the Avizo console. Starting
from Avizo 9.3, Microsoft Visual Studio 2010 is no longer supported. To run the debug version of
System Requirements 19
Avizo an installed Visual Studio is required.
On Linux, in order to add custom extensions to Avizo with Avizo XPand Extension, you will need
gcc 4.4.x on RHEL 6. Use gcc –version to find out the version of the GNU compiler.
Currently, Avizo XPand Extension support is not available for Mac OS X El Capitan (10.11) nor
macOS Sierra (10.12). It will become available once Clang support has been completed.
1.4.3.5 Matlab
In order to use the Calculus MATLAB module, that establishes a connection to MATLAB (The
MathWorks, Inc.), some installation steps must be followed.
Windows
If you did not register during installation, on the Windows command line you can enter the command:
matlab /regserver.
Linux
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.
Mac OS X
System Requirements 20
The LD LIBRARY PATH environment variable should be set and the PATH variable must be updated
with the MATLAB binaries directory. For example for MATLAB2015a:
This will set the environment variables for the current terminal session.
Avizo must be run from this terminal session to enable access to MATLAB librairies.
To set these variables for a global environment, please refer to the Mac developer zone.
Matlab can be used on OSX10.12 only after deactivation of System Integrity Protection:
Deactivation of System Integrity Protection (http://www.imore.com/el-capitan-system-integrity-
protection-helps-keep-malware-away):
There are two main types of licenses: node-locked licenses and floating licenses.
Node-locked licensing allows the software to run on a single identified computer only.
If you have purchased Avizofloating licenses, one or several concurrent users can run Avizo sessions at
the same time from their computers located on your local network. The number of concurrent users is
given by the number of Avizo tokens purchased. In this case, you will have to install FlexNet Publisher
license server manager on a local server. Then, on each end user’s computer, you will need to specify
the location of this local licensing server (see FNP license server mode).
Licenses can be time-limited or perpetual. Time-limited licenses are valid until a given date, which is
shown in the product splash screen at start-up or in the About dialog (accessible via the Help > About
menu). After this date, Avizo will stop working. This is usually the case for trial licenses, Beta, or for
renewable rented licenses (yearly subscriptions).
• Use online local activation codes: to activate one or several node-locked licenses on a computer
with an internet connection,
• Use offline local activation codes: to activate one or several node-locked licenses on a computer
with no internet connection,
• Use FNP license server: to specify a license server to activate one or several Avizo (editions
and/or extensions) licenses.
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.
Note: An internet connection is required for all following actions. If you do not have any in-
ternet connection, please refer to the 1.5.3.2 documentation.
When you purchase one or more Avizo (editions and/or extensions) licenses, you should receive an
email from fei@flexnetoperations.com containing a set of activation codes for each purchased product
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 Licenses page, simply copy and paste your
activation codes into the provided text field and press Activate.
The Activate button is enabled when the activation codes into the provided text field respect this for-
mat:
<EntitlementId> [<HostId>] <ProductName>_<ProductVersion> .
HostId is optional.
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 9.3
Add new node-locked license after activation
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 Licenses (see figure 1.3). Simply
copy and paste your activation codes into the provided text field and press Activate.
The Activate button is enabled when the activation codes into the provided text field respect this
format:
<EntitlementId> [<HostId>] <ProductName>_<ProductVersion> .
HostId is optional.
After activating a node-locked license on a computer, you may wish to move it to a new one. To do
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.
Note: The previous version can still be used on the same computer even after upgrading to the new
version.
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, an error dialog is displayed with several choices, including
a Reactivate option.
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.
Launch Avizo and select the Evaluate option. On the first page of the Activation Wizard, you must
select Use local activation codes and click on Next. On the Activate Demo Licenses page, simply
copy and paste your activation codes into the provided text field and press Activate.
The Activate button is enabled when the format of activation code into the provided text field respect
this format:
<EntitlementId> [<HostId>] <ProductName>_<ProductVersion> .
HostId is optional.
A connection to the online activation server will start immediately. When activation is complete, the
product is ready to be used.
Figure 1.8: License Manager - Demo Activation Wizard - Configure Demo Version Licensing
When you launch a Beta version for the first time, or if your Beta licenses are expired, the Activation
Wizard is opened at the Configure Beta Version Licensing page. You must select Use local activation
codes and click on Next. On the Activate Beta Licenses page, simply copy and paste your activation
In offline activation mode, you will be able to perform the same actions than in 1.5.3.1 but without
any internet connection.
When you purchase one or more Avizo (editions and/or extensions) licenses, you should receive an
email from fei@flexnetoperations.com containing a set of activation codes for each purchased product
or option.
Launch Avizo and select Activate. On the first page of the Activation Wizard, you must select Use
offline activation codes and click on Next. In the Activate Licenses page, simply copy and paste your
Figure 1.11: License Manager - Beta Activation Wizard - Activate Beta Licenses
activation codes into the provided text field and specify a path to an XML file (a file with extension
.xml) that will contain your offline activation request. Then, press Next (see figure 1.12).
The Next button is enabled when the path of XML request file is specified and the format of activation
code respect this format:
<EntitlementId> [<HostId>] <ProductName>_<ProductVersion> .
HostId is optional.
When activation is complete, the product is ready to be used, and the license manager displays
information related to the activation.
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.15).
The license manager wizard is opened and displays the page Activate Licenses (see figure 1.12).
Simply copy and paste your activation codes into the provided text field and specify a path to an
XML file that will contain your offline activation request. Then press Next and follow the displayed
instructions (listed also in the 1.5.3.2 section).
The Next button is enabled when the path of XML request file is specified and the format of activation
code respect this format:
<EntitlementId> [<HostId>] <ProductName>_<ProductVersion> .
HostId is optional.
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.15) and click on the Deactivate Extensions
or Editions button. A dialog will open (see figure 1.16), allowing you to select the licenses you want
to deactivate and the path to the XML file that will contain your offline deactivation request. After
clicking on the Next button, the dialog displaying the offline instructions (listed also in the 1.5.3.2
section) will be displayed. Once the import of the deactivation request has been performed, the selected
licenses are returned to the server and can be activated on any other system.
Upgrading to a new Avizo version
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.
After clicking on the Upgrade button, a dialog will open (see figure 1.18), allowing you to select
the licenses you want to upgrade and the path to the XML file that will contain your offline upgrade
request. Then, click on the Next button: the dialog displaying the offline instructions (listed also in the
1.5.3.2 section) will be displayed. Once the import of the upgrade request has been performed (and
if the licensed modules are under maintenance), the selected licenses will be upgraded and the new
version of Avizo can be used immediately.
Note: The previous version can still be used on the same computer even after upgrading to the new
version.
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, an error dialog is displayed with several choices, including
a Reactivate option.
After clicking on the Reactivate button, a dialog will open (see figure 1.20), allowing you to select the
licenses you want to reactivate and the path to the XML file that will contain your offline reactivation
request. Then, click on the Next button: the dialog displaying the offline instructions (listed also in the
1.5.3.2 section) will be displayed. Once the import of the reactivation request has been performed (and
if you have renewed your subscription), the selected licenses will be reactivated and the new version
of Avizo can be used immediately for a new period of time.
Activate Demo Avizo licenses
Launch Avizo and select the Evaluate option. On the first page of the Activation Wizard, you must
select Use offline activation codes and click on Next. On the Activate Demo Licenses page, simply
copy and paste your activation codes into the provided text field and specify a path to an XML file that
will contain your offline activation request (see figure 1.5.3.2).
The Next button is enabled when the path of XML request file is specified and the format of activation
code respect this format:
<EntitlementId> [<HostId>] <ProductName>_<ProductVersion> .
HostId is optional.
Figure 1.21: License Manager - Demo Activation Wizard - Configure Demo Version Licensing Offline
Figure 1.22: License Manager - Demo Activation Wizard - Activate Demo Licenses Offline
When you launch for the first time a Beta version or if your Beta licenses are expired, the Activation
Wizard is opened at the Configure Beta Version Licensing page. You must select Use offline activation
codes and click on Next. On the Activate Beta Licenses page, simply copy and paste your activation
codes into the provided text field and specify a path to an XML file that will contain your offline
activation request (see figure 1.5.3.2).
The Next button is enabled when the path of XML request file is specified and the format of activation
code respect this format:
<EntitlementId> [<HostId>] <ProductName>_<ProductVersion> .
HostId is optional.
Then, click on the Activate button: the dialog displaying the offline instructions (listed also in the
1.5.3.2 section) will be displayed. Once the import of the activation request has been performed, the
product is ready to be used.
Figure 1.23: License Manager - Beta Activation Wizard - Configure Beta Version Licensing Offline
1. Install FlexNet Publisher license server manager on a local server of your LAN,
For explanations about how installing a FlexNet license server and managing floating licenses
(activation, upgrade, re-activation, return), please refer to:
www.fei-software-center.com/flexnet-server-doc/
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 FNP license server. Optionally, you can specify a port number
with a separator ”:” (<ServerName>:<PortNumber>). Using a specific port number depends on the
way the server is configured. In such a case, please contact your server license administrator for more
information about the FNP license server configuration and the potential need to indicate a specific
port number.
Note: It is possible to test the connection to the specified server using the Test button.
Reconfigure
You can change your configuration mode at any time, but this action requires that you restart the
application.
To do so (in local activation mode), select Help > License Manager and click on the Reconfigure
Licensing button.
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.
When using Avizo node-locked activation codes, please deactivate them before any of the following
operations:
Otherwise, you will not be able to re-activate them on another system as they will still be activated on
the original system, and it will be difficult or impossible for you to deactivate them for a transfer.
To deactivate Avizo, please read the following instructions according to your licensing mode: online
or offline.
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.
You can set the environment variable via the Control Panel for Windows or you can set it in a
command prompt on all platforms.
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\Avizo9\bin\arch-Win64VC12-Optimize
4. Run Avizo as follows:
Avizo.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.
• Avizo
• Getting started with Image Processing and Analysis - the basics for 3D image processing
• Distribution of distance between 2 phases - measuring a catalyst
• Separation, Measures and Reconstruction - advanced pore reconstruction
• Granulometry - distribution of pore diameters
• Pore Thickness Computation - average thickness of pores
• Advanced segmentation - using watershed with segmentation editor or wizard
• Image filtering - choosing, tuning, and combining image filters
• Registration, Alignment and Data Fusion - registration of surfaces and images
• More about label measures - selecting the measures to perform on labels and creating
your own measures
• Advanced surface and grid generation - meshing and numerical simulation
Avizo technical support can be contacted using the Online Support item in Avizo Help menu or using
the contact information in Section 1.7 (Contact and Support). FEI technical support is dedicated to
FEI SAS
3, Impasse Rudolf Diesel, Bat A - BP 50227
F-33708 Merignac Cedex
France
Hotline requests
Phone: +33 556 13 37 71
Fax: +33 556 13 02 10
Email: fei-sw-support@fei.com
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.
• Run Avizo Lite Edition from the start menu for the Avizo Lite Edition for Scientific Visualization
• Run Avizo from the start menu for the Avizo for Materials Science
• On a Windows system, select the Avizo or AvizoLite icon from the start menu.
• On a Unix system, start Avizo or AvizoLite by launching the script bin/start.
• On a Mac OS X system, select the Avizo or AvizoLite icon from the Application menu.
When Avizo is running, a window like the one shown in Figure 2.1 appears on the screen. This Start
Figure 2.1: The AvizoStart page
1. Recent Data: allows opening data using Open Data button and displays all data recently
opened (at first start, this section is empty).
2. Recent Project: allows opening project using Open Project button and displays all project
recently opened (at first start, this section is empty).
3. Create New Project: allows creating a new project using Blank Project button.
4. Help: contains some links to help of Avizo.
5. News: contains some news on Avizo.
6. Follow us: contains some links to follow Avizo community.
7. Workrooms toolbar: provides quick access to some important workrooms. See specific docu-
mentation of workroom toolbar.
When switching to Project workroom, a window like the one shown in Figure 2.2 appears on the
screen. The user interface is divided into three major regions.
1. The Project View will contain small icons representing data objects and modules.
2. The Properties Area displays interface elements (ports) associated with Avizo objects.
3. The 3D viewer window displays visualization results, e.g., slices or isosurfaces.
You can also activate the help browser by pressing F1, selecting User’s Guide from the Help menu, or
by typing help in the console window.
After selecting this menu item, the file dialog appears (see Figure 2.3). 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 chocolate-bar.am and press
OK.
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 chocolate-bar.am contains 3D image data of
Loading Data 51
Figure 2.3: 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.
a chocolate bar. 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 ”chocolate-bar 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 2.4).
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.
Figure 2.4: Data objects are represented by green icons in the Project View. Once an icon has been selected information about
the data set such as its size or its coordinate type is displayed in the Properties Area.
Loading Data 52
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 access modules via
the menu interface to help familiarize you with the organization of modules within Avizo.
Further information about particular editors is provided in the user’s reference manual.
• Right-click 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 chocolate bar data set.
Invoking Editors 53
Figure 2.5: 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.
Now a 2D slice through the chocolate bar is shown in the viewer window. Initially, a slice oriented
perpendicular to the z-direction and centered inside the image volume is displayed. Slices are num-
bered 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.
• 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.
Data Import 56
Figure 2.7: The Ortho Slice module is able to extract arbitrary orthogonal slices from a regular 3D scalar field or image volume.
index section of the user’s guide. Usually, the system recognizes the format of a file automatically
by analyzing the file header or the filename suffix. If a supported format is detected, the file browser
indicates the format name.
Often, 3D image volumes are stored slice by slice using standard 2D image formats such as TIFF
or JPEG. In case of medical images, slices are commonly stored in ACR-NEMA or DICOM format.
If you select multiple 2D slices simultaneously in the file browser, all slices will automatically be
combined into a single 3D data set. Simultaneous selection is most easily achieved by first clicking
the first slice and then shift-clicking the last one.
If your data is not already present in a standard file format supported by Avizo, you will have to write
your own converter or export filter. For many data objects such as 3D images, regular fields, or tetrahe-
dral grids, Avizo’s native Avizo format is most appropriate. Using this format you can even represent
point sets or line segments for which there is hardly any other standard format. The Avizo format
Data Import 57
documentation explains the file syntax in detail and contains examples of how to encode different data
objects. One important Avizo data type, triangular non-manifold surfaces, cannot be represented in a
Avizo file but has its own file format called HxSurface format.
Alternatively, with Avizo XPand Extension, a C++ programmer can extend Avizo in order to integrate
a custom reader or writer.
Finally, in case of images or regular fields with uniform coordinates, you may also read binary raw
data. Note that for raw data the dimensions and the bounding box of the data volume must be entered
manually in a dialog box which pops up after you have selected the file in the file browser.
Data Import 58
Chapter 3
Avizo provides extensive support for importing, visualizing, and processing 2D and 3D images. For
an overview of related features, please refer to the section 1.2. 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.
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
box.
• Use the dragger box in the viewer to resize the subvolume.
• Press the Apply button.
• Attach an Isosurface module to the grain2.view (set threshold set to 100).
• Press Apply.
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.
or microscopy data, using a limited amount of memory. It is possible to convert original data of the
following types: Avizo, RawData, and StackedSlices (stacks of SGI, TIFF, GIF, JPEG, BMP, PNG,
JPEG2000, PGX, PNM, and RAS raster files). LDA data allows subvolume extraction to display parts
of the volume, or multi-resolution access to have a full subsampled view or accurate refined local
views.
Note: in standard, Avizo can support up to 8GB size LDA data. Above 8GB, you will need the Avizo
XLVolume Extension.
In particular, the following topics will be discussed in this tutorial:
4. Out-of-core conversion
5. Displaying an ortho slice, a slice, and a 3D volume
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 3.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 3.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 3.8):
• Convert to Large Data Access (LDA) format: 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 as External Disk Data: read data blocks from disk, allowing almost continuous disk access.
Please select ”Convert to Large Data Access (LDA) format”. Then, on the next dialog (Destination
file), specify the LDA destination file. grain.lda in a temporary folder for instance (see Figure 3.9).
Note: A .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 3.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 3.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.
The converted file is now in the Project View ready to be used and connected to other modules.
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 2 (Getting Started): a 3D image data set
of a part of a 235 x 175 x 295 CT scan of a chocolate bar.
Visualizing 3D Images 70
Figure 3.12: Project display (viewer and Project View)
• Connect a Bounding Box module to the data (use right mouse on chocolate-bar.am).
• Connect an Ortho Slice module to the data.
Visualizing 3D Images 71
• 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 the section Getting Started.
Figure 3.13: Chocolate bar data set visualized using three orthogonal slices.
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
Visualizing 3D Images 72
called Slice. You might want to try it by selecting it from the Display submenu of the chocolate bar
data popup menu.
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.
A new green data icon representing the output of the resample computation named chocolate-
bar.Resampled is created. You can treat this new data set like the original chocolate bar data. In
the popup menu of the resampled chocolate bar you will find exactly the same attachable modules and
you can save, export and load it like the original data.
Visualizing 3D Images 73
Figure 3.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.
You may want to compare the resampled data set with the original one using the Ortho Slice module.
You can simply pick the black 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 gray.
• Turn off the viewer toggle off the Ortho Slice module.
• Connect an Isosurface module to the resampled data record and select it.
• Adjust the threshold port to 450 or a similar value.
Visualizing 3D Images 74
• Press the Apply button.
Visualizing 3D Images 75
• Select the chocolate-bar.am data icon.
• Click on the Crop Editor button in the Properties Area.
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 a later sessions, you should save it by choosing Save Data As ... or Export 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
first slice of the data set will be duplicated as many times as necessary. Also, the bounding box will be
updated automatically.
Visualizing 3D Images 76
Figure 3.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.
• Set the range in the Colormap port of the Volume Rendering to 410..1910.
• Select the Volume Rendering Settings and change the lighting to none.
By default, emission-absorption volume rendering is shown. The amount of light being emitted and
absorbed by a voxel is taken from the color and alpha values of the colormap connected to the Volume
Rendering module. In our example the colormap is less opaque for smaller values. You may try to set
the lower bound of the colormap to 0 or 900 in order to get a better feeling for the influence of the
transfer function.
The module Volren is the latest addition to volume rendering in Avizo and takes full advantage of the
capabilities of modern graphics boards.
The Volren module provides several visualization techniques: shaded and classical texture-based vol-
ume rendering (VRT), maximum intensity projection (MIP), and digitally reconstructed radiograph
(DRR). The standard VRT and its shaded version enable a direct 3D visualization with flexible color
Visualizing 3D Images 77
Figure 3.17: The Volume Rendering module can be used to generate volume renderings based on an emission-absorption model.
and transparency colormaps with virtual lighting effects for better rendering of complex spatial struc-
tures and enhancing fine detail. The MIP rendering allows the visualization of the highest or lowest
intensity in a data volume along the current line of sight. The DRR simulates a radiograph display
from arbitrary views using the loaded volume data. Furthermore, the Volren module enables you to
render segmented regions at the same time with different colormaps. A LabelField can be attached
to the Volren and each material of the label list can be rendered separately. In order to optimize the
performance, the image volumes are represented at lower resolution when the rendering is done inter-
actively. For relatively large image volumes, you can also switch to a constant ”Low Resolution” mode
(see below). Volren is built for use with popular graphics accelerator technology such as the NVIDIA
Quadro FX graphics boards.
• Remove all objects in the Project View other than the chocolate-bar.am data record.
• Connect a Volren module to the data.
Visualizing 3D Images 78
Figure 3.18: Lighting computation are applied to the volume rendering, resulting in an easier to understand representation.
• Select the data icon and read off the range of data values printed on the first info line
(410...1910).
• Select the Volren module and enter the range in the Colormap port.
• On some systems, a significant slowdown can occur if the data set is larger than the available
texture memory (which is typically 4 - 16 MB). In this case, select the option LowRes only (see
below).
• When two or more Volren modules are used to render intersecting volumes (multivolume render-
ing), some rendering inaccuracies may occur. In case of multivolume rendering, the supported
combinations of modes are one MIP together with one MIP or one VRT with one VRT (see
below Mode). Other modes and combinations may lead to incorrect visual results.
Visualizing 3D Images 79
Figure 3.19: The Volren module can be used to generate maximum intensity projections as well as volume renderings based on
an emission-absorption model.
Visualizing 3D Images 80
• The Apply button is enabled only when the rendering must be recomputed.
The Volume Rendering module has been developed to take advantage of modern graphics hardware.
Rendering may fail on old generation graphics hardware. In some cases this can be solved by updating
the graphics driver. Otherwise the Volren or the Voltex module can be tried alternatively. Comparisons
between the three modules are given into Figure 3.20.
Visualizing 3D Images 81
Features Voltex module Volren module Volume Rendering module
(deprecated)
Mouse Picking No No Yes
Isosurface Rendering No No Yes (separate module)
Voxelized Rendering No No Yes (separate module)
DDR Rendering No Yes No
simulated Digitally Reconstructed
Radiograph
MIP Rendering Yes Yes Yes
Maximum Intensity Projection
Lighting and Shade effects No Yes Yes
Diffuse, Specular Diffuse, Specular, Enhanced,
Edge, Boundary, Ambient,
Deferred, High Quality
User-defined light coefficients No Yes No
Light angle control No Yes Yes
Port Shading: User-defined Menu View ¿ Light
to create custom light and
deactivate headlight
Cast shadows No No Yes
Multi-Channel Field input Yes No Yes
Color Field input (RGBA) Yes Yes Yes
Label field secondary input and No Yes No
per-label colormap
Label colormap support (cy- No No Yes
cling, no interpolation)
Multi-Volume support Limited Yes Yes
Support for data larger than Yes Yes Yes
graphics memory Very limited bricking Full resolution when still, Progressive adaptive resolution,
with uniform resolution Low resolution during interaction limited by memory threshold
Support for data larger than the No No Yes
main memory (RAM) converting data into LDA format
LDA format support No No Yes
Large Data Access for progressive
loading, instant preview,
quick extract from out-of-core
data
ROI Box: Region of Interest Yes Yes Yes
Custom ROI No Yes Yes
Corner Cut: exclusion corner ROI Box for Volume Rendering:
exclusion box, fence, cross, sub-
volume
Hardware Support Old graphics boards Modern graphics boards with up- Modern graphics boards with up-
dated driver (e.g. NVIDIA dated driver (e.g. NVIDIA
Quadro) Quadro).
Requires support for advanced
shaders
Requires high-level OpenGL fea-
tures that
may be unavailable or buggy on
specific graphic cards,
consider using Voltex as an alter-
native
To create a Voltex from the Con-
sole, type command:
create HxVoltex
Figure 3.20: Comparisons between Volren, Volume Rendering and Voltex modules
Visualizing 3D Images 82
3.3 Combined 3D and 2D views with Ortho Views (Avizo)
This tutorial requires an Avizo license (Avizo Lite Edition license is not sufficient).
In this tutorial, you will learn the basics to efficiently visualize and examine 3D images with Avizo:
You may use this tutorial as a quick start for visualizing and manipulating 3D images with Avizo.
However, you should be familiar with the basic concepts of Avizo to take full advantage of this tutorial.
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 2 - Getting started. To complement this
tutorial, you may also review section 3.2 (Visualizing 3D images) of Avizo Lite Edition about basic
3D image visualization techniques.
You can now try some interaction. You can refer to Section 2 (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 magnifying
glass icon, otherwise press the [ESC] key or use a toolbar button to switch to viewer navigation
mode.
• In the 3D viewer, you can rotate the view. For this, the mouse cursor shape should be a hand
icon, otherwise press [ESC] key or use a toolbar button to switch to viewer navigation mode.
• In the Properties panel of the Ortho Views module, you can drag the sliders controlling the slice
number.
• You can alternatively pick crosshair lines in the 2D views to move the corresponding slices. For
this, you may need to switch to pick interaction mode by pressing the [ESC] key or pressing
viewer toolbar button Interact.
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 Intensity Ranges Contours overlay module displaying over the orthogonal slices a set of con-
tours corresponding to intensity levels defined by Intensity Range Partitioning, 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.
• In the Properties panel, click on the clip button (the little cube split by a blue line, see Figure
3.23) 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 3.24).
• 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 8.1.9 about in Project Views.
• You can hide slices, intensity ranges contours, and crosshair, and show volume rendering, as
shown in Figure 3.25. You will need to use visibility buttons of Ortho Views, Bkg Properties,
Intensity Ranges Contours and Volume Rendering modules as shown in Figure 3.26.
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
viewers, and press the Four viewer button to restore the Ortho Views layout.
• Overlay representations can be combined with images slices, as illustrated by the Intensity
Ranges Contours of the Ortho Views Template described earlier in this chapter. You can also
control the display ordering of overlays by the Layer order port of the Bkg Properties module
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 Intensity Range Partitioning tools let you define ranges so that visualization and computation
modules can take advantage of this pre-defined identification. Intensity Range Partitioning is used at
several locations in Avizo. For example, it allows adjusting the range depicted by a port to a particular
• 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 Intensity Range Parti-
tioning options are set according to the defaults shown on Figure 3.28: 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 3.29
As outlined in section 3.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 3.30. 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 Intensity Range Partitioning 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 3.31).
• 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 Partitioning intends to provide presets matching to some intensity ranges. This ranges
can be easily selected to display a given data set. 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.
• Select the data object motor.am in the Project View and look at the data info in the Properties
panel (see Figure 3.32).
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 Intensity Range Partitioning editor by clicking its toggle button (with an histogram
ruler symbol) beside data title in the Properties panel as shown below. You can see the defined
• Press the Show range distribution button to display the data histogram, separated here in two
regions/ranges as shown in Figure 3.34.
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: Intensity Range Partitioning 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 accu-
rate identification 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 Intensity Range Partitioning 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 3.35.
More hints:
• In the Preferences, you can disable Intensity Range Partitioning, 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
Intensity Range Partitioning.
• Tip: The data window and ranges are defined as persistent data parameters when you save your
data to an Avizo format (see Section 8.2.7 Data parameters).
Segmentation of 3D Images 94
images and desired results.
This tutorial introduces each approach and comprises of the following steps:
This will automatically launch the Segmentation workroom thereby replacing the Project View and
Properties panels on the left and the 3D viewer on the right. At the same time and not currently visible,
a new data object will be added to the Project View that will hold the segmentation results. This is
the data object to be saved. By default, the Segmentation Editor operates in four-viewer mode. In
this mode, the three-slice viewer with XY, XZ, and YZ orientations are shown together with one 3D
viewer. Alternatively, single- or two-viewer layouts are possible. In two-viewer layouts (horizontally
stacked or side-by-side) a slice viewer is combined with a 3D viewer while in single viewer mode one
(XY) slice of the image is shown. You can change the orientation of the slice by either selecting an-
other orientation from the Segmentation/Orientation menu or by clicking Single-viewer in the viewer
toolbar multiple times which cycles through the different 2D views (XY, XZ, and YZ) and a 3D view.
The tools of the Segmentation Editor are displayed in the panel where the Project View and Properties
Area are normally displayed.
1. Switch to the four-viewer layout by clicking Four viewers in the viewer toolbar.
2. In the XY view, use the slider on the bottom to scroll through the slices. Go to slice 30 and you
will see six bright structures.
3. If necessary, click - of the Zoom Tool in the upper-right corner of the viewer to get a view of the
entire slice.
4. Click the brush icon in the the Tools area of the Segmentation Editor’s main panel.
5. Mark one of the structures with the mouse. Hold down CTRL to deselect incorrect pixels, if
necessary.
6. When finished, select the entry Inside in the Materials list. Then click + in the Selection group.
The pixels selected previously are now assigned to material Inside.You can right-click Inside in the
Materials list and choose a different draw style (e.g, dotted).
Segmentation of 3D Images 95
Figure 3.39: Selecting two Structures by using One Slice
1. Click the Materials list and select New Material from the right-button menu.
2. Mark a second structure using the brush, select the new material in the Materials list, and assign
the pixels to that structure (See Figure 3.39).
3. Go to slice 31 and practice by segmenting the same two structures.
Hint: If you prefer to work with one larger view rather than four small views, click Single Viewer in
the viewer toolbar. To cycle through each of the four views, click Single Viewer repeatedly. To return
to four-viewer mode, click Four Viewers.
If the changes from slice-to-slice are small, you can use interpolation.
1. Go to slice 30 and mark the top right structure using the brush. Go to slice 35 and mark the same
structure.
2. Select from the menu bar: Selection/Interpolate.
3. Scroll through the dataset. You will see that the slices 30 to 35 are now also selected.
4. To assign the selected pixels of all slices to the material Inside, select it in the Materials list,
then click + in the Selection group.
5. Repeat the procedure between slice 35 and 45.
6. Repeat the procedure for one of the left structures.
Hints:
Segmentation of 3D Images 96
• While segmenting, it is recommended that you frequently save the segmentation results. To do
so, switch to the Project View by clicking Project in the Workroom Toolbar. Then select the
icon of label image and select Save or Save As... from the AvizoFile menu. Click Segmentation
in the Workroom Toolbar to return to the Segmentation Editor workroom.
• The Brush Tool is probably the most basic segmentation tool. It can be noted that the editor
provides additional tools and functions that are described on the Segmentation Editor help pages.
• There are useful keyboard short cuts, including +(-) to add (remove) a selection to (from) a
material, SPACE and BACKSPACE to change the slice number, and d to change the material
draw style.
• You might want to give materials more meaningful names or different colors. To do so, double-
click the material name and enter a new name, or double-click the color button left to the name
and choose a different color in the Color Dialog.
A new panel in the application window shows a similar table. The *.MaterialStatistics object can
be saved to text (*.txt), to comma separated values file (*.csv), or to Micrsosoft XML Spreadsheet
(*.xml).
Note: If Units Management (see Edit/Preferences/Units) is turned off, the physical units of the values
in the volume column are implicit and the voxel size scales objects only within this implicit physical
unit. No physical units are shown in the column headers. In the case of motor.am, the voxel size is
in m. Thus, the numbers given in the Volume column have to be read as m3 . If Units Management is
turned on, the physical units specified as Display units are shown in the column header.
Segmentation of 3D Images 97
this can be achieved also by filtering the image before performing the segmentation. Under favorable
conditions, a satisfying segmentation can be achieved automatically based solely on the gray values of
the image data.
The first step is to separate the object from the background. This is done by classifying the voxels into
foreground and background voxels on the basis of their intensities or voxel values.
1. Clear the Project View area by selecting Project/Remove All Objects from the main menu.
2. Load the motor.am data record from the directory data/tutorials.
3. Attach a Image Segmentation / Multi-Thresholding module to the data icon and select it.
4. Type 85 into the text field of port Exterior-Range1. You may also determine some other thresh-
old that separates exterior and interior as described in the tutorial on Image Data Visualization.
5. Click Apply.
With 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 Inside. This may,
however, cause voxels to be labeled that are not part of the object but have voxel values above the
threshold. This can be suppressed by setting the remove couch option, which assures that only the
largest coherent area will be labeled as the foreground (Inside) and all other voxels are assigned to the
background (Exterior).
Clicking Apply creates a new data object motor.labels. This data object is a Label Field, has the
same dimensions as motor.am, and contains an Inside or Exterior label for each voxel according to the
segmentation result.
1. Select the motor.labels icon and click Segmentation Editor in the Properties Area.
1. In the YZ view, use the slider on the bottom to select slice 206.
2. Select a suitable magnification by clicking the + or - buttons of the Zoom Tool (last tool in the
Tools area).
The image segmentation editor shows the image data to be segmented (motor.am) as well as greyish
contours representing the borders between Inside and Exterior regions as contained in the motor.labels
data object. As you can see, the borders are not smooth and there are small islands bordered by cyan
contours. This is what we want to improve now.
Segmentation of 3D Images 98
Figure 3.40: Segmented CT Scan Data
1. Select Remove Islands... from the Segmentation menu. In response, a dialog box will appear.
2. In the dialog box, select the all slices mode. Then press Highlight all islands in order to highlight
all islands smaller or equal to 15 voxels.
3. Click Apply to merge all islands with the material they are embedded in.
4. To further clean up the image, select Smooth Labels... from the Segmentation menu. Another
dialog box will appear.
5. Select the 3D volume mode and click Apply to execute the smoothing operation.
6. To examine the results of the filter operations, browse through the label image slice-by-slice. In
addition to the slice slider, you may also use the cursor-up and cursor-down keys for this.
7. Return to the Project View using the workroom toolbar.
Segmentation of 3D Images 99
4. Image Segmentation / Correlation Histogram. This module can create a label image from corre-
lated regions in two images sets, typically after registration.
5. Image Segmentation / Interactive Thresholding and other tools from Avizo. This extension of-
fers advanced tools for quantification, including object separation and labelling. See Advanced
Image Processing, Segmentation, and Analysis tutorials.
Prior to segmentation, think about improving image quality and reducing noise in the dataset with:
Examples:
The region of interest should be centered in the middle of the image volume, as the optics of the
microscope usually has the least aberrations in this region and it helps to avoid possible boundary
artifacts, which can arise during the deconvolution procedure. Especially for widefield data, it is
important to record a sufficiently large (preferably empty) region below and above the actual sample.
Ideally, this region should be as large as the sample itself. For example, if the sample covers 100
micrometers in the z-direction, the scanned image volume should range from 50 micrometers below
the sample to 50 micrometers above it.
The sampling rate is determined by the pixel sizes in the x and y directions as well as the distance
between two subsequent optical sections, both measured in micrometers. Generally speaking, image
deconvolution works best if the data is apparently oversampled, i.e., if the pixel or optical section spac-
ing is smaller than required. The maximal required sampling distance (Nyquist sampling, described
in R. Heintzmann. Band-limit and appropriate sampling in microscopy, chapter 3, Vol. III, in: Cell
Biology: A Laboratory Handbook, Julio E. Celis (ed.), Elsevier Academic Press, 29-36, 2006) to avoid
ambiguities in the data can be obtained from considerations in Fourier-space yielding
λ
dxy = ,
4 NA
where λ denotes the wavelength and NA is the numerical aperture of the microscope. Similar consid-
erations yield for the maximal distance between adjacent image planes:
λ
dz = ,
2 n (1 − cos(α))
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.
The total number of optical sections is obtained by dividing the height of the image volume by the sam-
pling distance dz . It should be mentioned that deconvolution also works if the sampling distances are
not matched rigorously, but matching them improves the chances to get good results. In general, over-
sampling the object is less harmful than undersampling it, with one exception: In the case of confocal
data, the sampling distance dxy should not be much smaller than indicated, if the blind deconvolution
algorithm or the non-blind deconvolution algorithm together with a theoretically computed confocal
PSF are used. Otherwise, the unconstrained Maximum Likelihood algorithm and the predominant
noise in the data might lead to unsatisfactory results.
Before grabbing images from the microscope’s camera, the light level should be adjusted in such a
way that saturated pixels, either black or white ones, are avoided. Saturated pixels are pixels that are
clamped to either black or white because their actual intensity values are outside the range of rep-
resentable intensities. In any case, saturation means a loss of information and thus prevents proper
post-processing or deconvolution. At the same time, a high background level should be avoided be-
cause it decreases the dynamic range of the imaging system and the deconvolution works worse. This
means that empty regions not showing any fluorescence should appear almost black. A background
level close to zero is especially important when bead measurements are performed in order to extract an
experimental point spread function. Details are discussed is a separate tutorial about bead extraction.
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 ROOT/data/deconv.
The data set shows four chloroplasts in a spore of the moss polytrichum commune.
Besides the image data itself, for the standard non-blind deconvolution algorithm a so-called point
spread function (PSF) is also required. The PSF is the image of a single point source, or as a close
approximation, the image of a single fluorescing sub-resolution sphere. PSF images can either be
computed from theory (see below) or they can be obtained from measurements. In the latter case, tiny
so-called beads are recorded under the same conditions as the actual object. This means that the same
objective lens, the same dye and wavelength, and the same immersion medium are used. Typically, the
images of multiple beads are averaged to obtain an estimate of a single PSF. Avizo provides a module
The PSF appears as a bright spot located in the middle of the image volume (Figure 3.41). 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.
Next, select both the PSF and the image data. You’ll notice that the voxel sizes of both objects are not
the same. It is recommended to adjust different voxel sizes of PSF and image data prior to deconvo-
lution using the Resample module. The deconvolution module itself also accounts for different voxel
sizes, but it does so by using point sampling with trilinear interpolation. This is OK as long as the
voxel size of the PSF is larger than that of the image data. However, in our case the voxel size of the
PSF is smaller than that of the image data, i.e., the resolution of the PSF higher. Using the Resample
module provides slightly more accurate results here, since all samples will be filtered correctly using
a Lanczos kernel.
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
of a single voxel in z-direction is bigger now.
After a suitable PSF has been obtained, we are ready for deconvolving the image data set. This can be
done by attaching a Deconvolution module to the image data.
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 3.43 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.
Sometimes bead measurements are difficult to perform, so that an experimental PSF cannot easily be
obtained. In such cases, a theoretical PSF can be used instead. Avizo provides the module Generate
Point Spread Function, allowing you to calculate theoretical PSFs. The module can be created by
selecting Images And Fields / Generate Point Spread Function from the Project >Create Object...
menu of the Avizo main window.
Once the module is created, some parameters have to be entered again. The resolution and the voxel
size can be most easily specified by connecting the Data port of the PSGGen module to the image data
set to be convolved. In our case, please connect this port to polytrichum.am.
In order to generate a PSF, you also need to know the numerical aperture of the microscope objective,
the wavelength of the emitted light (to be entered in micrometers!), and the refractive index of the
immersion medium. In our test example, these values are NA=1.4, lambda=0.58, and n=1.516 (oil
medium). Also, change the microscopic mode from widefield to confocal.
After you press the Apply button, the computed PSF appears as an icon labeled PSF in the Project
View. You can compare the theoretical PSF with the measured one using the Ortho Slice module.
You’ll notice that the measured PSF appears to be slightly wider. This is a common observation in
many experiments.
Once you have computed a theoretical PSF, you can perform non-blind deconvolution as described
above. However, for convenience the Deconvolution module is also able to compute a theoretical
PSF by itself. You can check this by disconnecting the Kernel port of the Deconvolution module.
If no input is present at this port, additional input fields are shown, allowing you to enter the same
parameters (numerical aperture, wavelength, refractive index, and microscopic mode) as in PSFGen.
After these parameters have been entered, the deconvolution process again can be started by pressing
the Apply button.
Note that any previous result connected to the Deconvolution module will be overwritten when starting
the deconvolution process again. Therefore, be sure to disconnect a previous result if you want to
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.
Border width: The same as for standard non-blind deconvolution, the image data must 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. For this data set we specify a small guardband region of 8 voxels in
the x- and y-direction. In the z-direction we add 10 slices as border region. The resulting size of the
data array on which the computation is performed is 256 x 256 x 266.
Note that for dimensions with a power of two (28 ), the Fast Fourier Transforms, the computationally
most expensive part of the deconvolution algorithm, can be executed somewhat faster.
Iterations: We choose a value of 25 here. Depending on the data, usually at least 10 iterations are
required. With overrelaxation being enabled (see below), results usually don’t improve much after 40
iterations.
Initial estimate: Specifies the initial estimate of the deconvolution algorithm. Since there is not much
noise present in the original alphalobe images, it is safe to chose input data here. This causes the
algorithm to converge even faster.
Overrelaxation: Overrelaxation is a technique to speed up the convergence of the iterative deconvolu-
tion process. We enable overrelaxation by chosing the fixed toggle.
After all parameters have been entered, the deconvolution process can be started. This computation
can take some time. Especially, if you want to deconvolve multiple data sets at once, it is inconvenient
to do this in an interactive session. Therefore, multiple deconvolution jobs can be submitted to the
Avizo job queue and then, for example, processed overnight. This works as follows:
• Press the Batch Job button of the Action port. A dialog as shown in Figure 3.46 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 decon-
volved 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
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.
1. Bead measurements
2. Projection Settings View and Projection Settings View Cursor
3. Resampling and averaging the beads
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 superior 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.
The bead data set contains five different beads which can be clearly seen in the three orthogonal planes
of the Image Ortho Projections module. In order to obtain a single PSF, we first want to select several
”good” beads. These beads are then resampled and averaged, thus yielding the final PSF. A bead can
be considered as ”good” if it is clearly visible and if it is not superimposed by other beads (even when
defocused),
Selecting ”good” beads is an interactive process. It is most easily accomplished using the Projection
Cursor module. This module allows you to select a point in 3D space by clicking on one of the three
planes of the Image Ortho Projections module. The third coordinate is automatically set by looking
for the voxel with the highest intensity. Points selected with the Cursor module can be stored in a
Landmarks data object.
The landmarks do not need 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.
Now we are ready to extract and average the individual beads. This is done by means of the Extract
Point Spread Function module.
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 3.50 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.
The following tutorials require an Avizo license (Avizo Lite Edition license is not sufficient).
• Getting started with Advanced Image Processing and Quantitative Analysis - the basics for using
Avizo for image processing and analysis
• Examples:
• Measuring a Catalyst - Masking and Distance Map
• Separating, Measuring and Reconstructing - Watershed Separation
• Distribution of Pore Diameters in Foam - Custom Measurement
• Average Thickness of Material in Foam - Separation Thickness
• Watershed Segmentation - advanced Segmentation
• More about Image Filtering - reduce image noise or artefacts or enhance features of interest
• More about label measures - manage several groups of measures
1. Image enhancement
2. Features extraction
3. Data measures and analysis
You should be familiar with the basic concepts of Avizo to follow this tutorial. 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 2 - Getting started. For routine use of Avizo you may benefit
from familiarity with Avizo image filtering and segmentation (see chapter 3 - Images and volumes
visualization and processing).
Getting started with Advanced Image Processing and Quantitative Analysis 124
Figure 4.1: Initial data
• 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 4.2).
• 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 4.3.
Getting started with Advanced Image Processing and Quantitative Analysis 125
Figure 4.3: After removing noise with a median filter.
4.1.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-
Getting started with Advanced Image Processing and Quantitative Analysis 126
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 4.4 and 4.5).
• Press the Apply button to start the module.
The output binary image named foam.thresholded is generated in the Project View (see Figure
4.6).
Getting started with Advanced Image Processing and Quantitative Analysis 127
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 dis-
plays 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 4.7.
Getting started with Advanced Image Processing and Quantitative Analysis 128
4.1.6 More hints about binarization
(This section is optional and is not required reading for completing the subsequent tutorials.)
Extensive tools are available in Avizo 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 Segmentation 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 modules that can facilitate automated binarization:
• Auto Thresholding automatically computes a threshold. You can choose the criterion best suited
to your data, generally factorisation.
• Interactive Top-Hat is a powerful tool for segmenting areas with non uniform backgrounds,
when simple thresholding fails to capture wanted features without unwanted noise. A top-hat
transform can be seen as a ”local thresholding”. Top-hat results are often combined with thresh-
old results using logical operation OR Image.
• Hysteresis Thresholding is used to achieve intermediate binarization between low and high
thresholds defining a safe retained area and a rejected area. You may use, for instance, In-
teractive Thresholding interface to interactively choose the thresholds before using Hysteresis
Thresholding. See also the Canny Edge Detector module.
• Many image filters like gradient or Laplacian can be used to help binarization, e.g., for Edge
Detection.
• Filtering regions based on measures, as shown later in this tutorial, can also be a powerful
technique for segmentation.
After binarization, it may be necessary to separate some objects, as shown in the next section.
4.1.7 Separation
In the example data set, 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.
Getting started with Advanced Image Processing and Quantitative Analysis 129
• Then press the Apply button. A foam.separate data is generated in the Project View.
• Attach the first Ortho Slice to the new data. See the resulting display on Figure 4.8.
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 (considering also 3D). For more details and advanced separation, see Example 2: Separating,
Measuring, and Reconstructing Individual Objects - Pores in Foam.
4.1.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 4.9 and 4.10).
The toolbar offers the possibility to:
Getting started with Advanced Image Processing and Quantitative Analysis 130
Figure 4.9: Analysis network
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 Advanced Image Processing and Quantitative Analysis 131
Figure 4.11: Analysis Panel toolbar: the histogram button
Volume3d, Area3d, BaryCenterX, BaryCenterY, BaryCenterZ and Mean. It is possible to define new
groups of measures, composed of pre-defined measures but also of user-defined measures. To learn
more on the subject, please refer to the dedicated tutorial in chapter 4.4 - Further Image Analysis.
Note: By default, if the unit management of Avizo is disabled, the results are displayed with ”pixel” or
”voxel” as the unit. You can enable the unit management of Avizo to display data and measurements
with units. Please refer to chapter 8.2.9 - Units in Avizo for all the details on how to use the unit
management in Avizo.
Loading the project data/tutorials/image-processing-advanced/GettingStartedBasics-5-Analysis.hx
will complete the steps above.
• Click on the label seek button of the analysis panel toolbar (see Figure 4.13). A new Ortho Slice
Getting started with Advanced Image Processing and Quantitative Analysis 132
is automatically attached to the separated image and displayed in the 3D viewer, as well as a
point dragger (see Figure 4.14).
• 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 4.15.
• 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.
Figure 4.14: Point dragger (brown lines crossing) in the 3D viewer corresponding to row 82
Getting started with Advanced Image Processing and Quantitative Analysis 133
Figure 4.15: Line in the histrogram corresponding to row 82
• 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 4.17.
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/image-processing-advanced/GettingStartedBasics-6-
FilterAnalysis.hx will complete the steps above.
Getting started with Advanced Image Processing and Quantitative Analysis 134
Figure 4.17: Filtering result
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 image. 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 4.20.
In such cases, it is mandatory to convert a 16-bit per voxel label image into a 8-bit per voxel label
image.
Getting started with Advanced Image Processing and Quantitative Analysis 135
Figure 4.18: Sieve Analysis module
Note: Avizo label images coming from the Segmentation Editor and Multi-Thresholding modules are
8-bit per voxel label images.
Getting started with Advanced Image Processing and Quantitative Analysis 136
Figure 4.20: Each particle has been identified and assigned a unique index
By default, module outputs will be created in the same way as the module inputs. As a consequence, in
order to process data fully on disk (input and output), you need to choose to Stay on disk when opening
the input data.
In addition to Visilog format files, you can use Stay on disk with other data formats such as .lda. You
can also load uncompressed Avizo files, Raw files as Large Disk Data.
4.1.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 see the chapter 4.3 - Example 3: Separating, Measuring and
Reconstructing.
4.1.15 Conclusion
This tutorial has introduced you to:
Getting started with Advanced Image Processing and Quantitative Analysis 137
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 can be used to perform sophisticated segmentation and
analysis of 3D data, but there are many more processing operations and measurements in addition to
those presented here.
Avizo gives you this extensive toolkit so that you can map the appropriate tools to any processing
challenge that confronts you.
To follow this tutorial, you should have read the first tutorial chapter 4.1 - Getting started with Ad-
vanced Image Processing and Quantitative Analysis 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 8.1.9 about 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
background (exterior). Here, a difficulty is the exterior intensity is close or identical to the intensity
within the pores, which prevents the use of simple thresholding to isolate exterior. Moreover, some
pores are connected with exterior, which prevents the use of ”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:
For searching an appropriate threshold, you can directly change the Threshold port. According to the
Preview Type port, the 2D or 3D preview is interactively rendered. Remember to check through the
whole volume by changing the Preview Slice Number and Preview Orientation ports. Other Avizo
modules can also be helpful for this task (see Section 3.2 Visualizing 3D Images).
Here, thresholding the image between 0 and 225 (see Figure 4.23) gives a binary image where:
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
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.
Here are the steps to fill the pores of the object:
Loading the project CatalystDistribution-3-Closing.hx will complete this tutorial step (see Figure
4.26).
Note: The artifact you may notice on the right side of the 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 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 popup 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.
Loading the project CatalystDistribution-4-DistanceMap.hx will complete this tutorial step (see Figure
4.27).
Masking
Masking will be used to compute the restricted distance map of the catalyst. The mask operation takes
a gray level image for first input, a binary image for second input (mask image), and provides a gray
level image for output where:
• 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-
dering, you can map the colormap range of the Ortho Slice to the full range (min-max) of
Catalyst.masked : set 0...93 as min-max in the Colormap port.
Loading the project CatalystDistribution-6-Masking.hx will complete this tutorial step (see Figure
4.29).
• 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
4.30).
To follow this tutorial, you should have read the first tutorial chapter 4.1 - Getting started with
Advanced Image Processing and Quantitative Analysis 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 4.2 - 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 4.33).
By dragging the cursor of the Slice Number port, you may notice some artifact holes (e.g., in slices 4,
Loading the project WatershedSeparation-2-DistanceMap.hx will complete this tutorial step (see Fig-
ure 4.34).
• 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.
Loading the project WatershedSeparation-3-MergedMaxima.hx will complete this tutorial step (see
Figure 4.35).
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.
The watershed algorithm requires a unique label for each region finally separated. Two regions with
the same value in input image would be merged.
Loading the project WatershedSeparation-4-Markers.hx will complete this tutorial step (see Figure
4.37).
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 4.39).
To complete the separation, you can subtract separation lines from the binary image of pores:
• 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.
• If a separation is missing, it means that a marker is missing,
• Separation ’lines’ may look too thick or wrong, just because the slice you are looking at is
somewhat tangent to a separation face.
• Unwanted separation may occur if the object shape is non-convex: this leads multiple local
maxima, therefore separated object. Small concavity in an object can lead to a separation across
it. A solution may be to increase the contrast factor of H-Maxima in order to make markers
larger and merged,
• A separation based on distance map may follow the shortest path, i.e., straight line instead of the
desired shape. This is because the watershed is driven by the distance: the separation is driven
by geometrical criterion.
• Chamfer Distance Map is a discrete chamfer map. You could use instead a more accurate eu-
clidian distance map (see Distance Map or other distance map types referenced into Image Pro-
cessing/Distance Maps from the object popup); however, this has little impact in most cases.
• 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 data set 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
• 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 the 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 4.42).
Secondly, you want to filter unwanted small objects, and finally, measure the volumes of individual
pores.
In order to remove small objects, you can use measures and measure filters as described in the Getting
started tutorial. This involves two steps:
In one of the next tutorials (chapter 4.4 - 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 4.43).
• 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 4.44).
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.
Displaying the resulting surface with a Surface View module may be very slow due to the large number
of surface polygons. In this case, a prior simplification of the surface is recommended for faster display
on your hardware.
Avizo also allows you to export the surfaces to various file formats, or to generate and export a tetra-
hedral model suitable, for instance, for finite element simulation with some external solver.
A demo script corresponding to this whole tutorial can be found in:
data/tutorials/image-processing-advanced/PorositySurfaceReconstruction.hx
It uses a script object located in data/tutorials/image-processing-advanced for automating the process-
ing. It matches the workflow described on the figure 4.41.
Once the script is loaded, you can optionally change several port values and click on the Apply button
of the Action port to start the processing.
• 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).
As shown on Figure 4.46, 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 4.47.
The Separate Objects module detects surfaces that separate agglomerated particles. These surfaces are
subtracted from the initial image, see Figure 4.48.
4.4.3 Third step: custom measure group definition to determine the distribu-
tion of pore diameters
The AvizoLabel 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 plotted in
order to produce a representation of the measure distribution.
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
• Create a new measure group by pressing the dedicated button next to the measure group selector
(1).
• In the popup 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
(3).
• Press OK.
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
4.4.4 Fourth step: custom measure definition to compute the sphericity of pore
Avizo provides a set of pre-defined native measures but it is also possible to save user-defined custom
measures.
• Enter the shericity formula in the dedicated field of the panel (see Figure 4.56).
• Press Close.
• Select Sphericity in the user measures list and use the arrow button to add it to the diameter
group.
• Press OK.
The Analysis panel is updated and displays the EqDiameter and Sphericity measures.
• Porosity Detection
• Detection of the Separation Surfaces
• Distance Map of the Material
• Calculation of the Material Average Thickness
Loading the project PorosityThickness-1-SeparationObjects.hx will complete this tutorial step (see
Figure 4.58).
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
4.59).
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.
Apply the NOT module to FoamPoro.zones.
Loading the project PorosityThickness-3-SeparationSurfaces.hx will complete this tutorial step (see
Figure 4.60).
• 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
4.62).
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 4.63).
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 use watershed for segmentation using different Avizo tools:
To follow this tutorial, you should have completed Avizo tutorial on Image Processing and Analysis
and be familiar with basic manipulation of Avizo. Preferably, you should also be familiar with the use
of the Segmentation Editor.
4.6.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 4.64). 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).
There are actually 3 phases that can be clearly distinguished in this data set:
• 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,
• 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 and click on ”Select Masked Voxels”. 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 4.66).
The labels we have defined will now be used as seed markers for watershed expansion.
A gradient magnitude image is calculate using quick Canny 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 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 4.67).
A new label image is created with markers expanded to the edges of the landscape image (i.e., maxima
of gradient magnitude gradient). This becomes the current label image being edited in the Segmenta-
tion 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 4.68).
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/chocolate-bar.am.
Auto-Thresholding
This dataset contains regions with mousse, caramel, chocolate and air.
One could try first segmenting 3 phases (air, mousse filling, chocolate) 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.
A mousse layer (light blue) seems to surround the chocolate topping (dark blue): the mousse between
the exterior and the chocolate is actually an artifact due to partial volume effect (see Figure 4.69 and
Figure 4.70). Adjusting the thresholds will not solve that issue. As illustrated in figure 4.71, the image
gradient gives useful hints on actual boundaries. Instead of using direct intensity thresholding, a more
robust method is shown in the next section that takes advantage of the image gradient.
Watershed Segmentation Wizard
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:
1. Define ”conservative” thresholds defining initial seed markers for air, mousse and chocolate,
• Remove Auto Thresholding module and its result data, leaving only chocolate-bar.am in
the Project View.
• Attach Watershed Segmentation wizard module to chocolate-bar.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 4.72). 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 147.
• At first step, you need to input the number of separate materials or phases to segment: let the
number of phases to 3 for air (exterior), caramel and chocolate.
• 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 4.73).
• 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.
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 not attempt fitting accurately to the object
edge at this point, but rather safely avoid areas when the actual material transition might occur. The
holes in the mousse should be marked in the phase 0. Otherwise, they will be included in the mousse
area.
In the next step, you can set the range for phase 1 (mousse).
• You can use 629-674 as range here. Again, the goal is to mark inner areas of the given material.
(see Figure 4.77). If you select a lesser lower range, areas between the air and the chocolate will
be selected, and it will result in the same artifact than the one introduced in Figure 4.69.
Finally, in the next step, you can set the range for phase 2 (chocolate).
• You can use 1041-1910 as range here (see Figure 4.78). The mousse area should be avoided as
much as possible.
• Press Apply to complete this step.
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 4.80).
Hat module, and combined with previous segmentation using the Segmentation Editor or Arithmetic
module.
An example result is data/tutorials/chocolate-bar-labels-4-phases.am.
results.
In this tutorial, you will learn how to:
1. Distinguish the different types of image filters 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 4.1 - 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.
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 careful use to not alter information contained in the image, especially for quantification
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). It
requires an Avizo license.
• 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. It
requires an Avizo license.
• Edge-Preserving Smoothing - a diffusion filter preserving edge
• Anisotropic Diffusion - a GPU accelerated diffusion filter. It requires an Avizo license.
• Curvature-Driven Diffusion - a diffusion filter that may better preserve thin structures. It requires
an Avizo license.
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.
4.7.1.2 Sharpening
These filters help reinforce the contrast at edges and make details appear sharper. Commonly used
sharpening filters are:
• Unsharp masking
• Delineate - also acts as smoothing filter. It requires an Avizo license.
These filters highlight boundaries between different materials or phases. They can be used, for in-
stance, to directly extract feature contours and edges, or in watershed-based segmentation.
(See tutorial 4.6.1 - Advanced segmentation).
Here are the most commonly used modules in that category:
• 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 globally 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
• Match Contrast - adjust image dynamics according to a reference. It requires an Avizo license.
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.
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 the 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 calculated on original and filtered preview
area, in order to see how the filter helps to better separate peaks. You can right-click in the
The following example illustrates possible techniques for filter combination, however it is not intended
to show the preferred 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 blended linearly using the normalized Sobel-filtered image (A) as follows:
B ∗ A + C ∗ (1.0 − A)
almost equal to 1/256). You could alternatively change A by A/256 in expression below.
• Press Apply to create Catalyst-filtered.to-float
• Attach an Arithmetic module to the Catalyst-filtered.to-float.
• Set Input B to Catalyst.filtered (result of Median Filter), Input C to
Catalyst2.filtered (result of Bilateral Filter).
• Set Expr to B*A + C*(1-A) and press Apply.
• Attach an Ortho Slice module to Result.
• Set Colormap range to 0-255.
The following four default groups 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.
• Standard Shape Analysis group contains standard shape parameters measures.
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. To add
Attributes Editor. There are five kinds of attributes that can be edited through this editor:
• 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
default, there are 10 angles, every 18 degrees.
• Feret 3D angles for Feret 3D measures, which perform measurements in 3D space around each
cell. By default, 31 3D samples are used.
• Co-occurrence directions for measures based on the computation of a co-occurrence matrix to
classify a given direction (dx,dy) in pixels pairs by their gray level. The co-occurrence matrix
components are given by :
M (i, j) = number({x, y}/I(x, y) = i ∩ I(x + dx, y + dy) = j)
where I(x,y) is the image gray level at coordinates (x,y). This equation means that for a given
pair (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 gray levels of the image
i,j=1
These operations allow being 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 gray level histogram of
each label. Configurable attributes are in the range of gray values to consider and the size of the
IMPORTANT: Attribute 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 the console since the user can control the output in the console, but it may cause hidden
dependencies issues when used in scripts if a measure name ”mymeasure” already exists for instance.
In scripts, prefer:
Avizo allows the user to create geometric models derived from various types of data: surfaces from
point sets, surfaces from 3D images, tetrahedral grid from surfaces, center line spatial graphs from
3D images. For an overview of related features, please refer to the Features overview section. The
tutorials in this chapter introduce the following topics:
As a prerequisite for the following steps, you need a label image, which holds the result of a previ-
ous image segmentation. Please load the provided motor.labels.am data set from the data/tutorials
directory.
The option Add Border ensures that the created surface be closed. A new data object motor.labels.surf
is generated. Again, it is represented by a green icon in the Project View.
• Select the surface motor.labels.surf. Since the Simplifier is directly modifying the surface data,
you may want to duplicate your initial surface before proceeding so you can start again if you
do not reach the expected result.
• Click on the Simplification Editor icon in the Properties Area.
• You can set the desired number of faces in the Simplify port, or preferred method, you can
assign a maximum and minimum size for the triangles. Try 0.02 for max distance and 0.01 for
min one. You can estimate this size by looking for instance at the bounding box min and max
value of the data. Giving a too small number of faces or a too large max distance may result in
an over-simplified surface with self intersecting faces.
• Testing for intersections can be necessary, particularly if you are simplifying a multi-material
surface or a complex surface. In order to activate this, you can check the intersection tests
strategies toggle in the Options port and set your intersection tests strategy in the Intersections
port.
• Push the Simplify now button in the Action port.
The number of triangles is reduced from over 1.2 millions to 50K. 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. Please follow the Surface Reconstruction tutorial and keep the last
surface in the Project View.
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.
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
editing.
• 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 the Flip button. 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.
Hint: In order to see the entire surface again, select the Surface View icon, then press its Clear button
and press the Add button, then press the ViewAll button in the viewer toolbar.
• 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 popup dialog appears asking you whether you really
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:
• Hide the Surface View module by switching off its visibility toggle or removing it from the
Project View.
• Attach a Tetra Grid View module to the motor.labels.grid.
• Select the Tetra Grid View icon
• Set the Materials port to Material 3
• Press the Remove button of the Buffer port.
• Select outlined in the port Draw Style
The Tetra Grid View module maintains an internal buffer and displays all tetrahedra stored in this
buffer. By default the buffer contains all tetrahedra. 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
Area. The editor aims to select tetrahedra with respect to different quality of measures, e.g., aspect
ratio, dihedral angles at tetrahedron edges, solid angles at tetrahedron vertices, and edge length. The
editor contains several modifiers that can be applied for improving mesh quality.
Avizo 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.
• 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.
• Assign boundary conditions for simulation and export the resulting data.
You may skip the last two steps if you are only interested in surface extraction and not in grid genera-
tion.
You should be familiar with the basic concepts of Avizo to follow this tutorial. 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 2 - 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 tutorials.
For the purpose of numerical simulation, Avizo can be complemented with Avizo XWind Extension
in order to export and import data to standard and commercial software file formats such as Abaqus,
ANSYS, CGNS, OpenFOAM, etc. Avizo XWind Extension provides advanced visualization and post-
processing of numerical simulation results. See chapter 11 - Avizo XWind Extension User’s Guide for
more information.
Avizo actually provides support for different numerical simulation approaches: FEA/CFD solvers
as illustrated in this tutorial, but also pre-processing for Pore Network Modeling (see chapter 5.5 -
Avizo Skeletonization User’s Guide), and direct simulation add-on for Avizo (see chapter 12 - Avizo
XLabSuite Extension User’s Guide) . Avizo XLabSuite Extension does not require geometry pre-
processing and provides experiment simulation and effective property tensor calculation for properties
such as absolute permeability, molecular diffusivity, electrical resistivity (formation factor) and thermal
conductivity.
• SandPack128.labels.am is the data set from which are obtained all the pictures in this
tutorial,
• SandPack50.labels.am is a smaller data set, 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 image. However, you may first want to clean up the label image by
removing unwanted or useless features and by smoothing noise and voxel aliasing, in order to get an
accurate, yet not unnecessarily complex surface.
• With Open Data in File menu, load SandPack128.labels.am from the data/sandpack
subdirectory in the Avizo installation directory. Remove the Ortho Slice that was created at data
loading.
• In the label image property area, invoke the Segmentation Editor in order to access the tools
necessary to clean up the labels (see Figure 5.5).
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 image, 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 cases, 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).
Figure 5.9: Results of the different kind of smoothing on a segmented grain: None (top left), Existing Weights (top right),
Constrained Smoothing (low left) and Unconstrained Smoothing (low right).
Note: If you have a thin material, a strong smoothing can actually delete the material. Look at the
Generate Surface documentation for a full description of all parameters.
• Connect a Generate Surface module to the label image (see Figure 5.10).
• Check that the Smoothing Type is set to Existing Weights. This option is only available if the label
image 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 5.11).
You now have a 3D surface object that consists of three patches corresponding to the number of mate-
rials identified in the label image (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.
Figure 5.11: Surface generated from the two phases label image.
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 5.12).
• Press on the Check button in port Action.
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
this is to select the surface data object in the project view and press Ctrl-D. You may also want to use
later on the shortcut F2 to rename a surface data for better reflecting its content.
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 5.14).
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.
When the Surface Editor is activated, a tool bar and a new menu Surface are available (see Figure
5.17).
• 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 5.18).
The result of the test is displayed on top of the 3D viewer. In the current case, there is no intersection,
so you can skip to the next test. However, be aware that intersections can be fixed automatically using
the Fix intersections... tool in the Edit submenu (see Figure 5.19) 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 5.20). It is possible to observe the next highest aspect ratio
triangle by pressing on the right-pointing arrow in the Surface editor tool bar.
Prepare Generate Tetra Grid combines the Flip edges..., Fix small dihedral angles..., and Fix tetra
quality... tools.
If you run the Aspect ratio test again on the surface, you notice that the highest triangle aspect ratio
has a much more acceptable value (below 30).
At this point, you can perform quality checks again thanks to the Generate Tetra Grid module and see
also that all tests results are more acceptable.
If the surface you are editing happens to have intersections or too high triangle aspect ratio or any other
issue revealed by some test on it, you may need to interact with the surface to correct it. To do so, you
have to use the Tests menu and to select the test corresponding to your issue. The first problematic
triangle, will be displayed, highlighted in red, among its neighbors.
For example, on the surface considered for this tutorial, the triangle with the highest aspect ratio can
be improved:
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 5.23).
• Click on the edge of the triangle you want to remove (see Figure 5.24).
Figure 5.24: 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
percentage of the original surface number of triangles.
• Keep the percentage value of 50% in the Desired Size port (see Figure 5.25).
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.
Smoothness is an important parameter in the advanced options. 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 5.26).
Figure 5.26: Surface remeshed with two different values for smoothness parameter: 0 (left) and 0.6 (right).
• 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 5.27: 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 Export 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.
By default, all tetrahedra are generated according to the size of the triangles they are going to be
”attached” to onto the surface.
If you look at the Meshsize parameters for the two phases (pore space is Material1 and grains is
Material2), the value is set to the default value 0, which will trigger automatic sizing of tetrahedra
according to triangles size (see Figure 5.29). 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 5.30). The edge size on the surface interface will always be the size of the edges
of the shared triangles.
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
5.31).
Figure 5.31: Refining the triangles of the grains (Material1) phase surface.
• Select the remeshed surface you used to generate the tetrahedral grid.
• Open the Surface Editor.
• Switch to interaction mode (press [Esc]).
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 5.32).
• Select a patch by picking any triangle from this particular patch.
Figure 5.32: Using the Magic Wand to select a patch of coplanar triangles.
• 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 5.33).
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.
Figure 5.34: Surface colored by boundary ids: for instance here, top pore space faces are velocity inlet, bottom ones are pressure
outlet (not visible), side ones are periodic boundaries and grain faces are walls.
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 5.35).
• 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 / Export Data As... menu (see Figure 5.36) .
FEA/CFD software format export is available with Avizo XWind Extension.
Figure 5.36: Export formats available in the Export Data As... menu.
You can then use Avizo XWind Extension to post-process results of simulation back from the solver
(see chapter 11 - Avizo XWind Extension User’s Guide) .
Note: For fluid dynamics in porous media, you can use Avizo XLabSuite Extension modules to as-
sess the absolute permeability of your sample. Avizo XLabSuite Extension directly relies on mask
identifying porous phase and solid phase and does not require surface or 3D Mesh generation.
• 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.
Visualization and Analysis of 3D Models and Numerical Data with Avizo 231
Avizo enables workflows such as:
Avizo XWind Extension is the software suite that includes the Avizo Lite Edition feature set and all
of its 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 11 Avizo XWind Extension User’s Guide.
Avizo provides a first level of support summarized in the following sections:
For convenience, in Avizo Lite Edition, the Avizo XMesh Extension gathers modules providing basic
support for visualization of FEA and CFD data.
For a complete overview of features that can complement analysis and presentation of numerical data,
please refer to Features overview section and Chapter 11 Avizo XWind Extension User’s Guide.
The recommended tutorials for post-processing using Avizo XWind Extension can be found in Chapter
11 Avizo XWind Extension User’s Guide.
The on-line version of this chapter contains tutorials for the following topics using Avizo:
Visualization and Analysis of 3D Models and Numerical Data with Avizo 232
5.4.1 Avizo features for surfaces
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 clouds (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 Extension 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).
• Regular grids,
• Unstructured tetrahedral grids,
• Unstructured hexahedral grids.
• Unstructured models grids (arbitrary sets of tetrahedron, hexahedron, wedge and pyramid ele-
ments).
Note: If an Avizo XWind Extension license is detected at run-time, whenever loading files with format
AVS, Fluent, Ideas, Tecplot, or any format supported in Avizo XWind Extension (see File Formats
index for a complete list), an unstructured model grid is created automatically that can be connected
to Avizo XWind Extension 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.
Visualization and Analysis of 3D Models and Numerical Data with Avizo 233
For more details, please refer to section 13.5.2.2 for regular coordinate types.
Section 13.5.3 for tetrahedral grids and section 13.5.4 for hexahedral grids contain information on
these grid properties and on their coordinates or data storage systems.
Several display modules exist for the visualization of a grid and of its components, such as the mesh,
the faces, the boundaries or the nodes. It is also possible to visualize only a part of the grid, depending
on the region of interest chosen or on one (or several) material(s) chosen among the different materials
the set under study is made of. To that end, the modules Tetra Grid View for tetrahedral grids and Hexa
Grid View for hexahedral grids provide the user with various powerful display features.
Boundary faces of a tetrahedral grid can be displayed with the previously mentioned modules or with
Grid Boundary and the boundary conditions can be displayed with Boundary Conditions.
Cross sections are available for tetrahedral grids using Grid Cut.
The compute modules Lattice To Hexa Grid, Tetra Grid To Hexa Grid and Hexa Grid To Tetra Grid
convert a grid of one type to another type. Conversion of data might be performed at the same time.
Several tools for grid generation and transformation exist for tetrahedral grids, such as Generate Tetra
Grid (generation of a tetrahedral grid from a 3D triangulated surface), Merge Tetra (combination of
grids) and Align Surfaces (to align triangulated surfaces). You will find an example of grid generation
in the tutorial section 5.2 Creating a Tetrahedral Grid from a Triangular Surface.
The quality of a mesh is critical for the accuracy of the computation that are done on the grid. There-
fore, quality measurement tools such as Tetra Quality for tetrahedral grids and Hexa Quality for hexa-
hedral grids are very useful. Triangulated surfaces can be tested with Triangle Quality.
Visualization and Analysis of 3D Models and Numerical Data with Avizo 234
Figure 5.37: Chocolate bar grid representation colored with respect to the diameter ratio of the tetrahedral cells.
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 Exten-
sion.
Visualization and Analysis of 3D Models and Numerical Data with Avizo 235
Figure 5.38: Density used as colorfield for the pseudo-coloring of the hexahedral grid of a helicopter combustion chamber
section.
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.
Visualization and Analysis of 3D Models and Numerical Data with Avizo 236
Figure 5.39: Stream LIC Slice display of the air velocity vector field behind an airfoil.
Coloring a 3D vector field representation or a flow cross section such as a Stream LIC Slice with
respect to the magnitude of the vectors is a very common representation in physics, very often used for
the velocity vector field. To compute the magnitude, the Magnitude module can be used on any type
of grid supported by Avizo XMesh Extension.
Divergence is an operator used in many physics equations. The Divergence module computes the
divergence of vector fields defined on uniform grids. The same is true for the gradient of scalar fields
or Jacobian matrix of vector fields and can be calculated with the Gradient module, on regular grids.
The Lambda 2 module returns a scalar field that is of interest for the CFD study of turbulent flows as
the points where λ2 is negative mark a vortex core.
Visualization and Analysis of 3D Models and Numerical Data with Avizo 237
5.4.7.2 Tensor data
Avizo XMesh Extension provides some computational and visualization support for symmetric second
order tensors.
The Extract Eigenvalues module computes the eigenvalues of a symmetric second order tensor. Eigen-
vector To Color creates a color representation of the eigenvectors.
Finally, Tensor View displays symmetric second order tensors using tensor glyphs.
5.5 Skeletonization
Avizo XFiber Extension 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. 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:
You should be familiar with the basic concepts of Avizo to follow this tutorial. 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 2 - Getting Started. For actual use of skeletonization with
your data, you may also need to be familiar with image filtering and segmentation (see chapter 3 -
Images and Volumes Visualization and Processing in Avizo). Further related tools can also be found
in Avizo.
Skeletonization 238
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 label image such that finally a string of connected
voxels remains (Thinner).
Let’s extract the skeleton of porosity network in a fractured rock core sample data set:
• If the Project View is not empty, press [CRTL+N] to start a new empty project.
• Choose File / Open Data... from the File menu and load the file
data/core/coreSample.am from the Avizo root directory
• Remove the Ortho Slice module.
• Attach an Auto Skeleton module to the data set 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 5.40.
• 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
Skeletonization 239
Figure 5.41: Visualization of the Auto Skeleton result and associated Project View.
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 the 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 (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
Skeletonization 240
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. 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 image as input.
It is possible to modify the graph visualization by changing options in the Spatial Graph View module
(Figure 5.42). For example, it is easy to show the segments as tubes whose diameter depends on the
thickness defined by the distance map. This is achieved by selecting the checkbox Tubes on the
Segment style port and changing Tube scale to Thickness. However, be warned that this can be
slow depending on the complexity of the spatial graph and the graphics hardware used. In this tutorial,
the segments will be displayed with a color depending on their thickness:
Skeletonization 241
Figure 5.43: Visualization of the Spatial Graph View result and associated project view.
You can export Spatial Graph data, including connectivity and thickness information, to various for-
mats such as Avizo Spatial Graph ASCII format, SWC and MV3D formats.
• For this, select the data module and select Export Data As... in File menu or data object context
menu.
Skeletonization 242
Parameters {
ContentType "HxSpatialGraph"
}
You can get some statistics directly from the Spatial Graph data:
Skeletonization 243
click on the Show button in the data properties to display a tabbed spreadsheet (see Fig-
ure 5.5.2.3). graph summary is displayed into the first tab. Then, graph statistics are summed up
into the second tab. One graph corresponds to one tab.
Spatial Graph statistics can be saved in several file formats (CSV, XML, TXT).
It can be useful to convert the Spatial Graph object to a Line Set. Line sets provide additional tools
for display, editing, processing or export. For instance, the Line Set Editor can be used to interactively
identify line or node indexes.
Note: in the following, the Line Set Editor is going to be used. It requires Avizo console to be visible,
since it outputs information in it. By default, the console is not visible but it can be easily activated by
clicking on the Console button of the main toolbar.
• Attach a Convert / Spatial Graph To Line Set module to the Spatial Graph data
coreSample.Smt.SptGraph.
Skeletonization 244
• 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
Figure 5.45).
Figure 5.45: 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 the [ESC] key 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. Make sure that
the Point Probe module remains selected in the Project View. Then, when clicking with the
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.
Skeletonization 245
Figure 5.46: Visualization of the Line Set Editor result after a few selections and the associated Project View. Values appearing
are not shown since it depends on the selected points and lines.
connected.
• Switch the viewer to interaction mode and click and drag one of the green squares. This will
adjust the region of interest and the Line Set View will adopt the new restriction immediately.
• Click and drag on the (invisible) faces of the cuboid to move it to another position.
Skeletonization 246
Figure 5.47: Visualization of the Line Set View reduced to the ROI Box and associated project view.
• Click on the Shape drop-down menu and select Circle in Line Shape group.
• Click on the Scale Mode drop-down menu and select Data 0.
• Move the Scale Factor slider to 2.
Figure 5.48 shows an example 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.
Note: The data value associated with the lines is the local radius. The Line Set View scales by the local
diameter. To scale to the physical size, you therefore must use a Scale Factor 2.
Skeletonization 247
Figure 5.48: Visualization of the Line Set View reduced to the ROI Box and the parameters of the Line Set View module.
It can be useful to color the lines in different ways. In the next example, the line set will be colored by
the local z value. First create an Analytic Scalar Field to provide the depth (z value), then set line set
coloring according to values evaluated from this field.
To create the scalar field:
• 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 in the Optional Connections group to the Analytic
Scalar Field data object.
• Set the Color Mode port in the Coloring group of Line Set View module to
Skeletonization 248
Analytic-Scalar-Field
• Use the Colormap port to change colormap and data range. See Figure 5.49 for more details
about the parameters to modify.
Figure 5.49: 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 9.4
for an introduction to Tcl scripting.
It is possible to convert a Line Set back to a Spatial Graph.
The Auto Skeleton module can expose several intermediate data objects in the module workspace.
These intermediate files can be useful for checking, export, or as starting point for specific processing.
• 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, Create Objects port, check Distance Map
• In the Properties panel, Options port, uncheck Show Spatial Graph
• Press the Apply button to process skeletonization again.
• Attach an Ortho Slice to the distance map field coreSample.DistField. Result may look
like Figure 5.51.
Note that the distance map coreSample.DistField - 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.
Skeletonization 249
Figure 5.50: Visualization of the colored Line Set View and the associated project view.
• 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 data set 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 image coreSample.Labels.
The Auto Skeleton module internally uses a Image Morphology / Distance Map For Skeleton which in
Skeletonization 250
Figure 5.51: Visualization of the colored Line Set View and the associated project view.
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 the Image Morphology / Distance Map module. Other distance
maps such as those provided by Avizo could be used in a similar way.
Skeletonization 251
Figure 5.52: Euclidean distance map module parameters.
Figure 5.53: Visualization of the distance map and the associated project view.
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
Skeletonization 252
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 2 with Auto Skeleton module. Set its value to 5. 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:
Skeletonization 253
• Press the Apply button to create a Spatial Graph object.
• Attach an Eval On Lines module to coreSample.Spatial-Graph by selecting Compute / Eval On
Lines in the data context menu.
• Attach the Field input port of Eval On Lines module to coreSample.DistField, the float
distance field computed earlier. Eval On Lines can map any scalar field on Spatial Graph.
• Next you need to type the command "Eval On Lines" setZeroCorrection 0 in the
console. Since ChamferMapScaleFactor is not defined in distance map data parameters, Eval
On Lines applies a default 1/3 voxel-size factor to the input value. Eval On Lines also forces a
minimum value defined by zeroCorrection * voxel size (half voxel size by default).
• Press the Apply button of Eval On Lines. The Eval On Lines module doesn’t create a new data
icon. It is more like an editor and changes the connected line set. It adds a data value for every
vertex in the line set and calculates the value of the field at the point of the vertex.
• Attach Spatial Graph Statistics and Spatial Graph View to Spatial Graph to display 3D graph
and statistics as shown in the ”getting started” section.
Skeletonization 254
Figure 5.54: Visualization of the skeleton as a spatial graph and the associated project view.
Skeletonization 255
5.5.4.1 Preparation for using Large Disk Data
The modules Auto Skeleton, Distance Map For Skeleton, Thinner, Trace Lines, Eval On Lines can
operate directly on data on disk, allowing processing of data that cannot fit in memory. Another
distance map module Distance Map On Disk Data is also available for operating on disk data.
These modules currently support reading input and writing image results using the former Large
Disk Data (LDD) format. For converting image data to LDD, you can use Convert To Large
Data Format, accessible by right-clicking in project view, then selecting File / Convert To Large
Data Format. Prior to conversion, you’ll need to type "Convert To Large Data Format"
forceAmira311Format 1 in the console in order to convert the data to a format compatible with
skeletonization modules.
The Auto Skeleton module and Thinner algorithm on disk data also expect a black border around the
data. This border should be at least of size len of ends used during thinning (see the section
above). If the BorderWidth parameter is not specified on the disk data object, a default border is
automatically created with size of len of ends. The Auto Skeleton module expects disk data object
to specify a data parameter BorderWidth. When using Thinner with disk data, you can set the len of
ends parameter manually in the console, for instance: Thinner setVar lenOfEnds 10. This
will set the maximum length of branches to 10 voxels before they are detected as unconnected ends.
Avizo data sets may be saved as separate blocks, which can be useful for multiple acquisitions or large
data sets split into separate files. Avizo has a special data object (Mosaic) for storing links to files
on disk, arranging them in 3D, and other operations on these blocks such as alignment and template
operations like filtering or resampling.
Note: There is no way to convert the new multiresolution LDA format to LDD format directly. A
possible solution is to use Extract Subvolume to extract and save separate blocks, and use Mosaic to
convert these to LDD format.
For now, we will simply use Mosaic as a convenience for converting our data to LDD format while
adding the border necessary for skeletonization process. For more general information about using
large data with Avizo, see section 3.1.6 : Working with out-of-core data files (LDA).
A green icon appears. A Bounding Box display module also appears. When you select the green
module, you see that it contains no bricks (0 bricks in the Info port). The buttons below the Info port
are used to add data objects.
Skeletonization 256
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.
• Switch off the Bounding Box module.
• 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
Convert / Mosaic To Large Disk Data from the submenu in the context menu.
Skeletonization 257
• The red Mosaic To Large Disk Data icon should be selected so the module ports appear in the
Properties area.
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 bricks will be loaded one after the other and will be sampled. This may take some time
for large data.
Some information about the data stored on disk is displayed in the Properties Area. 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.
Skeletonization 258
Figure 5.56: Visualization of Large Disk Data and the associated Project View
A few display modules are available for visualization of LDD data (note that the LDA disk data format
offers more powerful visualization capabilities). Several computation modules are also able to handle
the Large Disk Data directly. These include thresholding, computation of a distance map, thinning,
extracting a spatial graph set from a voxel skeleton, and computation of the thickness of the lines
(evaluating the distance map at the points of the line set). You can, therefore, apply skeletonization
directly to large disk data. For other operations, you may need to load a subvolume into the workspace
as an in-memory object, or use Avizo modules for on-disk processing.
The next step is to apply a simple thresholding.
• Attach a Threshold to the image icon by right-clicking on it and selecting Threshold from the
Image Segmentation submenu in the popup menu.
Skeletonization 259
• Set Threshold to 140 in the Properties Area.
• Select a filename to which you want to store the result. In the tutorial, we will use the default
name image.labels.
• Press the Apply button.
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, using 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 image: ”Porosity network reconstructed”, located in demo/core/coreSkeleton.hx, that can be
accessed from the Examples help menu (in Rock Core Sample Analysis demos).
Skeletonization 260
Figure 5.57: Visualization of the skeleton of the LDD and the associated project view.
Skeletonization 261
Chapter 6
Spatial registration is about aligning or overlaying two or more data sets into the same coordinate
system. In registration, typically one of the data sets is taken as the reference, and the other one is
transformed - moved and possibly rescaled - until both data sets match. Registered data can be pro-
duced by different sensors, at different times, from different object regions, or from different specimens
or models. Image registration methods can be manual, automatic, or semi-automatic. Closely related
to registration is the task of data fusion, i.e., the simultaneous visualization of registered data sets, or
combination into derivative data.
A variety of tools related to registration can be used in Avizo depending on your purpose and on your
data - geometric surfaces, 2D image stacks, or 3D volumes. Registration with Avizo is used in a wide
range of applications, including:
• 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
You should be familiar with the basic concepts of Avizo to follow these tutorials. 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 2 - Getting started. The tutorial section 6.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 the FEI Hotline for further discussion.
6.1 Getting started with spatial data registration using the Trans-
form Editor
In this section, you will learn how to: change the spatial position of data objects interactively us-
ing various manipulators; how to specify numerically a geometric transformation as a combination of
translation, rotation, and scaling; how to copy/paste geometric transformations; how to apply geomet-
ric transformations to data in order to change actual data coordinates or voxel image axis alignment;
and where to find related tools.
This section has the following parts:
Getting started with spatial data registration using the Transform Editor 263
world origin; likewise it can be rotated with respect to the global axes, and it can be independently
scaled (enlarged or shrunk).
Select 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, respec-
tively. You can also use the viewer’s compass to see 3D space orientation. Select Edit / Preferences /
Layout to change Compass settings.
Every spatial data object in Avizo has an associated 3D bounding box as well as an optional geometric
transformation, which can be defined as a combination of translation, rotation, and scaling (internally
represented as a 4x4 homogeneous affine transformation matrix).
Rotating a scene within the viewer in ”trackball” mode (hand mouse cursor) does not alter the object
position or orientation relative to world coordinates. Rather, it changes the point of view of the camera
around the whole scene. In order to change the geometric transformation of an object, i.e., translate,
rotate or scale it with respect to other objects or to world coordinates, a Transform Editor is available
for every spatial data object.
In the following example, we use the Transform Editor to manipulate surface data objects. This ex-
ample would also apply to images, 3D volumes, or regular scalar fields, using modules such as Ortho
Slice for display.
• Start a new Avizo Project (menu File / New Project, or press Ctrl-N).
• With menu File / Open Data, load the chocolate-bar.simplified surface from the
data/tutorials subdirectory in the Avizo installation directory.
• Attach a Surface View module to chocolate-bar.simplified data set (i.e., choose Sur-
Getting started with spatial data registration using the Transform Editor 264
face View entry from the popup menu of the data set).
• Duplicate the data object. For this, you can select chocolate-bar.simplified and
press Ctrl-D or right-click and use data menu Object / Duplicate Object. The result is
chocolate-bar2.simplified.
• Attach a Surface View module to the copy chocolate-bar2.simplified. You can still
only see one engine shape in the viewer for now since the two data sets are overlaid.
• Select chocolate-bar2.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.,
canceling the rotation part. Using the Action port, it is possible to Undo/Redo the last transfor-
mation change.
• You can copy/paste a transformation from one data set to another. For instance:
Getting started with spatial data registration using the Transform Editor 265
Figure 6.3: An active Transform Manipulator
chocolate-bar2.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 the 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.
Getting started with spatial data registration using the Transform Editor 266
6.1.2 Applying Transforms
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 you 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, it re-
quires transformed data coordinates. For instance, the lattice of a transformed volume image or
regular scalar field may need to be aligned with global axes or with respect to another lattice.
This is useful to perform certain lattice-aligned operations as illustrated below.
Here is a first example showing how to apply a transformation to the surface data that you already used
in a previous section:
Getting started with spatial data registration using the Transform Editor 267
Figure 6.5: Before applying transform to surface
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:
Getting started with spatial data registration using the Transform Editor 268
Figure 6.6: After applying the transform
duces a new data object chocolate-bar.transformed added in the Project View. The
input data chocolate-bar.am remains unchanged.
• To visualize the result, you can attach to it a Bounding Box, Local Axes, and Ortho Slice mod-
ules. The result volume and attached Ortho Slice are now aligned along global axes. The input
volume data has been resampled over a lattice with new bounding box coordinates.
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.
Getting started with spatial data registration using the Transform Editor 269
Figure 6.7: Before applying transform to image
Getting started with spatial data registration using the Transform Editor 270
Figure 6.8: After applying Resample Transformed Image
• The Dialog... button of the Transform Editor pops up the Transform Editor 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:
Getting started with spatial data registration using the Transform Editor 271
Figure 6.9: Transform Editor Dialog
>"chocolate-bar.simplified" getTransform
0.257115 -0.306418 0 0 0.306418 0.257115 0 0 0 0 0.4 0 -4.30079 23.5849 -6.7025 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:
>"chocolate-bar.simplified" getTransform -d
translation: -12 0 -18
rotation: 0 0 -1 50
scaleFactor: 0.4 0.4 0.4
scaleOrientation: 0 0 1
center: 20.0481 23.4785 18.8292
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
Getting started with spatial data registration using the Transform Editor 272
and then save the data object. A module is also available for this purpose: Geometry Trans-
forms/Resample Transformed Image. For instance, type in the Avizo console:
>"chocolate-bar.am" applyTransform
The chocolate-bar.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 a previous section.
• The default manipulator is the Transformer. It allows translations, rotations, and scaling. It is
the most general manipulator for doing an approximate registration.
Figure 6.10: 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 6.11: 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.
Getting started with spatial data registration using the Transform Editor 273
• The TransformBox is a simplified version of the Transformer that allows translation, rotation
and uniform scaling.
Figure 6.12: TransformBox: Click-drag any small cube to scale. Click-drag any face to translate. Hold Shift to constrain axis.
Click-drag any box edge to rotate.
Figure 6.13: 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 6.14: 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).
• The HandleBox allows translation, uniform scaling and anisotropic scaling. It is the most suit-
able manipulator for anisotropic scaling operations.
• The TabBox allows translation and anisotropic scaling by box resize. It is used by modules such
as Extract Subvolume or ROI Box (Region Of Interest).
Getting started with spatial data registration using the Transform Editor 274
Figure 6.15: HandleBox: Click-drag any face to translate (Hold Shift key to constrain translation axis). Click-drag a small cube
to scale.
Figure 6.16: 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
• 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.
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 chocolate-bar.am visible, for instance, only
in the left viewer and chocolate-bar.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.
Figure 6.21: Interconnecting ports: (1) activate Connection Editor, (2) drag chain-link from one port to a module or port to be
connected
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:
Note: See also modules Image Processing / Filter Sandbox and Slice to display on-the-fly effects of
image filters.
• 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
• 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 image 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 6.6 (Alignment of 2D images stacks). See also section
6.1.2 (Applying Transforms) on how to align a volume with an arbitrary plane or Slice defined by
picking or point 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 Project View. 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)).
• Select object Landmarks-2-sets in the project view.
• Set ”Image set1” port of Landmarks-2-sets to motor.part1.simplified.surf, and set
• 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
use the editor to define some markers in both objects.
• 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”.
• 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.
• Click on the viewer toolbar arrow button or press the ESC key to turn on picking interaction
mode (arrow mouse cursor). Click on a particular point of surface1. This point must be in the
common region between surface1 and surface2. Click on the corresponding point in surface2.
A pair of points is created. Repeat this step to create several pairs of landmarks (at least 3, 8
pairs are probably sufficient). You may want to change the view of the objects to set landmarks
on parts that are initially hidden.
• If you want to change the position of an existing landmark set, select Edit Mode: Move. Click
on the landmark to be moved, and then just click on the desired position.
• A pair of landmarks can be removed by choosing Edit Mode: Remove and by clicking on one
of the landmarks (blue or yellow).
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.
• 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
registration 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.
• 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 the next section.
• 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.
• Turn off the viewer visibility toggle for motor.part1.simplified.surf and Landmark
View.
• Attach a Landmark Image Warp module to ”Landmarks-2-sets” set created in previous steps.
• In Landmark Image Warp properties, set Image Data port to motor.am.
• Options should be set as Direction 1>2 and Bookstein method). Press Apply.
• Visualize the result by attaching the Volume Rendering module to the result motor.Warped.
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.
>"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 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 6.2.2 (Data Fusion, Ortho Views).
• Attach 3 Ortho Slices to chocolate-bar.am, with different orientation (xy, xz and yz).
• Attach a Colorwash module to each Ortho Slice. Set the Data input to
chocolate-bar.labels.am, and the Fusion Method to Weighted Sum
• Activate the Transform Editor for chocolate-bar.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 chocolate-bar.labels.am.
• Attach a module Geometry Transform / Register Images to chocolate-bar.labels.am,
which is, therefore, considered as the model to be transformed.
• Attach the Reference input port of Register Images to chocolate-bar.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 Advanced 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.
• Then press 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
• Activate the Transform Editor for chocolate-bar-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.
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 a later
section 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 advanced options). Whenever possible, set the
correct voxel sizes for reference and models (see Crop Editor), then set the Transform port to
3. You can select a range of voxel intensities to be considered in registration (see advanced options
in a 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 advanced parameters, depending, for instance, on the data
set modality, voxel intensity distribution, dimensions, and aspect ratio. More on this available
in a later section.
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.
6.4.3 Using the Image Registration Wizard - example with partially overlap-
ping images
It is sometimes necessary 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 regis-
ter precisely the images. The overlapping regions must still contain enough information for successful
registration. 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 al-
lows 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 the Perspective / Orthographic button, then click on
the YZ button (or press X key), then Ctrl-Shift+click on the Rotate button for 90 degrees rota-
tion. 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).
2. Intensity range to be considered for registration (available when using Mutual Information met-
ric)
3. Degree of freedom: rotation and translation only; uniform scaling; variable scaling in x, y, z;
shear
4. Type of pre-alignment done before registration optimization. ”None” assumes that the model is
already approximately aligned with the reference. For instance, you might set the model in the
correct initial position by using the Transform Editor.
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.
1. Degrees of freedom
2. Image comparison metrics
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 6.45: 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, switch to
advanced mode 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
between the two data sets. This is the most generic and robust metric. It is recommended (es-
pecially the normalized version) when images come from different modalities (e.g., CT/MRI,
ECT/XCT). Also note that the histogram range can then be specified to define the relevant voxel
values to be considered for registration. You can use this to ignore high or low intensity voxels.
• 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 Range Partitioning.
• Label Difference, for labeled images, measures difference between two connected labels.
• 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,
the finer will be the transformation tested. Default values are based on the data bounding box
and voxel size (see reference help for detail). If the pre-alignment is precise enough, you can
reduce the initial value closer to the voxel size. When the bounding box aspect ratio is rather
flat and images tend to flee away during registration, you may need to reduce the initial step in
order to keep the images overlapping longer.
• Coarsest Resampling: set the coarsest level of resolution. Data sets will be resampled many
times until the coarsest resampling rate is reached. For the coarsest search, these values can be
increased.
• Ignore finest resolution: if this box is checked (default), the highest level of resolution will be
left out. Often, full resolution is not needed to register images, which can dramatically save
processing time.
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;
6.5.1 Guidelines
The method for 2D-to-3D image registration proceeds in two stages, as indicated in a previous section:
• 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.
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, whose numbers start from zero.
Advanced users familiar with scripting may extend this script for specific purposes. See chapter 9.4
(Scripting Guide) for guidance on how to extend scripts.
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.
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.
• 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.
Two landmarks should be visible now, a red one, and a yellow one. Next, let us move these landmarks
to some reasonable positions so that we can perform an alignment.
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.
Figure 6.60: (1) Manual alignment button; (2) Align current slice pair; (3) Align all slices
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,
this error can be compensated for in Avizo.
• 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 6.61: (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 6.62: (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
time using the Stop button.
• Automatically align all slices by pressing the first button from the right.
• 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.
• 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.
• Reload the saved object leaf.am.
• Attach a new Align Slices module to leaf.am and click the Edit button. You can verify that
the original alignment is restored.
The guard cells of the stomatal pore are marked in the label image. 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
Note about color image segmentation: The image volume used in this tutorial is an RGBA color field.
You can use Interactive Thresholding 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 3.4 on Intensity
Range Partitioning 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
unwanted high or low pixel values.
• Align Slices can use a label image connected to its Mask input port to restrict the region con-
sidered for automatic alignment. You can easily produce such a mask by using, for instance, the
Segmentation Editor or the Volume Edit module.
• In complex cases, you could perform alignment based on any subset or derivative of initial image
stack (e.g., cropped, filtered, or segmented), and then reapply the alignment to the original data.
• 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.
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).
• 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.
Alignment and pre-processing of FIB/SEM images stacks using the FIB Stack Wizard 322
Figure 6.64: FIB/SEM principle: overviews, SEM views, serial sections
• With menu File / Open Data, load the data file MoSi2-shear-corrected.am located in
Alignment and pre-processing of FIB/SEM images stacks using the FIB Stack Wizard 323
Figure 6.65: MoSi2 sample - courtesy C. Kong, University of New South Wales
subdirectory data/fib in Avizo installation directory. This image stack was saved as a native
Avizo data file. About loading stacks of image files, see the tutorial section 3.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’
Alignment and pre-processing of FIB/SEM images stacks using the FIB Stack Wizard 324
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.
Alignment and pre-processing of FIB/SEM images stacks using the FIB Stack Wizard 325
data with irregular, so-called ”stacked slice” coordinates. You may also turn the images into a uniform
scalar field using Arithmetic or Resample modules (use a uniform lattice as reference input for the
Resample module).
Foreshortening
Depending on how the data was collected, you may have to correct the foreshortening effect seen in
introduction. If you entered the field-of-view for the Y-axis, then there will be no need to make this
correction. If you entered the same voxel size for x and y, and the instrument did not already apply a
stretching correction, then you may want to correct by entering the corrected voxel height directly into
the Crop Editor. To apply the foreshortening correction in the Crop Editor, multiply the voxel height
by a correction factor, depending on the angle between FIB and SEM columns. For instance, for a 52
degrees angle: 1/sin(52◦ ) = 1/cos(90◦ −52◦ ) ≈ 1.269. The file MoSi2-shear-corrected.am
was already corrected for foreshortening.
Measurement units
Note: Indicating ”nm” as Display units in the Preferences will output measurements in nm. To learn
about unit management in Avizo, see the section 8.2.9 (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.
Alignment and pre-processing of FIB/SEM images stacks using the FIB Stack Wizard 326
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
Images corrected for viewpoint angle may still need correction from drift as show below, mostly visible
in XZ slices of MoSi2-shear-corrected.am.
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.
Alignment and pre-processing of FIB/SEM images stacks using the FIB Stack Wizard 327
Figure 6.70: XZ and YZ slices with jittering effect
• 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.
Alignment and pre-processing of FIB/SEM images stacks using the FIB Stack Wizard 328
Figure 6.71: FIB Stack Wizard at step 1
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
Alignment and pre-processing of FIB/SEM images stacks using the FIB Stack Wizard 329
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.
Alignment and pre-processing of FIB/SEM images stacks using the FIB Stack Wizard 330
• Once set, press 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 Intensity Range Partitioning editor and tutorial section 3.4 on Intensity
Range Partitioning.
• 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, press on the Apply button in order to go to the next step.
Alignment and pre-processing of FIB/SEM images stacks using the FIB Stack Wizard 331
Figure 6.74: Crop after alignment with FIB Stack Wizard
Alignment and pre-processing of FIB/SEM images stacks using the FIB Stack Wizard 332
• 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 6.75 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 6.75 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
Alignment and pre-processing of FIB/SEM images stacks using the FIB Stack Wizard 333
Figure 6.75: Shading correction with FIB Stack Wizard
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.
Alignment and pre-processing of FIB/SEM images stacks using the FIB Stack Wizard 334
• Load MoSi2-sheared.am
• Attach FIB Stack Wizard
• Press Apply to keep all volume at Crop step
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 image. 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.
• Apply Shear step with -38 degrees (i.e., 52 - 90).
Alignment and pre-processing of FIB/SEM images stacks using the FIB Stack Wizard 335
Figure 6.77: Createting mask for MoSi2
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.
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
reference orientation.
The model and reference are now almost aligned. You can still notice some discrepancy.
• Press the 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.
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.
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
Once you obtained an optimized registration, you can optionally check the surface distance using a
Surface Distance module.
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.
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 extension. The Avizo XWind Extension and bundle provides import capability for
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 blue. 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 also
try 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 3.4 on Intensity Range Partitioning 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.
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 im-
ported from the CAD model, i.e., holes. This is the approach used in the 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
This method can be effective for fast or repeated registration of 3D images with a single reference.
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.
Figure 7.1: Data chocolate-bar.am with a Bounding Box and an Ortho Slice
Like the other widgets, this widget is also dockable and you can place it at a convenient position
within the Avizo user interface. After activating the Animation Director by clicking on the related
button in the toolbar, all ports of the currently available modules that can be animated are extended by
an additional button representing a stopwatch .
Before we start animating the Ortho Slice’ slice position, let’s first have a quick look at some GUI
elements of the Animation Director widget (shown below in figure: event and keyframe in timeline).
As you can see, the user interface is divided into a left and a right panel. On the left panel, you can
control the timeline that is displayed on the right panel. The timeline has a main time slider. The name
of the current animation can be changed by writing directly into the current animation name field. For
example, we can name it ”CandyAnimation”.
We can now animate the Ortho Slice’ slice position. We do this by clicking on the stopwatch button of
Clicking on the stopwatch button creates a new keyframe in the Animation Director timeline and the
event is listed in the left panel of the user interface. If you hold the mouse cursor above the small
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 with which it is associated. 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 294. 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
Chocolate and All in the Materials port and press the Remove button in the buffer port. This will
visualize the inside surfaces of the model.
Figure 7.8: Viewer and Network when you visualize Ortho Slice and Surface View modules
If you want to switch the surface visualization on and off manually, you would use the viewer toggle
(orange rectangle) of the Surface View module. If you want to include this action in your animation
sequence, you need to do the following:
To test the newly added event, set the master time slider of the Animation Director 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.
• Set the master time slider to the time where the camera rotation should begin, e.g., 00:10.
• Select Camera Orbit module.
• Click on the stopwatch button next to the Time port of the Camera Orbit module and click on
Time: Value.
• Set the master time slider to the time where the camera rotation should end, e.g., 00:14.
• Adjust the Time port of the Camera Orbit module to its maximum (360).
• Click on the stopwatch button of the Time port again.
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 chocolate-bar.surf data set. Since Exterior and All
are selected as the default materials, this brings up the exterior surface.
• Click on the second Surface View module. It should be called Surface View 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 Director module.
• Adjust the grade of transparency using the BaseTrans slider in Surface View 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 Surface View 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 View 2 module
visible (e.g., 00:14).
• Click on the Surface View 2 module.
• Click on the top most stopwatch icon in the properties area of the Surface View 2 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.
• In the keyframe’s user interface, select the radiobox on to enable clipping using Ortho Slice.
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.
To avoid the Ortho Slice to hide the surface view when displaying the slice 294, you can change its
Transparency mode during the animation.
• Move the master time slider to the time where you wan to change the Transparency value, e.g.,
00:12.
• Set the Transparency port of Ortho Slice to Binary, then click on the stopwatch icon of Trans-
parency port. This will insert a new keyframe to the timeline.
• Move the master time slider to 00:00, and set the Ortho Slice Transparency to ”None” (See
Figure 7.12).
Start the animation either from the beginning or from 00:14 and watch the result.
Figure 7.13: How simply invert the orientation of the clipping in Animation Director
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 chocolate-bar.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 Director click on the + Add special event button.
• Select Add Break from the drop-down list. A new keyframe is created on top of the timeline
indicating the Break.
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.
and continue with the animation upon key press. You can easily do this with the Goto feature of the
Animation Director module:
• In the Animation Director module adjust the main time control to the time 00:11:950.
• Click on the + Add special event button.
• Select Add Goto from the drop-down list. A new keyframe is created on top of the timeline.
• Move the mouse cursor right over the new created keyframe icon and a user interface for this
Goto will appear.
• In the Time To Jump To field enter the time where you want to go from here, e.g., 00:04:000 in
this case.
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 Director 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 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-
The Animation Director 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 Director module. However, you can adjust these
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.6 (First steps in Avizo),
particularly the very first one described in Section 2 (Getting Started).
• File Menu, Edit Menu, Project Menu, View Menu, Window Menu, Help Menu
• Standard Toolbar, Workrooms Toolbar
• Project View, 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 2.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 allows you to save the complete project of icons and connections shown in the Project
View. The first time a project is saved in Avizo, a Save Project policy dialog box is displayed (see
Figure 8.1). This dialog box suggests different policies and a short description of each of them. More
details about the related choices can be found in the General Tab section. The chosen policy will apply
for the project being saved only, unless the checkbox is selected. If the checkbox is selected, the policy
applying to the project being saved will apply to all future projects. This setting can be modified later
in the General Tab of the Preferences dialog box.
If the project has not been saved previously, you will need to specify the name of an Avizo Project
script in the file dialog box. When executed, the project script restores all data objects and modules
as well as the current object transformations and camera settings. This 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 to be able to save the project. If this
is not the case, a dialog box is shown listing all the data objects that still need to be saved. In the
dialog box, you can specify that all required data objects should be saved automatically in a separate
subdirectory.
Instead of selecting the option Avizo Project, you can also choose Avizo Project and data files (pack &
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 9.1.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
submenu 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.
8.1.1.16 Quit
This button terminates Avizo and prompts you to save the current project configuration, if there are
unsaved changes.
8.1.2.1 Cut
In the Console, this command cuts selected text and copies it to the clipboard. In the Project View, this
command removes the selected objects.
In the Console, this command copies the selected text to the clipboard. In the Project View, this
command copies the selected objects.
8.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.
8.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.
8.1.2.6 Preferences
This option opens the AvizoPreferences Dialog. This dialog 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 performance options...
8.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
connected modules will be deleted as well. However, if you delete a module, connected data objects
(e.g., the results of a compute module) will be retained.
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. The button is disabled if no object is selected or if multiple objects re selected. 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 keep visible in the viewer only the display modules of the selected objects.
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.
8.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 uniform and
gradient background styles. In addition, the dialog allows you to adjust the two colors used by these
styles. Note that the checkerboard style is deprecated.
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 9.4.4.1 Viewer command options).
8.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.
8.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
8.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.
8.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.
8.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.
8.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.
8.1.5.2 Colormap
This toggle allows you to show/hide the Colormap Editor panel of Avizo.
8.1.5.3 Console
8.1.5.4 Tables
This toggle allows you to show/hide the Tables panel of Avizo, i.e., the one containing the tables of a
spreadsheet data.
This toggle allows you to show/hide the Project View panel of Avizo, i.e., the one containing the
Project View (Graph View or Tree View).
8.1.5.6 Properties
8.1.5.7 Help
8.1.5.8 Toolbars
In addition of these panels, you can also manage the visibility of some Avizo toolbars via the Toolbars
submenu.
This button shows the Help dialog on the Avizo documentation home page. You will have access to
the entire Avizo documentation.
8.1.6.2 Examples
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 Extension
license.
This button launches the AvizoLicense Manager which displays the status of your Avizo licenses.
This button launches a dialog which displays the activated licenses on your computer.
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.
8.1.6.9 About
This button launches a dialog containing Avizo build and copyrights information.
Note: by default, this toolbar is hidden, it can be shown via the Window / Toolbars menu.
To learn more about workrooms concept, please refer to the following documentation.
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 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.
Selecting an object from this menu causes the corresponding icon to be made visible in the Project
Graph View.
Icon colors are used to indicate different types of objects. Data objects are shown in green and are the
only objects which can be saved to disk using File > Save Data, File > Save Data As or File > Export
Data As menu entries. Computational modules are shown in red, visualization modules are yellow,
and visualization modules of slicing type are orange. These modules, Ortho Slice for example, may be
used to clip the graphical output of any other module.
Connections between data objects and processing modules, shown as blue lines, represent the flow of
data. For display modules, these connections show the data used to generate the display. You may
connect or disconnect objects by picking and dragging a blue line between object icons.
As you might expect, not all types of processing modules are applicable to all kinds of data objects.
If you click on a data object icon with the right mouse button, a menu pops up that shows all types of
modules that can be connected to that object (alternatively, you can click on the small white triangle on
the right side of the icon with the left, right, or middle button or press [Ctrl]+[Space]). For more
details about this menu, please refer to the Object Popup documentation. Selecting one of the modules
will automatically create an instance of that module type and connect it to the data object. A new icon
and a connecting line will appear in response. This way you can set up a more or less complex project
that represents the computational steps required to carry out a specific visualization task and is used to
trigger them. Note that modules used will appear as shortcut (or macro) buttons in the upper part of
the window.
Figure 8.3: The Project Graph View contains data objects and module icons.
As mentioned above, for most objects the required connections are established automatically on cre-
ation. However, in order to set up optional connections, you must use the connection popup menu. For
example, you may attach an optional scalar field to an Isosurface module’s Colorfield port in order to
color the surface using the values in the Colorfield.
Figure 8.4: The Project Tree View contains data objects and module icons organized in a tree view.
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.
• 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 two ”templates” which control the organization of the tree view: a default
template for most Avizo users and a ”geophysics” template in the Avizo XEarth Extension
which includes predefined folders for 3D surveys, horizons, faults, etc.
• Connections: If you right-click on a data object icon, a menu pops up that shows all types of
modules that can be connected to that object (alternatively, you can press [Ctrl]+[Space]).
For more details about this menu, please refer to the Object Popup documentation. Selecting
one of the modules will automatically create an instance of that module type and connect it to
the data object. A new item in the tree view will appear in response. In this way you can set
up a more or less complex project that represents the computational steps required to carry out
a specific visualization task and is used to trigger them. Note that modules used will appear as
shortcut (also known as ”macro”) buttons in the upper part of the window.
For most objects, the required connections are automatically established on creation. The con-
nection is shown in the connected object’s input port in its control panel in the Properties Area.
For example, when you attach a Ortho Slice to my data.am, in the ”Data” port of the Ortho
Slice control panel, you will see ”my data.am” in the pulldown list. If other objects in the Project
Tree View can be connected to the Ortho Slice, they will be in the list as well. To switch the
connection, simply select a different item from the list. The tree view (and possibly the viewer
display) will be updated accordingly. Selecting ”NO SOURCE” from the list disconnects the
module from any 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 on 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.
Data objects possess a special connection port called Master. This port refers to the computa-
tional module or editor to which the data object is attached. It indicates that the computational
module or editor controls the data object, i.e., that it may modify its contents.
• 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.
• Adding a Folder: At the right of the Project Tree View banner are the New Folder and the
Switch To Project Graph View buttons. The New Folder button is used for adding a new
folder directly below the currently selected folder. You can also add a folder by right-clicking
on an existing folder and selecting New Folder from the context menu. At some positions in the
tree, it may not be possible to add a new folder. The last button switches the Project View to
Project Graph View.
• Removing an Object: To remove one or more objects from the Project Tree View, first select
the object(s) to be removed. You can then use the Remove Object item from the Project context
menu, or you can press the [Delete] key to remove selected object(s). If you remove a data
object, all modules downstream from that module will be deleted as well.
• 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:
Only display modules have pickable toggles (See Figure 8.7). When the pickable toggle of a display
module is off, the user cannot pick it in the viewer.
Figure 8.9: State of the Progress Bar during a resampling operation (Resample module): current computational action is
”Resampling” and the Stop button is red and enabled.
• 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.
• 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.
• 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 9.4.4.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.
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.
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:
Pressing this button creates an instance of a Measurement module that lets you measure distances and
angles on objects within the viewer. Clicking on the down arrow will display a menu of measuring
tools from which to choose: 3D Length, 3D Angle, 3D Annotation, 3D Box, 3D Circle. Only one of
these buttons will be visible on the toolbar at a time, the button of the measuring tool most recently
accessed from the viewer toolbar.
Note: Depending on the Avizo edition, the created Measurement module won’t be the same.
Quick Probe:
This button allows you to choose the probing mode available in Interaction mode.
By default, Quick Probe is move sensitive, i.e., voxel value and coordinates under the mouse cursor
are displayed in the progress bar.
With click on this button you can disable the quick probe mode, make it move sensitive or click
sensitive. Click sensitive behavior displays coordinates and value if [SHIFT] key is pressed and left
mouse is clicked on some visualization in the viewer.
Note: If [SHIFT] key is pressed, no other interaction is possible in the viewer except clicking to
probe.
Display unit:
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.
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
listed in Section 9.4.4.1 Viewer command options.
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.
• 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:
Shows/hides the camera trackball (see Viewer gadgets section for more details).
Show compass:
Shows/hides 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
viewer masks.
Object visibility:
This sub-menu controls the object visibility in the viewer.
The following options are available:
Identify:
Figure 8.11: 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-
ples are:
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 9.4 (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
• 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.
Going through the online documents is similar to text handling within any other hypertext browser. In
fact, the documentation is stored in HTML format and can be read with a standard web browser as
well. Use the Backward and Forward buttons to scroll in the document history and Home to move to
the first page.
Searching the online documentation
The online help browser provides a very simple interface for a content and full text search. If you
want to search through the complete documentation, enter the desired text into the text field. Pressing
CTRL-SHIFT-F moves the focus to this text field and marks all text in this field for quick access. The
search will be performed upon pressing the Enter key.
The search is done by using the complete search phrase. For example, suppose you are looking for
information about the Surface Editor. The output shows the page title where the phrase is contained
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
Loads the specified hypertext document in the file browser. Note that only a subset of HTML is
supported.
help reload
Reloads the current document.
help invalidateCache
Destroys the search cache. In order the search function in Avizo’s help to be more responsive, the
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.
Commands
job submit cmd info [tmpdir]
Submits a new job to the job queue. cmd specifies the command to be executed. info specifies
the info string displayed in the Job Dialog. tmpdir specifies the temporary job directory. If this
• Minimize project size: Only necessary data to restore the project is saved to disk. Data that can
be computed will be computed at project loading. Some data that could not be recomputed may
be saved to disk if needed. This is the legacy and default behavior.
Web News
Do not show news
Web News will not be displayed at Avizo startup, if checked. The default is off. Web News are
displayed in the middle of the welcome workroom.
Online Documentation
Display only available features
Only the available features are displayed in the online documentation.
Preferences and Settings
The first button allows you to restore default preferences and/or default layout and/or to clear the recent
documents lists. The second and third buttons allow you to load or save predefined sets of preferences.
Current Profile
Here you could select which profile you wish to launch Avizo:
The application must be restarted in order for the option to apply. This group box is available in the
Avizo and Avizo Lite Edition editions only.
Maximum Number of Recent Documents
Set here the number of available recent files and projects.
• 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 8.1.12.
The 3D compass indicates the direction from which the camera is viewing the scene. See Section
8.1.12 for more details on the compass.
Click on the tab of the gadget whose attributes you wish to control, then set its attributes as described
below.
Show the camera trackball / Show the compass
This toggle controls the visibility of the trackball/compass. The default is off.
Auto-hide the camera trackball / Auto-hide the compass
When this box is checked, the trackball/compass is only displayed while the mouse is within the
trackball/compass display area. It is hidden as soon as the mouse moves outside the trackball/compass
display area. The default is on for the trackball and off for the compass. This item is not active if the
Show the trackball/compass item is off.
Camera trackball position / Compass position
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
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 generation of 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
data sets. Increasing this value enables the use of higher resolutions when loading very large files.
Video Memory Amount
Sets the maximum allowed texture memory in MB (megabytes) for all the out-of-core and in memory
data sets. Increasing this value allows visualization at higher resolutions for very large files.
Loading Priority
Specifies whether Avizo should load slices before volumes when running out of memory (Tcl
command thePrefDialog setLDAGeometryPriority and thePrefDialog enableLDAGeometryPriority).
Move the slider on the left to increase the resolution of the slices (it will decrease the volume render-
ing resolution) and move the slider on the right to increase the resolution of the volume rendering (it
will decrease the slice rendering resolution).
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
Use high precision framebuffer
This option enables high quality frame buffers, yielding better volume rendering quality with highly
transparent colormaps.
This is useful in the case of multiple overlapped volumes (or if volume raycasting is explicitly dis-
abled). If volumes do not overlap, or if there is only one volume displayed at a time, there is no benefit
to enable this mode. But, this is incompatible with some other rendering features, such as antialiasing
or shadowing, so it is disabled by default.
Simplified rendering during interaction
This option activates a set of rendering techniques to speed the interactions. This options has some
effect only with a small set of display modules (e.g., Isosurface).
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.
Here, by checking Email Notification option, an email will be sent when an Avizo Module terminates
a long computation. Following settings must be defined :
Note that this tab will be only available if you have an Avizo license. Even with an Avizo license, it
will be unavailable if you launch Avizo in its Avizo Lite Edition.
Automatic Intensity Range Partitioning at load
When enabled, activates automatic Intensity Range Partitioning on data loaded and generated by Avizo.
Unit Management
Select None to deactivate the unit 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 selected, Avizo automatically determines the working coordinate units.
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 unit management, the Units chapter and the Units
Editor documentation for more details.
• Edge Selection: Interactive (viewer mask needs to be configured) or Auto threshold mode.
RANSAC:
RANSAC is an algorithm used for filtering the input point cloud used to fit a primitive. It selects
points which are near theoretical model of the primitive. Its sensibility of selection is managed by its
parameters (see section RANSAC Parameters).
For example, if five points have been picked to fit a circle and one of them make the circle be too out
of the data, it is not considered to fit. Only the others are finally considered to fit the circle.
Location options
Geometries Location options:
• Enable automatic location from the Geometry Fitting panel: The current geometry selected in
the Geometry fitting panel is automatically located. The viewers are automatically set to display
the slices where the current selected geometry appears.
• Enable automatic location from the Measures panel: The latest geometry selected in the combo
box of the Measures panel is automatically located. The viewers are automatically set to display
the slices where the current selected geometry appears.
• Enable automatic location from the Local Coordinate System wizard: The latest geometry
selected in the combo box of the Local Coordinates System wizard is automatically located.
The viewers are automatically set to display the slices where the current selected geometry
appears.
• Enable automatic location from the Measures panel: The current measure selected in the Mea-
sures panel is automatically located. The viewers are automatically set to display the slices
where the current measure selected appears.
Decimal Display
Option to customize the number of decimals displayed in the Metrology Workroom.
Directories
These parameters control which are the default directories where looking for existing recipes and
saving the recipes results.
Note: the recipes results directory is automatically determined from the recipes directory.
Automatic Display
Check the box to activate the Automatic Display, uncheck to deactivate it.
Automatically connect a display module:
These three buttons allow you to adapt the automatic display behavior to your working habits.
Select the display module to auto-connect to:
Allows you to customize each association between data type and their associated display module.
See the chapter Automatic Display for more details.
Figure 8.16: The Snapshot Dialog allows you to save or print the contents of a Viewer window.
• 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. If one of the
offscreen dimension is bigger than 4096, the tiles algorithm is automatically used. Notice that
the offscreen option overwrites the tiles option.
• 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. Note that [Annotations—Colormap
displays— Plot Viewer—SpreadSheet Viewer— Scale] will change their size when using tiling
with snapshots.
• Antialias: Use this option to render snapshots with antialiasing enabled. In this mode, the
antialiasing is performed by using the tiling rendering followed by a downscale. The Antialias
factor determines the degree of antialiasing.
• 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.
• Auto-save network: Use this option to save a network in addition to the snapshot. If the option
is checked, a network will be saved at the same location as the snapshot specified by filename,
and ending with .hx. (i.e snapshot.jpg.hx )
Warning: it is not possible to generate a snapshot bigger than 2GB. The picture size depends on:
Commands
snapshot [options] [filename] [filename2 (for stereo mode only)]
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.
This page displays information about the system on which you are running Avizo. This information
can be useful when reporting problems to technical support.
This page displays information about the current OpenGL graphics driver. In particular, a list of
available OpenGL extensions is printed. This list allows it to check if certain rendering techniques,
like direct volume rendering via 3D textures, are supported on a particular hardware platform or not.
• 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.
• An options button used to perform specific actions on the object (rename, remove...).
• A save button (only on data objects) used to save (or save as, or export as) the data object.
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 whose names
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.
8.1.20.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 whose names 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 name, 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).
• Hide All From Viewer But This: to keep visible in the viewer only the display modules of the
selected objects.
The first button allows saving the data, the second button allows exporting the data.
• 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 whose names 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
9.4.6 (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 with points inside a tetrahedron
are obtained from the four vertex values by linear interpolation. This class does not provide a copy of
As for scalar fields Avizo provides a number of vector field classes, 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 applications. 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
in z-direction may vary. In case of rectilinear coordinates, the cells are still aligned to the axes, but
the grid spacing may vary from cell to cell. Finally, in the case of curvilinear coordinates each, node
of the grid may have arbitrary coordinates. Grids with curvilinear coordinates are often used in fluid
dynamics because they have a simple structure but still allow for accurate modeling of complex shapes
like rotor blades or airfoils.
The Tetra Grid class represents a volumetric grid composed of many tetrahedrons. Such grids can
generally be used to perform finite-element simulations, e.g., E-field simulations.
A considerable amount of information is maintained in a Tetra Grid. For each vertex, a 3D coordinate
vector is stored. For each tetrahedron, the indices of its four vertices are stored as well as a number
indicating the segment the tetrahedron belongs to as obtained by a segmentation procedure. Beside
this fundamental information, a number of additional variables are stored in order for the grid being
displayed quickly. In particular, all triangles or faces are stored separately together with six face
indices for each tetrahedron. In addition, for each face, pointers to the two tetrahedrons it belongs to
are stored. This way the neighborhood information can be obtained efficiently.
When simulating E-fields using the finite-element method, the edges of a grid need to be stored explic-
itly, because vector or Whitney elements are used. These elements and their corresponding coefficients
are defined on a per-edge basis. When a grid is selected, information on the number of its vertices,
edges, faces, and tetrahedrons is displayed.
8.2.6 Transformations
Data objects in Avizo can be modified using an arbitrary affine transformation. For example, this
makes it possible to align two different data objects so that they roughly match each other. Internally,
affine transformations are represented by a 4x4 transformation matrix. In particular, a uniform scalar
field remains a uniform scalar field, even if it is rotated or sheared. Display modules like Ortho Slice
still can exploit the simple structure of the uniform field. The possible transformation is automatically
applied to any geometry shown in the 3D viewer.
In order to interactively manipulate the transformation matrix, use the Transform Editor (documenta-
tion is contained in the index section of the user’s guide).
Be careful when saving transformed data sets! Most file formats do not allow you to store affine
transformations. In this case, you have to apply the current transformation to the data. This can be
done using the applyTransform Tcl command. In the case of vertex set objects, the transformation is
applied to all vertices. Old coordinates are replaced by new ones, and the transformation matrix is
reset to identity afterwards. After a transformation has been applied to a data set, it cannot easily be
unset.
If a transformation is applied to uniform fields, e.g., to 3D image data, the coordinate structure is
not changed, i.e., the field remains a uniform one. Instead, the data values are resampled, i.e., the
transformed field is evaluated at every vertex of the final regular grid. The bounding box of the resulting
grid is modified so that it completely encloses the transformed original box.
• 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.
Note that there are many file formats which do not allow parameters to be stored. Therefore, informa-
tion might get lost when you export the data set in such a format. If in doubt, use the specific Avizo
Format.
8.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 casts or receives shadows
•
Cast Shadows: the displayed shape only casts shadows
•
Receive shadows: the displayed shape only receives shadows
•
Cast & Receive shadows: the displayed shape both casts and receives shadows
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 MAPenables acti-
vating a less restrictive shadowing mode (i.e. more modules supports it but not the Volume Rendering)
• Presentation:
this section describes globally the unit management in the entire product.
8.2.9.1 Presentation
When activating the unit management in Avizo, you will be able to:
• associate a coordinate 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 coordinate units (e.g.,
meters). The coordinate units 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 coordinate units).
• display values related to coordinates information in the Avizo user interface (such as bounding
box, length...) in the coordinate units you want.
The units used to display values in the Avizo user interface are called display units.
To know how to activate/deactivate the unit management in Avizo, you can refer to the following
section: Activate/desactivate unit management in Avizo.
When the unit management is activated in Avizo, a coordinate unit will be assigned to each spatial data
object.
This can be done in 2 different ways:
In the most possible cases, Avizo readers will try to extract the coordinate 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 coordinate 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 coordinate unit has been assigned to the spatial data object, its coordinates values can possibly
be converted. This will happen if the specified coordinate unit for this data is not the same as the one
used internally by Avizo to store coordinates values for all spatial data objects (i.e., named working
• in the Units Editor, where you can see and modify the original coordinate 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 coordinate unit of the spatial data is speci-
fied under a Units bundle. In fact, under this bundle are displayed 2 informations:
• the current (working) coordinate unit of the spatial data stored in the Coordinates param-
eter (the one in which are currently stored the coordinates in memory),
• the original coordinate unit of the spatial data stored in the OriginalCoordinates parameter
(the one specified via the Units Editor at data loading or edited furtherly).
8.2.9.3 How to modify the coordinate unit used for displaying information
Even if the coordinate 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 coordinate units.
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 coordinate 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 coordinate unit is used for displaying coordinates values in the user interface:
The quickest way to modify this display unit is accessible on the main viewer toolbar between Measure
button and snapshot button (see Viewer toolbar description).
Several options linked with unit 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 unit management:
In order to be compatible with older versions of Avizo, you are not forced to use/set units information
in spatial data objects so it’s possible to deactivate the unit management in the entire product. In this
case, spatial data objects won’t contain any unit information and no conversion linked with units will
be performed: Avizo will work as in its previous versions, in the same way you are used to.
To activate/deactivate the unit management in the entire product:
• In the Unit management section, select None to deactivate the unit management or Spatial
information to activate it and use coordinates and angle units information
When the unit management is activated, some units conversions could occur if you are loading data
whose coordinate unit is different from the working unit, used by Avizo to internally store coordinates
values.
To limit as much as possible these conversions, we recommand you let Avizo automatically determine
the working coordinate units.
In this case, when spatial data is loaded, the working coordinate unit will be automatically set to the
Activate/deactivate the units editor dialog when loading spatial data objects
As explained before, when the unit management is activated, some readers can launch a specific dialog
used to specify the coordinate unit of the loaded spatial data.
This dialog will be launched only if the reader has failed to automatically retrieve the coordinate unit
from the information stored in the data file.
To deactivate the units editor dialog when loading spatial data objects:
Unit management is not yet available for all the components of Avizo. The components (data types,
files formats, modules) for which the unit management has been implemented are listed here.
Data types
When unit management is activated in the product, it is possible to assign coordinate units and poten-
tially make units conversion on coordinate values for all data objects for which the type is listed in
table 8.1 below.
For all other data types, coordinate values can’t be converted so these are always stored internally using
original values. In this case, the coordinate units are set to the working coordinate units.
Note:
Data fields (Hexa*Field, Tetra*Field, Reg*Field and Surface*Field) have coordinate units but they
are assumed to always be the same as the one specified on the associated data (HexaGrid, TetraGrid,
Lattice, Surface). Consequently, it’s not possible to explicitly specify the coordinate units of such field
data thanks to the Units Editor. However, setting or modifying the coordinate units of a data field will
automatically update the coordinate units of all attached fields.
Files formats
Some file formats can provide information about the coordinate units of stored data. The following
The following modules have been modified to support unit management in case it has been activated:
Module Unit 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
Several options linked with automatic display are available and allow you to customize the way you
are using it in Avizo. These options are the following:
• Choose the associations between data type and display module associated with
The contents of this preference tab looks like the following figure:
Activate/deactivate the automatic display in Avizo
The first available option is a global one that allows you to enable (if you check the box) or
disable (if you uncheck the box) the automatic display mechanism in Avizo.
Select the functional mode for automatic display mechanism
Three functional modes are available allowing you to adapt the automatic display behavior to
your working habits.
You can activate automatic display to:
• All data added to the project view, i.e., the loaded ones and the computed ones
• Loaded data only, i.e., computed data will never be automatically connected to a display module
• First loaded data only, i.e., only the first data loaded after the Avizo opening will be connected
automatically to a display module
Association management
The last section of the Automatic Display preference tab is the associations between data types
and display modules to auto-connect with. Currently, the four main data types used in Avizo are
available:
• Image
• Label Image
• Surface
• Other, i.e., all spatial data different from images, label images or surfaces.
To modify the predefined associations, you can click on the associated module to drop down a menu
as follows:
This menu lets you choose between four options:
• A custom module: This user defined module is selected by the Change Custom... entry.
• A recommended module: This module is selected by default. It has been chosen as the answer
to the most frequently usages and because of its low computation time.
• Nothing: This option allows you to use the automatic display, but not with all data type.
• A way to change the custom choice: Click on this menu entry to open the object explorer
allowing you to change the custom choice.
An easy way to enable/disable the automatic display mechanism is also available in the Project View.
It consists in a toggle button with two states. If the button is down, automatic connection is enabled,
disabled otherwise.
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. You can change the
label for each selected template input. 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.
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.
Figure 9.1: The template project save dialog.
Figure 9.2: Data Type association is possible if template has only one input.
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.
If the template is associated with a data type, you can create an instance using the right-click menu for
a data object of that type. In this case, the template will be immediately created using the selected data
object.
For other templates, you can create an instance from the Templates submenu of the Project >Create
Object... menu. The template may also appear in the macro buttons list. If this case, the following
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, colormaps 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 colormaps with existing objects by selecting the Independant
colormaps option.
9.2 Recipes
The Avizo XRecipe Extension allows for the creation of user-defined recipes for automating a com-
plex scenario, making use of multiple tools, and workspaces. These recipes define high-level work-
flows, such as extracting user-defined statistics from an image. For more information about the Avizo
XRecipe Extension, refer to Chapter 15 - Recipes Workroom.
Recipes 449
• Command Line Options
• Environment Variables
• Avizo start-up script
• -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
exploit hardware acceleration on some low-end PC graphics boards.
• -no overlays
Tells Avizo not to use overlay planes in its 3D graphics windows. Use this option if you experi-
ence problems when redirecting Avizo on a remote display.
• -no gui
Starts up Avizo without opening any windows. This option is useful for executing a script in
batch mode.
• -logfile filename
Causes any messages printed in the console window also to be written into the specified log file.
Useful especially in conjunction with the -no gui option.
• -depth number
This option is only supported on Linux systems. It specifies the preferred depth of the depth
buffer. The default on Linux systems is 16-bit.
• AVIZO DATADIR
A data directory path. This directory will be used as the default directory of the file dialog.
Note that for quick access to several directories, one can use operating system, for instance,
by adding directories to the list of Favorites places in the file dialog or by using a directory
containing shortcuts or links to other directories.
• AVIZO TEXMEM
Specifies the amount of texture memory in megabytes. If this variable is not set, some heuristics
are applied to determine the amount of texture memory available on a system. However, these
heuristics may not always yield a correct value. In such cases, the performance of the Volume
Rendering module might be improved using this variable.
• AVIZO MULTISAMPLE
On high-end graphics systems, a multi-sample visual is used by default. In this way, efficient
scene anti-aliasing is achieved. If you want to disable this feature, set the environment vari-
able AVIZO MULTISAMPLE to 0. Note that on other systems, especially on PCs, anti-aliasing
cannot be controlled by the application but has to be activated directly in the graphics driver.
In this example, the system’s default start-up script is executed first. This ensures that all Avizo objects
are registered properly. Then some special settings are made. Finally, a hot-key procedure is defined
First, please note that Tcl is case sensitive: set and Set are not the same.
A Tcl command is a space-separated list of words. The first word represents the command name,
all further words are treated as arguments to that command. As an example, try the Avizo-specific
command echo, which will print all its arguments to the Avizo console. Try typing
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:
Instead of a command, you can also place a comment in Tcl code. A comment starts with a hash
character (#) and is ended by the next line break:
Variables can be used in Tcl. A variable represents a certain state or value. Using Tcl code, the value
of the placeholder can be queried, defined, and modified. To define a variable use the command
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.
To do mathematical computations in Tcl, you can use the command expr which will evaluate its
arguments and return the value of the expression. Examples are:
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:
Further important language elements are if-else constructs, for loops and while loops. These
constructs typically are multi-line constructs and therefore can not be typed conveniently into the Avizo
console. If you want to try the examples shown below, write them into a file like C:\test.txt by
using a text editor of your choice, and execute the file by typing
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]
}
echo "average of 2 and 3: [computeAverageA 2 3]"
echo "average of 2,3,4: [computeAverageB 2 3 4]"
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.
Finally, at the end of this brief Tcl introduction, we come back to the concept of lists. Basically
everything in Tcl is constructed using lists, so it is very important to know the most important list
manipulation commands as well as to understand some subtle details.
Here is an example of how to take an input list of numbers and construct an output list in which each
element is twice as big as the corresponding element in the input list:
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}
You can use the lindex command to access a single element of a list. lindex takes two arguments: the
list and the index number of the desired element, starting with 0:
For example, if an object called ”Global Axes” exists (choose View/Axis from the Avizo menu) then
you can use commands like
"GlobalAxes" deselect
"GlobalAxes" select
"GlobalAxes" setIconPosition 100 100
Note: Modules are renamed in camel case. These three words are possible in commands: ”Global
Axes”, ”GlobalAxes” or GlobalAxes.
Remember to use the completion and history functions provided by the Avizo console, as described in
Section 8.1.13 (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, script commands
are also 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.
Some variables in Avizo Tcl exist that are predefined and have a special meaning. These are
The basic command interface of Avizo modules and data objects is described in the data type chapter
of the reference part of the user’s guide in the Object section. The basic syntax of object commands is
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.
Global commands are described in the following section.
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 spe-
cific command options listed below, all sub-commands listed in Section 9.4.4.4 (Common commands
for top-level windows) can also 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.
The app command provides several options not related to a particular object or component in Avizo,
but related to Avizo itself.
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.
app memTotal [-k | -m | -g]
Returns the physical memory of the system in bytes. Optional switches -k, -m, -g convert the output
to kilo-, mega-, or gigabytes, respectively.
Commands
addTimeout msec procedure [arg]
Schedules a Tcl procedure for being called after msec milliseconds. If arg is specified, it will
be passed to the procedure. The specified procedure will be called only once. If necessary, you
can schedule it again in the time-out procedure. Example: addTimeout 10000 echo {10
seconds are over.}
all [-selected | -visible | -hidden] [type]
Returns a list of all Avizo objects currently in the Project View. If type is specified, only objects
with that C++ class type (or derived objects) are returned. Search can be limited to selected, visible,
or hidden objects, respectively. Example: all -hidden HxColormap.
aminfo [-a outfile|-b outfile] Avizo-File
If used with only a file name as argument, this command will open the file which has to be in Avizo
data format and print header information. If used with the -a or -b option, the outputfile specified as
argument outfile will be written in ASCII (-a) or binary (-b) format, respectively. Thus, aminfo can
be used to convert binary Avizo data into ASCII and vice versa.
clear
Clears console window.
create class name [instance name]
Creates an instance of an Avizo object like a module or data object. Returns the instance name.
Note that data objects are normally not created this way but by loading them from a file. Example:
create HxOrthoSlice MySlice.
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.
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.
httpd [port]
Start a built-in httpd server. The http server will deliver any document requested. If a requested
document ends with .hx, Avizo will instead of delivering it execute the file as a Tcl script. This
can be used to control Avizo from a web browser. WARNING: This command can create security
holes. Do not use this unless behind a firewall and if you know what you are doing.
limit {datasize | stacksize | coredumpsize} size
Change process limits. Available on Unix platforms only. Use ”unlimited” as size for no limit. The
size has to be specified in bytes. Alternatively, you can use for example 1000k for 1000 kilobytes
or 1m for one megabyte.
load [fileformat] options files
Load data from one or more files. Optionally a file format can be specified to override Avizo’s
automatic file format recognition. The file format is specified by the same label which is displayed
in the file format combo box in the Avizo file dialog. The list of all file formats supported by Avizo
can be obtained using the global command fileFormats. Remote files can be read by using FTP or
HTTP protocol.
Additional options are:
mem
Prints out some memory statistics.
quit
Immediately quits Avizo.
remove {objectname | -all | -selected}
Removes objects from Project View.
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 9.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.
Finally, Tcl scripts can also be represented in the GUI and be combined with a user interface. In Avizo
this is called a Script Module.
• 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 im-
age can be regarded as a 3D image, it makes no sense to perform a threshold segmentation on
it. Therefore, Multi-Thresholding is only provided for raw 3D images, but not for label fields.
There is also a check on the primitive data type of the input (signed/unsigned integer, float,
signed/unsigned short...). Here, the Multi-Thresholding module does not support float or double
label images input.
• The option -category says that Multi-Thresholding should appear in the Image Segmentation
submenu of the main popup menu. If a module should appear not in a submenu but in the popup
menu itself, the category Main must be used.
• The option -class specifies the internal class name of the module. The internal class name of
an object can be retrieved using the command getTypeId. It is this class name which has to
be used for the -primary option described above, not the object’s label defined by -name.
• Finally, the option -package specifies in which package (shared library or DLL) the module
is defined.
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
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
Here the Tcl variable $PRIMARY refers to the input object. The same variable is also used in Tcl
expressions defined by a -check option, as described above.
Besides creating custom popup menu entries based on existing modules, it is also possible to define
completely new entries which do nothing but execute Tcl commands. For example, we could add a new
submenu Edit to the popup menu of every Avizo object and put in the Hide, Remove, and Duplicate
commands here which are normally contained in the Edit menu of the Avizo main window. This can
be achieved in the following way:
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
The optional argument <EventType> refers to the kind of event that will invoke the callback. Other
events will be ignored. This argument can take the following values:
• object, the name of Avizo object the picked geometry belongs to,
• x, the x coordinate of picked point,
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 indicate 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.
• Using inhibitors
• Modifying the input
The script-object should have an ”Apply” (portDoIt) button. The computation should be launched only
if this button has been hit.
In terms of code:
The recipe system is based into the HistoryLog of a data. The HistoryLog is a record of each step or
tool that has been applied to produce the data.
The script-object should create a result data, and set it as result by using ”setResult” command. The
”setResult” command will correctly record the HistoryLog of the data.
In terms of code:
In some particular case, the recipe created from the script result contains ”internal steps”: the internal
tools used in the script-object appear in the Recipe.
This appends when the connection port of the script-object is modified by the script.
If such case occurs, and if there is no reason these tools appear in the recipe, the internal tool recording
should be inhibited using startLogInhibitor and stopLogInhibitor TCL command. The
script ”setResult” command should be called after stopLogInhibitor command.
In terms of code:
• Start the inhibitor in the compute method, before creating any other tool.
• Stop the inhibitor before setting the result.
If you want to modify the input of the script-object (by changing its transformation, for example), the
setResult rule cannot be applied: the result of a tool cannot be connected as an input.
What is Python?
Python is a high-level, object-oriented, interpreted language first implemented in 1989.
(https://www.python.org/dev/peps/pep-0020/)
What is included?
Avizo utilizes Python 2.7.11. Detailed information on how to use Python 2.X can be found here:
https://docs.python.org/2/tutorial/index.html. Many packages are included in the Python installation
(See the List of Python Packages here). Numpy and Scipy are two of the most popular Python pack-
ages included in this installation.
Numpy is an extension for handling multi-dimensional array, which allow for elementwise operations,
comparisons, logical operations and statistics among others. The numpy array is implemented in C
allowing for faster computation. More information can be found here: http://www.numpy.org/.
Scipy is an extension which provides a toolbox for scientific computing such as interpolation, integra-
tion, image processing, linear algebra, signal processing, and statistics. Creating additional GUIs for
viewing plots is not currently supported. More information can be found here: http://www.scipy.org/.
9.5.2.1.1 Using Python This section is not meant to cover all applications and details of the
Python language. See the links in the previous section to learn more about Python, Scipy, or Numpy.
To learn more about how Python interacts with Avizo, continue to chapter: ”Python in Avizo ”.
Python Console
The console can be accessed by going to Windows>Consoles.
The consoles panel has a tabbed interface with several different tools available to use.
The consoles panel can be accessed by going to Windows>Consoles.
Redirect All Output: This pushes all output from all interpreters to the main console
Redirect This Output: This pushes all output from the current console to the main console
Remove Pythonic Objects: This removes all python objects created within the console from
Avizo’s workspace
The console acts as a Python interpreter, so any written commands will be immediately executed after
pressing <Enter>. The assignment or return value will be displayed after execution.
<TAB>:
When nothing is written in the console, <TAB>will auto-complete the following command
hx project.get(module), which will create a Python handle for the object. When text exists in the
console, <TAB>will attempt to auto-complete the current string from a list of available methods,
attributes, and modules. The highlighted choice from the drop-down list will be completed.
<UP>or <DOWN>:
These buttons cycle through your recent history. <UP>retrieves your previous command, while
<DOWN>retrieves the subsequent command.
This allows the user to avoid re-coding functionality that they need to use often. More information
about OOP in the context of Python can be found here:
>>>import numpy
The Numpy package contains a sin(x) method that can then be access to calculate sin(π/2):
>>>numpy.sin(3.1415/2)
0.999999998927
Luckily, Numpy already contains a global variable defining π that we can access in the same way:
>>>numpy.pi
3.14159265359
>>>numpy.sin(numpy.pi/2)
1.0
Packages can be assigned to variables when imported to the namespace to simplify code:
>>>import numpy as np
>>>np.sin(np.pi/2)
1.0
Syntax
Python supports several different object types:
Type Description Example
Number Integers, Floats, Complex, 1, 1.05, 3j+2, 3>2 is True
Booleans
String Sequence of characters "String of charaters"
List Container to group items [1, 5, "Dragon", 948.5]
that can be changed
Tuple Container to group items (948.5, "Dragon", 5, 1)
that cannot be changed
Dictionary Associated arrays with {’a’:99, ’b’:’red’, ’c’:’balloons’}
unique keys
Array Vectorized numeric array numpy.ones ((10,5))
optimized for C
Some types are denoted using specific characters. For example, single or double quotes are used to
create strings:
9.5.2.3 Overview
Similar to TCL, Python has been implemented in Avizo using a Pythonic API. Commands specific to
Avizo allow users to access information and functionalities contained within Avizo modules. There
are two main ways to interact with Avizo using Python. The first way to use Python is through the
Python console, which is separate from the TCL console. This is simply an interpreter. The basic
functionality of this console, such as tab completion, is described in chapter ”Introduction to Python”.
The second way to use Python in Avizo is through script modules. Python script modules allow the
user to inherit properties from the pre-defined PyScriptObject class, then override them to create their
own integrated extensions to Avizo. Script modules act like regular modules in Avizo, and can be
accessed in the Object Popup menu when accompanied by a resource file, which still must be written
in TCL. There are four methods included in the PyScriptObject class for the user’s convenience:
Here we will go through an example of how the console can be used to interact with modules in the
Project view by creating an Ortho Slice and changing its properties.
• If you are unsure what an object’s type ID is, you can create the object in the GUI then
use the <module> getTypeId command in the TCL console to learn its type.
>>>hx_project.create(’HxOrthoSlice’)
4. Now we need to connect Ortho Slice to chocolate-bar.am, but first, we will assign the Ortho
Slice to a variable using the get() method to make it easier to access in the future. We’ll do
the same for chocolate-bar.am:
>>>ortho = hx_project.get(’Ortho Slice’)
>>>input_data = hx_project.get(’chocolate-bar.am’)
5. To connect the Ortho Slice to chocolate-bar.am, we’ll need to see how to access the Data port
of Ortho Slice. Expose a list of possible ports to interact with by printing the results of the
portnames command to the console:
>>>ortho.portnames
6. From the portnames command we see that the ’data’ port likely coincides with the
"Data" connection exposed in the Ortho Slice’s properties. Connect chocolate-bar.am to this
port using the connect() method at the ports level, then apply the change with the fire()
method:
>>>ortho.ports.data.connect(input_data)
>>>ortho.fire()
7. We can also change the slice location by setting the sliceNumber port’s value:
>>>ortho.ports.sliceNumber.value = 100
>>>ortho.fire()
9. Read further on the methods and classes available for your manipulation by passing them to the
help() method:
>>>help(ortho.fire)
In this example we will write a simple script to calculate the total volume of the bounding box of a
dataset. This can be typed directly in the Python console in Avizo. You can also type the commands
in a text editor and copy them to the Python console for execution.
>>>bbox = hx_project.create(’HxBoundingBox’)
>>>bbox.ports.data.connect(data)
>>>bbox.fire()
4. Retrieve the extents of the bounding box in X, Y, and Z to calculate its volume. There is already
a bounding box command you can use to get this information, which is stored as a tuple defined
as ((xmin, ymin, zmin),(xmax, ymax, zmax)).
>>>type(data.bounding_box)
<type ’tuple’>
>>>data.bounding_box
((0.0, 0.0, 0.0),
(28.079999923706055,
20.880001068115234,
35.279998779296875))
6. Access each of the indices from the minimum and maximum boundary lists using brackets []
and plug this information into a formula to calculate the box’s volume.
>>>x_extent = max_bounds[0] - min_bounds[0]
>>>y_extent = max_bounds[1] - min_bounds[1]
>>>z_extent = max_bounds[2] - min_bounds[2]
>>>volume = x_extent * y_extent * z_extent
In this example, we wrap the bounding box volume calculator into a function that accepts our input
data as an argument and prints our answer back into the console. A few notes about functions and
Python syntax:
• If you do this directly in the Avizo console, use SHIFT+ENTER to enter a line break in your
code without executing it.
• Python requires consistent indentation within the body of a function. The best practices conven-
tion is to indent the body of code by four spaces (not a tab).
• The Python console in Avizo does not indent lines for the user, and the user must control inden-
tation themselves.
3. An ellipses is shown in the interpreter to show that it is waiting for more code before executing
the current input. Manually type four spaces, then assign the minimum and maximum bounding
box lists to variables as before.
... min_bounds, max_bounds = data_arg.bounding_box
4. Using SHIFT+ENTER to make a new line, enter another four spaces and proceed with the rest
of the volume calculator.
... x_extent = max_bounds[0] - min_bounds[0]
... y_extent = max_bounds[1] - min_bounds[1]
... z_extent = max_bounds[2] - min_bounds[2]
... volume = x_extent * y_extent * z_extent
... print(’The volume of %s is %.3f. ’ % (data_arg.name, volume))
5. Finally, include a return statement to send the volume variable back to the console. This
allows you to set the result of the calculation to a variable.
... return volume
6. Execute the function definition by hitting ENTER, then test the code with chocolate-bar.am.
Test your ability to assign the calculation result to a variable as well.
>>>bbVol(hx_project.get(’chocolate-bar.am’))
The volume of chocolate-bar.am is 20685.031.
20685.031198228968
>>>chocolatebar_volume = bbVol(hx_project.get(’chocolate-bar.am’))
There are two mains functions that greatly help the user to explore the structure of Python within
Avizo. The dir() function allows the user to see a list of attributes and methods that are available
for a given object.
The help() function has more detailed information about attributes and methods and examples of
their use. Output from help() also contains information about related parent classes.
>>>help(ortho)
class HxPlanarModBase(HxModule)
| Method resolution order:
| HxPlanarModBase
| HxModule
| HxObject
| HxBase
| McInterface
| __builtin__.object
|
| Data and other attributes defined here:
|
...
...
...
| all_interfaces
| Attribute that contains all admissible interfaces as sub-members.
|
| Examples
| --------
|
| Retrieve an ‘HxBase‘ interface on an orthoslice:
• print() is a native Python command that prints results to the Python console in Avizo.
>>>x = 3
>>>y = 2
>>>print(’The sum of %i + %i is %i.’ % (x,y,x+y))
The sum of 3 + 2 is 5.
• import is a native Python command that adds extended functionality to Python by loading
extra packages.
>>>x = 3
>>>y = 2
>>>import numpy
>>>numpy.add(x,y)
5
Some useful global functions for interacting with the Project view are contained in the hx project
method.
Method Description
hx project.create() Creates an instance of a certain Avizo class and adds it to the Project
view
hx project.remove() Removes an object from the Project view
hx project.add() Adds an object to the Project view
hx project.load() Loads data of a defined format when a filename is specified
Variables containing directory paths are also provided as attributes accessible via the hx paths
method.
Variable Description
hx paths.install dir Installation directory, also known as
<$AVIZO ROOT>
hx paths.tutorials dir Tutorials data directory
hx paths.python modules dir Python modules directory that contains extra
packages
hx paths.python script objects dir Python script objects directory that contains
user-created custom Python scripts
hx paths.executable dir Directory containing Avizo.exe
>>>hx paths.install dir
• HxConnection
This port class allows the user to connect modules. The type of module can also be restricted.
• HxPortFilename
This port class allows the user to load or save files. The function of the port is defined with the
mode attribute. The filename can either be input as text or accessed through a file browser.
• HxPortIntSlider
This port class holds a range of integer values that can be accessed through a sliding scale. This
port is used to define the slice number of the ”Ortho Slice” module.
• HxPortDoIt
This port class controls the auto-refresh box and handles the ”Apply” button.
• HxPortInfo
This port class is useful to provide instructions, notes, or warnings to the user. The text can be
found in the module properties.
1. Open a text editor and create a new file with the following structure. Name the object
BoundingBoxVolume.
class BoundingBoxVolume(PyScriptObject):
def __init__(self):
# Initialization code will go here
def update(self):
# Update code will go here
def compute(self):
# Computation code will go here
def __init__(self):
self.data.visible = True
3. In this example, use the pass keyword to skip updating the GUI in the update() method since
there will be no ports to update.
def update(self):
pass
4. In the compute method, we want to halt the volume computation if there is no data object
connected to the script module. Add an if statement that checks if the data connection is
empty. If the data connection is empty, use a return statement to exit the compute()
method.
• Python makes this easy with the None keyword (i.e. if <expression> is
None:)
def compute(self):
# Check if input data is connected
if self.input.source() is None:
return
5. Finally, if the logic check fails because a data object is attached, calculate the volume using the
bbVol script. Get the name of the connected data object using the source() method.
def compute(self):
# Check if input data is connected
if self.input.source() is None:
return
data = self.input.source()
min_bounds, max_bounds = data.bounding_box
x_extent = max_bounds[0] - min_bounds[0]
y_extent = max_bounds[1] - min_bounds[1]
z_extent = max_bounds[2] - min_bounds[2]
6. Once your module is complete, create a resource file in TCL that displays this module in the
Object Popup menu as an option to attach to all data objects.
• Refer to Configuring Popup Menus to learn more about creating resource files.
• This file can be found in:
$AVIZO ROOT/share/resources/PythonBoundingBoxVolume.rc
-name
This is the name of your module in the menu.
-primary
This restricts the data type that is required for your script to appear.
-category
This defines which folder in the menu that your script will appear.
-proc
This is the body of the resource file where you can identify while .pyscro to load along with
connecting your script to the object that you originally right-clicked.
-add
This creates a name for your button.
-color
This controls the color of your button.
-proc
This is the body of the resource file where you can identify while .pyscro to load or procedure
to run.
• official fei/avizo
It provides several options for finding and installing available packages, for viewing, updating, and
removing installed packages, and for reverting to previous states.
Prerequisites
In order to use the Package manager command line enpkg, it is necessary to have the root/admin
read/write/execute permissions.
’https://packages.enthought.com/repo/enthought/free/{PLATFORM}/’,
’https://packages.enthought.com/repo/enthought/commercial/{PLATFORM}/’,
By doing so, you will have access to merely the entire python ecosystem but notice that only packages
from the FEI repository have been tested as being fully compatible with Avizo: you may experience
strange or incorrect behavior when using packag from another repository that the FEI one.
./Scripts/enpkg --version
The --help option (or -h) shows all the available options:
./Scripts/enpkg -h
./Scripts/enpkg -l
./Scripts/enpkg -s
./Scripts/enpkg -s numpy
./Scripts/enpkg <package_name>
This may be useful if for a reason the FEI python distribution becomes non-functional (for instance
after installing unsupported packages).
1. As a first step, we open the file in a text editor and give our new module a name by changing the
first line to:
class ScipyFFT(PyScriptObject):
2. In the initialization function, the default data input port will be use for the data connection to
our module and the allowed connection types will be define:
self.data.valid_types = [’HxUniformScalarField3’]
5. The computation of the FFT will be done in the compute function. After checking if the ”Apply”
button was hit and if an input data set was selected, we will import a few needed packages from
6. As a first step in the computation, we need to create a variable to store the result from the FFT
computation as a 3D uniform scalar field.
result = hx_project.create(’HxUniformScalarField3’)
7. To measure execution time, we first need to take a time stamp at the beginning of the computa-
tion:
start_time = time.time()
9. To compute the absolute value of the FFT of our input data, we need to execute the following 3
commands:
# Compute the discrete Fourier transform.
F1 = fftpack.fftn(input.get_array())
10. After the computation has finished, the result array needs to be assigned to the result variable
that we created earlier:
result.set_array(F3)
11. Last but not least, we would like to print out the total execution time of the FFT:
print("--- %s seconds ---" % (time.time() - start_time))
start_time = time.time()
13. To make this module available in the graphical user interface of Avizo, we will also need to write
a resource file. Create a new file with your text editor and save it as ScipyFFT.rc. Resource files
15. We need to specify the data type we would like to be able to attach it to:
-primary "HxUniformScalarField3" \
17. The next line defines the location where it will appear in Avizo’s ”Object Popup” menu:
-category "{Python Scripts}" \
18. Next, we need to run a few TCL commands to initialize the module in Avizo’s graphical user
interface. The first will create the script object and set a label for the module:
-proc {
set this [[create HxPythonScriptObject] setLabel "Python FFT"]
19. We will then need to set the file name where to find the Python script for this module, where the
<PRODUCT PATH> is $AVIZO ROOT:
"$this" startStop hideMaskIncrease
"$this" filename hideMaskIncrease
"$this" filename setValue \
<PRODUCT_PATH>/share/python_script_objects/ScipyFFT.pyscro
20. Then the script needs to execute itself for the changes to take effect:
"$this" startStop hit 0
"$this" fire
22. The entire resource file will look like this at the end, where the <PRODUCT PATH> is
$AVIZO ROOT:
#############################################################
# .rc for pyscro ScipyFFT
#############################################################
23. To make this Python script object available to Avizo, we need to copy both files to
$AVIZO ROOT/share/python script objects/ and that Avizo was restarted after the resource file
was changed.
24. To test this new module, start Avizo, load $AVIZO ROOT/data/tutorials/chocolate-bar.am. Right
click on the data object and pick ”Python Scripts/Scipy FFT” from the ”Object Popup”. Hit
”Apply” and a new data object containing the resulting FFT will appear in the ”Project View”.
Avizo XFiber Extension is an extension that provides specific support for analyzing fibers, filaments,
tunnels, and other networks or tree-like structures. This option assists segmentation and analysis with
automatic, semi-automatic, and interactive tools.
The extension provides tools for tracing centerlines in various modality acquisitions such as X-ray
microtomography, to detect fibers or tube-like structure.
The Avizo XFiber Extension includes many analysis tools to compute advanced fiber statistics. Various
distributions and properties can be calculated and plotted. Various tools also allow filtering fibers based
on properties and attributes.
The Avizo XFiber Extension also includes the Filament Editor workroom that offers automatic and
interactive tracing tools for segmenting the centerline of the fibers and measuring their thickness in
fiber networks and other filamentous structures, and editing spatial graphs obtained by skeletonization.
To access the Filament Editor, click the icon in the Workrooms Toolbar. We begin our work by loading
the 3D image data set.
• Window Level Select the Window Level icon, click the 2D viewer, hold the mouse button
pressed, and drag the mouse cursor left/right to change the window width, or up/down to change
the window center. Set the window level around 30-80. Click the 3D button to visualize the
selected voxels using a shaded volume rendering.
• Browse Slice The browsing tool allows using the mouse to navigate through an image stack
in the 2D viewer (or MPR viewer). Select the Browse Slice icon, click the 2D viewer, hold
the mouse button pressed, and drag the mouse cursor up/down to scroll forward or backward
through the image stack. If you are working with a wheel mouse you can use the wheel instead
of this icon. Simply click the viewer and scroll the mouse wheel to scroll through the image
stack.
• Thick Slice The thickness of the slice can be set by sliding the Thickness slider. When displaying
a thick slice, data values are computed as maximum intensity of the values of the original slices.
Set thickness to 25. Click the 3D slice button to visualize the thick slice in the 3D viewer.
The AutoSkeleton tool traces connected regions according to a user-defined window level and converts
the centerline of those regions into graphs composed of points, segments, and nodes, which are the ele-
ments of the data class Spatial Graph. The result of the ”skeletonization” is, therefore, a Spatial Graph
object, which is being visualized in the 3D viewer as balls and lines, and as blue points connected by
green lines in the 2D viewer.
Depending on the quality of the data and on the selected window level the result of skeletonization will
typically show several disconnected elements and loops within the networks. Disconnected elements
will break the single neuron into several sub-graphs. Loops, on the other hand, are parts of a graph
where segments connect onto itself. In some biological objects like e.g., neurons loops must not occur.
To identify graphs and loops the Filament Editor offers dedicated tools.
• Press the button Identify Graphs (in the Edit panel) to automatically detect and label all graphs
(all connected components) in the Spatial Graph object. This creates a new label group in the
Label Editor named Identified Graphs under which all identified graphs are listed as Graph0,
Graph1, ..., GraphN.
At this point we have only two graphs: Graph0 is the large tree, while Graph1 is just three segments
and four nodes. Switch back to the Edit tab in the Tool Box.
It should perhaps be noted that the Auto Skeleton tool is also available as a compute module in the
Object Popup under the ImageProcessing¿Skeletonization category. Also, there is a rich set of tools
available in the Segmentation Editor to perform the threshold segmentation necessary for the skele-
tonization process. Finally, in the case of a strict tree topology it may be advantageous to restrict the
search to a tree. In this case, you may want to use module Centerline Tree to extract a graph with
guaranteed tree topology.
Before closing this subsection, we should save the Spatial Graph data object we have created, it will
be useful in further step of this tutorial.
• Switch back to the Project View, save the object called neuron.Smt.SptGraph in a directory of
your choice and then remove it from the Project Graph View.
• Switch again to the Filament Editor to prepare the next step.
defined data window. Now we can use the Interactive Tracer to re-trace the neuron segments. In order
to clearly understand how to use the tracer, we will try to re-trace a small part of the neuron tree we
extracted in the previous paragraph.
• Press the New button at the Graph Data port to create a new Spatial Graph data object.
• Click in the 2D viewer. Using the Browse Slices tool or the mouse wheel, slice through the
volume until you reach the root of the neuron.
• Set the thickness of the Thick Slice to 10 for a better visualization.
• Activate the Interactive Tracer by clicking the Trace Filament icon in the toolbar and make sure
that the Thick structures option is checked in the Trace tab.
Note that the Interactive Tracer is alway active while the Trace Filament icon is highlighted and it can
be triggered only if the 2D viewer is active.
If you now move the mouse over the 2D slice, the cursor has a cross shape whenever it is over black
regions and turns into a crosshair (cross within circle) when it is over voxels that are within the window
level. The cross-hair shape indicates that it is possible to set tracing key points. As you will see later,
when the pointer is over a traced segment (green line) a small ”P” appears in the crosshair. This
indicates that a click would select the nearest point as a key point. Likewise, an ”N” is shown in the
cursor whenever the cursor is over a node and a click will select this node as a key point. Furthermore,
the cursor turns red when the trace tool is in append mode, meaning that the next click will trigger a
tracing action between the previously selected and the current key point.
If you press Identify Graphs, you will see only one graph. You can also access some statistical in-
• Right-click into the Label Editor and select Add graph label group ¿ Empty label group.
• Right-click on the created label and rename it Topology.
• Right-click on the Topology label and select Add label. Repeat this action to add three labels.
• Select and right-click on each of the created labels and rename them Central, Right, and Left.
• Select the Select Lasso icon and select-lasso the right-hand branch. You can use the Select Lasso
tool in combination with Shift key to deselect-lasso or with the Ctrl key to add elements.
• Right-click on label Right and select Assign selection.
• Repeat the last two items to label Central and Left branches. Note that this is just an exercise, it
does not really matter to exactly select the ”Center”, ”Right” or ”Left” segments.
Select now the View tab in the Tool Box
• Scale the nodes using the Scaling Factor slider.
• Colorize the nodes according to the label by selecting Topology in Node Coloring.
• Repeat the last item for the segments.
• Click on the color button of label Right and select a new color.
For advanced network visualization you can switch to the Project View. If you do so, you may attach
a Spatial Graph View module to the Spatial Graph object we created before.
• If the label neuron.labels is not available, create this new label image by pressing the + icon
button in the Label field port located in the upper part of the user-interface.
• Create a new material by pressing the + icon button on the left of the Material List in the
Materials port.
• Right-click the new material in the Material List, select Rename Material and enter ”neuron”.
• In the tool box Tools at the bottom part of the user-interface, select the Threshold Tool.
• In the Threshold Tool area set the threshold to 100-255, and check the All slices option.
• In the Selection box click the + button to assign the selected region to material ”neuron”.
• Switch back to the Filament Editor and select neuron.labels from the Image Data pull-down
menu. Now skeletonize the label image by pressing the Run button in the AutoSkeleton tool.
The data set used in this tutorial is an Ultra High Performance Fibre Reinforced Concrete (UH-
PFRC), courtesy provided by Dr. Alenka Mauko and Dr. Aljosa Sajna from the Slovenian National
Once all parameters have been configured, press Apply. For the example project, the computation of
the correlation field takes several minutes. Note that this time consumption is not representative of
what it would be for the whole dataset as time consumption is not a linear function of the dataset
size. The algorithm requires to internally add a fixed size border to the dataset, which has an effect
on time consumption for small datasets but has a negligible effect on big datasets. Depending on the
graphics card and the size of the input image data, the computation of the full image data might take
up to several hours. For example, on a GeForce 8800 GT with 1GB video memory the computation
of an image of size 2000 x 2000 x 200 takes approximately 20 h. For testing the algorithm, consider
cropping the input image data using the Crop Editor.
As a result, two new objects concrete.CorrelationField and concrete.OrientationField will be con-
nected to the Cylinder Correlation module. The concrete.CorrelationField data object stores the max-
imum cross correlation, and the concretes.OrientationField stores the orientation of the cylinder cor-
responding to this correlation.
Those data objects also store information about the cylinder template that was used to compute the cor-
relation, in their data parameters. These information will then be used to correctly pre-set parameters
of the Trace Correlation Lines module.
From these two fields, tube-like structures can be extracted as described in the next section.
But first, the parameters of Cylinder Correlation are explained in more detail.
The cross correlation is computed on the GPU. Because GPU memory is limited, the port CUDA
memory allows you to limit the amount of GPU memory used for the computation. The preset value is
estimated automatically depending on the memory available on the chosen CUDA Device. If you run
other processes that consume GPU memory, computing the cross correlation might fail due to lack of
memory. In this case, you should set a reasonable limit. In practice, 80% of the free memory should
work.
Computing the cross correlation is time consuming. To minimize computation time, consider cropping
the image data to remove empty space. However, do not crop them too tightly (see discussion of
limitations below).
If you plan to process many data sets of similar characteristic, it is usually worth investing some time
to determine the lowest reasonable resolution as a higher resolution does not substantially increase
quality. The right voxel size is data-dependent, but for solid cylindrical fibers as glass or carbon fibers,
an apparent resolution with a fiber diameter of about 5 voxels should already yield good results.
The Cylinder Correlation module will try to correlate a cylinder template with the data, in all orienta-
tions, to mark each voxels with a score (maximum cross correlation). Before starting the computation,
this template needs to be well defined and to fit with a fiber structure of the data. This is done by
specifying the length and the radius of the cylinder. A visual cylinder template is provided to easily
set those parameters:
By using the visual cylinder, the Outer Cylinder Radius, the Mask Cylinder Radius, and the Cylinder
Length ports are automatically set. Changing those ports while visualizing the template will interac-
tively change the cylinder shape.
Alternatively, the values can be based on a-priori information about the structures or on measurements
taken from the image data. The measurement tool (Measurement in the viewer toolbar) is often useful
• Radius: For structures like steel fibers, a solid cylinder template is appropriate. Specify only
the Outer cylinder radius and set the Inner cylinder radius to 0. Based on the measurements on
the image data (see Figure 10.9), the fibers have a diameter of 8, so Outer cylinder radius of 4
should be fine. The Mask cylinder radius can be set to 8 for this example (diameter of 16). In the
case of a hollow cylinder, a non-zero inner cylinder radius should be specified. The thickness
if the cylinder wall is then Outer cylinder radius - Inner cylinder radius. Acquisition artifacts
like shrinking might introduce a slight difference between the fiber real size and the size in the
image.
• Length: The Cylinder length defines the template length in physical units. A longer template is
more robust to noise. But a longer template at the same time reduces the sensitivity to curved
structures and to the ends of structures. A longer template also requires to stay away further from
the image boundary (see discussion of limitations below). A reasonable compromise depends
on image quality and the structures to be extracted. Here, a cylinder length of 30 turned out to
be a good compromise. The trade-off is different for other structures.
• Contrast: specifies the contrast of the signal to be detected. Fibers, for example, are lighter than
the surrounding image, so Bright on dark should be selected.
10.2.1.3 Limitations
Boundary: The correlation field may contain artifacts close to the boundary (within half the cylinder
size). The reason is that the cross correlation is computed in Fourier space using the Discrete Fourier
transformation (DFT) with periodic boundary conditions. The practical implication is that a template
that is close to the boundary senses structures close to the opposing boundary of the image. Sharp
edges in the image signal, like rapid foreground to background transition, also may create undesired
effects. A general recommendation is:
• To acquire image data such that the relevant structures are far enough away from the image
boundary.
• To keep enough of the original image data when cropping so that the relevant part of the corre-
lation field is away from the image boundary; but ideally have reasonable image signal up to the
boundary (no sharp transitions to black).
• Either crop the resulting correlation field to the part that is far enough away from the boundary
(and cut the orientation field to the same size) before running Trace Correlation Lines, or clean
up the resulting lines if they look unreasonable close to the boundary.
Template size: The template is sampled onto a cubic grid, which must fit into the image volume. For a
large Cylinder length, the template may be too large for the image volume. In particular, if the image
volume has few z-slices, this might be a limitation. To successfully apply Cylinder Correlation, reduce
the Cylinder length until the template fits. If this does not yield satisfactory results, consider increasing
the volume by adding empty z-slices using the Crop Editor. Keeping the template small is a good idea,
in general, since the computation time increases with template size.
• Attach a Trace Correlation Lines module to concrete.CorrelationField (in category Fiber Trac-
ing).
• Choose concrete.OrientationField as Orientation field input of Trace Correlation Lines module.
• Set parameters as shown in Figure 10.10.
Trace Correlation Lines traces lines that start at points whose correlation value is greater than the value
of Min seed correlation. It is useful to inspect the correlation field to determine an initial value to try
and then refine the choice. If too few lines are extracted, consider lowering the value. If too many lines
are extracted, consider increasing the value. The initial values should be chosen such that all points
with a greater correlation value are clearly useful seed points. It can be done in various ways such as
using an Ortho Slice (see Figure 10.11 and Figure 10.12). Alternatively, use an Isosurface and adjust
its Threshold such that the isosurface contains only parts that are clearly useful as seed points. Then
use this threshold as Min seed correlation.
It is not necessary that a given fiber looks continuous on the correlation score image, but a fiber cannot
Figure 10.12: Slice through correlation values with the same data range as indicated in the histogram in the previous figure.
be traced if it has not at least one voxel above the Min Seed Correlation threshold.
The Min continuation quality can be determined in a similar way (see Figure 10.11). It controls where
line tracing stop. If lines are unexpectedly short, try a smaller value. If lines are too long, try a larger
value.
The purpose of Min Line Distance is to avoid that additional lines are traced inside the diameter of
another lines, which might happen if correlation values are not clearly separated. To determine a
reasonable distance value, use the measurement tools (Measurement in the viewer toolbar).
Another data-specific parameter is the Direction coefficient. If the tube-like structures are more or less
straight, a smaller value is appropriate. If the data also contains curved lines, a larger value might be
appropriate.
• Chord Length: straight distance between start and end point of the segmentation
• Curved Length: curved segment length
• Tortuosity: Curved Length / Chord Length
• Orientation (Theta and Phi) of the segment between the start and end points
Those statistics are stored as attributes in the spatial graph. Those attributes can be displayed in the
table view, with the Show button of the Spatial Graph module (Table port). The graph can also be
displayed by using the Spatial Graph View module (see Figure 10.14).
It is also possible to use a Spatial Graph Statistics module on this attributed graph to output the statistics
in a regular spreadsheet (see Figure 10.13).
• Attach a Spatial Graph Statistics module to the generated SpatialGraph. To do so, right-click on
the green data object CorrelationLines. From the context menu, choose Measure And Analyze.
Then click on the entry SpatialGraphStatistics.
• In the Properties Area of the SpatialGraphStatistics, press the Apply button. A con-
crete.statistics spreadsheet, as shown in Figure 10.13, is generated and displayed in the Project
View.
• Select the concrete.statistics spreadsheet and then click the Show button. A new dialog will be
displayed that presents the results in a table.
You can also load the project concrete tutorial.hx to complete this tutorial steps. The result of Cylinder
Correlation and Trace Correlation Lines, applied on the whole example data set, is shown in Figure
10.15.
Figure 10.14: Display centerline orientations using the Spatial Graph View module.
10.2.4 References
1 Weber, B., Greenan, G., Prohaska, S., Baum, D., Hege, H.-C., Mueller-Reichert, T., Hyman,
A. A., and Verbavatz, J.-M. (2012). Automated tracing of microtubules in electron tomograms
of plastic embedded samples of caenorhabditis elegans embryos. Journal of Structural Biology,
178(2):129-138.
2 Rigort, A., Guenther, D., Hegerl, R., Baum, D., Weber, B., Prohaska, S., Medalia, O., Baumeis-
ter, W., and Hege, H.-C. (2012). Automated segmentation of electron tomograms for a quanti-
tative description of actin filament networks. Journal of Structural Biology, 177:135-144.
The data set used in this tutorial is an Ultra High Performance Fibre Reinforced Concrete (UH-
PFRC), courtesy provided by Dr. Alenka Mauko and Dr. Aljosa Sajna from the Slovenian National
Building and Civil Engineering Institute (www.zag.si; aljosa.sajna@zag.si), Log Cezsoski
Bridge, Slovenia, WP7 project Assessment and Rehabilitation of Central European Highway Struc-
tures (ARCHES) http://arches.fehrl.org/.
The tutorial will be applied on a cropped volume of this data set. To apply the workflow to your data,
you might need to adapt these parameters, as explained in more details below.
The tutorial assumes that you are familiar with the basic concepts of Avizo. In particular, you should
know how to load files, how to interact with the viewer, and how to connect modules to data objects.
All these topics are covered in Chapter 2 - Getting started of the Avizo User’s Guide. Note that
the modules presented in this tutorial require an NVIDIA graphics card supporting CUDA Compute
Capability 1.3 or higher. To find your graphics card CUDA Compute Capability, see NVIDIA’s list of
CUDA GPUs ( http://developer.nvidia.com/cuda-gpus/ ).
In the next step, we will dilate the centerlines back to fit the original data:
• Attach a Ball Dilation module to concrete.converted and set the parameters as follow:
• Once all parameters have been configured, press Apply. Attach the voxelized rendering module
to the Ball Dilation result. The centerlines are dilated back to their original size.
• Attach a Label Interfaces module to the convert.dilated data and set the parameters as follow:
• Click on Apply.
• Label the contact point using a Labeling module, leaving the default values, then click on Apply.
• Attach a Label Analysis to the labeled contact points concrete.labels, to get basic statistics. Keep
the default values, then click on Apply.
• Attach a Fiber Shape Statistics module to concrete.CorrelationLines.am and set the parameters
like the following figure and apply.
• The module will output the following statistics in a spreadsheet.
• Attach a Distribution Analysis module to the output of the Fiber Shape Statistics module, set the
parameters as shown in the following figure, and click on Apply:
• Attach a Plot SpreadSheet module to the output and set the parameters as shown in following
figure, and click on Show in the Plot port:
The data is filtered so that only fibers matching the user’s equation remain:
• Spatial Graph Local Statistics computes local statistics from a Spatial Graph representing the
fiber centerlines (output of Trace Correlation Lines module). Use this module when the fiber’s
sample can be separated. Statistics include:
• Volume Density
• Surface Density
• Tensor
• Orientation (vector field corresponding to the main eigen vector of the tensor)
• Local Orientation computes local statistics directly from a greyscale volume. Use this module
when the fiber’s centerlines cannot be traced. Statistics include:
• Confidence
• Orientation (Theta, Phi)
• Eigen vectors
• Moment of inertia
As an example, local statistics from the concrete dataset are extracted, using the Spatial Graph Local
Statistics module:
Figure 10.35: Comparison between the volume fraction and surface area densities
ports Resolution and Voxel Size(units). The block size is, by default, such that there is no overlap
between adjacent blocks. However, this can be configured through the port Block if necessary.
• Once all parameters have been configured, press Apply. The spreadsheet output lists all statistics
for each block. Select the spreadsheet output and press Show to view the statistics in the table
view. Note: this is not recommended, the number of blocks is very large.
The statistics can also be generated in the form of scalar images (volume fraction and surface area),
vector field (major orientation) and tensor fields (orientation tensors), useful for visualization and data
export. For instance, attach an Ortho Slice to concrete.am, then create a colorwash to visualize volume
density on top of the data:
The same set up can be done with the area density map to compare zone of influence of the fibers’
volume and the fibers’ area:
Orientation tensors may be visualized as ellipsoids using the Tensor View module:
• Attach a Tensor View module to the tensor output of the Spatial Graph Local Statistics.
• You may set the Module port of the Tensor View to a different plane than the default clipping
plane. For example, use the ortho slice on which the density map is visualized. Set the parame-
ters as shown in the following figure:
Figure 10.40: Plotted data displayed using a Bar Chart Slice module
• Theta represents the angle formed with the Z-axis and varies in the range [0,90] degrees.
• Phi is the angle in the xy plane, measured from the X-axis towards the Y-axis in the range [0,360[
degrees.
• Standard in which a sample of small e.g. length should not account as much as a sample of e.g.
high length on height mapping.
• Averaged: the weight of each sample with the same orientation is the averaged weight of the
samples. For example, if the weight property is length, and there are 5 samples of a given
orientation, the weight assigned should be based on ”total length (cumulated length of each 5
samples)”/5.
Using the Export to lattice button, the module outputs the plotted data as regular 2D scalar field which
can be visualized using the Bar Chart Slice or the Height Map Slice module.
Avizo XWind Extension is the extension of Avizo for analyzing, visualizing and presenting numerical
solutions from CAE and CFD simulations.
Avizo XWind Extension provides advanced support for:
Avizo Lite Edition provides base post-processing support limited mostly to visualization. Avizo
XWind Extension extends the Avizo Lite Edition feature set by adding post-processing computation
and analysis of derived variables, statistics and feature extraction. Avizo XWind Extension brings also
the robust support for unstructured mixed meshes made up of tetrahedra, hexahedra, pyramids and
wedges. Most CAE files formats are supported in Avizo XWind Extension only. See the File Formats
Index for a complete list of supported file formats.
By following the provided tutorials, you will learn how to use these modules on your own data sets.
For a start you do not necessarily have to read the tips sections.
The data used for this tutorial is normally installed in the directory
data/tutorials/cfd-fea-advanced under your AVIZO ROOTdirectory.
the Project Tree View, information about it is displayed in the Properties area. A click on the question
tag ”?” in the upper right side of the area will take you to the contextual help page for the active object.
For more information about the user interface and especially the Viewer window, please refer to the
Program Description and to its Viewer Window subsection.
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 data set 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.
To get the same project tree view organization than in the tutorial screenshots, go to Edit / Preferences
/ Layout and select Group by display/compute/data in tree view). You can alternatively use the Avizo
Lite Edition version of the Project Tree View (without the ”Group by display/compute/data in tree
view” option) or switch to the Project Graph View from the Project Menu.
In the remaining of the tutorial, the Project Tree View will be named only Project View for easing the
reading.
• Abaqus
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 project 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 (see Figure 11.4).
Select Pressure in the data column and click Add-> then OK. The Pressure now appears in the
Project View under the model it is attached to and its colormap is displayed.
• Remove the bounding box by right-clicking on the module in the Project View and selecting
Bounding Box / 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 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 XWind Extension, 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.
• In the Boundary types port, deselect the items: Symmetry and Pressure Far Field.
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
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.
If you want to display a compass on your viewer, like in Figure 11.5:
Figure 11.6: 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 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/cfd-fea-advanced/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 cfd-fea-advanced/wind templatenetwork.hxtemplate (load it by se-
lecting Open Data... in the Project 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 11.6, 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 View, a time Sequence Controller module has appeared.
• Create a Boundary View module as before (right-click on the model in the Project 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/cfd-fea-advanced/fan/wind timeseries.hx.
Use the time sequence controller module to animate the display of pressure over time. Select the
controller in the Project View.
• Keep the Time mode port on time step. The physical time stands for the physical time associated
with 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 data set 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 data set. 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 View. Details about it appear in the Properties area (see Fig-
ure 11.10).
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 (see Figure 11.12). 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 View. Details about it appear in the Prop-
erties area.
In the Properties area of the scalar field you can find (see Figure 11.13):
11.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
colormap for any of the display modules.
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 XWind Extension, 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 (see Figure 11.15).
• 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 In
Viewer module appears in the Project 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:
Go back to viewing mode, for example by clicking in the 3D viewer window and pressing the [ESC]
key.
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. Results are
shown in Figure 11.17.
Figure 11.17: Data mapping of the pressure on the boundaries of the model.
• 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 (see Figure 11.18).
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/cfd-fea-advanced/wind boundariesview02.hx.
Extracting surfaces from boundaries
We will now create a surface from the boundaries of the aircraft.
• Click the create button in the Create surface port of the Boundary View.
The surface aircraft mach.surf has been created. This surface can then be used as a seed region
In the Properties area of the module you can see some ports that we have studied in Chapter 11.2.
• Options2 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 with 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/cfd-fea-advanced/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/cfd-fea-advanced/wind crosssection02.hx.
Two coupled objects were added to the Project 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/cfd-fea-advanced/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/cfd-fea-advanced/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
In case of any problems or uncertainties you can find the same project predefined in your tutorial folder
under the file name data/tutorials/cfd-fea-advanced/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
you can see some particles swirling and becoming red (that is to say old) close to the upper side of the
wing (see Figure 11.27).
• 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 the Properties area of ROI Box, select/unselect the display on the right viewer by clicking on
the right red half of the viewer toggle . This will make the ROI appear/disappear from the
right viewer. You can do the same for the Bounding Box if desired.
• Rotate and zoom in and out to get two different views, something like Figure 11.28.
In case of any problems or uncertainties you can find the same project predefined in your tutorial folder
under the file name data/tutorials/cfd-fea-advanced/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 11.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 11.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 View and select Object/Duplicate Object in the popup menu.
• Right-click on Velocity and select Stream LIC Slice in the Display menu.
• Select the new ROI ROI Box 2 in the ROI port.
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, press 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/cfd-fea-advanced/wind planarlic.hx.
Now we would like the vectors to be colored in accordance with the vector’s 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/cfd-fea-advanced/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/cfd-fea-advanced/wind streamribbons.hx.
be classified by an eigenvalue/eigenvector analysis of the Jacobian matrix. The Critical Points display
module finds and represents critical points by icons of different shapes, depending on the critical point
classification. Please refer to the documentation of Critical Points for more details.
• 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/cfd-fea-advanced/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.
Pressure force vector computation
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.
Scalar Field mean value computation
Volume and surface integrals can also be computed on data fields.
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.
Figure 11.38: The mean value of pressure in the model is approx. 1849 Pa.
An Animate Ports module is created in the Project 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 View.
Figure 11.39: Pressure surface integral on a sequence of plane cuts orthogonal to the aircraft.
• Load the Velocity data from the Datasets selector by clicking on its button in the Prop-
erties area of the model (aircraft mach.cas).
• Right-click on the Velocity vector field.
• Select Arithmetic in the Compute submenu.
• Select the Density as second input Input B.
• The momentum is a vector so you can keep same as input or select vector in the Output data
type port.
• Enter the components of the momentum vector field: B*Ax in Expr X, B*Ay in Expr Y, B*Az
in Expr Z.
• Click Apply.
A new data module named Result appears under the model.
• Rename this module Momentum.
To do this, right-click the module, select Object/Rename Object and type a new name in the
dialog box. Alternatively, you can select the module, press [F2] and type a new name directly
in the Project View.
In case of any problems or uncertainties you can find the same project predefined in your tutorial folder
under the file name data/tutorials/cfd-fea-advanced/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 Avizo Lite Edition display modules that take only regular inputs, such as the Volume Rendering
module.
• 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, load and select physics VolRend.am in
the Colormap port:
• Click on the Colormap port ”Edit” button, then ”Option / Load colormap...”
• Open data/colormaps/physics VolRend.am
• Set the colormap range to -5000, -1000.
• 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 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:
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 (see Figure 11.6.1).
In case of any problems or uncertainties you can find the same project predefined in your tutorial folder
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.
In case of any problems or uncertainties you can find the same project predefined in your tutorial folder
under the file name data/tutorials/cfd-fea-advanced/wind vcl.hx.
You can complete this visualization with the display of the 3D critical points (see Chapter 11.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 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 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.
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/cfd-fea-advanced/wind surfaceISL.hx.
Illuminated Streamlines Slices
This module visualizes the directional structure of a vector field in a cutting plane using illuminated
streamlines (ISLs). What would be interesting here is to visualize the ISLs in a plane orthogonal to the
core line. To do so, we will use the Trajectory module.
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.
You can also animate the streamlines to see them swirl around the core line by selecting animate in the
View options port.
Figure 11.45: Illuminated streamlines on a plane othogonal to the main core 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/cfd-fea-advanced/wind planarISL.hx.
11.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 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,
select it in the Properties area, then click on one of its red handles and drag it to a new location
or use the text ports Point 0 and Point 1 to change the position.
• Do the same on the side edge of the wing.
Tip: You may need to reposition the camera to select measurement points. As usual you can
press the [ESC] key to toggle between interactive mode and trackball mode or hold down the
[Alt] key to temporarily switch to trackball mode.
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).
11.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.
• Right-click on the Pressure and select Histogram in the Measure And Analyze menu.
• Click Apply in the Histogram Properties area.
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 10647 Pa
and the standard deviation is approximately 26442 Pa,
• in this same range, 2.44 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 1784 Pa (and 50 percent
greater).
• Right-click on Pressure.
• In the Measure And Analyze 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.
• Select the fourth point and set its coordinates to 4, 2, 0.3.
• You might want to hide the points and the dragger using the options submenu of the Points port.
• Click the Show button in the Plot port.
Figure 11.49: 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
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 Mesure And Analyze submenu of a
surface (entry named Create Surface Vertex Path).
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 View (use [Ctrl+N] or right click in the Project View
and select Remove All Objects).
• Open fan-0070.cas from the tutorials/cfd-fea-advanced/fan folder.
• Load the Pressure scalar field.
• Hide the Bounding Box.
• Connect a Boundary View to the model.
• Unselect everything except wall-1 in the Boundaries port and create the surface from the
Create surface port.
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 Compute
submenu.
In the Surface Intersector Properties area, the second surface still has to be set. We will use the
Parametric Surface module to create the intersecting surface we need, available from Project / Create
Object... (Surfaces And Grids submenu).
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 And Analyze 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.
Avizo XLabSuite Extension provides 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 calculated materials properties are:
• absolute permeability,
• molecular diffusivity,
• formation factor and electrical conductivity,
• thermal conductivity.
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 these kinds 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
605
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
tutorial.
Acknowledgements
Avizo XLabSuite Extension 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.
where:
→
−
• ∇. is the divergence operator;
→
−
• ∇ is the gradient operator;
→
−
• V is the velocity of the fluid in the fluid phase of the material;
• µ is still the dynamic viscosity of the flowing fluid;
• ∇2 is the Laplacian operator;
• P is the pressure of the fluid in the fluid phase of the material.
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 XLabSuite Extension provides two approaches to estimate absolute permeability.
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 system 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 ,
Figure 12.1: (1) In the Edit > Preferences... dialog, select the Units tab. (2) Select Spatial information only and (3) keep all the
boxes checked.
12.1.3 Step 2 - Load the data set and select the length unit for voxel size
Purpose Load the data set in Avizo and set the unit length.
Mandatory step Yes.
The data set that is used in this tutorial is a random packing of glass spheres. It was scanned by
Dominique Bernard, Research Director at ICMCB-CNRS. The spherical particles were sieved to have
diameters in the 100-120 microns range. The sample was sintered for 10 minutes at 700◦ Celsius prior
to scanning. Figure 12.2 shows the data set.
The complete 3D data set used in this tutorial is a 200×200×200 cube.
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 unit 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 12.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 coordinate units 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 12.5) and a dialog box appearing, which looks like Figure 12.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.
Figure 12.3: Open Data... dialog to load the data set of this tutorial. Choose the path to the data set, then select and open it.
• Open the Crop Editor by clicking on the highlighted button in Figure 12.7.
• The voxel size of the data set can be modified in the dialog that appeared (see Figure 12.8).
Figure 12.5: The Units Editor button is in the red square (visible only when a data set is selected in the Project View).
For the data set of this tutorial, the correct voxel size is 3.8, which is set by default.
If the Avizo unit management is not activated, the voxel size indicated in the data set will be considered
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 XLabSuite Extension computations.
• Right-click on 10mc3_200.vol.am in the Project View and select Image Processing >
Smoothing and Denoising > Median Filter .
• Set the Filter interpretation to 3D (see Figure 12.9).
Figure 12.7: Finding the Crop Editor button when the data set is selected in the Project View.
• 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 12.10).
Figure 12.9: Modified parameter of the Filter > Median Filter module is highlighted by a red arrow.
Figure 12.11: Modified parameter of the Segment > Multi-Thresholding module is highlighted by a red arrow.
• Click on Apply.
• Right-click on the result of the threshold operation (10mc3_200.Labels) in the Project View
and select Display > Ortho Slice (see Figure 12.12).
• Right-click on 10mc3_200.Labels in the Project View and select Compute > Logical Op-
erations > Invert.
• Click on Apply.
• Right-click on the result (10mc3_200.Invert) in the Project View and select Display >
Ortho Slice (see Figure 12.13).
• Right-click on 10mc3_200.Invert in the Project View and select Image Processing > Prop-
agation > Axis Connectivity.
• Select 6 in the Neighborhood port.
• Click on Apply.
• Right-click on the result (10mc3_200.Axis-Connectivity) in the Project View and se-
lect Display > Ortho Slice (see Figure 12.14).
This image contains all the 1-valued voxels of the void space that can be reached starting from the
plane z = 0 and moving only in 1-valued voxels until plane z = 200. The isolated void spaces are
removed, which makes the computation to follow a little faster. The usefulness of this test is increased
when the resulting image is empty. It means that there is no connected porosity, and permeability is
nil.
This ROI defines a cube with 50 voxel edges centered in the complete volume (see Figure 12.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.
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 12.18.
A spreadsheet can be exported into several formats (CSV, XML, txt for example).
• Hide Bounding Box and 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 12.20.
Figure 12.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
12.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
system, to ease convergence of the iterative algorithm;
• a diverging part to minimize the amount of void space added to the system and to spread the
flow on the input face;
• a totally fluid zone to be sure that the fluid can enter through the complete surface of the sample.
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.
• Click on Apply.
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 12.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 12.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 12.27.
The other velocity fields can be visualized by replaying the same procedure for each.
The data set used in this tutorial is a random packing of spheres. For such material, the Kozeny-Carman
equation can be used to estimate permeability from porosity and sphere diameters. Kozeny-Carman
equation can be written as:
1 3
kKC = d2
180 (1 − )2
where:
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 toolset, following a procedure 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 (with Quantification Tools > volume3d connected 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 absolute permeability simulations
modules on the complete geometry (without the region of interest used in this tutorial). Experiment
simulation in each direction gives the following values:
kX = 7.80d
kY = 7.85d
kZ = 7.75d
As the subject of data preparation for simulation has been addressed in the previous tutorial for absolute
permeability computation, it will only be shortly evoked here:
A demo script is also provided (for Microsoft Windows only). 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
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
2
which links the λ 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 is necessary to get equations valid on the entire volume. 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 XLabSuite 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, unit management is not mandatory here. However, refer to step 2
of absolute permeability simulations tutorial to learn more about editing the length units.
• Connect the ROI Box to the ROI input connection of the Molecular Diffusivity Experiment Sim-
ulation module.
• If step 4 has been completed, check the box referring to label 1 in the Pore space port, since
the label of the void space in 10mc3_200.Axis-Connectivity is 1. If step 4 was not
completed, check the box with referring to label 0 in the Pore space, since the label of the void
space in 10mc3_200.Labels is 0.
• Click on Apply.
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 12.32: Spreadsheet containing the main results of the Molecular Diffusivity Experiment Simulation computation.
The resulting visualization should look like Figure 12.33. One can notice that the input and output
Figure 12.33: Visualization of the evolution of both input and output reservoirs concentration.
• 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, and then select Adjust range to > Data min-max.
• In the Orientation port, select the yz orientation.
• Zoom on the slice to visualize it.
The resulting visualization should look like Figure 12.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 12.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 12.36.
We compare these values to the values computed with Avizo XLabSuite Extension 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 image
obtained from data/tutorials/xlab/10mc3_400.vol.am, without any ROI Box).
Porosity can be estimated with Avizo (with Measure And Analyze > Global Measures > Intensity
Integral in 3D interpretation 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 12.36. One can see that Avizo XLabSuite Extension results
are in good agreement with the different studies results.
A second demo script is also provided (for Microsoft Windows only), 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 absolute
permeability computation, it will only be shortly evoked here:
A demo script is also provided (for Microsoft Windows only). This script will automatically perform
all the steps detailed in the tutorial.
Getting started with formation factor and electrical conductivity computation 647
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
Getting started with formation factor and electrical conductivity computation 648
where σsolution is the electrical conductivity of the free solution.
Important remark: in the experiment, we consider direct current (there is no transient phenomenon)
and we neglect the skin effect and the concentration variations. An experimenter will usually have
to use correction models to remove those experimental phenomena, which we avoid here with this
experiment simulation in ideal conditions.
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
Getting started with formation factor and electrical conductivity computation 649
Avizo XLabSuite Extension proposes two approaches to estimate electrical conductivity.
The first is an experiment simulation based on Ohm’s equations resolution. As said previously, this
is done in Formation Factor Experiment Simulation module. The material is generally composed of
rocks, which can be considered as insulator. The boundary condition at fluid-solid interface is:
→
−
−−
n→
f s . ∇v = 0
where − n→f s is the normal to the fluid-solid interface directed from the fluid to the solid phase. Besides
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.
Getting started with formation factor and electrical conductivity computation 650
The data set that is used in this tutorial is a random glass spheres packing. It was scanned by Dominique
Bernard, Research Director at ICMCB-CNRS. The spherical particles were sieved to have diameters in
the 100-120 microns range. The sample was sintered for 10 minutes at 700◦ Celsius prior to scanning.
Figure 12.37 shows the data set.
The complete 3D data set used in this tutorial is a 200×200×200 cube.
As mentioned in the previous step, unit management is not mandatory here. However, refer to step 2
of absolute permeability simulations tutorial to learn more about editing the units of length.
Getting started with formation factor and electrical conductivity computation 651
3 of absolute permeability simulations tutorial.
Note: Isotropic, i.e., cubic, voxels are mandatory for Avizo XLabSuite Extension computations.
Getting started with formation factor and electrical conductivity computation 652
considered as an electrical insulator and so the current will not reach the solution in isolated spaces).
Computation should then be a little faster. The necessary connectivity, from a discrete point of view,
in 6-connectivity: a current density can be estimated over a non-nil surface only, i.e., a face between
two neighbor voxels.
You might follow the instructions described in step 5 of absolute permeability simulations tutorial to
perform the percolation test.
Getting started with formation factor and electrical conductivity computation 653
For convenience and because it will save time during this tutorial phase, we compute the electrical
conductivity and formation factor 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.
Getting started with formation factor and electrical conductivity computation 654
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
will be done successively. The potential values used as boundary conditions of the experiment can
also be modified. Modifying these values will not change the electrical conductivity or the formation
factor, which are intrinsic to the porous media. It will only modify the output potential 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 12.41. A spreadsheet can
be exported into several formats (CSV, XML, txt for example).
Figure 12.41: Spreadsheet containing the main results of the Formation Factor Experiment Simulation computation.
Getting started with formation factor and electrical conductivity computation 655
• 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.
• In the Ortho Slice properties, change the selected colormap to temperature.icol from the Edit
menu.
• Select the Edit menu of the colormap again, and then select Adjust range to > Data min-max.
• In the Orientation port, select the yz orientation.
• Zoom on the slice to visualize it.
The resulting visualization should look like Figure 12.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 12.42: Visualization of potential field in an experiment simulation with electrical flux in Z direction.
Getting started with formation factor and electrical conductivity computation 656
• Right-click on 10mc3_200.Axis-Connectivity (or 10mc3_200.Labels if step 4
was not completed) and select XLab Simulations > Effective Formation Factor Calculation.
• Connect the ROI Box to the ROI input connection of the Effective Formation Factor Calculation
module.
• If step 4 was completed, check the box refering to label 1 in the Pore space port, since the
label of the void space in 10mc3_200.Axis-Connectivity is 1. If step 4 was not com-
pleted, check the box refering to label 0 in the Pore space, since the label of the void space in
10mc3_200.Labels is 0.
• Click on Apply.
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 electrical conductivity simulations 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
Getting started with formation factor and electrical conductivity computation 657
is generated only if all the three directions have been selected and the full conductivity tensor has been
computed.
A spreadsheet can be exported into several formats (CSV, XML, txt for example).
Figure 12.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
Getting started with formation factor and electrical conductivity computation 658
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.
The data set used in this tutorial 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 image
obtained from data/tutorials/xlab/10mc3_400.vol.am, without any ROI Box).
Porosity can be estimated with Avizo (with Measure And Analyze > Global Measures > Intensity
Integral in 3D interpretation connected to 10mc3_400.Axis-Connectivity), and the value is
36.35%.
The formation values calculated from the different empirical laws are:
We compared these values to the values computed with electrical conductivity simulations 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
Getting started with formation factor and electrical conductivity computation 659
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 absolute
permeability computation, it will only be shortly evoked here:
A demo script is also provided (for Microsoft Windows only). This script will automatically perform
all the steps detailed in the tutorial.
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
−→
→ − →
−
→
−
∇(λα ( ∇ 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
λξ ∇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 specify that the temperature and the normal component of the heat flux are
continuous at the interface between the phases.
Avizo XLabSuite 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
As mentioned in the previous step, unit management is not mandatory here. However, refer to step 2
of absolute permeability simulations tutorial to learn more about editing the length units.
This step consists of creating a label image 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 absolute permeability simulations tutorial. The
resulting visualization should look like Figure 12.45.
tests.
In the present tutorial, we will consider that all the phases of our material are conducting heat but
in a case where you have to consider both isolating and conducting phases, you might follow the
instructions described in step 5 of absolute permeability simulations tutorial. The equivalent of the void
space where the fluid flows in absolute permeability simulations tutorial is here the heat conducting
material and the equivalent of the porous material is here the insulator.
For convenience and because it will save time during this tutorial phase, we compute the thermal con-
ductivity 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 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
Figure 12.48: Spreadsheet containing the main results of the Thermal Conductivity 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.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, and then select Adjust range to > Data min-max.
• In the Orientation port, select the yz orientation.
• Zoom on the slice to visualize it.
The resulting visualization should look like Figure 12.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).
Again, the heat front, represented by the isolines, obviously moves faster in the particules of phase
Inside.
The resulting visualization should look like Figure 12.50.
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
A spreadsheet can be exported into several formats (CSV, XML, txt for example).
Figure 12.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 12.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.
In Meredith and Tobias (1960), the following analytical estimation of the effective thermal conductivity
of an array of non-touching cylinders in parallel distribution (where the two phases are thermally in
parallel with respect to the direction of the heat flux) is given:
Λ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 12.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.
Maxwell (1881) obtained the following expression for the thermal conductivity of a packed-sphere bed
Meredith and Tobias (1960) gave an analytical expression for the same problem:
2+Λ 6 + 3Λ 7/3 3 − 3β 10/3
− 2β + 0.409 − 2.133
1−Λ 4 + 3Λ β 4 + 3β β
Λef f =
2+Λ 6 + 3Λ 7/3 3 − 3Λ 10/3
+ β + 0.409 β − 0.906
1−Λ 4 + 3Λ 4 + 3Λ β
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.
Figure 12.56: Comparison between Avizo simulation and Nozad et al. computation of thermal conductivity.
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:
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 Extension for short. In addition, you will need a C++ development
environment like Microsoft Visual Studio on Windows (for details see subsection 13.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: an Avizo project is actually a set of interconnected modules and data objects. In Avizo XPand
Extension 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 runtime 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
A resource file is stored along with each package. This file contains information about the components
being defined in a particular package. When Avizo starts, it first scans the resource files of all available
packages and thus knows about all the components which may be used at runtime.
The resource files of the standard Avizo packages are located under share/resources in the di-
rectory where Avizo is installed. Details about registering read and write routines or different kinds of
modules in a resource file are provided in sections 13.3 and 13.4.
Usually Avizo will be installed by the system administrator at a location where ordinary users are not
allowed to create or modify files. Therefore it is recommended that every user creates new packages
in his own personal local Avizo directory. The local Avizo directory has essentially the same structure
as the directory where Avizo is installed. A new local Avizo directory can most easily be created by
using the Development Wizard, a special-purpose dialog box described in detail in section 13.2.
Once a local Avizo directory has been set up, resource files located in it will also be scanned by Avizo
when started. In this way, new components can be added or existing ones redefined.
Avizo is based on a number of industry standard libraries. The most important ones are Open Inventor,
OpenGL, Qt, and Tcl.
Avizo’s 3D graphics is based on OpenGL and Open Inventor. OpenGL is the industry standard for
professional 3D graphics. Open Inventor is a C++ library using OpenGL which provides an object-
oriented scene description layer. Writing new visualization modules for Avizo essentially means cre-
ating an Open Inventor scene from the input data. If you already have code doing this, it will be
straightforward to turn it into an Avizo module. While the Open Inventor headers are included in
Avizo XPand Extension, OpenGL must already be installed on your system.
Qt is a platform-independent C++ library for building graphical user interfaces (GUIs). Avizo is built
with Qt. However, the user interface elements used in standard Avizo modules are encapsulated by
special Avizo classes called ports. Therefore, you can develop your own modules without knowing Qt.
You only need Qt if you plan to add completely new user interface components such as special purpose
dialogs. Note also, that in this case Qt headers and libraries are included in Avizo XPand Extension
under LGPL licensing. Avizo 9 is linked against Qt 5.4 under Microsoft Windows and Qt 4.8 under
Linux and Mac OS X.
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/oiv) of Open
Inventor C++ classes. The online documentation directory (share/devrefAvizo/) 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:
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
Avizo.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 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.
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 provides a toggle for copying an example package to the local Avizo direc-
tory. 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 example package is copied to the subdirectory
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
13.2.9.
In addition to the Package file, the file version.cpp will also 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
In order to create the template for an ordinary module using the development wizard, you must enter
the C++ class name of the module, the name to be shown in the popup menu of possible input data
objects, the C++ class name of possible input data objects, and finally the package where the input
class is defined (see Figure 13.6).
Once you press OK, two files are created in the package directory, namely a header file and a source
code file for the new module. In addition, a new module statement is added to the package resource
file located under share/resources in the package directory.
After you have added a new module to a package, you need to recreate the build system files before
you can compile the module. Details are described in subsection 13.2.9.
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 13.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
13.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 13.2.9.
If you select Create build system on the main page of the development wizard and then press the Next
button, the controls shown in Figure 13.9 will be activated. You can choose if you want to create the
build system files for all local packages or just for a particular one.
set LIBS {
hxplot hxtime hxsurface hxcolor hxfield
hxcore amiramesh mclib oiv tcl qt
}
set SHARE {
share/resources/mypackage.rc
}
In most cases, the default file works well and do not need 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.
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:
set SHARE {
share/resources/mypackage.rc
share/demo/mydemos/*.hx
}
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.
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.
Sometimes 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 Extension. In order to follow the example below, first create a local Avizo directory us-
ing the Development Wizard. Be sure that the toggle copy example package is activated, as de-
scribed in subsection 13.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.
if (!f) {
theMsg->ioError(filename);
return 0; // indicate error
}
// Register the data object to make it visible in the object pool. The
// name for the new object is automatically generated from the filename.
HxData::registerData(field, filename);
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:
dataFile -name "PPM3D Demo Format" \
-header "PPM3D" \
-load "readppm3d" \
-package "mypackage"
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
file mypackage/data/test.ppm3d. As you will see, the file browser automatically detects the
file format and displays PPM3D Demo Format in its file list.
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 13.2.2. Let
us now look at the complete read routine before discussing the details:
///////////////////////////////////////////////////////////////////////
//
// Read routine for the trimesh file format
//
///////////////////////////////////////////////////////////////////////
#include "api.h"
#include <hxcore/HxMessage.h>
#include <hxqt/QxStringUtils.h>
#include <hxsurface/HxSurface.h>
#include <hxsurface/HxSurfaceField.h>
MYPACKAGE_API int
readtrimesh(const QString& filename)
{
if (!fp)
{
theMsg->ioError(filename);
return 0;
}
char buffer[256];
fgets(buffer, 256, fp); // read first line
surface->points().resize(nPoints);
surface->triangles().resize(nTriangles);
patch->triangles.resize(nTriangles);
for (i = 0; i < nTriangles; i++)
patch->triangles[i] = i; // add all triangles to one patch
if (fields.size())
{
for (i = 0; i < nPoints; i++)
{ // read data values of all fields
fgets(buffer, 256, fp);
QStringList stringList = toQString(buffer).split(’ ’);
int indice = 0;
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++)
{
if (indice < stringList.size())
{
v[k] = stringList[indice].toFloat();
indice++;
}
}
}
}
return 1;
}
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
of as the boundary between two volumetric regions, an ”inner” and an ”outer” region. Therefore, for
each patch, an inner region and an outer region should be defined. In our case, all triangles will be
inserted into a single patch. After this patch has been created and initialized, the number of points and
triangles is set, i.e., the dynamic arrays points and triangles are resized appropriately.
Next, the point coordinates and the triangles are read. Each triangle is defined by the three points of
which it consists. The point indices start at one in the file but should start at zero in the HxSurface class.
Therefore, all indices are decremented by one. Once all triangles have been read, they are inserted into
the patch we have created before. The surface is now fully initialized and can be added to the Project
View by calling HxData::registerData.
The second part of the read routine is reading the data values. First, we check how many data fields
are defined and how many data variables each field has.
For each group of data variables, a corresponding surface field is created. The fields are temporarily
stored in the dynamic array fields. Instead of directly calling the constructor of the class HxSur-
faceField, the static method HxSurfaceField::create is used. This method checks the number of data
variables and automatically creates an instance of a subclass such as HxSurfaceScalarField or Hx-
SurfaceVectorField, if this is possible. In principle, surface fields may store data on a per-node or a
per-triangle basis. Here we are dealing with vertex data, so we specify the encoding to be HxSurface-
Field::ON NODES in HxSurfaceField::create.
Finally, the data values are read into the surface fields created before. Afterwards, all the fields are
added to the Project View by calling HxData::registerData again. In order to define a useful name
for the surface fields, we call the method composeLabel. This method takes a reference name, In this
case, the name of the surface, and replaces the suffix by some other string, in this case ”data”. Avizo
automatically modifies the name so that it is unique. Therefore, we can perform the same replacement
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 13.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,
surface->setLoadCmd(loadCmd,1);
This code requires some explanation. The file is loaded and all data objects are created when the first
line of the load command is executed. Note that we specified the -trimesh option as an argument
of load. This ensures that the Trimesh reader will always be used. The format of the file to be loaded
will not be determined automatically. The Tcl command load returns a list with the names of all
data objects which have been created. This list is stored in the variable TMPIO. Later the names of
the individual objects can be obtained by extracting the corresponding elements from this list. This is
done using the Tcl command lindex.
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 Extension 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.
MYPACKAGE_API
int writeppm3d(HxUniformScalarField3* field, const char* filename)
{
// For the moment we only want to support byte data
if (field->primType() != McPrimType::mc_uint8) {
theMsg->printf("This format only supports byte data.");
return 0; // indicate error
}
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
is opened and the image contents are written into it. However, note that the data object also contains
information which cannot be stored using our simple PPM3D file format. First of all, this applies to
the bounding box of the image volume, i.e., the position of the center of the first and the last voxel in
world coordinates. Also, all parameters of the object (defined in the member variable parameters of
type HxParamBundle) will be lost if the image is written into a PPM3D file and read again.
Like a read routine, a write routine must be registered in the package resource file, i.e., in
mypackage/share/resources/mypackage.rc. This is done by the following statement:
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:
int writeppm3d(HxStackedScalarField3* field, const char* fname);
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 13.5.
At this point, you may try to compile and execute the write routine by following the instructions given
in subsection 13.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<McVec3<float>>& 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::ON_NODES) {
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 13.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-
face fields attached to the surface in a dynamic array. This is done by scanning
surface->downStreamConnections which provides a list of all objects attached to the sur-
face. The class type of each object is checked using the method isOfType. This sort of dynamic
type-checking is the same as in Open Inventor. If a surface field has been found and if it contains data
defined on its nodes, it is appended to the temporary array fields. The surface itself, as well as the
collected fields, are then written to file by calling the utility method defined in the upper part of the
writer code.
The second write routine, the one adapted to surface fields, is simpler. Here a dynamic array of fields
is used too, but this array is filled with data representing the original surface field only. Once this has
been done, the same utility method can be called as in the first case.
Although actually two write routines have been defined, only one entry in the package resource file is
required. This entry looks as follows (see mypackage/share/resources/mypackage.rc):
dataFile -name "Trimesh Demo Format" \
-ext "trimesh" \
-type "HxSurface" \
-type "HxSurfaceField" \
-save "writetrimesh" \
-package "mypackage"
In order to compile and execute the write, please follow the instructions given in subsection 13.1.5
(Compiling and Debugging).
13.3.4 Use the AmiraMesh API to read and write files in Avizo data format
Besides many standard file formats, Avizo also provides its own native format called Avizo data format.
The Avizo data 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,
13.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.
If you look at the header file or at the AmiraMesh class documentation, you will notice that
there are four public methods called setParameters, setLocationList, setDataList,
and setFieldList. These methods completely store the information contained in a file. The
first method store the parameter bundle (with a HxParamBundle parameter). Like in an Avizo
data object, it is used to store an arbitrary hierarchy of parameters. The other three methods ma-
nipulate dynamic arrays of pointers to locally defined classes. The most important local classes are
Location and Data, which are stored in locationList and dataList, respectively. Four ac-
cessors getLocationList, setLocationList, getDataList and setDataList are cre-
ated to manipulate this two lists.
A Location defines the name of a single- or multi-dimensional array. It does not store any data by
itself. This is done by a Data class. Every Data class must refer to some Location. For example,
when writing a tetrahedral grid, we may define two different one-dimensional locations, one called
Nodes and the other one called Tetrahedra. On the nodes, we define a Data instance for storing the
x-, y-, and z-coordinates of the nodes. Likewise, on the tetrahedra we define a Data instance for
storing the indices of the four points of a tetrahedron.
As stated in the AmiraMesh class documentation, the Data class can take a pointer to some already
existing block of memory. In this way, it is prevented the copy of all data before it is written to file.
In order to write compressed data, the member method setCodec has to be called. Currently, two
different compression schemes are supported. The first one, called HxByteRLE, implements simple
run-length encoding on a per-byte basis. The second one, called HxZip, uses a more sophisticated
compression technique provided by the external zlib library. In any case, the data will be automatically
uncompressed when reading an Avizo data file.
It should be pointed out that the Avizo data file format itself merely provides a method for storing
arbitrary data organized in single- or multi-dimensional arrays in a file. It does not specify anything
about the semantics of the data. Therefore, when reading an Avizo data file, it is not clear what kind of
data object should be created from it. To facilitate file I/O of custom data objects, the actual contents
of an Avizo data file are indicated by a special parameter called ContentType. For each such type,
This method is called whenever the ContentType parameter matches the one for which the read method
is registered. 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;
}
This statement indicates that the static member method readAmiraMesh of the class
HxColormap256 defined in package hxcolor should be called if the Avizo data file contains a
parameter ContentType equal to Colormap. The source code of the read routine looks as follows:
int HxColormap256::readAmiraMesh(AmiraMesh* m,
const char* filename)
{
int count = 0;
if (data->getLocation()->getNumberOfDimensions() != 1)
continue;
if (data->getDimension()<3 || data->getDimension()>4)
continue;
HxColormap256* colormap =
(HxColormap256*) HxResource::createObject("HxColormap256");
if (!colormap)
return 0;
colormap->resize(size);
colormap->parameters = m->parameters;
switch (data->getPrimitiveType().getType()) {
case McPrimType::mc_uint8: {
unsigned char* src = (unsigned char*) data->getDataPtr();
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_int16: {
short* src = (short*) data->getDataPtr();
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_uint16: {
unsigned short* src = (unsigned short*) data->getDataPtr();
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_int32: {
int* src = (int*) data->getDataPtr();
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->getDataPtr();
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;
case McPrimType::mc_double: {
double* src = (double*) data->getDataPtr();
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;
}
int localInterpolate;
if (m->parameters.findNum("Interpolate",localInterpolate))
QString outOfBoundsBehavior;
if ( m->parameters.findString("OutOfBoundsBehavior", outOfBoundsBehavior) )
{
OutOfBoundsBehavior behavior = HxColormap256::DEFAULT_CLAMP; // i.e = 0
if (outOfBoundsBehavior.contains("CycleLeft"))
*(int*)&behavior |= CYCLE_BEFORE_MIN;
if (outOfBoundsBehavior.contains("CycleRight"))
*(int*)&behavior |= CYCLE_AFTER_MAX;
colormap->setOutOfBoundsBehavior(behavior);
}
int isLabelField;
if (m->parameters.findNum("LabelField", isLabelField))
{
colormap->setLabelField(isLabelField);
colormap->editMinMax.setMinMaxEnabled(!isLabelField);
}
// Set the default alpha curve if the file does not provide an alpha channel only for A
if (!((theAppSkin->getProductName() == "Avizo") && theInterpreter->networkIsLoading() &
{
if (dim != 4) {
colormap->setAlphaCurve(AC_SOFT_RAMP);
}
}
registerData(colormap, filename);
count++;
}
return count;
}
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.
public:
// This virtual method will be called when the port changes.
virtual void compute();
#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.
The package header file api.h is included. This file provides import and export storage-class spec-
ifiers for Windows systems. These are encoded in the macro MYPACKAGE API. A class declared
without this macro will not be accessible from outside the DLL it is defined in.
Following api.h, HxCompModule.h contains the definition of the base class of our compute tool.
The last file, HxPortFloatTextN.h, contains the definition of a port we want to use in our class. A
port represents an input parameter of a tool. In our case, we use a port of type HxPortFloatTextN.
This port provides one or more text fields where the user can enter floating point numbers. The required
text fields and labels are created automatically within the port constructor. As a programmer, you
simply put some ports into your tool, specifying their types and labels, and do not have to bother
creating a user interface for it.
In the rest of the header file, nothing more is done than deriving a new class from HxCompModule.
The macro HX HEADER is mandatory. This macro defines especially the default constructor and de-
structor of the class. A member function is defined, namely an overloaded virtual method called
compute. The compute method is called when the module has been created and whenever a change
of state occurs on one of the module’s input data objects or ports. In fact, a connection to an input data
object is also established by a port, as we shall see later on. In this example, we just declare one port
in our class, specifically an instance of type HxPortFloatTextN.
#include <QApplication>
MyComputeThreshold1::MyComputeThreshold1()
: HxCompModule(HxUniformScalarField3::getClassTypeId())
, portRange(this, "range", QApplication::translate("MyComputeThreshold1", "Range"), 2) // w
{
}
MyComputeThreshold1::˜MyComputeThreshold1()
{
}
void
MyComputeThreshold1::compute()
{
// Access the input data object. The member portData (which is of
// type HxConnection) is inherited from the base class HxModule.
HxUniformScalarField3* field = (HxUniformScalarField3*)portData.getSource();
// 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 this specfic grid node.
// It implicitely casts the result to float if necessary.
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 ANSI C++ compilers.
The second method to define is the destructor.
The third 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 rep-
resented 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 13.1.5 (Compiling and Debugging). Load the file
chocolate-bar.am from Avizo ‘s data/tutorials directory. Open the Create Object popup
menu and click on ComputeThreshold1 inside the Local category to attach the new module. Type
in different threshold values in the range port of ComputeThreshold1, and look at the different
results that appear in the Console window while you change range values:
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 13.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:
setResult(output); // register result
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 black 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
We use the global instance theProgress of class HxApplication 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 13.7.2 for details.
When the computation is done, we must call
theProgress->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.
theProgress->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 410 and 950, respectively:
// Set default value for the range port:
portRange.setValue(0,410); // min value is 410
portRange.setValue(1,950); // max value is 950
You may now test this second version of the compute module by loading the test
data set chocolate-bar.am from Avizo’s data/tutorials directory. Attach the
ComputeThreshold2 module from the Local category inside the data popup menu. Open the
Console window to watch results as you change the port range values. You can also see new output
objects created in the Project View on each change. To better appreciate the progress bar, try to resam-
ple the input data, for example to 512x512x100, and connect the compute module to the resampled
data set. However, be sure that you have enough main memory installed on your system.
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
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. It is possible to interactively try different range values without
creating a bunch of new results.
However, when one of the numbers of the range port is changed, computation starts immediately.
Sometimes this may be desired, but in this case, we prefer to add an Apply button as present in many
other compute modules. The user must explicitly push this button in order to start computation. In
order to use the Apply button, the following line of code must be added in the public section of the
module’s header file:
// Start computation when this button is clicked.
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 chocolate-bar.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 output 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
methods field->evalReg and output->set is convenient but rather expensive. For example,
if the input consists of 16-bit signed integers like in chocolate-bar.am, these methods involve a
cast from 16-bit signed to float and back to 16-bit signed.
The performance can be improved by writing code which explicitly handles a particular primitive
data type. A pointer to the actual data values of a HxUniformScalarField3 can be obtained by call-
ing field->lattice().dataPtr(). The value returned by this method is of type void*.
It must be explicitly cast to the data type to which the field actually belongs. 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.
#include <Inventor/nodes/SoSeparator.h>
public:
// 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
HX HEADER are mandatory,the last one including the definition of the default constructor and destruc-
tor. Our module implements a compute method. In addition, it has a port of type HxPortIntSlider
which allows the user to specify the number of triangles of the vertices to be displayed.
A pointer to the actual Open Inventor scene is stored in the member variable scene of type
McHandle<SoSeparator>. A McHandle is a so-called smart pointer. It can be used like an
ordinary C pointer. However, each time a value is assigned to it, the reference counter of the ref-
erenced object is automatically increased or decreased. This is done by calling the ref or unref
method of the object. If the reference counter becomes zero or less, the object is deleted automatically.
We recommend using smart pointers instead of C pointers because they are safer.
The actual implementation of the module is contained in the file MyDisplayVertices1.cpp.
This file looks as follows:
///////////////////////////////////////////////////////////////////////
//
// Example of a compute module (version 1)
//
///////////////////////////////////////////////////////////////////////
#include <QApplication>
#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
{
portNumTriangles.setMinMax(1, 12);
portNumTriangles.setValue(6);
scene = new SoSeparator;
}
MyDisplayVertices1::˜MyDisplayVertices1()
{
hideGeom(scene);
}
void
MyDisplayVertices1::compute()
{
int i;
if (!surface)
{ // Check if input object is available
hideGeom(scene);
return;
}
// Now create the scene graph. First remove all previous childs:
scene->removeAllChildren();
scene->addChild(trans);
scene->addChild(cube);
count++;
q = p[i];
}
}
A lot of things are happening here. Let us point out some of these in more detail now. The constructor
initializes the base class with the type returned by HxSurface::getClassTypeId. This ensures
that the module can only be attached to data objects of type HxSurface. The constructor also ini-
tializes the member variable portNumTriangles. The range of the slider is set from 1 to 12. The
initial value is set to 6. Finally, a new Open Inventor separator node is created and stored in scene.
The destructor contains only one call, hideGeom(scene). This causes the Open Inventor scene to
be removed from all viewers (provided it is visible). The scene itself is deleted automatically when the
destructor of McHandle is called.
The actual computation is performed in the compute method. The method returns immediately if no
input surface is present. If an input surface exists, the numbers of triangles per point are counted. For
this purpose, a dynamic array triCount is defined. The array provides a counter for each vertex.
Initially it is filled with zeros. The counters are increased in a loop over the vertices of all triangles.
In the second part of the compute method, the Open Inventor scene graph is created. First, all pre-
vious children of scene are removed. Then the length of the diagonal of the input surface is deter-
mined. The size of the cubes will be set proportional to this length. For convenience, the pointer
to the coordinates of the surface is stored in a local variable p. Actually, the coordinates are of
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);
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;
QString cmd = QString::fromUtf8(argv[1]);
if (cmdCheck(cmd, "setScale"))
{
ASSERTARG(3);
scale = atof(argv[2]);
fire();
}
else if (cmdCheck(cmd, "getScale"))
{
Tcl_VaSetResult(t, "%g", scale);
}
else
return HxModule::parse(t, argc, argv);
return TCL_OK;
}
Commands are defined in a sequence of if-else statements. For each command, the method cmdCheck
should be used. At the end of the if-else sequence the parse method of the base class should be called.
The new radio box port lets the user switch between the two display modes. Like the compute method,
the update method takes no argument 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:
void
MyDisplayVertices3::update()
{
if (portMode.getValue() == 0)
portNumTriangles.show();
else
portNumTriangles.hide();
}
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 encap-
sulated 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
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 13.10.
public:
// Shows the plot window.
protected:
McHandle<PzEasyPlot> plot;
};
#endif
The class declaration is very simple. The module is derived directly from HxModule. It provides 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 13.4.2.1, for details see there.
Now let us take a look at the source file MyPlotAreaPerSlice.cpp:
///////////////////////////////////////////////////////////////////////
//
// Example of a plot module (source code)
//
///////////////////////////////////////////////////////////////////////
HX_INIT_CLASS(MyPlotAreaPerSlice, HxModule)
MyPlotAreaPerSlice::MyPlotAreaPerSlice()
: HxModule(HxLabelLattice3::getClassTypeId())
, portAction(this, "action", QApplication::translate("MyPlotAreaPerSlice", "Action"), 1)
{
portAction.setLabel(0, QApplication::translate("MyPlotAreaPerSlice", "Show Plot"));
plot = new PzEasyPlot("Area per slice");
plot->autoUpdate(0);
}
MyPlotAreaPerSlice::˜MyPlotAreaPerSlice()
{
}
void
MyPlotAreaPerSlice::compute()
{
HxLabelLattice3* lattice =
(HxLabelLattice3*)portData.getSource(HxLabelLattice3::getClassTypeId());
int i, k, n;
const McDim3l& dims = lattice->getDims();
unsigned char* data = lattice->getLabels<unsigned char>();
int nMaterials = lattice->materials()->getNumberOfBundles();
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,
curve->setAttr("curvetype", type);
For each attribute corresponding getAttr methods are available. In order to access the axis of the
‘easy plot‘ window, you must call
PzAxis* axis = plot->getTheAxis();
As you would expect, the methods getMinMax, getAxisLabel 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:
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.
#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:
// To have a Apply button
virtual void compute();
#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
definition of the base class of our compute module. The other file, HxPortDoIt.h, allows the use
of the Apply button.
The package header file api.h is included. This file provides import and export storage-class speci-
fiers for Windows systems. These are encoded in the macro GAUSSIANFILTERCUDAC API. A class
declared without this macro will not be accessible from outside the DLL in which it is defined. On
Unix systems, the macro is empty and can be omitted.
The applyFilter function is declared with the extern "C" qualifier. This function is defined in
the Convolve2DCudaC.cu file and will be explained in the GPU section.
#include <QApplication>
#include <hxcore/HxApplication.h>
#include <hxcore/HxMessage.h>
#include <hxcore/HxProgressInterface.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;
// 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 to which the field actually belongs.
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] de-
note 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 the data object is controlled by an ’upstream’ component, i.e., that its contents may be overridden
by the object to which it is connected.
// 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 will be used to size the grid
and blocks and BORDER SIZE. Then, two variables are declared with the constant qualifier,
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.
The d filter, which was declared at the beginning of this file, is in constant memory, so it is
initialized with the cudaMemcpyToSymbol function.
The host initiates the execution of the kernel function, applyFilterKernel, on the CUDA de-
13.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.
In the following, let us first present an overview of the hierarchy of data classes. Afterwards, we will
discuss some of the general concepts behind it.
Note that you can find an in-depth description of every class in the online reference documen-
tation: share/devrefAvizo/Avizo.chm or share/devrefAvizo/index.html in the
Avizo root directory. The reference documentation not only covers data objects, but all classes pro-
vided with Avizo XPand Extension. 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 triangular 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:
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)
max = data[idx];
}
theMsg->printf("Max value is %d", 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.
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
HxLattice3 is not an Avizo data class, this is not possible. Instead we must create a suitable field
object of which the lattice is a member. For this purpose, the class HxLattice3 provides a static
method create which creates a regular field and puts an existing lattice into it. If the lattice contains
one data component, a scalar field will be created; if it contains three components, a vector field will
be created, and so on. The resulting field may then be used as the result of a compute module. Note
that the lattice must not be deleted once it has been put into a field object. The concept is illustrated
by the following example:
HxLattice3* lattice = new HxLattice3(dims, nDataVar,
primType, otherLattice->coords()->duplicate());
...
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
grid nodes, i.e., to the corner of a grid cell or to the center of a voxel. In order to compute the width of
a voxel, you should use code like this:
const int* dims = uniformcoords->dims();
const float* bbox = uniformcoords->bbox();
float width = (dims[0]>1) ? (bbox[1]-bbox[0])/(dims[0]-1):0;
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 13.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:
const int* dims = curvilinearcoords->dims();
const float* coords = curvilinearcoords->coords();
The triangles array also provides a way for accessing neighboring tetrahedra. Among other in-
formation (see reference documentation) stored for each triangle, the indices of the two tetrahedra it
belongs to are available. In the case of boundary triangles, one of these indices is -1. Therefore, in
order to get the index of a neighboring tetrahedron you can use the following code:
// Find tetra adjacent to tetra n at face 0:
int triangle = grid->tetras[n].triangles[0];
otherTetra = grid->triangles[triangle].tetras[0];
if (otherTetra == n)
otherTetra = grid->triangles[triangle].tetras[1];
if (otherTetra == -1) {
// No neighboring tetra, boundary face
...
}
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 tetrahe-
dra by calling 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.
Data on tetrahedral grids must always be of type float. The data values may be stored in three
different ways, indicated by the encoding type as defined in HxTetraData:
• PER TETRA: One data vector is stored for each tetrahedron. The data are assumed to be constant
inside the tetrahedron.
• PER VERTEX: One data vector is stored for each vertex of the grid. The data are interpolated
linearly inside a tetrahedron.
• PER TETRA VERTEX: Four separate data vectors are stored for each tetrahedron. The data are
also interpolated linearly.
• PER VERTEX AND EDGE: One data vector is stored for each vertex and edge of the grid.
This last encoding scheme is useful for modeling discontinuous fields. In order to evaluate a field at an
arbitrary location in a transparent way, Avizo’s procedural data interface should be used. This interface
is described in subsection 13.5.6.1.
Like HxLattice3, the class HxTetraData provides a static method create which can be used
to create a matching data field, e.g., an object of type HxTetraScalarField3, from an existing
instance of HxTetraData. The HxTetraData object will not be copied but will be directly put
into the field object. Therefore, it may not be deleted afterwards. Also see subsection 13.5.2.1.
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 than 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.
Data on hexahedral grids must always be of type float. The data values may be stored in three
different ways, indicated by the encoding type defined in HxHexaData:
• PER HEXA: One data vector is stored for each hexahedron. The data are assumed to be constant
inside the hexahedron.
• PER VERTEX: One data vector is stored for each vertex of the grid. The data are interpolated
trilinearly inside a hexahedron.
• PER HEXA VERTEX: Eight separate data vectors are stored for each hexahedron. The data are
also interpolated trilinearly.
The last encoding scheme is useful for modeling discontinuous fields. In order to evaluate a field at an
arbitrary location in a transparent way, Avizo’s procedural data interface should be used. This interface
is described in subsection 13.5.6.1.
Like HxLattice3, the class HxHexaData provides a static method create which can be used
to create a matching data field, e.g., an object of type HxHexaScalarField3, from an existing
instance of HxHexaData. The HxHexaData object will not be copied but will be directly put into
the field object. Therefore, it may not be deleted afterwards. Also see subsection 13.5.2.1.
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;
...
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 in which the current point is contained. Secondly, it converts the result to a float
value, if the field is represented internally by a different primitive data type.
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.
The class HxParamBundle provides several methods for looking up parameter values. All these
find-methods return 0 if the requested parameter could not be found. For example, in order to retrieve
the value of a one-component floating point parameter called Transparency, the following code may
be used:
float transparency = 0;
if (!material->findReal("Transparency",transparency))
theMsg->printf("Transparency not defined, using default");
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 with 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
is the module name.
\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
syntax. This requires that LaTeX and Ghostscript be installed on the user’s system. The following
environment variables need to be set:
• DOC2HTML LATEX points to the LaTeX executable
• DOC2HTML DVIPS points to the dvi to PostScript converter (dvips)
• DOC2HTML GS points to Ghostscript
13.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
Miscellaneous 773
• Important global objects, such as theMsg and theProgress
• Save-project issues, making save Avizo project work for custom modules
• Troubleshooting, providing a list of common errors and solutions
Miscellaneous 774
Another feature of HxPortTime is that the class is also an interface, i.e., it is derived from HxInterface
(compare subsection 13.5.1.2). In this way, it is possible to write modules which can be connected to
any object containing an instance of HxPortTime. An example is the Display Time module. In order
to access the time port of a source object, the following C++ dynamic cast construct should be used:
HxPortTime* time = dynamic_cast<HxPortTime*>(
portData.source(HxPortTime::getClassTypeid()));
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 Extension. 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();
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.
Miscellaneous 775
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.
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 Extension 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 DoAni-
mate 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 776
HxMessage: This class corresponds to the Avizo console window in the lower right part of the screen.
There is only one global instance of this class, which can be accessed by theMsg. All text output
should go to this object. Text can be printed using the function theMsg->printf("...",...),
which supports common C-style printf syntax. HxMessage also provides static methods for pop-
ping up error and warning messages or simple question dialogs.
HxObjectPool: This class maintains the list of all currently existing data objects and modules. In
the graphical user interface, this area is called the Project View and contains the modules and data
objects icons. There is only one global instance of this class, which can be accessed by the pointer
theObjectPool.
HxProgressInterface: This class displays the ports of selected objects in the Properties Area and
provides the progress bar and busy-state functionality. Important functions are startWorking,
stopWorking, wasInterrupted as well as busy and notBusy. There is only one global
instance of this class, which can be accessed by the pointer theProgress.
HxFileDialog: This class represents the file browser used for loading and saving data. Normally the
developer does not need to use this class since the standard I/O mechanism is completely implemented
in the Avizo kernel. However, for special purpose modules, a separate file browser might be useful.
There is a global instance of this class, which can be accessed by the pointer theFileDialog.
HxResource: This class maintains the list of all registered file formats and modules as defined in the
package resource files. It also provides information about the Avizo root directory, the local Avizo
directory, the version number, and so on. Normally there is no need for the developer to use this class
directly. There is no instance of this class, since all its members are static.
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 13.5.6.3.
Miscellaneous 777
13.7.3 Save-Project Issues
This section describes the mechanism used in Avizo to save projects. For most modules, this is done
transparently for the developer.
The menu command ”Save Project” dumps a Tcl script that should reconstruct the current Avizo
project. Essentially this is done by writing a load ... command for each data object, a create
... command for each module and setValue ... commands for each port of a module.
This suffices to reconstruct the Avizo project correctly if all information about a module’s state is kept
in the module’s ports only. If this is not the case, e.g., if the developer uses extra member variables that
are important for the modules current state, those values are not restored automatically. If you cannot
avoid this, you must extend the ”Save Project” functionality of your module. In order to do so, you can
override the virtual function savePorts so that it writes additional Tcl commands. For example, let
us take a look at the HxArbitraryCut class, which is the base class e.g., for the Slice module
and which has to save its current slice orientation:
void HxArbitraryCut::savePorts(FILE* fp)
{
HxModule::savePorts(fp);
...
fprintf(fp, "%s setPlane %g %g %g %g %g %g %g %g %g\n",
getName(),
origin()[0], origin()[1], origin()[2],
uVec()[0], uVec()[1], uVec()[2],
vVec()[0], vVec()[1], vVec()[2]);
}
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
13.4.2.2.
Some remarks about how to generate the load command for data objects are given in subsection 13.3.2.
Figure 13.15: When loading this Avizo project, the Resample module recreates the chocolate-bar.Resampled data object on the
fly.
There is a special optimization for data objects created by computational modules. Avizo automatically
determines whether data objects which are created by other modules are not yet saved and asks the user
to do so, if necessary. Avizo proposes also two policies for saving projects: ”Minimize project size”
and ”Minimize project computation”. If the user selects ”Minimize project size” then the data objects
will not be saved at project saving and they will be computed at project loading, otherwise they will
Miscellaneous 778
be saved at project saving and they will not be computed at project loading. As an example, consider
the Avizo project in Figure 13.15. In this case, if the user selects ”Minimize project size” as policy,
the resample module can automatically recompute the chocolate-bar.Resampled data object
when the Avizo project is loaded. An algorithm must determine whether the compute module can
create the 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.
This behavior is completely handled by HxCompModule while the method
HxCompModule::setResult is used to register the output data object.
13.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 779
console when Avizo starts. If not, probably the Local Avizo directory is not set correctly. Reset it with
the Development Wizard in Avizo. Details are given in subsection 13.2.2
If the file is parsed, but the module still does not show up, the syntax of the rc file entry might be wrong
or you specified a wrong primary data type, so that the module will appear in the menu of a different
data class.
There is an entry in the popup menu, but the module is not created: Probably something is wrong
with the shared library (the .so or .dll file). In the Avizo console, type dso verbose 1 and try to
create the module again. You will see some error messages, indicating that either the dll is not found, or
that it cannot be loaded (and why) or that some symbol is missing. Check whether your building mode
(debug/optimize) and execution mode are the same. In particular, if you have compiled debug code
you must start Avizo using the -debug command line option or the debug executable (see subsection
13.1.5).
A read or write routine does not work: The procedure for such problems is the same. First check
whether the load function is registered. Then verify that your save-file format shows up in the file
format list when saving the corresponding data object. For a load method, right-click on a filename in
the load-file dialog. Choose format and check whether your format appears in the list. If that is the
case, you probably have a dll problem. Follow the steps above. If the library can be loaded, but the
symbol cannot be found, your method may have either a wrong signature (wrong argument types) or
on Windows you might have forgotten the <PACKAGE>_API macro. This macro indicates that the
routine should be exported by the DLL.
In general, if you have problems with unresolved and/or missing symbols, you should take a look
at the symbols in your library. On Unix, type nm lib/arch-*-Debug/libmypackage.so.
On Windows, type in Visual Studio command prompt: dumpbin /exports
bin/arch-*-Debug/mypackage.dll.
Miscellaneous 780
Chapter 14
Where:
• ω0 [t] and ω1 [t] are respectively the probabilities of being in classes C0 and C1 .
Metrology 3D display: Display volume rendering or surface view. Points used for geometry
fitting are picked on surface. This button allows showing data volume rendering or surface view.
• Surface color: To set surface view’s color. This option changes isocontours’ color in 2D viewers
too.
• View parameters: To set surface view’s opacity.
Geometry fitting relies on selecting points supporting the geometry lying on the interface between the
part and the ”outside” of the part (air for instance). These points are selected by picking in one of the
4 viewers provided in the layout, in 3D or 2D view. When a point is picked, it is projected on the
surface set in the Data Selection panel. Different point selection tools are provided in the toolbar on
top of the viewers.
In order to fit geometry on an area that is not visible or hidden in the volume, clipping can be activated
by clicking the icon in the lower right corner of each 2D viewer. Clipping is done through a
plane which orientation is defined by the view orientation of the 2D viewer in one of the following
modes:
No clipping is applied.
The clipping direction is either the direction of the normal to the plane or its inverse, depending
on which one forms the largest angle with the camera direction.
The clipping direction is the opposite direction of the normal to the plane.
This toolbar contains all geometry related tools. The different tools are:
• Advanced Parameters: Metrology Preferences to customize the fitting method.
• Pick Geometry: Pick any geometry in 3D viewer to select the corresponding geometry in the
geometries panel.
• Fitting tools: This drop down menu contains all tools to fit a geometry in the 3D or 2D viewers.
• Auto Fit Mode: Enable/Disable ”Auto Fit” mode. In ”Auto Fit” mode, the geometry fitting is
updated every time the user selects a new set of points.
• Fit: If ”Auto Fit Mode” is disabled, the geometry will be fitted only after having clicked on this
button.
• Finish: To stop the fitting edition when the user has finished picking points.
The fitting methods based on Chebyshev algorithm required minimum number of points per geometry.
For the 3D geometries, the points used to fit must represent 3D volume.
Geometry Mathematical minium Recommended
Line 2 5
Plane 3 9
Circle 3 7
Sphere 4 9
Cylinder 5 15
Cone 6 15
The default fitting method can be changed via the Metrology Preferences
The fitting method of a geometry can be changed using the Fitting Options Editor.
Previous formula is the sum of the squares of the vertical deviations R2 of a set of n data points. R2 is
minimized when the following equation is verified:
∂(R2 )
∂(ai ) =0
However, because squares of the offsets are used, outlying points can have a disproportionated effect
on the fit. This can be avoided by using RANSAC Options.
Figure 14.10: Minimum Zone fitting of a 2D Circle. Fitted circle is the green circle.
The goal is to find the two circles which minimizes the distance d. The minimum zone circle is the
mean of the two circles.
The more P is high and the more Pi is low will imply a great N biteration . Our most complicated
primitives (sphere and cone) have N bM inP ointT oF it = 4. Then if we set P to 90% and Pi to
20% we get N biteration ≈ 1500.
• Radius Range: Radius limit of the geometry
Multiple LCS can be created with the different tools and user can switch from one to another using the
LCS toolbar. This will allow aligning measures according to different orientations of the part.
14.4.2 Toolbar
This toolbar contains all Local Coordinate Systems (LCS) related tools. The different tools are:
• Bounding box: Shows/hides the LCS bounding box.
• Axes: Shows/hides the LCS axes.
• Origin: Shows/hides the LCS origin.
• Options: Displays the LCS options. This menu contains:
• the LCS list, allowing to quickly set the current LCS
• an access to the LCS Wizard (Add LCS...), allowing the creation of LCS
Avizo allows for the creation of user-defined recipes, which allows for the automation of a complex
scenario making use of multiple tools and workspaces. They define high-level workflows such as
extracting user-defined statistics from an image. User recipes are black boxes designed to create push
button solutions, integrating the user knowledge.
The Recipes panel lets you execute user-defined recipes (see Figure 15.1). Once a recipe is loaded into
the panel, it can be played and edited. Multiple recipes can be loaded. The current recipe is chosen
from the main panel input. Recipes can be saved on disk using a dedicated file format (hxrecipe).
Recipes can be shared.
Figure 15.1: The Recipes Panel
When a recipe is played, the user has control over the execution, which can either be executed at once
or paused using breakpoints (see Figure 15.2). A breakpoint allows for the changing of the properties
of a tool used in the recipe (instead of the properties saved in the recipe). It allows you to play a recipe
several times and to change a parameter to evaluate the sensitivity of that parameter. For example, you
can change a threshold to evaluate if porosity is sensitive to the segmentation parameter.
Notice: Some tools will automatically force a breakpoint when a user interaction is needed (e.g., paint).
For each step, you can set the following attributes to on/off: one for saving the result to disk and one
to export the result to the Project workroom. If the export to project is off, the data will be removed
from memory if it is not needed anymore in any of the subsequent steps. This allows for optimizing
memory consumption.
Notice: Results will be saved to disk only if Production Mode is turned on.
795
Figure 15.2: Edit Recipe
When a recipe has been played, browsing on top of a step will display a popup thumbnail showing a
snapshot of the data (see Figure 15.3).
796
At each step, it is possible to take a snapshot of the result. The snapshots are saved on the application
data directory. By default, the default display module defined in the Edit>Preferences>Auto Display
is used. However, this can be changed by adding a snapshot for a particular step, setting a break point
on the snapshot step, and then running recipe. When a recipe reaches the snapshot breakpoint, the
recipe will stop and a snapshot can be customized in the Properties window (see Figure 15.4).
3. Attach a Fill Holes module to spring loaded cam.labels data, select 3D option, and
then apply it (see Figure 15.6).
4. Attach an Arithmetic module to spring loaded cam.filled data, connect its B input to
5. Attach a Label Analysis module to Result data (result from previous Arithmetic module), con-
nect its Intensity Image input port to spring loaded cam.am, and then apply it (see Figure
15.8).
Let us reuse and edit this recipe to get porosity statistics on another dataset:
1. Load AVIZO ROOT/data/pump-bracket/Pump-bracket-CT-scan.am
2. Select Pump-bracket-CT-scan.am in the Recipes panel
3. Play recipe on the pump bracket part. The recipe will compute statistics (see Figure 15.10).
Let us check a few other options of the recipe mechanism. Here is another example reusing the recipe
just saved on disk:
1. Start Avizo
2. Load AVIZO ROOT/data/tutorials/spring loaded cam.am
3. Attach an Extract Subvolume module to spring loaded cam.am data and extract a small
portion of the image (see Figure 15.11 and Figure 15.12).
6. Run the recipe until it hits the breakpoint. At this stage, it is not possible to change the input
data or to quit the recipes workroom. Only the properties of the tool are available for change.
Set Measures to Standard Shape Analysis. Click Play to continue (see Figure 15.14).
Avizo allows for the creation of reports. This is performed through the Reporting Workroom (see
Figure 16.1). From this room, report templates can be loaded. A report template is an HTML page with
frames. The Reporting Workroom allows for the user to associate snapshot and statistical results to the
HTML template. This can be done automatically by assigning a particular snapshot or table generated
when running a recipe to a specific frame; or by dragging-and-dropping a snapshot generated through
the Avizo snapshot tool, or a table resulting from an analysis.
Any HTML editor can be used to create a template suitable for the Reporting Workroom of Avizo. The
page should consist of frames and static elements, such as text or images. Each frame containing the
class=”reportContentContainer” will be able to receive a snapshot or a table from an Avizo session.
The Reporting Workroom is not designed to be an HTML viewer, it is designed to load a template,
populate a template during the session, and save a report. A saved report in HTML can be viewed with
any browser or via PDF with any PDF reader. Default report template provided with Avizo is loaded
when switching to the Reporting Workroom. From there, this default report can be used or a new one
can be loaded (see Figure 16.2).
The Content panel of the Reporting Workroom is split in two sub-panels. The top one lists the available
snapshots that can be imported to the template and the bottom one lists the tables. There are two
ways of populating these sub-panels. The table sub-panel will be automatically populated when a
spreadsheet resulting from any analysis is produced, such as a Label Analysis module. For the snapshot
panel, snapshots can be interactively generated from the Avizo snapshot tool where the Reporting
Workroom can be selected as destination for the snapshot (see Figure 16.3).
806
Figure 16.3: The Avizo Snapshot Tool
807
Figure 16.4: Drag-and-Drop of Snapshots
The same way, tables resulting from analysis will be sent to the Reporting Workroom where they can be
dragged-and-dropped into a frame of the template. The second way is by using recipes. A recipe may
automatically produce snapshots and tables resulting from analysis. Each snapshot and table produced
by a recipe is sequentially identified and will populate the sub-panels in the same order when played.
Replaying a recipe will replace in the same order the snapshots and tables in the two sub-panels.
1. Load AVIZO ROOT/data/tutorials/spring loaded cam.am.
2. Load the AVIZO ROOT/data/tutorials/recipes/porosity.hxrecipe.
3. Switch to the Recipes Workroom.
4. Add a snapshot step between each step.
5. Play the recipe.
6. Switch to the Reporting Workroom. The snapshots and tables appear in the sub-panels. Note
that when loading a recipe, Avizo automatically detects the snapshots generated by the recipe,
and the snapshot sub-panel is automatically populated with empty snapshot placeholders. This
is not true for tables since the recipe must be played once for Avizo to determine which tables
are generated (see Figure 16.5).
808
Figure 16.5: Snapshots and Table from Recipe
7. Snapshots and tables can then be dragged-and-dropped to each frame of the template. Once this
association is complete, the snapshots and tables will be automatically updated in the template
each time the recipe is played. Once the association has been set, the template can be saved as a
new template. This new template can be reloaded in Avizo and will be populated automatically
each time the associated recipe is played (see Figure 16.6).
809
Figure 16.6: Report Example
The report can then be saved as an HTML page or exported to PDF (see Figure 16.7).
A report can be filled using an Avizo script. To create such a report, set a unique HTML tag in each
frame (it is recommended using: accesskey="key").
To set a snapshot in a given frame, use the following command line:
810
To save a report, use the following command line:
811
Chapter 17
Avizo XPoreNetworkModeling
Extension User’s Guide
The Avizo XPoreNetworkModeling Extension is required to play the tutorial and unlock the features
described in this chapter.
It allows accessing different statistics from a labeled and separated pore space. The statistics include
distribution of the following parameters:
• Pore volume
• Pore area
• Pore equivalent radius
• Pore center of gravity
• Pore coordination number (number of connected neighbors)
• Intersection percentage between pore network model and original pore space
• Throat area
• Throat equivalent radius
• Throat channel length
• Throat connection (id of pore 1, id of pore 2)
The extension also allows reading pore network code from the Pore Network Node-Link data format.
The general workflow for accessing statistics is the following:
• Create a binary pore space from the grayscale data (see Segmentation Workroom)
• If connected porosity needs to be analyzed, unconnected pores can be removed with the Axis
Connectivity module
• Separate the pore space into a set of connected and labeled pores using the Separate Ob-
jects Module. The extension provides a mode optimized for arbitrary pore shapes (Skeleton
-Aggressive). Spherical pores can be well separated with the default mode (Chamfer - conser-
Figure 17.1: PNM displayed within pore space
vative).
• Generate a pore network model (extracts network code) using the Generate Pore Network Model
The generated PNM contains the network code and can be used with the Histogram to plot the distri-
bution of the different parameters.
To learn more about the tools available in the extension, please refer to the following links:
• Pore Space Analysis Tutorial
• Generate Pore Network Model
• Pore Intersection
• Pore Network Model Filter
• Pore Network Model View
• Separate Objects
• Pore Network Node-Link
Notice: it is also possible to visualize the model on top of the original data. Below is a set up showing
the labeled and separated pore space overlaid on top of the model and the model within the grayscale
data.
813
Figure 17.2: Original data with color map configured to hide void
voxels in the neighborhood port. This allows keeping only the connected porosity of the sample.
• The connected porosity vs total porosity can be computed using a Volume Fraction module
connected to the output of the axis connectivity module (for amount of connected porosity),
or connected to the output of the Auto Thresholding module (for amount of total porosity)
respectively. This example reports 50% of connected porosity for a total porosity of 54%.
• To visualize the connected porosity vs unconnected porosity: attach a Subtract Image module to
the output of the Auto Thresholding module and to the output of the Axis Connectivity module.
This will create a label representing the unconnected porosity (floating void). Attach a Volume
Rendering to this data, and use e.g. the /em seismic colormap. This colormap will colorize in
blue the data at 0 (connected porosity) and in red the data at 1 (unconnected porosity)
• Apply a Separate Objects module on the output of the Axis Connectivity module. Set the Marker
Extent port value to 2 and the Output Type port to connected object. In this example we keep
the default method (Chamfer - Conservative) as the pores are mostly spherical.
• Display the result by creating another Volume Rendering module on the previous output.
The project data/tutorials/PNM/1-PrepareData.hx allows jumping directly to this step.
button of any pore network model. The PNM spreadsheet has two tabs, one for pores and one
for throats:
• When displaying the pore network model with a Pore Network Model View, and displaying the
spreadsheet at the same time in the table view, it is possible to highlight the pores (or the throats)
which are selected in the table from the Pores table (or the Throats table). Select pores in the
table by left-clicking on one or several lines (left click pressed on a line, and move up or down
the table without releasing). The corresponding pores will be highlighted in red in the 3D view:
• The generated pore network model can be used to plot the statistics of the pore space:
• It is possible to plot the pore size distribution of the sample, using the Distribution Analysis
module (equivalent radius vs cumulated pore volume within a bin):
• Attach a Distribution Analysis module to the generated pore network model
• Set the parameters as follow and apply:
• The following distribution curve is displayed using a Plot SpreadSheet module as fol-
low: The plot shows that the majority of the pore space is filled by big pores, but the
predominant small pores have a radius around 0.15.
• Filter the data to keep only pores with volume greater than 0.02. Create a Pore Network Model
Filter module on the generated Pore Network Model then add Volume ¿ 0.02 in the Filter port.
You can visualize the filtered network by changing the Data port of the Pore Network Model
About Bio-Formats
Bio-Formats is a popular Java library for handling life science image data
(http://www.openmicroscopy.org/site/products/bio-formats). The Bio-Formats integration en-
ables Avizo to read image- and metadata from over 140 file formats. For a list of all supported file
formats and additional information, please visit: http://www.openmicroscopy.org/site/support/bio-
formats5.1/supported-formats.html. To facilitate data exchange between different software packages
and organizations, Bio-Formats converts data stored in proprietary file formats into an open standard
called the OME data model, in particularly the OME-TIFF file format.
Bio-Formats Metadata
Bio-Formats categorizes metadata in 3 tiers:
• Core metadata: only includes information necessary to understand the basic structure of the
images, e.g. image dimension; number of focal planes; time points; channels; byte order; di-
mension order; color arrangement (RGB, indexed color or separate channels); and thumbnail
dimensions.
• Original metadata: is information specific to a particular file format. These fields are key/value
pairs in the original format, with no guarantee of cross-format naming consistency or compati-
bility. The nomenclature often differs between formats, as each vendor is free to use their own
terminology.
• OME metadata: is information from Core metadata and Original metadata converted by
Bio-Formats into the OME data model. Performing this conversion is the primary task of Bio-
Formats.
Bio-Formats Integration
The integration into Avizo then organizes the opened image and metadata into the native Avizo data
structure, with its well-known parameter bundles. During this process, standard image information
e.g. voxel size, matrix dimensions etc. are assigned to the corresponding standard Avizo parameter
bundles. All metadata is stored in a dedicated Bio-Formats parameter bundle. The Bio-Formats
integration is able to open data as scalar-, color-, and multi-channel fields, as well as tiled images and
time-series.
The Bio-Formats library is seamlessly integrated into Avizo. Avizo prioritizes its own format imple-
mentation over Bio-Formats. Thus, if a file format is known by Avizo, the native Avizo reader is used
for performance reasons. Reading such a file with Bio-Formats requires opening it using the ”Open
Data As...” file dialog and selecting Bio-Formats as the preferred reader. Files that Avizo does not have
a native reader for are automatically loaded using Bio-Formats.
Commands
Caution: Bio-Formats reader is part of a separate library. Using directly the TCL command requires
to load this library manually by using the following command:
dso open hxbioformatreader
The following Tcl commands can be used in order to parametrize the Bio-Formats reader.
bioFormats read [-series <seriesId>] [-time <timeId>] [-channel
<channelId>] <fileName>
This command reads an image file <fileName> (using an absolute or relative path).
It is possible to read a specific series number using the -series option. If the -series option is not
defined, the default setting is to read all the series.
It is possible to read a specific time step using the -time option. If the -time option is not defined,
the default setting is to read all the time steps.
It is possible to read a specific channel number using the -channel option. If the -channel option is
not defined, the default setting is to read all channels.
The command returns the labels of the data objects created in the Project View.
Remark: All the metadata that Bio-Formats reader gets from the file are copied as parameters of
the created object.
bioFormats canRead <fileName>
This command checks if the image file can be read.
The command returns: ”<fileName> can be read.” or ”<fileName> can not be read.”.
bioFormats format <fileName>
This command asks Bio-Formats the file format of the <fileName>.
The command returns the format (as a string) detected by Bio-Formats.
bioFormats info [-series <seriesId>] <fileName>
This command reads the image file information (all the metadata Bio-Formats gets). It is possible
to get the metadata of a specific series number using the -series option. If the -series option is not
825
defined, the default setting is to get the metadata of all the series successively.
The command returns a list of ”key : value” pairs available.
bioFormats omexml <fileName>
This command reads the OME XML header file available or populated. This command returns the
metadata associated to presented as an XML tree. The XML format is OME-XML.
Environment variables:
The -Xms and -Xmx command line options are available to change the behaviour of JRockit JVM
to better suit the needs of the Bio-Formats reader Java application.
The -Xms option sets the initial and minimum Java heap size. The default allocated memory is
256MB. In order to change the size, add the following environment variable and set the new size:
HX JAVA HEAP SIZE MIN=<size>[g—G—m—M—k—K]
The -Xmx option sets the maximum Java heap size. The default allocated memory is 64GB. In
order to change the size, add the following environment variable and set the new size:
HX JAVA HEAP SIZE MAX=<size>[g—G—m—M—k—K]
826
Index
INDEX 828
Save Project, 375 HxParamBundle, 771
Save Project As, 376 HxPortButtonList, 738
Save Project As Template, 376 HxPortFloatTextN, 722
file name extension, 696 HxPortIntSlider, 730
firewall, 18 HxPortRadioBox, 735
firing algorithm, 410 HxTetraData, 764
font size, 452, 453 HxTetraGrid, 762
Fourier transform, 118 HxUniformScalarField3, 725
function key, 454
procedure, 478 immersion medium, 113
in-plane sampling, 103
global objects, 776 initial estimate, 107, 110
global search, 769 intensity attenuation, 105
gmake, 683, 689 interface, 712, 755
GNUmakefile, 683, 689 introduction, 13
Graph View, 387
graphical user interface, 682, 710 job dialog, 111
graphicscards, 13 Job dialog box, 407
INDEX 829
microsphere, 113 Make All Display Modules Unpickable,
model, 207 380
module Remove All Objects, 379
adding new one, 694 Remove Object, 378
example, 729 Rename Object, 379
multi-processing, 118 Show All Objects, 379
multiple file input, 696 Show Object, 379
Tree View, 378
no-show-news, 412 Port, 393
noise, 102, 103 portData, 724
non-conformal grids, 765 PPM3D format, 702, 711
numerical aperture, 103 preferences, 410
Nyquist sampling, 103 preferences-and-settings, 412
primitive data types, 756
Object Popup, 423 prioritizinghardaware, 13
oil immersion, 113 procedural data interface, 768
Open Inventor, 682, 729 processor, 12
OpenGL, 12, 682, 683 profile-selection, 412
optical sectioning microscopy, 101 progress, 726
out-of-focus light, 102, 109 Progress Bar, 395
overrelaxation, 107, 110 progress bar, 726
oversampling, 103 Project Graph View, 387
overwrite dialog, 712 PSF, 102, 105
theoretical, 108
package, 681, 693
Python Common Global Commands, 497
parallel flags, 689
Python Documentation, 486
parameters, 755, 771
Python In Product, 491
parameters of data objects, 434
Python Introduction, 487
parse method, 734
Python Modules, 500
performance, 118, 728
Python Package manager, 505
plot API, 736
Python Packages, 507
polymorphism, 712
Python Script Objects, 501
Pool, 777
Python Tutorial, 509
Pool Menu
Python Tutorials, 486
Auto adjust range of colormaps, 380
Create Object, 379 Qt, 682, 710
Duplicate Mode, 380 question dialog, 777
Duplicate Object, 379
Graph View, 378 read routine
Hide All From Viewer But This, 379 adding new one, 696
Hide Object, 378 example, 701
Make All Display Modules Pickable, 380 multiple files, 709
reampling, 106
INDEX 830
recent-documents, 412 system requirements
rectilinear coordinates, 760 development, 12
refracrtive index, 113 Mac, 19
refractive index, 103 systemmemory, 15
register
data, 704, 709 table coordinates, 769
read routine, 704 TCL, 461
write routine, 712, 715 Tcl, 454
registry, 687, 692 Tcl interface, 734
regular grid, 433, 756 Tcl introduction, 455
renaming a package, 690 Tcl library, 683
resource file, 682, 704, 712, 715, 779 template function, 758
tetrahedral grid, 207
sampling rate, 103 tetrahedral grids, 433, 762
saturation, 104 transformations, 770
save ports, 778 Trimesh format, 705, 713
save project, 411, 477, 778 tutorials, 44
scalar fields, 431
scanned volume, 103 undersampling, 103
scene graph, 729 uniform coordinates, 760
script, 461 unknown identifier, 779
SCRIPTDIR, 462 unresolved symbol, 779
SCRIPTFILE, 462 update method, 735
scripting, 461 Upgrading to latest version of Avizo XPand
Scripting interface, 454 Extension, 689
segmentation, 94
Shadowing, 435 vector fields, 432
shared object, 681 VertexSets, 434
simulation, 207 View Menu
smart pointer, 730, 738 Antialiasing, 382
Snapshot dialog box, 420 Axis, 383
Spacemouse, 453 Background, 381
SpatialData, 755 Enable Shadows, 383
specialconsideration, 18 Fog, 382
stacked coordinates, 760 FPS (frames-per-second), 383
Standard Toolbar, 386 Frame counter, 383
start-up script, 453, 478 Layout, 380
stereo mode, 453 Lights, 381
storage-class specifier, 704, 712 Measuring, 383
surface, 433, 705 Transparency, 381
patch, 708 Viewer, 396, 777
surface field, 705 Fullscreen, 401
system information dialog, 422 Home, 399
INDEX 831
Interact, 397 workrooms-toolbar, 386
interaction mode, 397 world coordinates, 769
Layout, 401 write routine
LinkObjectsVisibility, 401 adding new one, 696
Measuring, 400 example, 710
Perspective/Ortho toggle, 399
Pick, 397, 399 xpand, 19
rotate button , 399
Seek, 399
Set Home, 399
Snapshot, 401
Stereo, 400
Trackball, 398
Translate, 398
View, 398
View All, 399
viewing directions (geographic), 400
viewing directions (seismic), 400
viewing directions XY, XZ, YZ, 400
viewing mode, 397
Zoom, 398
zoom, 396
viewer toggles, 411
Visual Studio
debug code, 688
release code, 687
INDEX 832