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();
133 void moveSelectedSegmentsUp();
135 void moveSelectedSegmentsDown();
139 void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
143 void segmentAboutToBeModified(const QString &segmentID);
147 void onSegmentTableItemChanged(QTableWidgetItem* changedItem);
150 void onSegmentSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
153 void onVisibilityButtonClicked();
154 void onVisibility3DActionToggled(
bool visible);
155 void onVisibility2DFillActionToggled(
bool visible);
156 void onVisibility2DOutlineActionToggled(
bool visible);
159 void populateSegmentTable();
162 void updateWidgetFromMRML();
165 void endProcessing();
174 void setSegmentVisibility(QObject* senderObject,
int visible,
int visible3D,
int visible2DFill,
int visible2DOutline);
177 virtual
bool eventFilter(QObject* target, QEvent* event);
180 virtual
void contextMenuEvent(QContextMenuEvent* event);
183 QScopedPointer<qMRMLSegmentsTableViewPrivate> d_ptr;
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.