Skip to main content

ViewOperations

Operations

Provides operations for application views, scene orientation, camera, layout, rendering representation, and visualization settings. This class exposes the functionality available through the View ribbon tab, including layout presets, scene orientations, 3D/2D view operations, surface representation modes, shading options, and object widget visibility.

Import

import ScriptingApi as api

# Access via Application
app = api.Application()
ops = app.get_view_operations()

Methods

Properties

set_layout

Sets the workspace layout to a predefined arrangement of 3D and 2D slice views.

Signature:

set_layout(preset: LayoutPreset) -> None

Parameters:

ParameterTypeDescription
presetanyThe layout preset to apply. Use api.LayoutPreset values (e.g., api.LayoutPreset.Conventional, api.LayoutPreset.ThreeDOnly, api.LayoutPreset.FourUpRight).

get_layout

Returns the current workspace layout preset.

Signature:

get_layout() -> LayoutPreset

Returns: LayoutPreset — The active layout preset value as api.LayoutPreset.


set_scene_orientation

Sets the scene orientation type, which determines the axis labels and view directions for both 3D and 2D slice views. Standard and Classic orientations use engineering conventions (X, Y, Z). Medical orientations use anatomical camera conventions (Radiologist/Neurologist viewpoints).

Signature:

set_scene_orientation(orientation: SceneOrientation) -> None

Parameters:

ParameterTypeDescription
orientationanyThe scene orientation to apply. Use api.SceneOrientation values (e.g., api.SceneOrientation.Standard, api.SceneOrientation.Medical1).

get_scene_orientation

Returns the current scene orientation type.

Signature:

get_scene_orientation() -> SceneOrientation

Returns: SceneOrientation — The active scene orientation value as api.SceneOrientation.


set_3d_contours_enabled

Enables or disables the visibility of 3D contours in the 2D slice views for the specified object type. When enabled, the intersection of 3D objects with the current slice plane is rendered as contour lines in the 2D views.

Signature:

set_3d_contours_enabled(objectType: ContourObjectType, enabled: bool) -> None

Parameters:

ParameterTypeDescription
objectTypeanyThe type of object whose contours to set. Use api.ContourObjectType.Surface, api.ContourObjectType.VolumeMesh, or api.ContourObjectType.MaskPreview.
enabledanyTrue to show the contours, false to hide them.

set_crosshair_enabled

Enables or disables the crosshair in both the slice and 3D views. When enabled, the crosshair indicates the intersection of the three orthogonal slice planes in all views.

Signature:

set_crosshair_enabled(enabled: bool) -> None

Parameters:

ParameterTypeDescription
enabledanyIf true, enables the crosshair; if false, disables it.

is_crosshair_enabled

Returns whether the crosshair is currently enabled.

Signature:

is_crosshair_enabled() -> bool

Returns: bool — True if the crosshair is enabled; false otherwise.


set_slice_views_linked

Enables or disables camera synchronization (linking) of the slice views. When enabled, panning and zooming in one slice view is synchronized across all slice views.

Signature:

set_slice_views_linked(enabled: bool) -> None

Parameters:

ParameterTypeDescription
enabledanyIf true, links the slice views; if false, unlinks them.

is_slice_views_linked

Returns whether the slice views are currently linked (camera synchronized).

Signature:

is_slice_views_linked() -> bool

Returns: bool — True if slice views are linked; false otherwise.


set_window_level

Sets the window and level values for the active volume in the slice views. Window defines the range of gray values displayed, and level defines the center of that range. Together they control the brightness and contrast of the 2D slice views. The window value must be non-negative. A window of 0 means all voxels at the level value will be displayed at maximum brightness.

Signature:

set_window_level(window: float, level: float) -> None

Parameters:

ParameterTypeDescription
windowanyThe window (contrast) value. Must be >= 0.
levelanyThe level (brightness center) value.

get_window_level

Returns the current window and level values of the active volume. The returned array contains two elements: [window, level]. Window is the range of displayed gray values and level is the center of that range.

Signature:

get_window_level() -> list

Returns: list — A std::array with [window, level] values.


get_mask_3d_preview_quality

Returns the current quality level used for mask 3D previews.

Signature:

get_mask_3d_preview_quality() -> Mask3dPreviewQuality

Returns: Mask3dPreviewQuality — The current mask preview quality value as api.Mask3dPreviewQuality.


set_mask_volume_rendering_enabled

Enables or disables direct volume rendering of masks in the 3D view. When enabled, all masks are rendered directly as GPU volumes without generating surface meshes, so mask edits are reflected immediately in the 3D view. Enabling this mode implicitly turns off any active mesh preview for all masks. Selecting any 'Mask 3D Preview (Mesh)' quality button will disable this mode again.

Signature:

set_mask_volume_rendering_enabled(enabled: bool) -> None

Parameters:

ParameterTypeDescription
enabledanyTrue to enable direct volume rendering; false to disable it.

is_mask_volume_rendering_enabled

Returns whether mask direct volume rendering is currently enabled.

Signature:

is_mask_volume_rendering_enabled() -> bool

Returns: bool — True if mask direct volume rendering is active; false otherwise.


set_outline_enabled

Enables or disables the bounding box outline for all objects of the specified type.

Signature:

set_outline_enabled(objectType: WidgetObjectType, enabled: bool) -> None

Parameters:

ParameterTypeDescription
objectTypeanyThe type of objects to set the outline for. Use api.WidgetObjectType.Volume, api.WidgetObjectType.Surface, or api.WidgetObjectType.VolumeMesh.
enabledanyTrue to show the bounding box outline, false to hide it.

set_corner_outline_enabled

Enables or disables the corner bounding box outline for all objects of the specified type.

Signature:

set_corner_outline_enabled(objectType: WidgetObjectType, enabled: bool) -> None

Parameters:

ParameterTypeDescription
objectTypeanyThe type of objects to set the corner outline for. Use api.WidgetObjectType.Volume, api.WidgetObjectType.Surface, or api.WidgetObjectType.VolumeMesh.
enabledanyTrue to show the corner outline, false to hide it.

set_slice_planes_enabled

Enables or disables the visibility of the 3D slice planes in the 3D view. Slice planes show the current slice positions from the 2D views overlaid in the 3D view.

Signature:

set_slice_planes_enabled(enabled: bool) -> None

Parameters:

ParameterTypeDescription
enabledanyTrue to show the slice planes, false to hide them.

set_axes_planes_enabled

Enables or disables the visibility of the axes planes in the 3D view. Axes planes show the three orthogonal planes at the origin of the volume coordinate system.

Signature:

set_axes_planes_enabled(enabled: bool) -> None

Parameters:

ParameterTypeDescription
enabledanyTrue to show the axes planes, false to hide them.

set_volume_shading_enabled

Enables or disables volume shading in the 3D view. When shading is enabled, the volume rendering uses lighting to enhance depth perception of the rendered volume data.

Signature:

set_volume_shading_enabled(enabled: bool) -> None

Parameters:

ParameterTypeDescription
enabledanyTrue to enable volume shading, false to disable it.

set_surface_representation

Sets the surface representation mode for all surface, volume mesh, and mask objects. Changes how the 3D mesh geometry is rendered in the 3D view for all objects.

Signature:

set_surface_representation(representation: SurfaceRepresentation) -> None

Parameters:

ParameterTypeDescription
representationanyThe representation mode to apply. Use api.SurfaceRepresentation values (e.g., api.SurfaceRepresentation.Solid, api.SurfaceRepresentation.Wireframe).

set_surface_shading

Sets the surface shading (interpolation) method for all surface, volume mesh, and mask objects. Controls the shading algorithm used to render surfaces in the 3D view.

Signature:

set_surface_shading(interpolation: SurfaceInterpolation) -> None

Parameters:

ParameterTypeDescription
interpolationanyThe interpolation method to apply. Use api.SurfaceInterpolation values (e.g., api.SurfaceInterpolation.Flat, api.SurfaceInterpolation.Phong).

set_point_colors_enabled

Enables or disables the visibility of scalar colors on all surface, volume mesh, and mask objects. When enabled, objects are rendered using their vertex color data (if available). When disabled, objects are rendered with their assigned solid color.

Signature:

set_point_colors_enabled(enabled: bool) -> None

Parameters:

ParameterTypeDescription
enabledanyTrue to show scalar (point) colors, false to use the assigned solid color.

set_standard_view

Sets the 3D view camera to a predefined standard view direction.

Signature:

set_standard_view(view: StandardView) -> None

Parameters:

ParameterTypeDescription
viewanyThe standard view direction. Use api.StandardView values (e.g., api.StandardView.XPlus, api.StandardView.ZMinus, api.StandardView.Isometric).

reset_3d_view

Resets the 3D view camera to fit all visible objects in the scene. Adjusts the camera position, focal point, and zoom so that all visible objects fit within the view.

Signature:

reset_3d_view() -> None

reset_slice_views

Resets the 2D slice view cameras to fit the image data. Restores all slice views to their default zoom and pan positions, and resets the slice positions to the middle of the volume.

Signature:

reset_slice_views() -> None

get_3d_camera_settings

Returns the current 3D camera settings, as api.CameraSettings(). The returned structure contains the full camera pose together with the derived distance, projection parameters, and current clipping range.

Signature:

get_3d_camera_settings() -> CameraSettings

Returns: CameraSettings — The current full 3D camera state as api.CameraSettings().


set_3d_camera_settings

Applies a full 3D camera state. The distance value must match the Euclidean distance between position and focalPoint. The viewUp vector must be non-zero and must not be parallel to the viewing direction. The renderer may refine the final clipping range after the settings are applied.

Signature:

set_3d_camera_settings(settings: CameraSettings) -> None

Parameters:

ParameterTypeDescription
settingsanyThe camera settings to apply. Use api.CameraSettings() to construct the settings structure.

get_3d_center_of_rotation

Returns the current 3D center of rotation.

Signature:

get_3d_center_of_rotation() -> list

Returns: list — The current world-space center of rotation [x, y, z].


set_3d_center_of_rotation

Sets the 3D center of rotation.

Signature:

set_3d_center_of_rotation(center: list) -> None

Parameters:

ParameterTypeDescription
centeranyThe world-space center of rotation [x, y, z].

reset_3d_center_of_rotation

Resets the 3D center of rotation to the center of the visible scene.

Signature:

reset_3d_center_of_rotation() -> None

set_gpu_volume_rendering_enabled

Enables or disables GPU volume rendering for the 3D view. When enabled, the graphics card is used for grayscale volume rendering, which provides better quality and performance. When disabled, the CPU is used instead.

Signature:

set_gpu_volume_rendering_enabled(enabled: bool) -> None

Parameters:

ParameterTypeDescription
enabledanyIf true, enables GPU rendering; if false, uses CPU rendering.

is_gpu_volume_rendering_enabled

Returns whether GPU volume rendering is currently enabled.

Signature:

is_gpu_volume_rendering_enabled() -> bool

Returns: bool — True if GPU volume rendering is enabled; false if CPU rendering is used.


set_gpu_memory_budget

Sets the GPU memory budget for grayscale volume rendering in the 3D view. Controls how much graphics memory the application may use for volume rendering. Lower values can reduce image quality when large datasets are displayed.

Signature:

set_gpu_memory_budget(budget: GpuMemoryBudget) -> None

Parameters:

ParameterTypeDescription
budgetanyThe memory budget to apply. Use api.GpuMemoryBudget values (e.g., api.GpuMemoryBudget.Auto, api.GpuMemoryBudget.GB4, api.GpuMemoryBudget.GB8).

get_gpu_memory_budget

Returns the current GPU memory budget setting.

Signature:

get_gpu_memory_budget() -> GpuMemoryBudget

Returns: GpuMemoryBudget — The active GPU memory budget value as api.GpuMemoryBudget.


set_volume_multi_volume_renderer

Enables or disables the multi-volume renderer for grayscale volumes in the 3D view. When enabled, overlapping grayscale volumes are blended together correctly. When disabled, each grayscale volume is rendered separately.

Signature:

set_volume_multi_volume_renderer(enabled: bool) -> None

Parameters:

ParameterTypeDescription
enabledanyIf true, enables multi-volume blending; if false, uses single-volume rendering.

is_volume_multi_volume_renderer

Returns whether the multi-volume renderer is active for grayscale volumes.

Signature:

is_volume_multi_volume_renderer() -> bool

Returns: bool — True if multi-volume rendering is enabled for grayscale volumes; false otherwise.


set_mask_direct_multi_volume_renderer

Enables or disables the multi-volume renderer for direct mask previews in the 3D view. When enabled, overlapping direct mask previews are blended together correctly. When disabled, each direct mask preview is rendered separately.

Signature:

set_mask_direct_multi_volume_renderer(enabled: bool) -> None

Parameters:

ParameterTypeDescription
enabledanyIf true, enables multi-volume blending for mask previews; if false, uses separate rendering.

is_mask_direct_multi_volume_renderer

Returns whether the multi-volume renderer is active for direct mask previews.

Signature:

is_mask_direct_multi_volume_renderer() -> bool

Returns: bool — True if multi-volume rendering is enabled for direct mask previews; false otherwise.


set_rendering_quality

Sets the interactive rendering quality for the 3D view. The quality controls how much detail is kept while the scene is being rotated, panned, or zoomed. Higher quality preserves more detail but can lower the frame rate.

Signature:

set_rendering_quality(quality: RenderingQuality) -> None

Parameters:

ParameterTypeDescription
qualityanyThe rendering quality to apply. Use api.RenderingQuality values (api.RenderingQuality.Adaptive, api.RenderingQuality.Normal, or api.RenderingQuality.Maximum).

get_rendering_quality

Returns the current interactive rendering quality of the 3D view.

Signature:

get_rendering_quality() -> RenderingQuality

Returns: RenderingQuality — The active rendering quality value as api.RenderingQuality.


set_rendering_update_rate

Sets the interactive update rate (target frames per second) for the rendering views. The update rate controls the interactive speed while the scene is being manipulated. Higher values favor smoother interaction over detail. The value must be between 1 and 100. This setting has no effect while the rendering quality is set to api.RenderingQuality.Maximum, where full detail is always used during interaction.

Signature:

set_rendering_update_rate(framesPerSecond: float) -> None

Parameters:

ParameterTypeDescription
framesPerSecondanyThe desired update rate in frames per second. Must be between 1 and 100.

get_rendering_update_rate

Returns the current interactive update rate (frames per second) of the rendering views.

Signature:

get_rendering_update_rate() -> float

Returns: float — The active update rate in frames per second.


set_depth_peeling_enabled

Enables or disables depth peeling in the 3D view. Depth peeling renders translucent geometry in the correct order. Enabling it can reduce rendering performance.

Signature:

set_depth_peeling_enabled(enabled: bool) -> None

Parameters:

ParameterTypeDescription
enabledanyTrue to enable depth peeling; false to disable it.

is_depth_peeling_enabled

Returns whether depth peeling is currently enabled in the 3D view.

Signature:

is_depth_peeling_enabled() -> bool

Returns: bool — True if depth peeling is enabled; false otherwise.


set_fxaa_enabled

Enables or disables FXAA anti-aliasing in the 3D view. FXAA smooths the edges of 3D geometry when supported by the graphics card.

Signature:

set_fxaa_enabled(enabled: bool) -> None

Parameters:

ParameterTypeDescription
enabledanyTrue to enable FXAA anti-aliasing; false to disable it.

is_fxaa_enabled

Returns whether FXAA anti-aliasing is currently enabled in the 3D view.

Signature:

is_fxaa_enabled() -> bool

Returns: bool — True if FXAA is enabled; false otherwise.


set_hidden_line_removal_enabled

Enables or disables hidden line removal in the 3D view. When enabled, only the front wireframe surface is drawn for wireframe geometry.

Signature:

set_hidden_line_removal_enabled(enabled: bool) -> None

Parameters:

ParameterTypeDescription
enabledanyTrue to enable hidden line removal; false to disable it.

is_hidden_line_removal_enabled

Returns whether hidden line removal is currently enabled in the 3D view.

Signature:

is_hidden_line_removal_enabled() -> bool

Returns: bool — True if hidden line removal is enabled; false otherwise.


set_ambient_occlusion_enabled

Enables or disables ambient occlusion shadows for improved depth perception in the 3D view. Ambient occlusion darkens crevices and contact areas to make the shape of surfaces easier to read. It is currently not applied to volume rendering.

Signature:

set_ambient_occlusion_enabled(enabled: bool) -> None

Parameters:

ParameterTypeDescription
enabledanyTrue to enable ambient occlusion; false to disable it.

is_ambient_occlusion_enabled

Returns whether ambient occlusion is currently enabled in the 3D view.

Signature:

is_ambient_occlusion_enabled() -> bool

Returns: bool — True if ambient occlusion is enabled; false otherwise.


set_floor_shadows_enabled

Enables or disables floor shadows in the 3D view. When enabled, the scene lights cast soft shadows onto opaque surfaces and an invisible floor. Shadows are cast by switched-on directional lights and spotlights whose cast-shadows option is enabled. Headlights, point lights, and volume rendering do not cast these shadows.

Signature:

set_floor_shadows_enabled(enabled: bool) -> None

Parameters:

ParameterTypeDescription
enabledanyTrue to enable floor shadows; false to disable them.

is_floor_shadows_enabled

Returns whether floor shadows are currently enabled in the 3D view.

Signature:

is_floor_shadows_enabled() -> bool

Returns: bool — True if floor shadows are enabled; false otherwise.


set_floor_shadows_quality

Sets the floor shadow quality in the 3D view. Higher quality gives sharper shadow outlines but uses more graphics memory and time.

Signature:

set_floor_shadows_quality(quality: FloorShadowsQuality) -> None

Parameters:

ParameterTypeDescription
qualityanyThe floor shadow quality to apply. Use api.FloorShadowsQuality values (api.FloorShadowsQuality.Low, api.FloorShadowsQuality.Medium, api.FloorShadowsQuality.High, or api.FloorShadowsQuality.Ultra).

get_floor_shadows_quality

Returns the current floor shadow quality in the 3D view.

Signature:

get_floor_shadows_quality() -> FloorShadowsQuality

Returns: FloorShadowsQuality — The active floor shadow quality value as api.FloorShadowsQuality.


set_floor_shadows_softness

Sets the softness (edge blur) of the floor shadows in the 3D view. A value of 0 gives hard shadow edges; higher values give softer, more diffuse shadows. The value must be between 0 and 8.

Signature:

set_floor_shadows_softness(softness: float) -> None

Parameters:

ParameterTypeDescription
softnessanyThe shadow edge softness. Must be between 0 and 8.

get_floor_shadows_softness

Returns the current floor shadow softness in the 3D view.

Signature:

get_floor_shadows_softness() -> float

Returns: float — The current shadow edge softness.


set_floor_shadows_darkness

Sets the darkness (strength) of the floor shadows in the 3D view. A value of 0 gives no shadows; a value of 1 gives the strongest shadows. The value must be between 0 and 1.

Signature:

set_floor_shadows_darkness(darkness: float) -> None

Parameters:

ParameterTypeDescription
darknessanyThe maximum shadow strength. Must be between 0 and 1.

get_floor_shadows_darkness

Returns the current floor shadow darkness in the 3D view.

Signature:

get_floor_shadows_darkness() -> float

Returns: float — The current maximum shadow strength.


set_floor_shadows_plane

Aligns the virtual shadow floor with a world plane in the 3D view.

Signature:

set_floor_shadows_plane(plane: ShadowFloorPlane) -> None

Parameters:

ParameterTypeDescription
planeanyThe floor alignment plane. Use api.ShadowFloorPlane values (api.ShadowFloorPlane.XY, api.ShadowFloorPlane.XZ, or api.ShadowFloorPlane.YZ).

get_floor_shadows_plane

Returns the world plane the virtual shadow floor is aligned with in the 3D view.

Signature:

get_floor_shadows_plane() -> ShadowFloorPlane

Returns: ShadowFloorPlane — The active floor alignment plane as api.ShadowFloorPlane.


set_back_face_coloring_enabled

Enables or disables back face coloring for surfaces in the 3D view. When enabled, the back faces of surfaces are drawn with a separate color set by set_back_face_color(), which helps distinguish inside and outside surfaces.

Signature:

set_back_face_coloring_enabled(enabled: bool) -> None

Parameters:

ParameterTypeDescription
enabledanyTrue to enable back face coloring; false to disable it.

is_back_face_coloring_enabled

Returns whether back face coloring is currently enabled in the 3D view.

Signature:

is_back_face_coloring_enabled() -> bool

Returns: bool — True if back face coloring is enabled; false otherwise.


set_back_face_color

Sets the back face color used for surfaces in the 3D view. The color is used only while back face coloring is enabled. Color components are normalized values in the range 0.0 to 1.0.

Signature:

set_back_face_color(color: list) -> None

Parameters:

ParameterTypeDescription
coloranyThe back face color as {r, g, b} in the range [0.0, 1.0].

get_back_face_color

Returns the current back face color used for surfaces in the 3D view.

Signature:

get_back_face_color() -> list

Returns: list — The back face color as {r, g, b} in the range [0.0, 1.0].


set_3d_scene_bounding_box_color

Sets the color of the scene bounding box in the 3D view. Color components are normalized values in the range 0.0 to 1.0.

Signature:

set_3d_scene_bounding_box_color(color: list) -> None

Parameters:

ParameterTypeDescription
coloranyThe scene bounding box color as {r, g, b} in the range [0.0, 1.0].

get_3d_scene_bounding_box_color

Returns the current color of the scene bounding box in the 3D view.

Signature:

get_3d_scene_bounding_box_color() -> list

Returns: list — The scene bounding box color as {r, g, b} in the range [0.0, 1.0].


set_3d_scene_axes_labels_color

Sets the color of the scene axes labels in the 3D view. Color components are normalized values in the range 0.0 to 1.0.

Signature:

set_3d_scene_axes_labels_color(color: list) -> None

Parameters:

ParameterTypeDescription
coloranyThe scene axes labels color as {r, g, b} in the range [0.0, 1.0].

get_3d_scene_axes_labels_color

Returns the current color of the scene axes labels in the 3D view.

Signature:

get_3d_scene_axes_labels_color() -> list

Returns: list — The scene axes labels color as {r, g, b} in the range [0.0, 1.0].


set_3d_ruler_type

Sets the ruler style shown in the 3D view. The ruler is available when the 3D view is in orthographic display mode. Selecting any type other than Off automatically switches the 3D view to orthographic mode.

Signature:

set_3d_ruler_type(type: RulerType) -> None

Parameters:

ParameterTypeDescription
typeanyThe ruler style to apply. Use api.RulerType values (e.g., api.RulerType.Off, api.RulerType.Thin, api.RulerType.Thick).

get_3d_ruler_type

Returns the current ruler style in the 3D view.

Signature:

get_3d_ruler_type() -> RulerType

Returns: RulerType — The active ruler type value as api.RulerType.


set_3d_ruler_color

Sets the ruler color in the 3D view.

Signature:

set_3d_ruler_color(color: RulerColor) -> None

Parameters:

ParameterTypeDescription
coloranyThe ruler color to apply. Use api.RulerColor values (e.g., api.RulerColor.White, api.RulerColor.Black, api.RulerColor.Yellow).

get_3d_ruler_color

Returns the current ruler color in the 3D view.

Signature:

get_3d_ruler_color() -> RulerColor

Returns: RulerColor — The active ruler color value as api.RulerColor.


set_3d_orientation_marker_type

Sets the orientation marker style shown in the 3D view.

Signature:

set_3d_orientation_marker_type(type: OrientationMarkerType) -> None

Parameters:

ParameterTypeDescription
typeanyThe orientation marker style to apply. Use api.OrientationMarkerType values (e.g., api.OrientationMarkerType.Off, api.OrientationMarkerType.Axes, api.OrientationMarkerType.Cube).

get_3d_orientation_marker_type

Returns the current orientation marker style in the 3D view.

Signature:

get_3d_orientation_marker_type() -> OrientationMarkerType

Returns: OrientationMarkerType — The active orientation marker type value as api.OrientationMarkerType.


set_3d_orientation_marker_size

Sets the orientation marker size in the 3D view.

Signature:

set_3d_orientation_marker_size(size: OrientationMarkerSize) -> None

Parameters:

ParameterTypeDescription
sizeanyThe orientation marker size to apply. Use api.OrientationMarkerSize values (e.g., api.OrientationMarkerSize.Small, api.OrientationMarkerSize.Medium, api.OrientationMarkerSize.Large).

get_3d_orientation_marker_size

Returns the current orientation marker size in the 3D view.

Signature:

get_3d_orientation_marker_size() -> OrientationMarkerSize

Returns: OrientationMarkerSize — The active orientation marker size value as api.OrientationMarkerSize.


set_stereo_type

Sets the stereo display mode for the 3D view.

Signature:

set_stereo_type(type: StereoType) -> None

Parameters:

ParameterTypeDescription
typeanyThe stereo mode to apply. Use api.StereoType values (e.g., api.StereoType.NoStereo, api.StereoType.RedBlue, api.StereoType.Anaglyph).

get_stereo_type

Returns the current stereo display mode of the 3D view.

Signature:

get_stereo_type() -> StereoType

Returns: StereoType — The active stereo type value as api.StereoType. Returns api.StereoType.NoStereo if stereo rendering is off.


set_orthographic_mode_enabled

Enables or disables orthographic display mode for the 3D view. In orthographic mode, the scene is projected without perspective distortion. The ruler is only available in orthographic mode.

Signature:

set_orthographic_mode_enabled(enabled: bool) -> None

Parameters:

ParameterTypeDescription
enabledanyIf true, enables orthographic mode; if false, uses perspective mode.

is_orthographic_mode_enabled

Returns whether orthographic display mode is currently active.

Signature:

is_orthographic_mode_enabled() -> bool

Returns: bool — True if the 3D view is in orthographic mode; false if in perspective mode.


set_3d_animation_mode

Sets the animation mode for the 3D view. Spin continuously rotates the scene around the vertical axis. Rock oscillates the scene back and forth. Off stops any active animation.

Signature:

set_3d_animation_mode(mode: AnimationMode3d) -> None

Parameters:

ParameterTypeDescription
modeanyThe animation mode to apply. Use api.AnimationMode3d values (e.g., api.AnimationMode3d.Off, api.AnimationMode3d.Spin, api.AnimationMode3d.Rock).

get_3d_animation_mode

Returns the current animation mode of the 3D view.

Signature:

get_3d_animation_mode() -> AnimationMode3d

Returns: AnimationMode3d — The active animation mode value as api.AnimationMode3d.


set_3d_background

Sets the background color of the 3D view to a predefined preset.

Signature:

set_3d_background(preset: Background3dPreset) -> None

Parameters:

ParameterTypeDescription
presetanyThe background preset to apply. Use api.Background3dPreset values (e.g., api.Background3dPreset.Default, api.Background3dPreset.Black, api.Background3dPreset.White).

set_3d_custom_background

Sets a custom background color or gradient for the 3D view. For Single type, only bottomColor is used. For Gradient type, bottomColor is the bottom (or start) color and topColor is the top (or end) color. The gradient direction controls the orientation of the color transition. Color components are normalized values in the range 0.0 to 1.0.

Signature:

set_3d_custom_background(type: Background3dType, bottomColor: list, topColor: list, direction: GradientDirection) -> None

Parameters:

ParameterTypeDescription
typeanyThe background type. Use api.Background3dType values (api.Background3dType.Single or api.Background3dType.Gradient).
bottomColoranyThe bottom or primary color as {r, g, b} in the range [0.0, 1.0].
topColoranyThe top or secondary color as {r, g, b} in the range [0.0, 1.0]. Ignored when type is Single.
directionanyThe gradient direction. Use api.GradientDirection values (e.g., api.GradientDirection.Vertical, api.GradientDirection.Horizontal). Ignored when type is Single.

set_3d_origin_axes_visible

Shows or hides the origin axes in the 3D view.

Signature:

set_3d_origin_axes_visible(visible: bool) -> None

Parameters:

ParameterTypeDescription
visibleanyIf true, shows the origin axes; if false, hides them.

is_3d_origin_axes_visible

Returns whether the origin axes are currently visible in the 3D view.

Signature:

is_3d_origin_axes_visible() -> bool

Returns: bool — True if the origin axes are visible; false otherwise.


set_3d_center_of_rotation_axes_visible

Shows or hides the center of rotation axes in the 3D view. The axes mark the point used as the current rotation center for 3D navigation.

Signature:

set_3d_center_of_rotation_axes_visible(visible: bool) -> None

Parameters:

ParameterTypeDescription
visibleanyIf true, shows the center of rotation axes; if false, hides them.

is_3d_center_of_rotation_axes_visible

Returns whether the center of rotation axes are currently visible in the 3D view.

Signature:

is_3d_center_of_rotation_axes_visible() -> bool

Returns: bool — True if the center of rotation axes are visible; false otherwise.


set_3d_logo_visible

Shows or hides the software logo in the 3D view.

Signature:

set_3d_logo_visible(visible: bool) -> None

Parameters:

ParameterTypeDescription
visibleanyIf true, shows the software logo; if false, hides it.

is_3d_logo_visible

Returns whether the software logo is currently visible in the 3D view.

Signature:

is_3d_logo_visible() -> bool

Returns: bool — True if the software logo is visible; false otherwise.


set_3d_color_map_bar_visible

Shows or hides the color map bar in the 3D view.

Signature:

set_3d_color_map_bar_visible(visible: bool) -> None

Parameters:

ParameterTypeDescription
visibleanyIf true, shows the color map bar; if false, hides it.

is_3d_color_map_bar_visible

Returns whether the color map bar is currently visible in the 3D view.

Signature:

is_3d_color_map_bar_visible() -> bool

Returns: bool — True if the color map bar is visible; false otherwise.


set_3d_scene_bounding_box_visible

Shows or hides the scene bounding box in the 3D view.

Signature:

set_3d_scene_bounding_box_visible(visible: bool) -> None

Parameters:

ParameterTypeDescription
visibleanyIf true, shows the scene bounding box; if false, hides it.

is_3d_scene_bounding_box_visible

Returns whether the scene bounding box is currently visible in the 3D view.

Signature:

is_3d_scene_bounding_box_visible() -> bool

Returns: bool — True if the scene bounding box is visible; false otherwise.


set_3d_scene_axes_labels_visible

Shows or hides the scene axes labels in the 3D view.

Signature:

set_3d_scene_axes_labels_visible(visible: bool) -> None

Parameters:

ParameterTypeDescription
visibleanyIf true, shows the axes labels; if false, hides them.

is_3d_scene_axes_labels_visible

Returns whether the scene axes labels are currently visible in the 3D view.

Signature:

is_3d_scene_axes_labels_visible() -> bool

Returns: bool — True if the scene axes labels are visible; false otherwise.


set_3d_fps_visible

Shows or hides the frames-per-second counter in the 3D view.

Signature:

set_3d_fps_visible(visible: bool) -> None

Parameters:

ParameterTypeDescription
visibleanyIf true, shows the FPS counter; if false, hides it.

is_3d_fps_visible

Returns whether the frames-per-second counter is currently visible in the 3D view.

Signature:

is_3d_fps_visible() -> bool

Returns: bool — True if the FPS counter is visible; false otherwise.


set_2d_ruler_type

Sets the ruler style shown in the 2D slice views. This setting applies to all three slice views simultaneously.

Signature:

set_2d_ruler_type(type: RulerType) -> None

Parameters:

ParameterTypeDescription
typeanyThe ruler style to apply. Use api.RulerType values (e.g., api.RulerType.Off, api.RulerType.Thin, api.RulerType.Thick).

get_2d_ruler_type

Returns the current ruler style in the 2D slice views.

Signature:

get_2d_ruler_type() -> RulerType

Returns: RulerType — The active ruler type value as api.RulerType.


set_2d_ruler_color

Sets the ruler color in the 2D slice views. This setting applies to all three slice views simultaneously.

Signature:

set_2d_ruler_color(color: RulerColor) -> None

Parameters:

ParameterTypeDescription
coloranyThe ruler color to apply. Use api.RulerColor values (e.g., api.RulerColor.White, api.RulerColor.Black, api.RulerColor.Yellow).

get_2d_ruler_color

Returns the current ruler color in the 2D slice views.

Signature:

get_2d_ruler_color() -> RulerColor

Returns: RulerColor — The active ruler color value as api.RulerColor.


set_2d_orientation_marker_type

Sets the orientation marker style shown in the 2D slice views. This setting applies to all three slice views simultaneously.

Signature:

set_2d_orientation_marker_type(type: OrientationMarkerType) -> None

Parameters:

ParameterTypeDescription
typeanyThe orientation marker style to apply. Use api.OrientationMarkerType values (e.g., api.OrientationMarkerType.Off, api.OrientationMarkerType.Axes, api.OrientationMarkerType.Cube).

get_2d_orientation_marker_type

Returns the current orientation marker style in the 2D slice views.

Signature:

get_2d_orientation_marker_type() -> OrientationMarkerType

Returns: OrientationMarkerType — The active orientation marker type value as api.OrientationMarkerType.


set_2d_orientation_marker_size

Sets the orientation marker size in the 2D slice views. This setting applies to all three slice views simultaneously.

Signature:

set_2d_orientation_marker_size(size: OrientationMarkerSize) -> None

Parameters:

ParameterTypeDescription
sizeanyThe orientation marker size to apply. Use api.OrientationMarkerSize values (e.g., api.OrientationMarkerSize.Small, api.OrientationMarkerSize.Medium, api.OrientationMarkerSize.Large).

get_2d_orientation_marker_size

Returns the current orientation marker size in the 2D slice views.

Signature:

get_2d_orientation_marker_size() -> OrientationMarkerSize

Returns: OrientationMarkerSize — The active orientation marker size value as api.OrientationMarkerSize.


set_2d_interpolation_mode

Sets the slice image interpolation mode for the 2D slice views. This setting applies to all three slice views simultaneously.

Signature:

set_2d_interpolation_mode(mode: Interpolation2d) -> None

Parameters:

ParameterTypeDescription
modeanyThe interpolation mode to apply. Use api.Interpolation2d values (e.g., api.Interpolation2d.Nearest, api.Interpolation2d.Linear, api.Interpolation2d.Cubic).

get_2d_interpolation_mode

Returns the current slice image interpolation mode of the 2D slice views.

Signature:

get_2d_interpolation_mode() -> Interpolation2d

Returns: Interpolation2d — The active interpolation mode value as api.Interpolation2d.


set_2d_annotations_visible

Shows or hides the corner annotations in the 2D slice views. This setting applies to all three slice views simultaneously.

Signature:

set_2d_annotations_visible(visible: bool) -> None

Parameters:

ParameterTypeDescription
visibleanyIf true, shows the annotations; if false, hides them.

is_2d_annotations_visible

Returns whether the corner annotations are currently visible in the 2D slice views.

Signature:

is_2d_annotations_visible() -> bool

Returns: bool — True if the annotations are visible; false otherwise.


set_2d_orientation_labels_visible

Shows or hides the edge-center orientation labels in the 2D slice views. When enabled, each slice view displays axis direction labels at the midpoint of its four viewport edges. Medical orientations use anatomical shorthand (R/L/A/P/S/I), while engineering orientations use signed axis labels (+X/-X, +Y/-Y, +Z/-Z). This setting applies to all three slice views simultaneously.

Signature:

set_2d_orientation_labels_visible(visible: bool) -> None

Parameters:

ParameterTypeDescription
visibleanyIf true, shows the orientation labels; if false, hides them.

is_2d_orientation_labels_visible

Returns whether the edge-center orientation labels are currently visible in the 2D slice views.

Signature:

is_2d_orientation_labels_visible() -> bool

Returns: bool — True if the orientation labels are visible; false otherwise.


set_2d_color_map_bar_visible

Shows or hides the color map bar in the 2D slice views. This setting applies to all three slice views simultaneously.

Signature:

set_2d_color_map_bar_visible(visible: bool) -> None

Parameters:

ParameterTypeDescription
visibleanyIf true, shows the color map bar; if false, hides it.

is_2d_color_map_bar_visible

Returns whether the color map bar is currently visible in the 2D slice views.

Signature:

is_2d_color_map_bar_visible() -> bool

Returns: bool — True if the color map bar is visible; false otherwise.


set_2d_background

Sets the background color of a specific 2D slice view to a predefined preset.

Signature:

set_2d_background(view: SliceViewIndex, preset: Background2dPreset) -> None

Parameters:

ParameterTypeDescription
viewanyThe slice view to change. Use api.SliceViewIndex values (e.g., api.SliceViewIndex.SliceView1_YZ, api.SliceViewIndex.SliceView2_XZ, api.SliceViewIndex.SliceView3_XY).
presetanyThe background preset to apply. Use api.Background2dPreset values (e.g., api.Background2dPreset.DarkGray, api.Background2dPreset.Black, api.Background2dPreset.White).

UI

set_voxel_information_display_mode

Sets how voxel information is displayed in the 2D slice views. The available modes match the Voxel Information menu in the View ribbon and the 2D right-click menu. Use api.VoxelInformationDisplayMode values (api.VoxelInformationDisplayMode.Off, api.VoxelInformationDisplayMode.StatusBar, api.VoxelInformationDisplayMode.MouseHover, or api.VoxelInformationDisplayMode.Both).

Signature:

set_voxel_information_display_mode(mode: VoxelInformationDisplayMode) -> None

Parameters:

ParameterTypeDescription
modeanyThe voxel information display mode to apply.

get_voxel_information_display_mode

Returns the current voxel information display mode in the 2D slice views.

Signature:

get_voxel_information_display_mode() -> VoxelInformationDisplayMode

Returns: VoxelInformationDisplayMode — The active voxel information display mode.


Creation

generate_mask_3d_preview

Generates 3D preview of the visible masks in the 3D view. The 3D preview creates a surface mesh representation of the mask data for visualization in the 3D view.

Signature:

generate_mask_3d_preview() -> None

generate_mask_3d_preview_with_quality

Sets the mask preview quality level and regenerates the 3D preview of the visible masks. Lower quality settings use downsampled mask data, which renders faster but may exhibit reduced geometric accuracy.

Signature:

generate_mask_3d_preview_with_quality(quality: Mask3dPreviewQuality) -> None

Parameters:

ParameterTypeDescription
qualityanyThe quality level for the mask preview. Use api.Mask3dPreviewQuality values (api.Mask3dPreviewQuality.Optimal, api.Mask3dPreviewQuality.High, api.Mask3dPreviewQuality.Medium, or api.Mask3dPreviewQuality.Low).

General

remove_all_mask_previews

Removes all 3D mask previews from the 3D view. After removal, the 3D preview of visible masks will need to be regenerated.

Signature:

remove_all_mask_previews() -> None

center_3d_view

Centers the 3D view on the scene by resetting the focal point. Moves the camera focal point to the center of the visible scene without changing the zoom level.

Signature:

center_3d_view() -> None

render_3d_view

Schedules a render of the 3D view.

Signature:

render_3d_view() -> None

render_2d_view1

Schedules a render of 2D view 1. 2D view 1 corresponds to Plane 1 (YZ).

Signature:

render_2d_view1() -> None

render_2d_view2

Schedules a render of 2D view 2. 2D view 2 corresponds to Plane 2 (XZ).

Signature:

render_2d_view2() -> None

render_2d_view3

Schedules a render of 2D view 3. 2D view 3 corresponds to Plane 3 (XY).

Signature:

render_2d_view3() -> None

render_all_views

Schedules a render of all 2D and 3D views.

Signature:

render_all_views() -> None

yaw_3d_camera

Applies an incremental yaw rotation to the 3D camera. Positive values rotate the camera to the left around the current focal point. Negative values rotate the camera to the right.

Signature:

yaw_3d_camera(deltaDegrees: float) -> None

Parameters:

ParameterTypeDescription
deltaDegreesanySigned yaw angle in degrees.

pitch_3d_camera

Applies an incremental pitch rotation to the 3D camera. Positive values pitch the camera upward around the current focal point. Negative values pitch the camera downward.

Signature:

pitch_3d_camera(deltaDegrees: float) -> None

Parameters:

ParameterTypeDescription
deltaDegreesanySigned pitch angle in degrees.

roll_3d_camera

Applies an incremental roll rotation to the 3D camera. Positive values roll the camera to the right when looking along the current view direction. Negative values roll the camera to the left.

Signature:

roll_3d_camera(deltaDegrees: float) -> None

Parameters:

ParameterTypeDescription
deltaDegreesanySigned roll angle in degrees.

dolly_3d_camera

Applies an incremental dolly to the 3D camera. A factor greater than 1.0 moves the camera closer to the focal point. A factor between 0.0 and 1.0 moves it farther away.

Signature:

dolly_3d_camera(factor: float) -> None

Parameters:

ParameterTypeDescription
factoranyDolly factor. Must be greater than zero.

pan_3d_camera

Pans the 3D camera along its local right and up directions. This translates the camera position, focal point, and center of rotation together. The offsets are expressed in world units along the camera's local axes.

Signature:

pan_3d_camera(rightOffset: float, upOffset: float) -> None

Parameters:

ParameterTypeDescription
rightOffsetanySigned offset along the camera's local right direction.
upOffsetanySigned offset along the camera's local up direction.

flip_2d_view

Flips the display of a specific 2D slice view.

Signature:

flip_2d_view(view: SliceViewIndex, flip: FlipType) -> None

Parameters:

ParameterTypeDescription
viewanyThe slice view to flip. Use api.SliceViewIndex values (e.g., api.SliceViewIndex.SliceView1_YZ, api.SliceViewIndex.SliceView2_XZ, api.SliceViewIndex.SliceView3_XY).
flipanyThe flip direction. Use api.FlipType values (e.g., api.FlipType.Horizontal, api.FlipType.Vertical, api.FlipType.Both).

center_2d_view

Centers a specific 2D slice view to fit the current image.

Signature:

center_2d_view(view: SliceViewIndex) -> None

Parameters:

ParameterTypeDescription
viewanyThe slice view to center. Use api.SliceViewIndex values (e.g., api.SliceViewIndex.SliceView1_YZ, api.SliceViewIndex.SliceView2_XZ, api.SliceViewIndex.SliceView3_XY).

zoom_in_2d_view

Increases the magnification of a specific 2D slice view.

Signature:

zoom_in_2d_view(view: SliceViewIndex) -> None

Parameters:

ParameterTypeDescription
viewanyThe slice view to zoom in. Use api.SliceViewIndex values (e.g., api.SliceViewIndex.SliceView1_YZ, api.SliceViewIndex.SliceView2_XZ, api.SliceViewIndex.SliceView3_XY).

zoom_out_2d_view

Decreases the magnification of a specific 2D slice view.

Signature:

zoom_out_2d_view(view: SliceViewIndex) -> None

Parameters:

ParameterTypeDescription
viewanyThe slice view to zoom out. Use api.SliceViewIndex values (e.g., api.SliceViewIndex.SliceView1_YZ, api.SliceViewIndex.SliceView2_XZ, api.SliceViewIndex.SliceView3_XY).

Modification

set_ambient_occlusion_scale_factor

Sets the scale factor that controls the size of ambient occlusion shadows. A value of 0 enables automatic mode, where the scale factor is chosen automatically based on the sizes of the scene objects. Non-zero values set the scale manually. The value must be between -3 and 3.

Signature:

set_ambient_occlusion_scale_factor(scaleFactor: float) -> None

Parameters:

ParameterTypeDescription
scaleFactoranyThe ambient occlusion scale factor. Must be between -3 and 3. 0 enables automatic mode.

get_ambient_occlusion_scale_factor

Returns the current ambient occlusion scale factor. Returns 0 when automatic mode is active.

Signature:

get_ambient_occlusion_scale_factor() -> float

Returns: float — The current ambient occlusion scale factor.


set_3d_origin_axes_scale

Sets the size of the origin axes in the 3D view, as a percentage. The percentage scales the origin axes relative to the scene size. The value must be between 1 and 100.

Signature:

set_3d_origin_axes_scale(percentage: float) -> None

Parameters:

ParameterTypeDescription
percentageanyThe origin axes size as a percentage. Must be between 1 and 100.

get_3d_origin_axes_scale

Returns the current size of the origin axes in the 3D view, as a percentage.

Signature:

get_3d_origin_axes_scale() -> float

Returns: float — The origin axes size as a percentage in the range [1, 100].


set_3d_crosshair_axes_scale

Sets the size of the crosshair axes in the 3D view, as a percentage. The percentage scales the crosshair axes relative to the scene size. The value must be between 1 and 100.

Signature:

set_3d_crosshair_axes_scale(percentage: float) -> None

Parameters:

ParameterTypeDescription
percentageanyThe crosshair axes size as a percentage. Must be between 1 and 100.

get_3d_crosshair_axes_scale

Returns the current size of the crosshair axes in the 3D view, as a percentage.

Signature:

get_3d_crosshair_axes_scale() -> float

Returns: float — The crosshair axes size as a percentage in the range [1, 100].


set_3d_scale_ruler_visible

Shows or hides the scene scale ruler in the 3D view.

Signature:

set_3d_scale_ruler_visible(visible: bool) -> None

Parameters:

ParameterTypeDescription
visibleanyIf true, shows the scale ruler; if false, hides it.

is_3d_scale_ruler_visible

Returns whether the scene scale ruler is currently visible in the 3D view.

Signature:

is_3d_scale_ruler_visible() -> bool

Returns: bool — True if the scale ruler is visible; false otherwise.


set_2d_scale_ruler_visible

Shows or hides the scene scale ruler in the 2D slice views. This setting applies to all three slice views simultaneously.

Signature:

set_2d_scale_ruler_visible(visible: bool) -> None

Parameters:

ParameterTypeDescription
visibleanyIf true, shows the scale ruler; if false, hides it.

is_2d_scale_ruler_visible

Returns whether the scene scale ruler is currently visible in the 2D slice views.

Signature:

is_2d_scale_ruler_visible() -> bool

Returns: bool — True if the scale ruler is visible; false otherwise.


See Also