23 #ifndef __qMRMLSegmentsTableView_h 24 #define __qMRMLSegmentsTableView_h 27 #include "qSlicerSegmentationsModuleWidgetsExport.h" 34 #include <ctkVTKObject.h> 37 class qMRMLSegmentsTableViewPrivate;
39 class QContextMenuEvent;
43 class QTableWidgetItem;
55 Q_PROPERTY(
int selectionMode READ selectionMode WRITE setSelectionMode)
56 Q_PROPERTY(
bool headerVisible READ headerVisible WRITE setHeaderVisible)
57 Q_PROPERTY(
bool visibilityColumnVisible READ visibilityColumnVisible WRITE setVisibilityColumnVisible)
58 Q_PROPERTY(
bool colorColumnVisible READ colorColumnVisible WRITE setColorColumnVisible)
59 Q_PROPERTY(
bool opacityColumnVisible READ opacityColumnVisible WRITE setOpacityColumnVisible)
60 Q_PROPERTY(
bool statusColumnVisible READ statusColumnVisible WRITE setStatusColumnVisible)
61 Q_PROPERTY(
bool layerColumnVisible READ layerColumnVisible WRITE setLayerColumnVisible)
62 Q_PROPERTY(
bool readOnly READ readOnly WRITE setReadOnly)
63 Q_PROPERTY(
bool filterBarVisible READ filterBarVisible WRITE setFilterBarVisible)
64 Q_PROPERTY(QString textFilter READ textFilter WRITE setTextFilter)
65 Q_PROPERTY(
bool jumpToSelectedSegmentEnabled READ jumpToSelectedSegmentEnabled WRITE setJumpToSelectedSegmentEnabled)
77 Q_INVOKABLE QTableView* tableWidget();
80 int segmentCount() const;
83 Q_INVOKABLE QStringList selectedSegmentIDs();
85 Q_INVOKABLE
void setSelectedSegmentIDs(QStringList segmentIDs);
87 Q_INVOKABLE
void clearSelection();
90 Q_INVOKABLE static QString terminologyTooltipForSegment(
vtkSegment* segment);
94 bool visibilityColumnVisible();
95 bool colorColumnVisible();
96 bool opacityColumnVisible();
97 bool statusColumnVisible();
98 bool layerColumnVisible();
100 bool filterBarVisible();
104 Q_INVOKABLE
void setHideSegments(const QStringList& segmentIDs);
105 Q_INVOKABLE QStringList hideSegments()const;
108 Q_INVOKABLE QStringList displayedSegmentIDs()const;
115 QString textFilter();
118 Q_INVOKABLE
bool statusShown(
int status);
121 int rowForSegmentID(QString segmentID);
123 QString segmentIDForRow(
int row);
134 void setSelectionMode(
int mode);
136 void setHeaderVisible(
bool visible);
137 void setVisibilityColumnVisible(
bool visible);
138 void setColorColumnVisible(
bool visible);
139 void setOpacityColumnVisible(
bool visible);
140 void setStatusColumnVisible(
bool visible);
141 void setLayerColumnVisible(
bool visible);
142 void setReadOnly(
bool aReadOnly);
143 void setFilterBarVisible(
bool visible);
146 void showOnlySelectedSegments();
153 void setJumpToSelectedSegmentEnabled(
bool enable);
156 void setSelectedSegmentsStatus(
int status=-1);
159 void clearSelectedSegments();
162 void moveSelectedSegmentsUp();
164 void moveSelectedSegmentsDown();
168 void setTextFilter(QString textFilter);
171 void setStatusShown(
int status,
bool shown);
174 bool jumpToSelectedSegmentEnabled()const;
178 void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
182 void segmentAboutToBeModified(const QString &segmentID);
186 void onSegmentSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
189 void onVisibility3DActionToggled(
bool visible);
190 void onVisibility2DFillActionToggled(
bool visible);
191 void onVisibility2DOutlineActionToggled(
bool visible);
194 void onSegmentsFilterModified();
196 void onShowStatusButtonClicked();
199 void onSegmentsTableClicked(const QModelIndex& modelIndex);
202 void endProcessing();
204 void onSegmentAddedOrRemoved();
208 void updateWidgetFromMRML();
211 void updateMRMLFromFilterParameters();
214 void modelAboutToBeReset();
224 void setSegmentVisibility(QObject* senderObject,
int visible,
int visible3D,
int visible2DFill,
int visible2DOutline);
225 void setSegmentVisibility(QString segmentId,
int visible,
int visible3D,
int visible2DFill,
int visible2DOutline);
228 bool eventFilter(QObject* target, QEvent* event) override;
231 void contextMenuEvent(QContextMenuEvent* event) override;
234 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.