23#ifndef __qMRMLSegmentsTableView_h
24#define __qMRMLSegmentsTableView_h
27#include "qSlicerSegmentationsModuleWidgetsExport.h"
34#include <ctkVTKObject.h>
37class qMRMLSegmentsTableViewPrivate;
39class QContextMenuEvent;
43class QTableWidgetItem;
263 void setSegmentVisibility(QObject* senderObject,
int visible,
int visible3D,
int visible2DFill,
int visible2DOutline);
264 void setSegmentVisibility(QString segmentId,
int visible,
int visible3D,
int visible2DFill,
int visible2DOutline);
275 QScopedPointer<qMRMLSegmentsTableViewPrivate>
d_ptr;
void setJumpToSelectedSegmentEnabled(bool enable)
Enables automatic jumping to current segment when selection is changed.
Q_INVOKABLE bool statusShown(int status)
void onSegmentAddedOrRemoved()
Q_INVOKABLE QStringList selectedSegmentIDs()
Get the segment IDs of selected segments.
void toggleSelectedSegmentsVisibility()
Toggle visibility for the selected segments.
void showOnlySelectedSegments()
Show only selected segments.
void onVisibility2DFillActionToggled(bool visible)
bool jumpToSelectedSegmentEnabled
void setUseTerminologySelector(bool useTerminologySelector)
Set if standard terminologies are used for choosing segment name and color.
void onShowStatusButtonClicked()
Handles clicks on the show status buttons.
void contextMenuEvent(QContextMenuEvent *event) override
Handle context menu events.
void moveSelectedSegmentsUp()
Move selected segments up in the list.
void setMRMLScene(vtkMRMLScene *newScene) override
Set MRML scene.
Q_INVOKABLE vtkMRMLNode * segmentationNode()
Get segmentation MRML node.
void setTextFilter(QString textFilter)
Q_INVOKABLE void setSelectedSegmentIDs(QStringList segmentIDs)
Select segments with specified IDs.
Q_INVOKABLE qMRMLSegmentsModel * model() const
void setSelectionMode(int mode)
void onSegmentsFilterModified()
Handles when the filters on underlying sort model are modified.
Q_INVOKABLE QStringList displayedSegmentIDs() const
Return list of visible segment IDs.
void setSelectedSegmentsStatus(int status=-1)
Set the status of the selected segments.
void moveSelectedSegmentsDown()
Move selected segments down in the list.
Q_INVOKABLE qMRMLSortFilterSegmentsProxyModel * sortFilterProxyModel() const
void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
Emitted if selection changes.
static Q_INVOKABLE QString terminologyTooltipForSegment(vtkSegment *segment)
Assemble terminology info string (for tooltips) from a segment's terminology tags.
void setVisibilityColumnVisible(bool visible)
void onSegmentsTableClicked(const QModelIndex &modelIndex)
Handles clicks on a table cell (visibility + state)
void setTerminologySelectorOptionVisible(bool visible)
Set if the user can choose between the standard terminologies selector or the simple selectors for se...
Q_INVOKABLE QTableView * tableWidget()
Get access to the table widget to allow low-level customization.
void onVisibility2DOutlineActionToggled(bool visible)
void onUseTerminologyActionToggled(bool useTerminology)
Toggle using standard terminology for this segments table.
Q_INVOKABLE void clearSelection()
Clear segment selection.
void setUseTerminologySelectorSettingsKey(QString settingsKey)
Q_INVOKABLE void setHideSegments(const QStringList &segmentIDs)
void segmentAboutToBeModified(const QString &segmentID)
Q_INVOKABLE QStringList hideSegments() const
bool visibilityColumnVisible
void updateMRMLFromFilterParameters()
Update the filter parameters in the vtkMRMLSegmentationNode.
void setFilterBarVisible(bool visible)
void modelAboutToBeReset()
Signals to save/restore segment ID selection when the model is reset.
bool eventFilter(QObject *target, QEvent *event) override
To prevent accidentally moving out of the widget when pressing up/down arrows.
void setStatusColumnVisible(bool visible)
bool terminologySelectorAutoDisable
bool opacityColumnVisible
void onSegmentsTableDoubleClicked(const QModelIndex &modelIndex)
Handles clicks on a table cell (name + color change / terminology change)
void clearSelectedSegments()
Erase the contents of the selected segments and set the status to "Not started".
void setHeaderVisible(bool visible)
void setTerminologySelectorAutoDisable(bool autoDisable)
Offer automatic disable of using standard terminologies selector if custom segment names or colors ar...
bool useTerminologySelector
qMRMLSegmentsTableView(QWidget *parent=nullptr)
Constructor.
void endProcessing()
Handle MRML scene event.
Q_INVOKABLE QString segmentIDForRow(int row)
Get the segment ID for the specified row.
void setReadOnly(bool aReadOnly)
void setOpacityColumnVisible(bool visible)
void setSegmentVisibility(QObject *senderObject, int visible, int visible3D, int visible2DFill, int visible2DOutline)
bool terminologySelectorOptionVisible
void onSegmentSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
Forwards selection changed events. In case of batch update of items, selected and deselected are empt...
void setLayerColumnVisible(bool visible)
void onVisibility3DActionToggled(bool visible)
Handles actions on table cell (visibility)
Q_INVOKABLE int rowForSegmentID(QString segmentID)
Get the row for the specified segment ID.
QScopedPointer< qMRMLSegmentsTableViewPrivate > d_ptr
void setStatusShown(int status, bool shown)
void updateWidgetFromMRML()
void setSegmentationNode(vtkMRMLNode *node)
Set segmentation MRML node.
bool userSetCustomNameOrColor()
QString useTerminologySelectorSettingsKey
void setColorColumnVisible(bool visible)
Abstract Superclass for all specific types of MRML nodes.
A set of MRML Nodes that supports serialization and undo/redo.
This class encapsulates a segment that is part of a segmentation.