Skip to main content

Project Management

Application Basics 📥 Download Script

Project Management Tutorial.

This tutorial demonstrates how to manage projects including opening, saving, closing projects, and working with project data. It also covers object management functions like renaming, duplicating, and deleting objects.

Prerequisites
  • Volvicon application must be running
  • A sample project file for testing

Opening a Project​

# Close any existing project first
app.close_project()

# Open a project file
# Modify this path to point to an existing project file on your system
project_path = r'C:\path\to\your\project.vvcx'

# Uncomment to open a project:
# success = app.open_project(project_path)
# if not success:
# raise RuntimeError(f"Failed to open project: {project_path}")
# print(f"Project opened: {project_path}")

Listing Objects in the Project​

# Get all object names by type

# Volumes
all_volumes = app.get_all_volume_names()
visible_volumes = app.get_visible_volume_names()
print(f"All volumes: {all_volumes}")
print(f"Visible volumes: {visible_volumes}")

# Masks
all_masks = app.get_all_mask_names()
visible_masks = app.get_visible_mask_names()
print(f"All masks: {all_masks}")
print(f"Visible masks: {visible_masks}")

# Surfaces
all_surfaces = app.get_all_surface_names()
visible_surfaces = app.get_visible_surface_names()
print(f"All surfaces: {all_surfaces}")
print(f"Visible surfaces: {visible_surfaces}")

# Volume meshes
all_volume_meshes = app.get_all_volume_mesh_names()
visible_volume_meshes = app.get_visible_volume_mesh_names()
print(f"All volume meshes: {all_volume_meshes}")
print(f"Visible volume meshes: {visible_volume_meshes}")

# Measurements
all_measurements = app.get_all_measurement_names()
visible_measurements = app.get_visible_measurement_names()
print(f"All measurements: {all_measurements}")
print(f"Visible measurements: {visible_measurements}")

Active Object Management​

# The active object is displayed in bold in the scene tree and is used
# by certain operations that require a single object target.

# Get active objects
active_volume = app.get_active_volume_name()
active_mask = app.get_active_mask_name()
active_surface = app.get_active_surface_name()
active_volume_mesh = app.get_active_volume_mesh_name()

print(f"Active volume: {active_volume}")
print(f"Active mask: {active_mask}")
print(f"Active surface: {active_surface}")
print(f"Active volume mesh: {active_volume_mesh}")

# Set active objects (uncomment if objects exist in the project)
# if all_volumes:
# app.set_active_volume(all_volumes[0])
# if all_masks:
# app.set_active_mask(all_masks[0])
# if all_surfaces:
# app.set_active_surface(all_surfaces[0])
# if all_volume_meshes:
# app.set_active_volume_mesh(all_volume_meshes[0])

Visibility Management​

# Control which objects are visible in the 3D view

# Show/hide volumes
if all_volumes:
# Hide all volumes
app.set_volumes_visible(all_volumes, False)

# Show only the first volume
app.set_volumes_visible([all_volumes[0]], True)

# Isolate specific volumes (shows only these, hides all others)
app.isolate_volumes([all_volumes[0]])

# Show all volumes again
app.isolate_volumes([]) # Empty list shows all

# Show/hide masks
if all_masks:
app.set_masks_visible(all_masks, False)
app.isolate_masks([all_masks[0]] if all_masks else [])

# Show/hide surfaces
if all_surfaces:
app.set_surfaces_visible(all_surfaces, False)
app.isolate_surfaces([all_surfaces[0]] if all_surfaces else [])

# Show/hide volume meshes
if all_volume_meshes:
app.set_volume_meshes_visible(all_volume_meshes, False)
app.isolate_volume_meshes([all_volume_meshes[0]] if all_volume_meshes else [])

# Show/hide measurements
if all_measurements:
app.set_measurements_visible(all_measurements, False)
app.isolate_measurements([all_measurements[0]] if all_measurements else [])

Renaming Objects​

# Rename objects to give them meaningful names

# Rename volume
# if all_volumes:
# app.rename_volume(all_volumes[0], "CT_Scan_Patient_001")

# Rename mask
# if all_masks:
# app.rename_mask(all_masks[0], "Bone_Segmentation")

# Rename surface
# if all_surfaces:
# app.rename_surface(all_surfaces[0], "Femur_Surface")

# Rename volume mesh
# if all_volume_meshes:
# app.rename_volume_mesh(all_volume_meshes[0], "Femur_FEM_Mesh")

# Rename measurement
# if all_measurements:
# app.rename_measurement(all_measurements[0], "Bone_Length")

Duplicating Objects​

# Create copies of existing objects

# Duplicate volumes
# if all_volumes:
# duplicated = app.duplicate_volumes([all_volumes[0]])
# print(f"Duplicated volumes: {duplicated}")

# Duplicate masks
# if all_masks:
# duplicated = app.duplicate_masks([all_masks[0]])
# print(f"Duplicated masks: {duplicated}")

# Duplicate surfaces
# if all_surfaces:
# duplicated = app.duplicate_surfaces([all_surfaces[0]])
# print(f"Duplicated surfaces: {duplicated}")

# Duplicate volume meshes
# if all_volume_meshes:
# duplicated = app.duplicate_volume_meshes([all_volume_meshes[0]])
# print(f"Duplicated volume meshes: {duplicated}")

# Duplicate measurements
# if all_measurements:
# duplicated = app.duplicate_measurements([all_measurements[0]])
# print(f"Duplicated measurements: {duplicated}")

Deleting Objects​

# Remove objects from the project
# WARNING: These operations cannot be undone when executed via script

# Delete specific objects (uncomment to use)
# app.delete_volumes(['Volume_to_delete'])
# app.delete_masks(['Mask_to_delete'])
# app.delete_surfaces(['Surface_to_delete'])
# app.delete_volume_meshes(['VolumeMesh_to_delete'])
# app.delete_measurements(['Measurement_to_delete'])

# Delete all objects of a type
# app.delete_all_volumes(showMsgBox=False) # Set True to show confirmation dialog
# app.delete_all_masks(showMsgBox=False)
# app.delete_all_surfaces(showMsgBox=False)
# app.delete_all_volume_meshes(showMsgBox=False)
# app.delete_all_measurements(showMsgBox=False)

Saving the Project​

# Save project changes

# Save to current location
# app.save_project()

# Save to new location
# app.save_project(r'C:\path\to\new_project.vvcx')

Closing the Project​

# Close the project when done
# app.close_project()

print("Project management tutorial completed successfully.")