PRISMRenderingLogic Module

PRISMRenderingLogic Class

class PRISMRenderingLogic

Bases: sphinx.ext.autodoc.importer._MockObject

addObservers()

Create all observers needed in the UI to ensure a correct behaviour.

createEndPoints()

Create endpoints.

deleteNodes()

Deletes the nodes in the scene.

enableOption(paramName, type_, checkBox, CSName)

Function to add or remove parameters according to the value of the boolean.

Parameters:
  • paramName (str) – Name of the parameter.
  • type (str.) – Type of the parameter.
  • checkBox (QCheckbox) – Checkbox to enable or disable the option.
  • CSName (str) – Name of the current custom shader.
getEntry()

Get Entry point position. If not yet placed, return (0,0,0).

Returns:Entry markups position if placed, empty array if not.
Return type:Array[double]
getTarget()

Get Target point position. If not yet placed, return (0,0,0).

Returns:Entry markups position if placed, empty array if not.
Return type:Array[double]
onCloseScene(caller, event)

Function called when the scene is closed. Delete nodes in the scene.

onCustomShaderParamChanged(value, paramName, type_)

Change the custom parameters in the shader.

Parameters:
  • value (str) – Value to be changed
  • paramName (Int) – Name of the parameter to be changed
  • type – (float or int), type of the parameter to be changed
onEndPointAdded(caller, event)

Callback function to get the position of the new point.

Parameters:
  • caller – Slicer.mrmlScene, Slicer active scene.
  • event (str) – Flag corresponding to the triggered event.
onEndPointsChanged(caller, event, call_data)

Callback function to get the position of the modified point. Note: Vtk.calldata_type(vtk.VTK_OBJECT) function get calling instance as a vtkMRMLNode to be accesed in the function.

Parameters:
  • caller (SlicermrmlScene.) – Slicer active scene.
  • event (str) – Flag corresponding to the triggered event.
  • call_data – VtkMRMLNode, Node added to the scene.
renderVolume(volumeNode, multipleVolumes=False)

Use Slicer Volume Rendering module to initialize and setup rendering of the given volume node.

Parameters:
  • volumeNode (VtkMRMLVolumeNode) – Volume node to be rendered.
  • multipleVolumes (Bool) – If the rendered volume is a secondary volume.
setCustomShaderType(shaderTypeName, volumeNode)

Set given shader type as current active shader.

Parameters:
  • shaderTypeName (str) – Name corresponding to the type of rendering needed.
  • volumeNode (vtkMRMLScalarVolumeNode) – Current volume.
setEntry(entry)

Set Entry point position.

Parameters:entry (Arraydouble]) – Entry markups position.
setPlacingMarkups(paramType, paramName, btn, interaction=1, persistence=0)

Activate Slicer markups module to set one or multiple markups in the given markups fiducial list.

Parameters:
  • paramType – Type of the parameter.
  • paramName (str) – Name of the parameter.
  • btn (QObject) – Button pushed to place the markup.
  • interaction (Int0: /, 1: Place, 2: View transform, 3: / ,4: Select) –
  • persistence (Int0: Unique, 1: Peristent) –
setTarget(target)

Set Target point position.

Parameters:
  • target – Entry markups position.
  • target – Array[double].
setupCustomShader(volumeNode=None)

Get or create shader property node and initialize custom shader.

Parameters:volumeNode (vtkMRMLScalarVolumeNode) – Current volume.
updateVolumeColorMapping(volumeNode, displayNode, volumePropertyNode=None)
Given a volume, compute a default color mapping to render volume in the given display node.
If a volume property node is given to the function, uses it as color mapping.
Parameters:
  • volumeNode (vtkMRMLVolumeNode) – Volume node to be rendered.
  • displayNode (vtkMRMLVolumeRenderingDisplayNode) – Default rendering display node. (CPU RayCast, GPU RayCast, Multi-Volume)
  • volumePropertyNode (VtkMRMLVolumePropertyNode) – Volume propery node that carries the color mapping wanted.