23 #ifndef __qMRMLSegmentEditorWidget_h 24 #define __qMRMLSegmentEditorWidget_h 27 #include "qSlicerSegmentationsModuleWidgetsExport.h" 36 #include <ctkVTKObject.h> 48 class QAbstractButton;
49 class qMRMLSegmentEditorWidgetPrivate;
69 Q_PROPERTY(
bool segmentationNodeSelectorVisible READ segmentationNodeSelectorVisible WRITE setSegmentationNodeSelectorVisible)
70 Q_PROPERTY(
bool masterVolumeNodeSelectorVisible READ masterVolumeNodeSelectorVisible WRITE setMasterVolumeNodeSelectorVisible)
71 Q_PROPERTY(
bool autoShowMasterVolumeNode READ autoShowMasterVolumeNode WRITE setAutoShowMasterVolumeNode)
72 Q_PROPERTY(
bool switchToSegmentationsButtonVisible READ switchToSegmentationsButtonVisible WRITE setSwitchToSegmentationsButtonVisible)
73 Q_PROPERTY(
bool undoEnabled READ undoEnabled WRITE setUndoEnabled)
74 Q_PROPERTY(
int maximumNumberOfUndoStates READ maximumNumberOfUndoStates WRITE setMaximumNumberOfUndoStates)
75 Q_PROPERTY(
bool readOnly READ readOnly WRITE setReadOnly)
76 Q_PROPERTY(Qt::ToolButtonStyle effectButtonStyle READ effectButtonStyle WRITE setEffectButtonStyle)
77 Q_PROPERTY(
bool unorderedEffectsVisible READ unorderedEffectsVisible WRITE setUnorderedEffectsVisible)
92 Q_INVOKABLE QString segmentationNodeID()const;
96 Q_INVOKABLE QString masterVolumeNodeID()const;
99 Q_INVOKABLE QString currentSegmentID()const;
113 Q_INVOKABLE QStringList availableEffectNames();
117 Q_INVOKABLE
void setEffectNameOrder(const QStringList& effectNames);
122 Q_INVOKABLE QStringList effectNameOrder() const;
127 void setUnorderedEffectsVisible(
bool visible);
131 bool unorderedEffectsVisible() const;
135 Q_INVOKABLE
int effectCount();
145 Q_INVOKABLE
void setupViewObservations();
150 Q_INVOKABLE
void removeViewObservations();
153 bool segmentationNodeSelectorVisible() const;
155 bool masterVolumeNodeSelectorVisible() const;
159 bool autoShowMasterVolumeNode() const;
161 bool switchToSegmentationsButtonVisible() const;
163 bool undoEnabled() const;
165 int maximumNumberOfUndoStates() const;
167 bool readOnly() const;
171 Qt::ToolButtonStyle effectButtonStyle() const;
175 Q_INVOKABLE
void segmentationNodeSelectorAddAttribute(const QString& nodeType,
176 const QString& attributeName,
177 const QVariant& attributeValue = QVariant());
180 Q_INVOKABLE
void segmentationNodeSelectorRemoveAttribute(const QString& nodeType,
181 const QString& attributeName);
185 Q_INVOKABLE
void masterVolumeNodeSelectorAddAttribute(const QString& nodeType,
186 const QString& attributeName,
187 const QVariant& attributeValue = QVariant());
190 Q_INVOKABLE
void masterVolumeNodeSelectorRemoveAttribute(const QString& nodeType,
191 const QString& attributeName);
205 virtual
void updateWidgetFromMRML();
210 void setSegmentationNodeID(const QString& nodeID);
216 void setMasterVolumeNodeID(const QString& nodeID);
219 void setCurrentSegmentID(const QString segmentID);
222 void setActiveEffectByName(QString effectName);
226 void saveStateForUndo();
229 void updateVolume(
void* volumePtr,
bool& success);
232 void setSegmentationNodeSelectorVisible(
bool);
234 void setMasterVolumeNodeSelectorVisible(
bool);
238 void setAutoShowMasterVolumeNode(
bool);
240 void setSwitchToSegmentationsButtonVisible(
bool);
242 void setUndoEnabled(
bool);
244 void setMaximumNumberOfUndoStates(
int);
246 void setReadOnly(
bool aReadOnly);
248 void toggleMasterVolumeIntensityMaskEnabled();
259 void installKeyboardShortcuts(QWidget* parent = NULL);
262 void uninstallKeyboardShortcuts();
267 bool turnOffLightboxes();
270 void hideLabelLayer();
274 void setEffectButtonStyle(Qt::ToolButtonStyle toolButtonStyle);
277 void updateEffectLayouts();
282 void updateEffectList();
288 void showMasterVolumeInSliceViewers(
bool forceShowInBackground = false,
bool fitSlice = false);
292 void rotateSliceViewsToSegmentation();
300 void currentSegmentIDChanged(const QString&);
316 void onSegmentSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
319 void onInteractionNodeModified();
322 void onEffectButtonClicked(QAbstractButton* button);
327 void onSelectEffectShortcut();
330 void onSelectSegmentShortcut();
335 void onRemoveSegment();
337 void onSwitchToSegmentations();
339 void onCreateSurfaceToggled(
bool on);
341 void onSegmentAddedRemoved();
343 void onMasterVolumeImageDataModified();
345 void onLayoutChanged(
int layoutIndex);
347 void onSegmentationDisplayModified();
350 void onMaskModeChanged(
int);
353 void onMasterVolumeIntensityMaskChecked(
bool checked);
355 void onMasterVolumeIntensityMaskRangeChanged(
double low,
double high);
358 void onOverwriteModeChanged(
int);
361 void onMRMLSceneEndCloseEvent();
364 void initializeParameterSetNode();
367 void onSegmentationHistoryChanged();
370 void anchorClicked(const QUrl &url);
373 void onEnableSurfaceSmoothingToggled(
bool enabled);
374 void onSurfaceSmoothingFactorChanged(
double newSmoothingFactor);
376 void onImportExportActionClicked();
378 void onExportToFilesActionClicked();
381 void updateMaskingSection();
384 void updateSliceRotateWarningButtonVisibility();
387 void showSegmentationGeometryDialog();
391 static
void processEvents(vtkObject* caller,
unsigned long eid,
void* clientData,
void* callData);
393 void updateWidgetFromSegmentationNode();
394 void updateWidgetFromMasterVolumeNode();
395 void updateEffectsSectionFromMRML();
399 bool setMasterRepresentationToBinaryLabelmap();
405 QScopedPointer<qMRMLSegmentEditorWidgetPrivate> d_ptr;
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 ...