PRISMRendering Module

class PRISMRendering(parent)

Bases: sphinx.ext.autodoc.importer._MockObject

class PRISMRenderingWidget(*args, **kwargs)

Bases: sphinx.ext.autodoc.importer._MockObject

UpdateShaderParametersUI()

Updates the shader parameters on the UI.

addGUIObservers()

Function to add observers to the GUI’s widgets.

addParamButtonClicked()

Function to get the current parameters and add them into a dictionnary.

addParamButtonState()

Function to enable or disable the button to change the parametters.

addTransferFunctions(parameters, paramNames, volumeID)

Function to add transfer function widgets to the ui.

Parameters:
  • parameters (str) – Dictionnary of transfert functions.
  • paramNames (dictstr]) – Name of the transfert functions.
  • volumeID (int) – ID of the volume.
appendList(widget, name)

Function to add a widget to self.widgets without duplicate.

Parameters:
  • widget (QObject) – Widget to be added to the list.
  • name (str) – Name of the widget.
cleanup()

Function to clean up the scene.

createParametersLayout()

Function to create the parameters layout to enable adding new parameters to a file.

createTransferFunctionWidget(volumePropertyNode, params, p, secondTf, volumeID)

Function to create a transfert fuction widget.

Parameters:
  • volumePropertyNode (vtkMRMLVolumePropertyNode) – Volume property node to be associated to the widget.
  • params – Parameters of the widget.
  • p (str's name.) – Parameter
  • secondTf (bool) – If the widget is one of the secondary volumes.
  • volumeID – ID of the volume.
duplicateFile(old_file_name, new_file_name)

Function to create a new class from the template.

Parameters:
  • old_file_name (str) – Name of the file that is being duplicated.
  • new_file_name (str) – Name of the file that is being created.
Returns:

Duplicated file’s path.

Return type:

str

getClassName(widget)

Function to get the class name of a widget.

Parameters:widget (QObject) – Wanted widget.
Returns:widget’s class name.
Return type:str
getPath(name, packageName='PRISMRenderingShaders')

Function to get a selected shader file path.

Parameters:
  • name (str) – Name of the shader.
  • packageName (str) – Name of the package in which the class in contained, defaults to ‘PRISMRenderingShaders’.
Returns:

Selected shader’s path. :rtype: str

getText()

Function to create a window with input to get the file name.

Returns:File name.
Return type:str
getWidgetPosition(layout, widgetName)

Function to get the widget’s position in a layout.

Parameters:
  • layout (QObject) – Layout in which the widget is containted.
  • widgetName (str) – Name of the widget being searched.
Returns:

Position of the widget.

Return type:

int.

hideLayout(layout)

Function to clear the widgets of a specific layout.

Parameters:layout (qLayout) – Layout to clear.
initState()

Function to initialize the all user interface based on current scene.

modifyDict(shader, dictType, value)

Function to modify the specified dictionnary in the specified shader.

Parameters:
  • shader (strin) – Name of the shader to be modified.
  • dictType (string) – Name of the dictionnary to be modified.
  • value (dict) – Dictionnary to be added.
onAddParamComboIndexChanged(i)

Sets the current parameter type according to the combobox input.

Parameters:i (int) – Index of the current input.
onAddPointsComboChanged()

Function to hide/show the points related widgets.

onAddTFComboChanged()

Function to hide/show the transfer functions related widgets.

onAddTypeComboChanged()

Function to hide/show the transfer functions widgets.

onCustomShaderComboIndexChanged(i)

Callback function when the custom shader combo box is changed.

Parameters:i (int) – Index of the element.
onDisplayControlsCheckBoxToggled(caller=None, event=None)
Callback function triggered when the display controls check box is toggled.
Show/hide in the VR view scene the controls at the location of the Windows Mixed Reality controllers.
Parameters:
  • caller – Caller of the function.
  • event – Event that triggered the function.
onDisplayROICheckBoxToggled(caller=None, event=None)

Function to display ROI box and show/hide scaling and rotation parameters.

Parameters:
  • caller – Caller of the function.
  • event – Event that triggered the function.
onDuplicateCustomShaderButtonClicked()

Function to duplicate custom shader file.

onEditSourceButtonClicked()

Function to create a new file with the custom shader and open the file in editor.

onEnableROICheckBoxToggled(caller=None, event=None)

Function to enable ROI cropping and show/hide ROI Display properties.

Parameters:
  • caller – Caller of the function.
  • event – Event that triggered the function.
onEnableRotationCheckBoxToggled(caller=None, event=None)

Function to enable rotating ROI box.

Parameters:
  • caller – Caller of the function.
  • event – Event that triggered the function.
onEnableScalingCheckBoxToggled(caller=None, event=None)

Function to enable scaling ROI box.

Parameters:
  • caller – Caller of the function.
  • event – Event that triggered the function.
onImageSelectorChanged(node, widget, index=0)

Callback function when the volume node has been changed in the dedicated combobox. Setup slice nodes to display selected node and render it in the 3d view.

Parameters:
  • node (vtkMRMLVolumeNode) – Volume node selected in the scene.
  • widget (QObject) – Widget modified.
  • index (int) – Index of the widget being modified.
onModify()

Function to activate or deactivate the button to modify a custom shader.

onModifyCustomShaderButtonClicked(caller=None, event=None)

Function to add the new shader replacement to a file.

Parameters:
  • caller – Caller of the function.
  • event – Event that triggered the function.
onModifyCustomShaderComboIndexChanged(value)

Function to set which shader will be modified.

Parameters:value (list) – Current value of the comboBox.
onNewCustomShaderButtonClicked()

Function to create a new file with the associated class.

Returns:Success at creating the file.
Return type:bool.
onOpenCustomShaderButtonClicked(caller=None, event=None)

Function to open custom shader file.

Parameters:
  • caller – Caller of the function.
  • event – Event that triggered the function.
onParameterNodeModified(caller, event)

Function to update the parameter node.

Parameters:
  • caller – Caller of the function.
  • event – Event that triggered the function.
onReload()

Reload the modules.

onReloadCurrentCustomShaderButtonClicked(caller=None, event=None)

Function to reload the current custom shader.

Parameters:
  • caller – Caller of the function.
  • event – Event that triggered the function.
onSelect()

Function to activate or deactivate the button to create a custom shader.

onShaderOpenFileButtonClicked(caller=None, event=None)

Function to open a file containing the new shader replacement.

Parameters:
  • caller – Caller of the function.
  • event – Event that triggered the function.
onShaderTagsComboIndexChanged(value)

Function to set which shader tag will be added to the shader.

Parameters:value (list) – Current value of the comboBox.
onShaderTagsTypeComboIndexChanged(value)

Function to set which shader tag type will be added to the shader.

Parameters:value (list) – Current value of the comboBox.
onToolCustomShaderButton()
onVolumeRenderingCheckBoxToggled(caller=None, event=None)

Callback function when the volume rendering check box is toggled. Activate or deactivate the rendering of the selected volume.

Parameters:
  • caller – Caller of the function.
  • event – Event that triggered the function.
pointModified(caller, event, index)
prismPath()

Function to get the module’s path.

Returns:Module’s path.
Return type:str
removeGUIObservers()

Function to remove observers from the GUI’s widgets.

resetLayout(layout)

Function to reset a specific layout.

Parameters:layout (qLayout) – Layout to reset.
resetROI()

Function to reset the ROI in the scene.

setAndObserveParameterNode(caller=None, event=None)

Function to set the parameter node.

setup()

Function to setup the class.

setup_file(file_, className, displayName)

Function to modify the new class with regex to match the given infos.

Parameters:
  • file – str, Path of the file being modified.
  • className (str) – Name of the class being modified.
  • displayName (str) – Display name of the class being modified.
showLayout(layout)

Function to show specific widgets of a layout.

Parameters:layout (qLayout) – Layout to reset.
updateComboBox(tab, comboBox, func)

Function to populate a combobox from an array.

Parameters:
  • tab (list) – List to populate the combobox.
  • comboBox (QComboBox) – ComboBox to be modified.
  • func (func) – Connect function when the ComboBox index is changed
updateGUIFromParameterNode(caller=None, event=None)

Function to update GUI from parameter node values

Parameters:
  • caller – Caller of the function.
  • event – Event that triggered the function.
updateParameterNodeFromGUI(value, w)

Function to update the parameter node from gui values.

Parameters:
  • value (float) – Value of the widget.
  • w (QObject) – Widget being modified.

PRISMRendering Class

class PRISMRendering(parent)

Bases: sphinx.ext.autodoc.importer._MockObject

PRISMRenderingWidget Class

class PRISMRenderingWidget(*args, **kwargs)

Bases: sphinx.ext.autodoc.importer._MockObject

UpdateShaderParametersUI()

Updates the shader parameters on the UI.

addGUIObservers()

Function to add observers to the GUI’s widgets.

addParamButtonClicked()

Function to get the current parameters and add them into a dictionnary.

addParamButtonState()

Function to enable or disable the button to change the parametters.

addTransferFunctions(parameters, paramNames, volumeID)

Function to add transfer function widgets to the ui.

Parameters:
  • parameters (str) – Dictionnary of transfert functions.
  • paramNames (dictstr]) – Name of the transfert functions.
  • volumeID (int) – ID of the volume.
appendList(widget, name)

Function to add a widget to self.widgets without duplicate.

Parameters:
  • widget (QObject) – Widget to be added to the list.
  • name (str) – Name of the widget.
cleanup()

Function to clean up the scene.

createParametersLayout()

Function to create the parameters layout to enable adding new parameters to a file.

createTransferFunctionWidget(volumePropertyNode, params, p, secondTf, volumeID)

Function to create a transfert fuction widget.

Parameters:
  • volumePropertyNode (vtkMRMLVolumePropertyNode) – Volume property node to be associated to the widget.
  • params – Parameters of the widget.
  • p (str's name.) – Parameter
  • secondTf (bool) – If the widget is one of the secondary volumes.
  • volumeID – ID of the volume.
duplicateFile(old_file_name, new_file_name)

Function to create a new class from the template.

Parameters:
  • old_file_name (str) – Name of the file that is being duplicated.
  • new_file_name (str) – Name of the file that is being created.
Returns:

Duplicated file’s path.

Return type:

str

getClassName(widget)

Function to get the class name of a widget.

Parameters:widget (QObject) – Wanted widget.
Returns:widget’s class name.
Return type:str
getPath(name, packageName='PRISMRenderingShaders')

Function to get a selected shader file path.

Parameters:
  • name (str) – Name of the shader.
  • packageName (str) – Name of the package in which the class in contained, defaults to ‘PRISMRenderingShaders’.
Returns:

Selected shader’s path. :rtype: str

getText()

Function to create a window with input to get the file name.

Returns:File name.
Return type:str
getWidgetPosition(layout, widgetName)

Function to get the widget’s position in a layout.

Parameters:
  • layout (QObject) – Layout in which the widget is containted.
  • widgetName (str) – Name of the widget being searched.
Returns:

Position of the widget.

Return type:

int.

hideLayout(layout)

Function to clear the widgets of a specific layout.

Parameters:layout (qLayout) – Layout to clear.
initState()

Function to initialize the all user interface based on current scene.

modifyDict(shader, dictType, value)

Function to modify the specified dictionnary in the specified shader.

Parameters:
  • shader (strin) – Name of the shader to be modified.
  • dictType (string) – Name of the dictionnary to be modified.
  • value (dict) – Dictionnary to be added.
onAddParamComboIndexChanged(i)

Sets the current parameter type according to the combobox input.

Parameters:i (int) – Index of the current input.
onAddPointsComboChanged()

Function to hide/show the points related widgets.

onAddTFComboChanged()

Function to hide/show the transfer functions related widgets.

onAddTypeComboChanged()

Function to hide/show the transfer functions widgets.

onCustomShaderComboIndexChanged(i)

Callback function when the custom shader combo box is changed.

Parameters:i (int) – Index of the element.
onDisplayControlsCheckBoxToggled(caller=None, event=None)
Callback function triggered when the display controls check box is toggled.
Show/hide in the VR view scene the controls at the location of the Windows Mixed Reality controllers.
Parameters:
  • caller – Caller of the function.
  • event – Event that triggered the function.
onDisplayROICheckBoxToggled(caller=None, event=None)

Function to display ROI box and show/hide scaling and rotation parameters.

Parameters:
  • caller – Caller of the function.
  • event – Event that triggered the function.
onDuplicateCustomShaderButtonClicked()

Function to duplicate custom shader file.

onEditSourceButtonClicked()

Function to create a new file with the custom shader and open the file in editor.

onEnableROICheckBoxToggled(caller=None, event=None)

Function to enable ROI cropping and show/hide ROI Display properties.

Parameters:
  • caller – Caller of the function.
  • event – Event that triggered the function.
onEnableRotationCheckBoxToggled(caller=None, event=None)

Function to enable rotating ROI box.

Parameters:
  • caller – Caller of the function.
  • event – Event that triggered the function.
onEnableScalingCheckBoxToggled(caller=None, event=None)

Function to enable scaling ROI box.

Parameters:
  • caller – Caller of the function.
  • event – Event that triggered the function.
onImageSelectorChanged(node, widget, index=0)

Callback function when the volume node has been changed in the dedicated combobox. Setup slice nodes to display selected node and render it in the 3d view.

Parameters:
  • node (vtkMRMLVolumeNode) – Volume node selected in the scene.
  • widget (QObject) – Widget modified.
  • index (int) – Index of the widget being modified.
onModify()

Function to activate or deactivate the button to modify a custom shader.

onModifyCustomShaderButtonClicked(caller=None, event=None)

Function to add the new shader replacement to a file.

Parameters:
  • caller – Caller of the function.
  • event – Event that triggered the function.
onModifyCustomShaderComboIndexChanged(value)

Function to set which shader will be modified.

Parameters:value (list) – Current value of the comboBox.
onNewCustomShaderButtonClicked()

Function to create a new file with the associated class.

Returns:Success at creating the file.
Return type:bool.
onOpenCustomShaderButtonClicked(caller=None, event=None)

Function to open custom shader file.

Parameters:
  • caller – Caller of the function.
  • event – Event that triggered the function.
onParameterNodeModified(caller, event)

Function to update the parameter node.

Parameters:
  • caller – Caller of the function.
  • event – Event that triggered the function.
onReload()

Reload the modules.

onReloadCurrentCustomShaderButtonClicked(caller=None, event=None)

Function to reload the current custom shader.

Parameters:
  • caller – Caller of the function.
  • event – Event that triggered the function.
onSelect()

Function to activate or deactivate the button to create a custom shader.

onShaderOpenFileButtonClicked(caller=None, event=None)

Function to open a file containing the new shader replacement.

Parameters:
  • caller – Caller of the function.
  • event – Event that triggered the function.
onShaderTagsComboIndexChanged(value)

Function to set which shader tag will be added to the shader.

Parameters:value (list) – Current value of the comboBox.
onShaderTagsTypeComboIndexChanged(value)

Function to set which shader tag type will be added to the shader.

Parameters:value (list) – Current value of the comboBox.
onToolCustomShaderButton()
onVolumeRenderingCheckBoxToggled(caller=None, event=None)

Callback function when the volume rendering check box is toggled. Activate or deactivate the rendering of the selected volume.

Parameters:
  • caller – Caller of the function.
  • event – Event that triggered the function.
pointModified(caller, event, index)
prismPath()

Function to get the module’s path.

Returns:Module’s path.
Return type:str
removeGUIObservers()

Function to remove observers from the GUI’s widgets.

resetLayout(layout)

Function to reset a specific layout.

Parameters:layout (qLayout) – Layout to reset.
resetROI()

Function to reset the ROI in the scene.

setAndObserveParameterNode(caller=None, event=None)

Function to set the parameter node.

setup()

Function to setup the class.

setup_file(file_, className, displayName)

Function to modify the new class with regex to match the given infos.

Parameters:
  • file – str, Path of the file being modified.
  • className (str) – Name of the class being modified.
  • displayName (str) – Display name of the class being modified.
showLayout(layout)

Function to show specific widgets of a layout.

Parameters:layout (qLayout) – Layout to reset.
updateComboBox(tab, comboBox, func)

Function to populate a combobox from an array.

Parameters:
  • tab (list) – List to populate the combobox.
  • comboBox (QComboBox) – ComboBox to be modified.
  • func (func) – Connect function when the ComboBox index is changed
updateGUIFromParameterNode(caller=None, event=None)

Function to update GUI from parameter node values

Parameters:
  • caller – Caller of the function.
  • event – Event that triggered the function.
updateParameterNodeFromGUI(value, w)

Function to update the parameter node from gui values.

Parameters:
  • value (float) – Value of the widget.
  • w (QObject) – Widget being modified.