SoView2DScene¶
-
InventorModule
¶ genre View2DExtended
author MeVis Medical Solutions AG
package MeVisLab/Standard
dll SoView2DScene
definition SoView2DScene.def see also SoView2D
inherits from SoView2DExtension
keywords slice
,3D
,visualization
Purpose¶
The module SoView2DScene
renders an Open Inventor scene graph into 2D slices.
Only the part of the scene that fits into the current slice or slab is displayed.
Details¶
The scene graph rendered by this module is transformed from world space into voxel space and clipped against the top and bottom slice. Since the scene is rendered with OpenGL directly into the slice it is displayed with pixel accuracy, which is often more accurate than a rasterized voxel representation.
This module is very useful in combination with the SoGVRVolumeRenderer
, since it allows to render a GVR slab rendering onto any SoView2D
coordinate system. Have a look at the SoGVRSlabHint
example network for an example usage.
Parameter Fields¶
Field Index¶
alt : Enum |
Drawing On : Bool |
Send Events To Scene : Bool |
button1 : Enum |
editingOn : Bool |
setEventHandled : Bool |
button2 : Enum |
fixZOn : Bool |
shift : Enum |
button3 : Enum |
ignoreHandledEvents : Bool |
Slab Mode : Enum |
clipToSlice : Bool |
interactionProviderID : String |
Slab Size : Float |
Color : Color |
Lighting Model : Enum |
wantsAllEvents : Bool |
control : Enum |
maskValid : Bool |
wantsKeyEvents : Bool |
createNewMode : Bool |
needsValidVoxel : Bool |
wantsMouseWheelEvents : Bool |
createNewModeRequest : Trigger |
renderOnSlab : Bool |
|
cursorShape : Enum |
selectionTolerance : Float |
Visible Fields¶
Drawing On¶
-
name:
drawingOn
, type:
Bool
, default:
TRUE
¶ If checked, the module renders geometry onto the current slice.
see also SoView2DExtension.drawingOn
Color¶
-
name:
color
, type:
Color
, default:
1 1 1
¶ Sets a default diffuse color of the rendered scene. This color may be overwritten by any color node such as
SoBaseColor
orSoMaterial
.
see also SoView2DExtension.color
Send Events To Scene¶
-
name:
sendEventsToScene
, type:
Bool
, default:
FALSE
¶ If enabled, mouse events are forwarded to the 3D scene.
If you do not want to pass all mouse events to the scene, you can set the
button1
,button2
,button3
,shift
,control
, andalt
mask to something different than IGNORED, and also can unsetwantsAllEvents
.You can also set the
wantsKeyEvents
andwantsMouseWheelEvents
to forward these event types to the scene.
Slab Size¶
Slab Mode¶
-
name:
slabMode
, type:
Enum
, default:
USE_VIEW2D_SLAB_SIZE
¶ Defines the slab mode.
Pseudo code the shows the slab calculation (using Python syntax, note that the end position is +1 because of range() at the bottom):
mode = ctx.field("SoView2DScene.slabMode").value slabSize = ctx.field("SoView2DScene.slabSize").value startSlice = ctx.field("SoView2D.startSlice").value voxelSizeZ = ctx.field("SoView2D.image").voxelSizeZ() if mode == "SLAB_SIZE_IN_SLICES": slabSize = int(slabSize) start = startSlice - (slabSize-1)//2 end = startSlice + 1 + slabSize//2 elif mode == "USE_VIEW2D_SLAB_SIZE": slabSize = int(ctx.field("SoView2D.slab").value) start = startSlice - (slabSize-1)//2 end = startSlice + 1 + slabSize//2 elif mode == "SLAB_SIZE_IN_SLICES_NEGATIVE_FIRST": slabSize = int(slabSize) start = startSlice - slabSize//2 end = startSlice + 1 + (slabSize-1)//2 elif mode == "SLAB_SIZE_IN_SLICES_FORWARD": slabSize = int(slabSize) start = startSlice end = startSlice + slabSize elif mode == "SLAB_SIZE_IN_MM_FORWARD": slabSize = math.floor(slabSize/voxelSizeZ + 0.5) if slabSize < 1: slabSize = 1 start = int(startSlice) end = int(math.ceil(startSlice + slabSize)) elif mode == "SLAB_SIZE_IN_MM": slabSize = slabSize/voxelSizeZ if slabSize < 1: slabSize = 1 start = int(math.ceil(startSlice - slabSize/2.)) end = int(math.floor(startSlice + 1 + slabSize/2.)) # clip to dataset if start<0: start = 0 maxSlice = int(ctx.field("SoView2D.maxSlice").value); if end>maxSlice+1: end = maxSlice+1 # return the expected range return range(start, end)
Values:
Title | Name | Description |
---|---|---|
Use View2d Slab Size | USE_VIEW2D_SLAB_SIZE | Uses the slab parameter of the attached SoView2D as number of slab slices and renders as in SLAB_SIZE_IN_SLICES. |
Slab Size In Mm | SLAB_SIZE_IN_MM | Uses the Slab Size parameters as millimeters using the z voxel size of the SoView2D image. The slab is centered exactly to the SoView2D.startSlice center and is clamped to contain at least one slice. |
Slab Size In Mm Forward | SLAB_SIZE_IN_MM_FORWARD | Uses the Slab Size parameters as millimeters using the z voxel size of the SoView2D image. The slab starts at SoView2D.startSlice, going in positive z direction and is clamped to contain at least one slice. |
Slab Size In Slices | SLAB_SIZE_IN_SLICES | Uses the Slab Size parameter as number of slab slices and renders the slab slices around the current slice, preferring the positive z direction. |
Slab Size In Slices Negative First | SLAB_SIZE_IN_SLICES_NEGATIVE_FIRST | Uses the Slab Size parameter as number of slab slices and renders the slab slices around the current slice, preferring the negative z direction. |
Slab Size In Slices Forward | SLAB_SIZE_IN_SLICES_FORWARD | Uses the Slab Size parameter as number of slab slices and renders the slab slices starting at the current slice, going in positive z direction. |
Slab Size Unlimited | SLAB_SIZE_UNLIMITED | Does not set any clipping planes and thus renders all geometry that is visible. Note: this is not supported by the |