Slicer
4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
|
Qt widget for editing a segment from a segmentation using Editor effects.Widget for editing segmentations that can be re-used in any module. More...
#include <Modules/Loadable/Segmentations/Widgets/qMRMLSegmentEditorWidget.h>
Public Types | |
typedef qMRMLWidget | Superclass |
Public Types inherited from qMRMLWidget | |
typedef QWidget | Superclass |
Properties | |
bool | autoShowMasterVolumeNode |
Qt::ToolButtonStyle | effectButtonStyle |
bool | masterVolumeNodeSelectorVisible |
int | maximumNumberOfUndoStates |
bool | readOnly |
bool | segmentationNodeSelectorVisible |
bool | switchToSegmentationsButtonVisible |
bool | undoEnabled |
bool | unorderedEffectsVisible |
Public Slots | |
void | hideLabelLayer () |
Unselect labelmap layer in all slice views in the active layout. More... | |
void | installKeyboardShortcuts (QWidget *parent=NULL) |
void | redo () |
Restores next saved state of the segmentation. More... | |
void | saveStateForUndo () |
void | setActiveEffectByName (QString effectName) |
Set active effect by name. More... | |
void | setAutoShowMasterVolumeNode (bool) |
void | setCurrentSegmentID (const QString segmentID) |
Set selected segment by its ID. More... | |
void | setEffectButtonStyle (Qt::ToolButtonStyle toolButtonStyle) |
void | setMasterVolumeNode (vtkMRMLNode *node) |
Set master volume MRML node. More... | |
void | setMasterVolumeNodeID (const QString &nodeID) |
Set master volume MRML node by its ID. More... | |
void | setMasterVolumeNodeSelectorVisible (bool) |
Show/hide the master volume node selector widget. More... | |
void | setMaximumNumberOfUndoStates (int) |
Set maximum number of saved undo/redo states. More... | |
virtual void | setMRMLScene (vtkMRMLScene *newScene) |
Set the MRML scene associated with the widget. More... | |
void | setMRMLSegmentEditorNode (vtkMRMLSegmentEditorNode *newSegmentEditorNode) |
Set the segment editor parameter set node. More... | |
void | setReadOnly (bool aReadOnly) |
Set whether the widget is read-only. More... | |
void | setSegmentationNode (vtkMRMLNode *node) |
Set segmentation MRML node. More... | |
void | setSegmentationNodeID (const QString &nodeID) |
Set segmentation MRML node by its ID. More... | |
void | setSegmentationNodeSelectorVisible (bool) |
Show/hide the segmentation node selector widget. More... | |
void | setSwitchToSegmentationsButtonVisible (bool) |
Show/hide the switch to Segmentations module button. More... | |
void | setUndoEnabled (bool) |
Undo/redo enabled. More... | |
void | showMasterVolumeInSliceViewers (bool forceShowInBackground=false, bool fitSlice=false) |
void | toggleMasterVolumeIntensityMaskEnabled () |
Enable/disable masking using master volume intensity. More... | |
bool | turnOffLightboxes () |
void | undo () |
Restores previous saved state of the segmentation. More... | |
void | uninstallKeyboardShortcuts () |
Uninstall previously installed keyboard shortcuts. More... | |
void | updateEffectLayouts () |
Perform updates to prevent layout collapse. More... | |
void | updateVolume (void *volumePtr, bool &success) |
Update modifierLabelmap, maskLabelmap, or alignedMasterVolumeNode. More... | |
virtual void | updateWidgetFromMRML () |
Update widget state from the MRML scene. More... | |
Public Slots inherited from qMRMLWidget | |
virtual void | setMRMLScene (vtkMRMLScene *newScene) |
Set the MRML scene associated with the widget. More... | |
Signals | |
void | currentSegmentIDChanged (const QString &) |
Emitted if different segment is selected in the segment list. More... | |
void | masterVolumeNodeChanged (vtkMRMLVolumeNode *) |
void | segmentationNodeChanged (vtkMRMLSegmentationNode *) |
Signals inherited from qMRMLWidget | |
void | mrmlSceneChanged (vtkMRMLScene *) |
Public Member Functions | |
Q_INVOKABLE qSlicerSegmentEditorAbstractEffect * | activeEffect () const |
bool | autoShowMasterVolumeNode () const |
Q_INVOKABLE QStringList | availableEffectNames () |
Get list of all registered effect names that can be displayed in the widget. More... | |
Q_INVOKABLE QString | currentSegmentID () const |
Get segment ID of selected segment. More... | |
Qt::ToolButtonStyle | effectButtonStyle () const |
Q_INVOKABLE qSlicerSegmentEditorAbstractEffect * | effectByIndex (int index) |
Q_INVOKABLE qSlicerSegmentEditorAbstractEffect * | effectByName (QString name) |
Q_INVOKABLE int | effectCount () |
Q_INVOKABLE QStringList | effectNameOrder () const |
Q_INVOKABLE vtkMRMLNode * | masterVolumeNode () const |
Get currently selected master volume MRML node. More... | |
Q_INVOKABLE QString | masterVolumeNodeID () const |
Get ID of currently selected master volume node. More... | |
Q_INVOKABLE void | masterVolumeNodeSelectorAddAttribute (const QString &nodeType, const QString &attributeName, const QVariant &attributeValue=QVariant()) |
Q_INVOKABLE void | masterVolumeNodeSelectorRemoveAttribute (const QString &nodeType, const QString &attributeName) |
bool | masterVolumeNodeSelectorVisible () const |
Show/hide the master volume node selector widget. More... | |
int | maximumNumberOfUndoStates () const |
Get maximum number of saved undo/redo states. More... | |
Q_INVOKABLE vtkMRMLSegmentEditorNode * | mrmlSegmentEditorNode () const |
Get the segment editor parameter set node. More... | |
qMRMLSegmentEditorWidget (QWidget *parent=0) | |
Constructor. More... | |
bool | readOnly () const |
Get whether widget is read-only. More... | |
Q_INVOKABLE void | removeViewObservations () |
Q_INVOKABLE vtkMRMLNode * | segmentationNode () const |
Get currently selected segmentation MRML node. More... | |
Q_INVOKABLE QString | segmentationNodeID () const |
Get ID of currently selected segmentation node. More... | |
Q_INVOKABLE void | segmentationNodeSelectorAddAttribute (const QString &nodeType, const QString &attributeName, const QVariant &attributeValue=QVariant()) |
Q_INVOKABLE void | segmentationNodeSelectorRemoveAttribute (const QString &nodeType, const QString &attributeName) |
bool | segmentationNodeSelectorVisible () const |
Show/hide the segmentation node selector widget. More... | |
Q_INVOKABLE void | setActiveEffect (qSlicerSegmentEditorAbstractEffect *effect) |
Q_INVOKABLE void | setEffectNameOrder (const QStringList &effectNames) |
void | setUnorderedEffectsVisible (bool visible) |
Q_INVOKABLE void | setupViewObservations () |
bool | switchToSegmentationsButtonVisible () const |
Show/hide the switch to Segmentations module button. More... | |
bool | undoEnabled () const |
Undo/redo enabled. More... | |
bool | unorderedEffectsVisible () const |
virtual | ~qMRMLSegmentEditorWidget () |
Destructor. More... | |
Public Member Functions inherited from qMRMLWidget | |
Q_INVOKABLE vtkMRMLScene * | mrmlScene () const |
Return a pointer on the current MRML scene. More... | |
qMRMLWidget (QWidget *parent=0, Qt::WindowFlags f=0) | |
virtual | ~qMRMLWidget () |
Protected Slots | |
void | anchorClicked (const QUrl &url) |
Update layout after expanding/collapsing the help text browser. More... | |
void | initializeParameterSetNode () |
Set default parameters in parameter set node (after setting or closing scene) More... | |
void | onAddSegment () |
Add empty segment. More... | |
void | onCreateSurfaceToggled (bool on) |
Create/remove closed surface model for the segmentation that is automatically updated when editing. More... | |
void | onEffectButtonClicked (QAbstractButton *button) |
Activate effect on clicking its button. More... | |
void | onImportExportActionClicked () |
Switch to Segmentations module and jump to Import/Export section. More... | |
void | onInteractionNodeModified () |
Handles mouse mode changes (view / place markups) More... | |
void | onLayoutChanged (int layoutIndex) |
Handle layout changes. More... | |
void | onMaskModeChanged (int) |
Changed selected editable segment area. More... | |
void | onMasterVolumeImageDataModified () |
Called if master volume image data is changed. More... | |
void | onMasterVolumeIntensityMaskChecked (bool checked) |
Enable/disable threshold when checkbox is toggled. More... | |
void | onMasterVolumeIntensityMaskRangeChanged (double low, double high) |
Handles threshold values changed event. More... | |
void | onMasterVolumeNodeChanged (vtkMRMLNode *node) |
Handles changing of the current master volume MRML node. More... | |
void | onMRMLSceneEndCloseEvent () |
Clean up when scene is closed. More... | |
void | onOverwriteModeChanged (int) |
Changed selected overwriteable segments. More... | |
void | onRemoveSegment () |
Remove selected segment. More... | |
void | onSegmentAddedRemoved () |
Called if a segment or representation is added or removed. More... | |
void | onSegmentationDisplayModified () |
Handle display node view ID changes. More... | |
void | onSegmentationHistoryChanged () |
Update GUI if segmentation history is changed (e.g., undo/redo button states) More... | |
void | onSegmentationNodeChanged (vtkMRMLNode *node) |
Handles changing of current segmentation MRML node. More... | |
void | onSegmentSelectionChanged (const QItemSelection &selected, const QItemSelection &deselected) |
Handles segment selection changes. More... | |
void | onSelectEffectShortcut () |
void | onSelectSegmentShortcut () |
Segment selection shortcut is activated. More... | |
void | onSetSurfaceSmoothingClicked () |
Show surface smoothing option. More... | |
void | onSwitchToSegmentations () |
Edit segmentation properties in Segmentations module. More... | |
void | updateMaskingSection () |
Update masking section on the UI. More... | |
Protected Member Functions | |
bool | setMasterRepresentationToBinaryLabelmap () |
qSlicerAbstractModuleWidget * | switchToSegmentationsModule () |
Switches to Segmentations module and returns the module widget. More... | |
void | updateEffectsSectionFromMRML () |
void | updateWidgetFromMasterVolumeNode () |
void | updateWidgetFromSegmentationNode () |
Static Protected Member Functions | |
static void | processEvents (vtkObject *caller, unsigned long eid, void *clientData, void *callData) |
Callback function invoked when interaction happens. More... | |
Protected Attributes | |
QScopedPointer< qMRMLSegmentEditorWidgetPrivate > | d_ptr |
Protected Attributes inherited from qMRMLWidget | |
QScopedPointer< qMRMLWidgetPrivate > | d_ptr |
Qt widget for editing a segment from a segmentation using Editor effects.
Widget for editing segmentations that can be re-used in any module.
IMPORTANT: The embedding module is responsible for setting the MRML scene and the management of the
Definition at line 64 of file qMRMLSegmentEditorWidget.h.
Definition at line 79 of file qMRMLSegmentEditorWidget.h.
|
readwrite |
Definition at line 70 of file qMRMLSegmentEditorWidget.h.
|
readwrite |
Definition at line 75 of file qMRMLSegmentEditorWidget.h.
|
readwrite |
Definition at line 69 of file qMRMLSegmentEditorWidget.h.
|
readwrite |
Definition at line 73 of file qMRMLSegmentEditorWidget.h.
|
readwrite |
Definition at line 74 of file qMRMLSegmentEditorWidget.h.
|
readwrite |
Definition at line 68 of file qMRMLSegmentEditorWidget.h.
|
readwrite |
Definition at line 71 of file qMRMLSegmentEditorWidget.h.
|
readwrite |
Definition at line 72 of file qMRMLSegmentEditorWidget.h.
|
readwrite |
Definition at line 76 of file qMRMLSegmentEditorWidget.h.
|
explicit |
Constructor.
|
virtual |
Destructor.
Q_INVOKABLE qSlicerSegmentEditorAbstractEffect* qMRMLSegmentEditorWidget::activeEffect | ( | ) | const |
Return active effect if selected, NULL otherwise
|
protectedslot |
Update layout after expanding/collapsing the help text browser.
bool qMRMLSegmentEditorWidget::autoShowMasterVolumeNode | ( | ) | const |
If autoShowMasterVolumeNode is enabled then master volume is automatically displayed in slice views when a new master volume is selected or layout is changed. Enabled by default.
Q_INVOKABLE QStringList qMRMLSegmentEditorWidget::availableEffectNames | ( | ) |
Get list of all registered effect names that can be displayed in the widget.
Q_INVOKABLE QString qMRMLSegmentEditorWidget::currentSegmentID | ( | ) | const |
Get segment ID of selected segment.
|
signal |
Emitted if different segment is selected in the segment list.
Qt::ToolButtonStyle qMRMLSegmentEditorWidget::effectButtonStyle | ( | ) | const |
Get appearance of effect buttons. Showing text may make it easier to find an effect but uses more space.
Q_INVOKABLE qSlicerSegmentEditorAbstractEffect* qMRMLSegmentEditorWidget::effectByIndex | ( | int | index | ) |
Get n-th effect shown in the widget. n>=0 and n<effectCount().
Q_INVOKABLE qSlicerSegmentEditorAbstractEffect* qMRMLSegmentEditorWidget::effectByName | ( | QString | name | ) |
Get an effect object by name
Q_INVOKABLE int qMRMLSegmentEditorWidget::effectCount | ( | ) |
Get number of displayed effects
Q_INVOKABLE QStringList qMRMLSegmentEditorWidget::effectNameOrder | ( | ) | const |
Get requested order of effects. Actually displayed effects can be retrieved by using
|
slot |
Unselect labelmap layer in all slice views in the active layout.
|
protectedslot |
Set default parameters in parameter set node (after setting or closing scene)
|
slot |
Install keyboard shortcuts to allow quick selection of effects and segments. If parent is not specified then the main window will be used as parent. Previous keyboard shortcuts will be uninstalled.
Q_INVOKABLE vtkMRMLNode* qMRMLSegmentEditorWidget::masterVolumeNode | ( | ) | const |
Get currently selected master volume MRML node.
|
signal |
Emitted when the user selects a different master volume (or any time master volume selection is changed in the segment editor parameter node).
Q_INVOKABLE QString qMRMLSegmentEditorWidget::masterVolumeNodeID | ( | ) | const |
Get ID of currently selected master volume node.
Q_INVOKABLE void qMRMLSegmentEditorWidget::masterVolumeNodeSelectorAddAttribute | ( | const QString & | nodeType, |
const QString & | attributeName, | ||
const QVariant & | attributeValue = QVariant() |
||
) |
Add node type attribute that filter the master volume nodes to display.
Q_INVOKABLE void qMRMLSegmentEditorWidget::masterVolumeNodeSelectorRemoveAttribute | ( | const QString & | nodeType, |
const QString & | attributeName | ||
) |
Remove node type attribute filtering the displayed master volume nodes.
bool qMRMLSegmentEditorWidget::masterVolumeNodeSelectorVisible | ( | ) | const |
Show/hide the master volume node selector widget.
int qMRMLSegmentEditorWidget::maximumNumberOfUndoStates | ( | ) | const |
Get maximum number of saved undo/redo states.
Q_INVOKABLE vtkMRMLSegmentEditorNode* qMRMLSegmentEditorWidget::mrmlSegmentEditorNode | ( | ) | const |
Get the segment editor parameter set node.
|
protectedslot |
Add empty segment.
|
protectedslot |
Create/remove closed surface model for the segmentation that is automatically updated when editing.
|
protectedslot |
Activate effect on clicking its button.
|
protectedslot |
Switch to Segmentations module and jump to Import/Export section.
|
protectedslot |
Handles mouse mode changes (view / place markups)
|
protectedslot |
Handle layout changes.
|
protectedslot |
Changed selected editable segment area.
|
protectedslot |
Called if master volume image data is changed.
|
protectedslot |
Enable/disable threshold when checkbox is toggled.
|
protectedslot |
Handles threshold values changed event.
|
protectedslot |
Handles changing of the current master volume MRML node.
|
protectedslot |
Clean up when scene is closed.
|
protectedslot |
Changed selected overwriteable segments.
|
protectedslot |
Remove selected segment.
|
protectedslot |
Called if a segment or representation is added or removed.
|
protectedslot |
Handle display node view ID changes.
|
protectedslot |
Update GUI if segmentation history is changed (e.g., undo/redo button states)
|
protectedslot |
Handles changing of current segmentation MRML node.
|
protectedslot |
Handles segment selection changes.
|
protectedslot |
Effect selection shortcut is activated. 0 means deselect active effect. -1 toggles between no effect/last active effect.
|
protectedslot |
Segment selection shortcut is activated.
|
protectedslot |
Show surface smoothing option.
|
protectedslot |
Edit segmentation properties in Segmentations module.
|
staticprotected |
Callback function invoked when interaction happens.
bool qMRMLSegmentEditorWidget::readOnly | ( | ) | const |
Get whether widget is read-only.
|
slot |
Restores next saved state of the segmentation.
Q_INVOKABLE void qMRMLSegmentEditorWidget::removeViewObservations | ( | ) |
Remove observations NOTE: This method should be called from the exit function of the embedding module widget so that events are not processed unnecessarily.
|
slot |
Save current segmentation before performing an edit operation to allow reverting to the current state by using undo
Q_INVOKABLE vtkMRMLNode* qMRMLSegmentEditorWidget::segmentationNode | ( | ) | const |
Get currently selected segmentation MRML node.
|
signal |
Emitted when the user selects a different segmentation node (or any time segmentation node selection is changed in the segment editor parameter node).
Q_INVOKABLE QString qMRMLSegmentEditorWidget::segmentationNodeID | ( | ) | const |
Get ID of currently selected segmentation node.
Q_INVOKABLE void qMRMLSegmentEditorWidget::segmentationNodeSelectorAddAttribute | ( | const QString & | nodeType, |
const QString & | attributeName, | ||
const QVariant & | attributeValue = QVariant() |
||
) |
Add node type attribute that filter the segmentation nodes to display.
Q_INVOKABLE void qMRMLSegmentEditorWidget::segmentationNodeSelectorRemoveAttribute | ( | const QString & | nodeType, |
const QString & | attributeName | ||
) |
Remove node type attribute filtering the displayed segmentation nodes.
bool qMRMLSegmentEditorWidget::segmentationNodeSelectorVisible | ( | ) | const |
Show/hide the segmentation node selector widget.
Q_INVOKABLE void qMRMLSegmentEditorWidget::setActiveEffect | ( | qSlicerSegmentEditorAbstractEffect * | effect | ) |
Set active effect
|
slot |
Set active effect by name.
|
slot |
If autoShowMasterVolumeNode is enabled then master volume is automatically displayed in slice views when a new master volume is selected or layout is changed. Enabled by default.
|
slot |
Set selected segment by its ID.
|
slot |
Set appearance of effect buttons. Showing text may make it easier to find an effect but uses more space.
Q_INVOKABLE void qMRMLSegmentEditorWidget::setEffectNameOrder | ( | const QStringList & | effectNames | ) |
Request displaying effects in the specified order. Effects that are not listed will be hidden if
|
protected |
Switches the master representation to binary labelmap. If the master representation cannot be set to binary labelmap (e.g., the user does not allow it) then false is returned.
|
slot |
Set master volume MRML node.
|
slot |
Set master volume MRML node by its ID.
|
slot |
Show/hide the master volume node selector widget.
|
slot |
Set maximum number of saved undo/redo states.
|
virtualslot |
Set the MRML scene associated with the widget.
|
slot |
Set the segment editor parameter set node.
|
slot |
Set whether the widget is read-only.
|
slot |
Set segmentation MRML node.
|
slot |
Set segmentation MRML node by its ID.
|
slot |
Show/hide the segmentation node selector widget.
|
slot |
Show/hide the switch to Segmentations module button.
|
slot |
Undo/redo enabled.
void qMRMLSegmentEditorWidget::setUnorderedEffectsVisible | ( | bool | visible | ) |
Show/hide effect names that are not listed in
Q_INVOKABLE void qMRMLSegmentEditorWidget::setupViewObservations | ( | ) |
Create observations between slice view interactor and the widget. The captured events are propagated to the active effect if any. NOTE: This method should be called from the enter function of the embedding module widget so that the events are correctly processed.
|
slot |
Show master volume in slice views by hiding foreground and label volumes.
forceShowInBackground | If set to false then views will only change if master volume is not selected as either foreground or background volume. |
fitSlice | Reset field of view to include all volumes. |
bool qMRMLSegmentEditorWidget::switchToSegmentationsButtonVisible | ( | ) | const |
Show/hide the switch to Segmentations module button.
|
protected |
Switches to Segmentations module and returns the module widget.
|
slot |
Enable/disable masking using master volume intensity.
|
slot |
Convenience method to turn off lightbox view in all slice viewers. Segment editor is not compatible with lightbox view layouts. Returns true if there were lightbox views.
|
slot |
Restores previous saved state of the segmentation.
bool qMRMLSegmentEditorWidget::undoEnabled | ( | ) | const |
Undo/redo enabled.
|
slot |
Uninstall previously installed keyboard shortcuts.
bool qMRMLSegmentEditorWidget::unorderedEffectsVisible | ( | ) | const |
Get visibility status of effect names that are not listed in effectNameOrder().
|
slot |
Perform updates to prevent layout collapse.
|
protected |
|
protectedslot |
Update masking section on the UI.
|
slot |
Update modifierLabelmap, maskLabelmap, or alignedMasterVolumeNode.
|
protected |
|
virtualslot |
Update widget state from the MRML scene.
|
protected |
|
protected |
Definition at line 376 of file qMRMLSegmentEditorWidget.h.