23 #ifndef __qMRMLSegmentEditorWidget_h 24 #define __qMRMLSegmentEditorWidget_h 27 #include "qSlicerSegmentationsModuleWidgetsExport.h" 36 #include <ctkVTKObject.h> 47 class QAbstractButton;
48 class qMRMLSegmentEditorWidgetPrivate;
68 Q_PROPERTY(
bool segmentationNodeSelectorVisible READ segmentationNodeSelectorVisible WRITE setSegmentationNodeSelectorVisible)
69 Q_PROPERTY(
bool masterVolumeNodeSelectorVisible READ masterVolumeNodeSelectorVisible WRITE setMasterVolumeNodeSelectorVisible)
70 Q_PROPERTY(
bool autoShowMasterVolumeNode READ autoShowMasterVolumeNode WRITE setAutoShowMasterVolumeNode)
71 Q_PROPERTY(
bool switchToSegmentationsButtonVisible READ switchToSegmentationsButtonVisible WRITE setSwitchToSegmentationsButtonVisible)
72 Q_PROPERTY(
bool undoEnabled READ undoEnabled WRITE setUndoEnabled)
73 Q_PROPERTY(
int maximumNumberOfUndoStates READ maximumNumberOfUndoStates WRITE setMaximumNumberOfUndoStates)
74 Q_PROPERTY(
bool readOnly READ readOnly WRITE setReadOnly)
75 Q_PROPERTY(Qt::ToolButtonStyle effectButtonStyle READ effectButtonStyle WRITE setEffectButtonStyle)
76 Q_PROPERTY(
bool unorderedEffectsVisible READ unorderedEffectsVisible WRITE setUnorderedEffectsVisible)
91 Q_INVOKABLE QString segmentationNodeID()const;
95 Q_INVOKABLE QString masterVolumeNodeID()const;
98 Q_INVOKABLE QString currentSegmentID()const;
112 Q_INVOKABLE QStringList availableEffectNames();
116 Q_INVOKABLE
void setEffectNameOrder(const QStringList& effectNames);
121 Q_INVOKABLE QStringList effectNameOrder() const;
126 void setUnorderedEffectsVisible(
bool visible);
130 bool unorderedEffectsVisible() const;
134 Q_INVOKABLE
int effectCount();
144 Q_INVOKABLE
void setupViewObservations();
149 Q_INVOKABLE
void removeViewObservations();
152 bool segmentationNodeSelectorVisible() const;
154 bool masterVolumeNodeSelectorVisible() const;
158 bool autoShowMasterVolumeNode() const;
160 bool switchToSegmentationsButtonVisible() const;
162 bool undoEnabled() const;
164 int maximumNumberOfUndoStates() const;
166 bool readOnly() const;
170 Qt::ToolButtonStyle effectButtonStyle() const;
174 Q_INVOKABLE
void segmentationNodeSelectorAddAttribute(const QString& nodeType,
175 const QString& attributeName,
176 const QVariant& attributeValue = QVariant());
179 Q_INVOKABLE
void segmentationNodeSelectorRemoveAttribute(const QString& nodeType,
180 const QString& attributeName);
184 Q_INVOKABLE
void masterVolumeNodeSelectorAddAttribute(const QString& nodeType,
185 const QString& attributeName,
186 const QVariant& attributeValue = QVariant());
189 Q_INVOKABLE
void masterVolumeNodeSelectorRemoveAttribute(const QString& nodeType,
190 const QString& attributeName);
200 virtual
void updateWidgetFromMRML();
205 void setSegmentationNodeID(const QString& nodeID);
209 void setMasterVolumeNodeID(const QString& nodeID);
212 void setCurrentSegmentID(const QString segmentID);
215 void setActiveEffectByName(QString effectName);
219 void saveStateForUndo();
222 void updateVolume(
void* volumePtr,
bool& success);
225 void setSegmentationNodeSelectorVisible(
bool);
227 void setMasterVolumeNodeSelectorVisible(
bool);
231 void setAutoShowMasterVolumeNode(
bool);
233 void setSwitchToSegmentationsButtonVisible(
bool);
235 void setUndoEnabled(
bool);
237 void setMaximumNumberOfUndoStates(
int);
239 void setReadOnly(
bool aReadOnly);
241 void toggleMasterVolumeIntensityMaskEnabled();
252 void installKeyboardShortcuts(QWidget* parent = NULL);
255 void uninstallKeyboardShortcuts();
260 bool turnOffLightboxes();
263 void hideLabelLayer();
267 void setEffectButtonStyle(Qt::ToolButtonStyle toolButtonStyle);
270 void updateEffectLayouts();
276 void showMasterVolumeInSliceViewers(
bool forceShowInBackground = false,
bool fitSlice = false);
280 void currentSegmentIDChanged(const QString&);
296 void onSegmentSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
299 void onInteractionNodeModified();
302 void onEffectButtonClicked(QAbstractButton* button);
307 void onSelectEffectShortcut();
310 void onSelectSegmentShortcut();
315 void onRemoveSegment();
317 void onSwitchToSegmentations();
319 void onCreateSurfaceToggled(
bool on);
321 void onSegmentAddedRemoved();
323 void onMasterVolumeImageDataModified();
325 void onLayoutChanged(
int layoutIndex);
327 void onSegmentationDisplayModified();
330 void onMaskModeChanged(
int);
333 void onMasterVolumeIntensityMaskChecked(
bool checked);
335 void onMasterVolumeIntensityMaskRangeChanged(
double low,
double high);
338 void onOverwriteModeChanged(
int);
341 void onMRMLSceneEndCloseEvent();
344 void initializeParameterSetNode();
347 void onSegmentationHistoryChanged();
350 void anchorClicked(const QUrl &url);
353 void onSetSurfaceSmoothingClicked();
355 void onImportExportActionClicked();
358 void updateMaskingSection();
362 static
void processEvents(vtkObject* caller,
unsigned long eid,
void* clientData,
void* callData);
364 void updateWidgetFromSegmentationNode();
365 void updateWidgetFromMasterVolumeNode();
366 void updateEffectsSectionFromMRML();
370 bool setMasterRepresentationToBinaryLabelmap();
376 QScopedPointer<qMRMLSegmentEditorWidgetPrivate> d_ptr;
379 Q_DECLARE_PRIVATE(qMRMLSegmentEditorWidget);
380 Q_DISABLE_COPY(qMRMLSegmentEditorWidget);
Abstract class for segment editor effects.
A set of MRML Nodes that supports serialization and undo/redo.
Parameter set node for the segment editor widget.
MRML node for representing a volume (image stack).
Abstract Superclass for all specific types of MRML nodes.
MRML node containing segmentationsSegmentation node stores a set of segments (also known as contours ...