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 | Static Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes
qMRMLSegmentsTableView Class Reference

#include <Modules/Loadable/Segmentations/Widgets/qMRMLSegmentsTableView.h>

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

Public Types

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

Properties

bool colorColumnVisible
 
bool headerVisible
 
bool opacityColumnVisible
 
bool readOnly
 
int selectionMode
 
bool visibilityColumnVisible
 

Public Slots

void setColorColumnVisible (bool visible)
 
void setHeaderVisible (bool visible)
 
virtual void setMRMLScene (vtkMRMLScene *newScene)
 
void setOpacityColumnVisible (bool visible)
 
void setReadOnly (bool aReadOnly)
 
void setSegmentationNode (vtkMRMLNode *node)
 Set segmentation MRML node. More...
 
void setSelectionMode (int mode)
 
void setVisibilityColumnVisible (bool visible)
 
void showOnlySelectedSegments ()
 Show only selected segments. More...
 
- Public Slots inherited from qMRMLWidget
virtual void setMRMLScene (vtkMRMLScene *newScene)
 Set the MRML scene associated with the widget. More...
 

Signals

void segmentAboutToBeModified (const QString &segmentID)
 
void selectionChanged (const QItemSelection &selected, const QItemSelection &deselected)
 Emitted if selection changes. More...
 
- Signals inherited from qMRMLWidget
void mrmlSceneChanged (vtkMRMLScene *)
 

Public Member Functions

Q_INVOKABLE void clearSelection ()
 Clear segment selection. More...
 
bool colorColumnVisible ()
 
Q_INVOKABLE QStringList displayedSegmentIDs () const
 Return list of visible segment IDs. More...
 
bool headerVisible ()
 
Q_INVOKABLE QStringList hideSegments () const
 
bool opacityColumnVisible ()
 
 qMRMLSegmentsTableView (QWidget *parent=0)
 Constructor. More...
 
bool readOnly ()
 
Q_INVOKABLE vtkMRMLNodesegmentationNode ()
 Get segmentation MRML node. More...
 
int segmentCount () const
 Return number of segments (rows) in the table. More...
 
Q_INVOKABLE QStringList selectedSegmentIDs ()
 Get segment ID of selected segments. More...
 
int selectionMode ()
 
Q_INVOKABLE void setHideSegments (const QStringList &segmentIDs)
 
Q_INVOKABLE void setSelectedSegmentIDs (QStringList segmentIDs)
 Select segments with specified IDs. More...
 
Q_INVOKABLE QTableWidget * tableWidget ()
 Get access to the table widget to allow low-level customization. More...
 
bool visibilityColumnVisible ()
 
virtual ~qMRMLSegmentsTableView ()
 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 ()
 

Static Public Member Functions

static Q_INVOKABLE QString terminologyTooltipForSegment (vtkSegment *segment)
 Assemble terminology info string (for tooltips) from a segment's terminology tags. More...
 

Protected Slots

void endProcessing ()
 Handle MRML scene event. More...
 
void onSegmentSelectionChanged (const QItemSelection &selected, const QItemSelection &deselected)
 Forwards selection changed events. In case of batch update of items, selected and deselected are empty. More...
 
void onSegmentTableItemChanged (QTableWidgetItem *changedItem)
 Handles changing of values in a cell (segment name, visibility, color, opacity) More...
 
void onVisibility2DFillActionToggled (bool visible)
 
void onVisibility2DOutlineActionToggled (bool visible)
 
void onVisibility3DActionToggled (bool visible)
 
void onVisibilityButtonClicked ()
 Handles clicks on a table cell (visibility) More...
 
void populateSegmentTable ()
 Populate segment table according to the segmentation node. More...
 
void updateWidgetFromMRML ()
 Update from segmentation node state (invoked when segment count stays the same) More...
 

Protected Member Functions

virtual void contextMenuEvent (QContextMenuEvent *event)
 Handle context menu events. More...
 
virtual bool eventFilter (QObject *target, QEvent *event)
 To prevent accidentally moving out of the widget when pressing up/down arrows. More...
 
void setSegmentVisibility (QObject *senderObject, int visible, int visible3D, int visible2DFill, int visible2DOutline)
 

Protected Attributes

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

Detailed Description

Definition at line 46 of file qMRMLSegmentsTableView.h.

Member Typedef Documentation

◆ Superclass

Definition at line 68 of file qMRMLSegmentsTableView.h.

Property Documentation

◆ colorColumnVisible

bool qMRMLSegmentsTableView::colorColumnVisible
readwrite

Definition at line 64 of file qMRMLSegmentsTableView.h.

◆ headerVisible

bool qMRMLSegmentsTableView::headerVisible
readwrite

Definition at line 62 of file qMRMLSegmentsTableView.h.

◆ opacityColumnVisible

bool qMRMLSegmentsTableView::opacityColumnVisible
readwrite

Definition at line 65 of file qMRMLSegmentsTableView.h.

◆ readOnly

bool qMRMLSegmentsTableView::readOnly
readwrite

Definition at line 66 of file qMRMLSegmentsTableView.h.

◆ selectionMode

int qMRMLSegmentsTableView::selectionMode
readwrite

Definition at line 61 of file qMRMLSegmentsTableView.h.

◆ visibilityColumnVisible

bool qMRMLSegmentsTableView::visibilityColumnVisible
readwrite

Definition at line 63 of file qMRMLSegmentsTableView.h.

Constructor & Destructor Documentation

◆ qMRMLSegmentsTableView()

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

Constructor.

◆ ~qMRMLSegmentsTableView()

virtual qMRMLSegmentsTableView::~qMRMLSegmentsTableView ( )
virtual

Destructor.

Member Function Documentation

◆ clearSelection()

Q_INVOKABLE void qMRMLSegmentsTableView::clearSelection ( )

Clear segment selection.

◆ colorColumnVisible()

bool qMRMLSegmentsTableView::colorColumnVisible ( )

◆ contextMenuEvent()

virtual void qMRMLSegmentsTableView::contextMenuEvent ( QContextMenuEvent *  event)
protectedvirtual

Handle context menu events.

◆ displayedSegmentIDs()

Q_INVOKABLE QStringList qMRMLSegmentsTableView::displayedSegmentIDs ( ) const

Return list of visible segment IDs.

◆ endProcessing

void qMRMLSegmentsTableView::endProcessing ( )
protectedslot

Handle MRML scene event.

◆ eventFilter()

virtual bool qMRMLSegmentsTableView::eventFilter ( QObject *  target,
QEvent *  event 
)
protectedvirtual

To prevent accidentally moving out of the widget when pressing up/down arrows.

◆ headerVisible()

bool qMRMLSegmentsTableView::headerVisible ( )

◆ hideSegments()

Q_INVOKABLE QStringList qMRMLSegmentsTableView::hideSegments ( ) const

◆ onSegmentSelectionChanged

void qMRMLSegmentsTableView::onSegmentSelectionChanged ( const QItemSelection &  selected,
const QItemSelection &  deselected 
)
protectedslot

Forwards selection changed events. In case of batch update of items, selected and deselected are empty.

◆ onSegmentTableItemChanged

void qMRMLSegmentsTableView::onSegmentTableItemChanged ( QTableWidgetItem *  changedItem)
protectedslot

Handles changing of values in a cell (segment name, visibility, color, opacity)

◆ onVisibility2DFillActionToggled

void qMRMLSegmentsTableView::onVisibility2DFillActionToggled ( bool  visible)
protectedslot

◆ onVisibility2DOutlineActionToggled

void qMRMLSegmentsTableView::onVisibility2DOutlineActionToggled ( bool  visible)
protectedslot

◆ onVisibility3DActionToggled

void qMRMLSegmentsTableView::onVisibility3DActionToggled ( bool  visible)
protectedslot

◆ onVisibilityButtonClicked

void qMRMLSegmentsTableView::onVisibilityButtonClicked ( )
protectedslot

Handles clicks on a table cell (visibility)

◆ opacityColumnVisible()

bool qMRMLSegmentsTableView::opacityColumnVisible ( )

◆ populateSegmentTable

void qMRMLSegmentsTableView::populateSegmentTable ( )
protectedslot

Populate segment table according to the segmentation node.

◆ readOnly()

bool qMRMLSegmentsTableView::readOnly ( )

◆ segmentAboutToBeModified

void qMRMLSegmentsTableView::segmentAboutToBeModified ( const QString &  segmentID)
signal

Emitted when a segment property (e.g., name) is about to be changed. Can be used for capturing the current state of the segment, before it is modified.

◆ segmentationNode()

Q_INVOKABLE vtkMRMLNode* qMRMLSegmentsTableView::segmentationNode ( )

Get segmentation MRML node.

◆ segmentCount()

int qMRMLSegmentsTableView::segmentCount ( ) const

Return number of segments (rows) in the table.

◆ selectedSegmentIDs()

Q_INVOKABLE QStringList qMRMLSegmentsTableView::selectedSegmentIDs ( )

Get segment ID of selected segments.

◆ selectionChanged

void qMRMLSegmentsTableView::selectionChanged ( const QItemSelection &  selected,
const QItemSelection &  deselected 
)
signal

Emitted if selection changes.

◆ selectionMode()

int qMRMLSegmentsTableView::selectionMode ( )

◆ setColorColumnVisible

void qMRMLSegmentsTableView::setColorColumnVisible ( bool  visible)
slot

◆ setHeaderVisible

void qMRMLSegmentsTableView::setHeaderVisible ( bool  visible)
slot

◆ setHideSegments()

Q_INVOKABLE void qMRMLSegmentsTableView::setHideSegments ( const QStringList &  segmentIDs)

Segments that have their ID listed in hideSegments are not shown in the table.

◆ setMRMLScene

virtual void qMRMLSegmentsTableView::setMRMLScene ( vtkMRMLScene newScene)
virtualslot

◆ setOpacityColumnVisible

void qMRMLSegmentsTableView::setOpacityColumnVisible ( bool  visible)
slot

◆ setReadOnly

void qMRMLSegmentsTableView::setReadOnly ( bool  aReadOnly)
slot

◆ setSegmentationNode

void qMRMLSegmentsTableView::setSegmentationNode ( vtkMRMLNode node)
slot

Set segmentation MRML node.

◆ setSegmentVisibility()

void qMRMLSegmentsTableView::setSegmentVisibility ( QObject *  senderObject,
int  visible,
int  visible3D,
int  visible2DFill,
int  visible2DOutline 
)
protected

Convenience function to set segment visibility options from event handlers

See also
onVisibilityButtonToggled
onVisibility3DActionToggled
onVisibility2DFillActionToggled
onVisibility2DOutlineActionToggled
Parameters
visibleVisibility of the segment referenced from senderObject. If 0, then hide, if 1 then show, otherwise don't change
visible3DVisibility of the segment referenced from senderObject in 3D. If 0, then hide, if 1 then show, otherwise don't change
visible2DFillVisibility of the segment referenced from senderObject for 2D fill. If 0, then hide, if 1 then show, otherwise don't change
visible2DOutlineVisibility of the segment referenced from senderObject for 2D outline. If 0, then hide, if 1 then show, otherwise don't change

◆ setSelectedSegmentIDs()

Q_INVOKABLE void qMRMLSegmentsTableView::setSelectedSegmentIDs ( QStringList  segmentIDs)

Select segments with specified IDs.

◆ setSelectionMode

void qMRMLSegmentsTableView::setSelectionMode ( int  mode)
slot

Set selection mode in the table. Input value is int for Python compatibility. Actual values are defined in QAbstractItemView::SelectionMode. For example, QAbstractItemView::NoSelection, QAbstractItemView::SingleSelection, QAbstractItemView::ExtendedSelection.

◆ setVisibilityColumnVisible

void qMRMLSegmentsTableView::setVisibilityColumnVisible ( bool  visible)
slot

◆ showOnlySelectedSegments

void qMRMLSegmentsTableView::showOnlySelectedSegments ( )
slot

Show only selected segments.

◆ tableWidget()

Q_INVOKABLE QTableWidget* qMRMLSegmentsTableView::tableWidget ( )

Get access to the table widget to allow low-level customization.

◆ terminologyTooltipForSegment()

static Q_INVOKABLE QString qMRMLSegmentsTableView::terminologyTooltipForSegment ( vtkSegment segment)
static

Assemble terminology info string (for tooltips) from a segment's terminology tags.

◆ updateWidgetFromMRML

void qMRMLSegmentsTableView::updateWidgetFromMRML ( )
protectedslot

Update from segmentation node state (invoked when segment count stays the same)

◆ visibilityColumnVisible()

bool qMRMLSegmentsTableView::visibilityColumnVisible ( )

Member Data Documentation

◆ d_ptr

QScopedPointer<qMRMLSegmentsTableViewPrivate> qMRMLSegmentsTableView::d_ptr
protected

Definition at line 174 of file qMRMLSegmentsTableView.h.


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