Skip to main content

Wall-Thickness Analysis Workflow

Workflows 📥 Download Script

Wall Thickness Analysis Workflow Tutorial.

This tutorial guides you through the automated wall‑thickness analysis workflow—from threshold‑based segmentation of grayscale volume data, through surface generation and cleanup, to full 3D wall‑thickness evaluation. You will learn how to convert segmented data into a surface object, perform remeshing and surface fixing, run wall‑thickness analysis with interactive 3D visualization, and finally save all results to disk. The workflow concludes with optional post‑processing steps such as capturing view snapshots, saving the project, and closing it to free system memory.

Note: The UI analysis tools are heavily based on user interaction, such as picking points on the target object to find values, viewing frequency vs. statistics distribution charts, etc. Since user interactions cannot be performed through the scripting interface, the scripting analysis operations have certain limitations. For interactive analysis, it is highly recommended to use the UI tools located under the Analyze ribbon tab. The UI tools also provide options to generate detailed 3D PDF reports, including snapshots, measurements, interactive 3D scenes, charts, and more.

Prerequisites
  • Volvicon application must be running
  • Relevant objects loaded (volume as required)

Scripting Api Initialization​

import ScriptingApi as api

# Create Application instance
app = api.Application()

mask_operations = app.get_mask_operations()
surface_operations = app.get_surface_operations()
analysis_operations = app.get_analysis_operations()

# Listing Analyses
all_analyses = app.get_all_analysis_names()
print(f"Available analyses: {all_analyses}")

active_volume_name = app.get_active_volume_name()

Threshold Segmentation​

threshold_params = api.ThresholdParams()
threshold_params.lower_threshold = 31724.617 # Minimum intensity
threshold_params.upper_threshold = 65156 # Maximum intensity
threshold_params.fill_cavities = True
threshold_params.filter_regions = True
threshold_params.keep_largest = True

new_mask_name = mask_operations.threshold(active_volume_name, threshold_params)
print(f"Created threshold mask: {new_mask_name}")

# Convert the segmentation mask to surface object
mask_to_surface_params = api.MaskToSurfaceParams()
mask_to_surface_params.resolution_reduction = True
mask_to_surface_params.xy_resolution_reduction = 2;
mask_to_surface_params.smoothing = True
mask_to_surface_params.smooth_iterations = 50
mask_to_surface_params.triangle_reduction = True
mask_to_surface_params.triangle_reduction_percent = 90

surface_names = mask_operations.convert_to_surface_objects([new_mask_name], mask_to_surface_params)

# Remesh the surface
surface_operations.remesh(surface_names)

# Fix the surface if there are any geometric issues.
surface_diagnostics_checks = api.SurfaceDiagnosticsChecks()
surface_operations.fix_surface(surface_names[0], surface_diagnostics_checks)

app.isolate_surfaces(surface_names)

Wall Thickness Analysis Workflow​

# A. Creation
wall_thickness_params = api.WallThicknessParams()
wall_thickness_params.method = api.WallThicknessMethod.RayCasting
wall_thickness_params.max_wall_thickness = 20.0
wall_thickness_params.search_angle = 20.0
wt_name = analysis_operations.create_wall_thickness_analysis_surface(
"WallThickness_Surface_1",
surface_names[0],
wall_thickness_params
)

# B. Running
analysis_operations.run_analysis(wt_name)

# C. Getting Info and Results
analysis_info = analysis_operations.get_analysis_info(wt_name)
print(f"Analysis info: name={analysis_info.name}, type={analysis_info.type}")

# Get specific analysis type name
analysis_type_str = analysis_operations.get_analysis_type_as_string(wt_name)
print(f"Analysis type name: {analysis_type_str}")

# Check if analysis has results
has_results = analysis_operations.has_analysis_results(wt_name)
print(f"Has results: {has_results}")

wall_thickness_analysis_results = analysis_operations.get_wall_thickness_analysis_results(wt_name)
print(f"Wall Thickness Mean: {wall_thickness_analysis_results.statistics.mean_value}")

# D. Writing Results to Disk
analysis_operations.write_wall_thickness_results_to_disk(wall_thickness_analysis_results, r'C:\Samples\wall_thickness.txt')

# E. Changing Display Settings
analysis_display_settings = analysis_operations.get_display_settings(wt_name)
analysis_display_settings.above_max_range_color = [1.0, 0.6, 0.6]
analysis_display_settings.lookup_table_type = api.LookupTableType.ReverseRainbow
analysis_display_settings.below_min_range_color = [0.6, 0.0, 1.0]
analysis_display_settings.constant_color = [0.0, 0.0, 1.0]
analysis_display_settings.lookup_table_opacity = 1.0
analysis_display_settings.range = [1.0, 20.0]
analysis_operations.set_display_settings(wt_name, analysis_display_settings)
analysis_display_settings = analysis_operations.get_display_settings(wt_name)

# Restoring visualization defaults
# analysis_operations.restore_visualizations(wt_name)

# F. Updating Analysis
# analysis_operations.update_analysis(wt_name)

Post-Analysis Operations​

# Save snapshots and the project to disk, then close the project to free up memory

app.save_snapshot_to_disk(api.SnapshotType.Application, 'C:/Samples/Application.png')
app.save_snapshot_to_disk(api.SnapshotType.Scene, 'C:/Samples/Scene.png')
app.save_snapshot_to_disk(api.SnapshotType.View3D, 'C:/Samples/View3D.png')

app.save_project("C:/Samples/wallthickness-workflow.vvcx")

app.close_project()

print("Analysis operations tutorial completed successfully.")