Slicer  5.1
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 filterBarVisible
 
bool headerVisible
 
bool jumpToSelectedSegmentEnabled
 
bool layerColumnVisible
 
bool opacityColumnVisible
 
bool readOnly
 
int selectionMode
 
bool statusColumnVisible
 
QString textFilter
 
bool visibilityColumnVisible
 

Public Slots

void clearSelectedSegments ()
 Erase the contents of the selected segments and set the status to "Not started". More...
 
void jumpSlices ()
 
bool jumpToSelectedSegmentEnabled () const
 Returns true if automatic jump to current segment is enabled. More...
 
void moveSelectedSegmentsDown ()
 Move selected segments down in the list. More...
 
void moveSelectedSegmentsUp ()
 Move selected segments up in the list. More...
 
void setColorColumnVisible (bool visible)
 
void setFilterBarVisible (bool visible)
 
void setHeaderVisible (bool visible)
 
void setJumpToSelectedSegmentEnabled (bool enable)
 Enables automatic jumping to current segment when selection is changed. More...
 
void setLayerColumnVisible (bool visible)
 
void setMRMLScene (vtkMRMLScene *newScene) override
 Set MRML scene. More...
 
void setOpacityColumnVisible (bool visible)
 
void setReadOnly (bool aReadOnly)
 
void setSegmentationNode (vtkMRMLNode *node)
 Set segmentation MRML node. More...
 
void setSelectedSegmentsStatus (int status=-1)
 Set the status of the selected segments. More...
 
void setSelectionMode (int mode)
 
void setStatusColumnVisible (bool visible)
 
void setStatusShown (int status, bool shown)
 
void setTextFilter (QString textFilter)
 
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 filterBarVisible ()
 
bool headerVisible ()
 
Q_INVOKABLE QStringList hideSegments () const
 
bool layerColumnVisible ()
 
Q_INVOKABLE qMRMLSegmentsModelmodel () const
 
bool opacityColumnVisible ()
 
 qMRMLSegmentsTableView (QWidget *parent=nullptr)
 Constructor. More...
 
bool readOnly ()
 
int rowForSegmentID (QString segmentID)
 Get the row for the specified segment ID. More...
 
Q_INVOKABLE vtkMRMLNodesegmentationNode ()
 Get segmentation MRML node. More...
 
int segmentCount () const
 Return number of segments (rows) in the table. More...
 
QString segmentIDForRow (int row)
 Get the segment ID for the specified row. More...
 
Q_INVOKABLE QStringList selectedSegmentIDs ()
 Get the segment IDs 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 qMRMLSortFilterSegmentsProxyModelsortFilterProxyModel () const
 
bool statusColumnVisible ()
 
Q_INVOKABLE bool statusShown (int status)
 
Q_INVOKABLE QTableView * tableWidget ()
 Get access to the table widget to allow low-level customization. More...
 
QString textFilter ()
 
bool visibilityColumnVisible ()
 
 ~qMRMLSegmentsTableView () override
 Destructor. More...
 
- Public Member Functions inherited from qMRMLWidget
Q_INVOKABLE vtkMRMLScenemrmlScene () const
 Return a pointer on the current MRML scene. More...
 
 qMRMLWidget (QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
 
 ~qMRMLWidget () override
 

Static Public Member Functions

static Q_INVOKABLE QString terminologyTooltipForSegment (vtkSegment *segment)
 Assemble terminology info string (for tooltips) from a segment's terminology tags. More...
 
- Static Public Member Functions inherited from qMRMLWidget
static Q_INVOKABLE QPixmap pixmapFromIcon (const QIcon &icon)
 
static Q_INVOKABLE void postInitializeApplication ()
 Initialization that needs to be performed after application object is created. More...
 
static Q_INVOKABLE void preInitializeApplication ()
 

Protected Slots

void endProcessing ()
 Handle MRML scene event. More...
 
void modelAboutToBeReset ()
 Signals to save/restore segment ID selection when the model is reset. More...
 
void modelReset ()
 
void onSegmentAddedOrRemoved ()
 
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 onSegmentsFilterModified ()
 Handles when the filters on underlying sort model are modified. More...
 
void onSegmentsTableClicked (const QModelIndex &modelIndex)
 Handles clicks on a table cell (visibility + state) More...
 
void onShowStatusButtonClicked ()
 Handles clicks on the show status buttons. More...
 
void onVisibility2DFillActionToggled (bool visible)
 
void onVisibility2DOutlineActionToggled (bool visible)
 
void onVisibility3DActionToggled (bool visible)
 Handles actions on table cell (visibility) More...
 
void updateMRMLFromFilterParameters ()
 Update the filter parameters in the vtkMRMLSegmentationNode. More...
 
void updateWidgetFromMRML ()
 

Protected Member Functions

void contextMenuEvent (QContextMenuEvent *event) override
 Handle context menu events. More...
 
bool eventFilter (QObject *target, QEvent *event) override
 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)
 
void setSegmentVisibility (QString segmentId, 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 49 of file qMRMLSegmentsTableView.h.

Member Typedef Documentation

◆ Superclass

Definition at line 67 of file qMRMLSegmentsTableView.h.

Property Documentation

◆ colorColumnVisible

bool qMRMLSegmentsTableView::colorColumnVisible
readwrite

Definition at line 58 of file qMRMLSegmentsTableView.h.

◆ filterBarVisible

bool qMRMLSegmentsTableView::filterBarVisible
readwrite

Definition at line 63 of file qMRMLSegmentsTableView.h.

◆ headerVisible

bool qMRMLSegmentsTableView::headerVisible
readwrite

Definition at line 56 of file qMRMLSegmentsTableView.h.

◆ jumpToSelectedSegmentEnabled

bool qMRMLSegmentsTableView::jumpToSelectedSegmentEnabled
readwrite

Definition at line 65 of file qMRMLSegmentsTableView.h.

◆ layerColumnVisible

bool qMRMLSegmentsTableView::layerColumnVisible
readwrite

Definition at line 61 of file qMRMLSegmentsTableView.h.

◆ opacityColumnVisible

bool qMRMLSegmentsTableView::opacityColumnVisible
readwrite

Definition at line 59 of file qMRMLSegmentsTableView.h.

◆ readOnly

bool qMRMLSegmentsTableView::readOnly
readwrite

Definition at line 62 of file qMRMLSegmentsTableView.h.

◆ selectionMode

int qMRMLSegmentsTableView::selectionMode
readwrite

Definition at line 55 of file qMRMLSegmentsTableView.h.

◆ statusColumnVisible

bool qMRMLSegmentsTableView::statusColumnVisible
readwrite

Definition at line 60 of file qMRMLSegmentsTableView.h.

◆ textFilter

QString qMRMLSegmentsTableView::textFilter
readwrite

Definition at line 64 of file qMRMLSegmentsTableView.h.

◆ visibilityColumnVisible

bool qMRMLSegmentsTableView::visibilityColumnVisible
readwrite

Definition at line 57 of file qMRMLSegmentsTableView.h.

Constructor & Destructor Documentation

◆ qMRMLSegmentsTableView()

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

Constructor.

◆ ~qMRMLSegmentsTableView()

qMRMLSegmentsTableView::~qMRMLSegmentsTableView ( )
override

Destructor.

Member Function Documentation

◆ clearSelectedSegments

void qMRMLSegmentsTableView::clearSelectedSegments ( )
slot

Erase the contents of the selected segments and set the status to "Not started".

◆ clearSelection()

Q_INVOKABLE void qMRMLSegmentsTableView::clearSelection ( )

Clear segment selection.

◆ colorColumnVisible()

bool qMRMLSegmentsTableView::colorColumnVisible ( )

◆ contextMenuEvent()

void qMRMLSegmentsTableView::contextMenuEvent ( QContextMenuEvent *  event)
overrideprotected

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()

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

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

◆ filterBarVisible()

bool qMRMLSegmentsTableView::filterBarVisible ( )

◆ headerVisible()

bool qMRMLSegmentsTableView::headerVisible ( )

◆ hideSegments()

Q_INVOKABLE QStringList qMRMLSegmentsTableView::hideSegments ( ) const

◆ jumpSlices

void qMRMLSegmentsTableView::jumpSlices ( )
slot

Jump position of all slice views to show the segment's center. Segment's center is determined as the center of bounding box.

◆ jumpToSelectedSegmentEnabled

bool qMRMLSegmentsTableView::jumpToSelectedSegmentEnabled ( ) const
slot

Returns true if automatic jump to current segment is enabled.

◆ layerColumnVisible()

bool qMRMLSegmentsTableView::layerColumnVisible ( )

◆ model()

Q_INVOKABLE qMRMLSegmentsModel* qMRMLSegmentsTableView::model ( ) const

◆ modelAboutToBeReset

void qMRMLSegmentsTableView::modelAboutToBeReset ( )
protectedslot

Signals to save/restore segment ID selection when the model is reset.

◆ modelReset

void qMRMLSegmentsTableView::modelReset ( )
protectedslot

◆ moveSelectedSegmentsDown

void qMRMLSegmentsTableView::moveSelectedSegmentsDown ( )
slot

Move selected segments down in the list.

◆ moveSelectedSegmentsUp

void qMRMLSegmentsTableView::moveSelectedSegmentsUp ( )
slot

Move selected segments up in the list.

◆ onSegmentAddedOrRemoved

void qMRMLSegmentsTableView::onSegmentAddedOrRemoved ( )
protectedslot

◆ 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.

◆ onSegmentsFilterModified

void qMRMLSegmentsTableView::onSegmentsFilterModified ( )
protectedslot

Handles when the filters on underlying sort model are modified.

◆ onSegmentsTableClicked

void qMRMLSegmentsTableView::onSegmentsTableClicked ( const QModelIndex &  modelIndex)
protectedslot

Handles clicks on a table cell (visibility + state)

◆ onShowStatusButtonClicked

void qMRMLSegmentsTableView::onShowStatusButtonClicked ( )
protectedslot

Handles clicks on the show status buttons.

◆ onVisibility2DFillActionToggled

void qMRMLSegmentsTableView::onVisibility2DFillActionToggled ( bool  visible)
protectedslot

◆ onVisibility2DOutlineActionToggled

void qMRMLSegmentsTableView::onVisibility2DOutlineActionToggled ( bool  visible)
protectedslot

◆ onVisibility3DActionToggled

void qMRMLSegmentsTableView::onVisibility3DActionToggled ( bool  visible)
protectedslot

Handles actions on table cell (visibility)

◆ opacityColumnVisible()

bool qMRMLSegmentsTableView::opacityColumnVisible ( )

◆ readOnly()

bool qMRMLSegmentsTableView::readOnly ( )

◆ rowForSegmentID()

int qMRMLSegmentsTableView::rowForSegmentID ( QString  segmentID)

Get the row for the specified segment ID.

◆ 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.

◆ segmentIDForRow()

QString qMRMLSegmentsTableView::segmentIDForRow ( int  row)

Get the segment ID for the specified row.

◆ selectedSegmentIDs()

Q_INVOKABLE QStringList qMRMLSegmentsTableView::selectedSegmentIDs ( )

Get the segment IDs 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

◆ setFilterBarVisible

void qMRMLSegmentsTableView::setFilterBarVisible ( 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.

◆ setJumpToSelectedSegmentEnabled

void qMRMLSegmentsTableView::setJumpToSelectedSegmentEnabled ( bool  enable)
slot

Enables automatic jumping to current segment when selection is changed.

◆ setLayerColumnVisible

void qMRMLSegmentsTableView::setLayerColumnVisible ( bool  visible)
slot

◆ setMRMLScene

void qMRMLSegmentsTableView::setMRMLScene ( vtkMRMLScene newScene)
overrideslot

Set MRML scene.

◆ 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() [1/2]

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

◆ setSegmentVisibility() [2/2]

void qMRMLSegmentsTableView::setSegmentVisibility ( QString  segmentId,
int  visible,
int  visible3D,
int  visible2DFill,
int  visible2DOutline 
)
protected

◆ setSelectedSegmentIDs()

Q_INVOKABLE void qMRMLSegmentsTableView::setSelectedSegmentIDs ( QStringList  segmentIDs)

Select segments with specified IDs.

◆ setSelectedSegmentsStatus

void qMRMLSegmentsTableView::setSelectedSegmentsStatus ( int  status = -1)
slot

Set the status of the selected segments.

◆ 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.

◆ setStatusColumnVisible

void qMRMLSegmentsTableView::setStatusColumnVisible ( bool  visible)
slot

◆ setStatusShown

void qMRMLSegmentsTableView::setStatusShown ( int  status,
bool  shown 
)
slot

Set if the specified status should be shown in the table

See also
statusShown

◆ setTextFilter

void qMRMLSegmentsTableView::setTextFilter ( QString  textFilter)
slot

Set the text used to filter the segments in the table

See also
textFilter

◆ setVisibilityColumnVisible

void qMRMLSegmentsTableView::setVisibilityColumnVisible ( bool  visible)
slot

◆ showOnlySelectedSegments

void qMRMLSegmentsTableView::showOnlySelectedSegments ( )
slot

Show only selected segments.

◆ sortFilterProxyModel()

Q_INVOKABLE qMRMLSortFilterSegmentsProxyModel* qMRMLSegmentsTableView::sortFilterProxyModel ( ) const

◆ statusColumnVisible()

bool qMRMLSegmentsTableView::statusColumnVisible ( )

◆ statusShown()

Q_INVOKABLE bool qMRMLSegmentsTableView::statusShown ( int  status)
See also
setStatusShown

◆ tableWidget()

Q_INVOKABLE QTableView* 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.

◆ textFilter()

QString qMRMLSegmentsTableView::textFilter ( )

The text used to filter the segments in the table

See also
setTextFilter

◆ updateMRMLFromFilterParameters

void qMRMLSegmentsTableView::updateMRMLFromFilterParameters ( )
protectedslot

Update the filter parameters in the vtkMRMLSegmentationNode.

◆ updateWidgetFromMRML

void qMRMLSegmentsTableView::updateWidgetFromMRML ( )
protectedslot

Update the widget form the MRML node Called when the segmentation node is modified

◆ visibilityColumnVisible()

bool qMRMLSegmentsTableView::visibilityColumnVisible ( )

Member Data Documentation

◆ d_ptr

QScopedPointer<qMRMLSegmentsTableViewPrivate> qMRMLSegmentsTableView::d_ptr
protected

Definition at line 234 of file qMRMLSegmentsTableView.h.


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