23 #ifndef __qMRMLSegmentsTableView_h 24 #define __qMRMLSegmentsTableView_h 27 #include "qSlicerSegmentationsModuleWidgetsExport.h" 34 #include <ctkVTKObject.h> 38 class qMRMLSegmentsTableViewPrivate;
41 class QTableWidgetItem;
43 class QContextMenuEvent;
51 enum SegmentTableItemDataRole
54 IDRole = Qt::UserRole + 1,
61 Q_PROPERTY(
int selectionMode READ selectionMode WRITE setSelectionMode)
62 Q_PROPERTY(
bool headerVisible READ headerVisible WRITE setHeaderVisible)
63 Q_PROPERTY(
bool visibilityColumnVisible READ visibilityColumnVisible WRITE setVisibilityColumnVisible)
64 Q_PROPERTY(
bool colorColumnVisible READ colorColumnVisible WRITE setColorColumnVisible)
65 Q_PROPERTY(
bool opacityColumnVisible READ opacityColumnVisible WRITE setOpacityColumnVisible)
66 Q_PROPERTY(
bool readOnly READ readOnly WRITE setReadOnly)
78 Q_INVOKABLE QTableWidget* tableWidget();
81 int segmentCount() const;
84 Q_INVOKABLE QStringList selectedSegmentIDs();
86 Q_INVOKABLE
void setSelectedSegmentIDs(QStringList segmentIDs);
88 Q_INVOKABLE
void clearSelection();
91 Q_INVOKABLE static QString terminologyTooltipForSegment(
vtkSegment* segment);
95 bool visibilityColumnVisible();
96 bool colorColumnVisible();
97 bool opacityColumnVisible();
102 Q_INVOKABLE
void setHideSegments(const QStringList& segmentIDs);
103 Q_INVOKABLE QStringList hideSegments()const;
106 Q_INVOKABLE QStringList displayedSegmentIDs()const;
117 void setSelectionMode(
int mode);
119 void setHeaderVisible(
bool visible);
120 void setVisibilityColumnVisible(
bool visible);
121 void setColorColumnVisible(
bool visible);
122 void setOpacityColumnVisible(
bool visible);
123 void setReadOnly(
bool aReadOnly);
126 void showOnlySelectedSegments();
130 void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
134 void segmentAboutToBeModified(const QString &segmentID);
138 void onSegmentTableItemChanged(QTableWidgetItem* changedItem);
141 void onSegmentSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
144 void onVisibilityButtonClicked();
145 void onVisibility3DActionToggled(
bool visible);
146 void onVisibility2DFillActionToggled(
bool visible);
147 void onVisibility2DOutlineActionToggled(
bool visible);
150 void populateSegmentTable();
153 void updateWidgetFromMRML();
156 void endProcessing();
165 void setSegmentVisibility(QObject* senderObject,
int visible,
int visible3D,
int visible2DFill,
int visible2DOutline);
168 virtual
bool eventFilter(QObject* target, QEvent* event);
171 virtual
void contextMenuEvent(QContextMenuEvent* event);
174 QScopedPointer<qMRMLSegmentsTableViewPrivate> d_ptr;
177 Q_DECLARE_PRIVATE(qMRMLSegmentsTableView);
178 Q_DISABLE_COPY(qMRMLSegmentsTableView);
This class encapsulates a segment that is part of a segmentation.
A set of MRML Nodes that supports serialization and undo/redo.
Abstract Superclass for all specific types of MRML nodes.