Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Public Types | Properties | Public Slots | Signals | Public Member Functions | Protected Slots | Protected Attributes
qMRMLSegmentSelectorWidget Class Reference

Qt widget for selecting a single segment from a segmentation. If multiple segments are needed, then use. More...

#include <Libs/MRML/Widgets/qMRMLSegmentSelectorWidget.h>

Inheritance diagram for qMRMLSegmentSelectorWidget:
Inheritance graph
[legend]
Collaboration diagram for qMRMLSegmentSelectorWidget:
Collaboration graph
[legend]

Public Types

typedef qMRMLWidget Superclass
 Superclass typedef. More...
 
- Public Types inherited from qMRMLWidget
typedef QWidget Superclass
 

Properties

bool editEnabled
 
bool horizontalLayout
 
bool multiSelection
 
bool noneEnabled
 
bool segmentationNodeSelectorVisible
 
bool selectNodeUponCreation
 

Public Slots

Q_INVOKABLE void setCurrentNode (vtkMRMLNode *node)
 Set segmentation MRML node. More...
 
Q_INVOKABLE void setCurrentNodeID (const QString &nodeID)
 Set segmentation MRML node by its ID. More...
 
Q_INVOKABLE void setCurrentSegmentID (QString segmentID)
 
Q_INVOKABLE void setSelectedSegmentIDs (QStringList segmentIDList)
 
- Public Slots inherited from qMRMLWidget
virtual void setMRMLScene (vtkMRMLScene *newScene)
 Set the MRML scene associated with the widget. More...
 

Signals

void currentNodeChanged (vtkMRMLNode *)
 
void currentNodeChanged (bool validNode)
 
void currentSegmentChanged (QString)
 
void nodeAboutToBeEdited (vtkMRMLNode *node)
 Signal emitted when edit node menu action is selected in the segmentation node combobox. More...
 
void segmentSelectionChanged (QStringList)
 
- Signals inherited from qMRMLWidget
void mrmlSceneChanged (vtkMRMLScene *)
 

Public Member Functions

Q_INVOKABLE vtkMRMLNodecurrentNode ()
 Get currently selected segmentation MRML node. More...
 
Q_INVOKABLE QString currentNodeID ()
 Get currently selected segmentation node's ID. More...
 
Q_INVOKABLE QString currentSegmentID ()
 
bool editEnabled () const
 
bool horizontalLayout () const
 
bool multiSelection () const
 
bool noneEnabled () const
 
 qMRMLSegmentSelectorWidget (QWidget *parent=0)
 Constructor. More...
 
bool segmentationNodeSelectorVisible () const
 
Q_INVOKABLE QStringList selectedSegmentIDs ()
 
bool selectNodeUponCreation () const
 
void setEditEnabled (bool enable)
 
void setHorizontalLayout (bool horizontal)
 
void setMultiSelection (bool multi)
 
void setNoneEnabled (bool enable)
 
void setSegmentationNodeSelectorVisible (bool visible)
 
void setSelectNodeUponCreation (bool value)
 
virtual ~qMRMLSegmentSelectorWidget ()
 Destructor. More...
 
- Public Member Functions inherited from qMRMLWidget
Q_INVOKABLE vtkMRMLScenemrmlScene () const
 Return a pointer on the current MRML scene. More...
 
 qMRMLWidget (QWidget *parent=0, Qt::WindowFlags f=0)
 
virtual ~qMRMLWidget ()
 

Protected Slots

Q_INVOKABLE void onCurrentNodeChanged (vtkMRMLNode *node)
 Handles changing of current segmentation MRML node. More...
 
void onCurrentSegmentChanged (int index)
 Handles changing of selection in the segment combobox. More...
 
void onSegmentMultiSelectionChanged ()
 Handles selection change in case of multi-selection. More...
 
void populateSegmentCombobox ()
 Populate segment combobox according to the segmentation node. More...
 

Protected Attributes

QScopedPointer< qMRMLSegmentSelectorWidgetPrivate > d_ptr
 
- Protected Attributes inherited from qMRMLWidget
QScopedPointer< qMRMLWidgetPrivate > d_ptr
 

Detailed Description

Qt widget for selecting a single segment from a segmentation. If multiple segments are needed, then use.

See also
qMRMLSegmentsTableView instead in SimpleListMode

Definition at line 43 of file qMRMLSegmentSelectorWidget.h.

Member Typedef Documentation

◆ Superclass

Superclass typedef.

Definition at line 58 of file qMRMLSegmentSelectorWidget.h.

Property Documentation

◆ editEnabled

bool qMRMLSegmentSelectorWidget::editEnabled
readwrite

Definition at line 50 of file qMRMLSegmentSelectorWidget.h.

◆ horizontalLayout

bool qMRMLSegmentSelectorWidget::horizontalLayout
readwrite

Definition at line 53 of file qMRMLSegmentSelectorWidget.h.

◆ multiSelection

bool qMRMLSegmentSelectorWidget::multiSelection
readwrite

Definition at line 52 of file qMRMLSegmentSelectorWidget.h.

◆ noneEnabled

bool qMRMLSegmentSelectorWidget::noneEnabled
readwrite

Definition at line 49 of file qMRMLSegmentSelectorWidget.h.

◆ segmentationNodeSelectorVisible

bool qMRMLSegmentSelectorWidget::segmentationNodeSelectorVisible
readwrite

Definition at line 51 of file qMRMLSegmentSelectorWidget.h.

◆ selectNodeUponCreation

bool qMRMLSegmentSelectorWidget::selectNodeUponCreation
readwrite

Definition at line 54 of file qMRMLSegmentSelectorWidget.h.

Constructor & Destructor Documentation

◆ qMRMLSegmentSelectorWidget()

qMRMLSegmentSelectorWidget::qMRMLSegmentSelectorWidget ( QWidget *  parent = 0)
explicit

Constructor.

◆ ~qMRMLSegmentSelectorWidget()

virtual qMRMLSegmentSelectorWidget::~qMRMLSegmentSelectorWidget ( )
virtual

Destructor.

Member Function Documentation

◆ currentNode()

Q_INVOKABLE vtkMRMLNode* qMRMLSegmentSelectorWidget::currentNode ( )

Get currently selected segmentation MRML node.

◆ currentNodeChanged [1/2]

void qMRMLSegmentSelectorWidget::currentNodeChanged ( vtkMRMLNode )
signal

◆ currentNodeChanged [2/2]

void qMRMLSegmentSelectorWidget::currentNodeChanged ( bool  validNode)
signal

Signal emitted just after currentNodeChanged(vtkMRMLNode*) is.

Parameters
validNodeset to True when the current node is changed. Set to False when the list is empty. Useful to enable/disable/show/hide other widgets depending on the validity of the current node.

◆ currentNodeID()

Q_INVOKABLE QString qMRMLSegmentSelectorWidget::currentNodeID ( )

Get currently selected segmentation node's ID.

◆ currentSegmentChanged

void qMRMLSegmentSelectorWidget::currentSegmentChanged ( QString  )
signal

◆ currentSegmentID()

Q_INVOKABLE QString qMRMLSegmentSelectorWidget::currentSegmentID ( )

Get segment ID of selected segment. Returns empty string if multi-selection is enabled (when

See also
multiSelection is true)

◆ editEnabled()

bool qMRMLSegmentSelectorWidget::editEnabled ( ) const

Return true if the edit option is enabled in the segmentation node combobox

See also
noneEnabled, setEditEnabled()

◆ horizontalLayout()

bool qMRMLSegmentSelectorWidget::horizontalLayout ( ) const

Return true if the current layout is horizontal

See also
horizontalLayout, setHorizontalLayout()

◆ multiSelection()

bool qMRMLSegmentSelectorWidget::multiSelection ( ) const

Return true if the multi-selection of segments is enabled, false otherwise.

See also
multiSelection, setMultiSelection()

◆ nodeAboutToBeEdited

void qMRMLSegmentSelectorWidget::nodeAboutToBeEdited ( vtkMRMLNode node)
signal

Signal emitted when edit node menu action is selected in the segmentation node combobox.

◆ noneEnabled()

bool qMRMLSegmentSelectorWidget::noneEnabled ( ) const

Return true if the "none" is in the segmentation node comboBox list, false otherwise.

See also
noneEnabled, setNoneEnabled()

◆ onCurrentNodeChanged

Q_INVOKABLE void qMRMLSegmentSelectorWidget::onCurrentNodeChanged ( vtkMRMLNode node)
protectedslot

Handles changing of current segmentation MRML node.

◆ onCurrentSegmentChanged

void qMRMLSegmentSelectorWidget::onCurrentSegmentChanged ( int  index)
protectedslot

Handles changing of selection in the segment combobox.

◆ onSegmentMultiSelectionChanged

void qMRMLSegmentSelectorWidget::onSegmentMultiSelectionChanged ( )
protectedslot

Handles selection change in case of multi-selection.

◆ populateSegmentCombobox

void qMRMLSegmentSelectorWidget::populateSegmentCombobox ( )
protectedslot

Populate segment combobox according to the segmentation node.

◆ segmentationNodeSelectorVisible()

bool qMRMLSegmentSelectorWidget::segmentationNodeSelectorVisible ( ) const

Return whether segmentation node selector combobox is visible

See also
segmentationNodeSelectorVisible, setSegmentationNodeSelectorVisible()

◆ segmentSelectionChanged

void qMRMLSegmentSelectorWidget::segmentSelectionChanged ( QStringList  )
signal

◆ selectedSegmentIDs()

Q_INVOKABLE QStringList qMRMLSegmentSelectorWidget::selectedSegmentIDs ( )

Get segment IDs of selected segments. Returns empty string in case of single selection (when

See also
multiSelection is false)

◆ selectNodeUponCreation()

bool qMRMLSegmentSelectorWidget::selectNodeUponCreation ( ) const

if true, when the user create a node using "Add node", the node will be automatically selected. It doesn't apply if the node is programatically added (when the combobox is populated by the scene).

◆ setCurrentNode

Q_INVOKABLE void qMRMLSegmentSelectorWidget::setCurrentNode ( vtkMRMLNode node)
slot

Set segmentation MRML node.

◆ setCurrentNodeID

Q_INVOKABLE void qMRMLSegmentSelectorWidget::setCurrentNodeID ( const QString &  nodeID)
slot

Set segmentation MRML node by its ID.

◆ setCurrentSegmentID

Q_INVOKABLE void qMRMLSegmentSelectorWidget::setCurrentSegmentID ( QString  segmentID)
slot

Select segment with given ID. Does nothing in case multi-selection is enabled (when

See also
multiSelection is true)

◆ setEditEnabled()

void qMRMLSegmentSelectorWidget::setEditEnabled ( bool  enable)

Set whether the edit option is enabled in the segmentation node combobox

See also
editEnabled, editEnabled()

◆ setHorizontalLayout()

void qMRMLSegmentSelectorWidget::setHorizontalLayout ( bool  horizontal)

Set whether the widget layout is horizontal (everything in one row) or vertical. False by default

See also
horizontalLayout, horizontalLayout()

◆ setMultiSelection()

void qMRMLSegmentSelectorWidget::setMultiSelection ( bool  multi)

Set whether multi-selection of segments is enabled or not. Off by default (single-selection)

See also
multiSelection, multiSelection()

◆ setNoneEnabled()

void qMRMLSegmentSelectorWidget::setNoneEnabled ( bool  enable)

Set whether the "none" item should be in the segmentation node comboBox list or not.

See also
noneEnabled, noneEnabled()

◆ setSegmentationNodeSelectorVisible()

void qMRMLSegmentSelectorWidget::setSegmentationNodeSelectorVisible ( bool  visible)

Set whether segmentation node selector combobox is visible

See also
segmentationNodeSelectorVisible, segmentationNodeSelectorVisible()

◆ setSelectedSegmentIDs

Q_INVOKABLE void qMRMLSegmentSelectorWidget::setSelectedSegmentIDs ( QStringList  segmentIDList)
slot

Select segments with given IDs. Does nothing in case of single selection (when

See also
multiSelection is false)

◆ setSelectNodeUponCreation()

void qMRMLSegmentSelectorWidget::setSelectNodeUponCreation ( bool  value)

Member Data Documentation

◆ d_ptr

QScopedPointer<qMRMLSegmentSelectorWidgetPrivate> qMRMLSegmentSelectorWidget::d_ptr
protected

Definition at line 156 of file qMRMLSegmentSelectorWidget.h.


The documentation for this class was generated from the following file: