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)
78 Q_PROPERTY(QString defaultTerminologyEntrySettingsKey READ defaultTerminologyEntrySettingsKey WRITE setDefaultTerminologyEntrySettingsKey)
79 Q_PROPERTY(QString defaultTerminologyEntry READ defaultTerminologyEntry WRITE setDefaultTerminologyEntry)
80 Q_PROPERTY(
bool jumpToSelectedSegmentEnabled READ jumpToSelectedSegmentEnabled WRITE setJumpToSelectedSegmentEnabled)
95 Q_INVOKABLE QString segmentationNodeID()const;
99 Q_INVOKABLE QString masterVolumeNodeID()const;
102 Q_INVOKABLE QString currentSegmentID()const;
116 Q_INVOKABLE QStringList availableEffectNames();
120 Q_INVOKABLE
void setEffectNameOrder(const QStringList& effectNames);
125 Q_INVOKABLE QStringList effectNameOrder() const;
130 void setUnorderedEffectsVisible(
bool visible);
134 bool unorderedEffectsVisible() const;
138 Q_INVOKABLE
int effectCount();
148 Q_INVOKABLE
void setupViewObservations();
153 Q_INVOKABLE
void removeViewObservations();
156 bool segmentationNodeSelectorVisible() const;
158 bool masterVolumeNodeSelectorVisible() const;
162 bool autoShowMasterVolumeNode() const;
164 bool switchToSegmentationsButtonVisible() const;
166 bool undoEnabled() const;
168 int maximumNumberOfUndoStates() const;
170 bool readOnly() const;
174 Qt::ToolButtonStyle effectButtonStyle() const;
178 Q_INVOKABLE
void segmentationNodeSelectorAddAttribute(const QString& nodeType,
179 const QString& attributeName,
180 const QVariant& attributeValue = QVariant());
183 Q_INVOKABLE
void segmentationNodeSelectorRemoveAttribute(const QString& nodeType,
184 const QString& attributeName);
188 Q_INVOKABLE
void masterVolumeNodeSelectorAddAttribute(const QString& nodeType,
189 const QString& attributeName,
190 const QVariant& attributeValue = QVariant());
193 Q_INVOKABLE
void masterVolumeNodeSelectorRemoveAttribute(const QString& nodeType,
194 const QString& attributeName);
206 void setDefaultTerminologyEntrySettingsKey(const QString& terminologyEntrySettingsKey);
209 QString defaultTerminologyEntrySettingsKey() const;
213 void setDefaultTerminologyEntry(const QString& terminologyEntry);
216 QString defaultTerminologyEntry();
219 bool jumpToSelectedSegmentEnabled()const;
229 virtual
void updateWidgetFromMRML();
234 void setSegmentationNodeID(const QString& nodeID);
240 void setMasterVolumeNodeID(const QString& nodeID);
243 void setCurrentSegmentID(const QString segmentID);
246 void setActiveEffectByName(QString effectName);
250 void saveStateForUndo();
253 void updateVolume(
void* volumePtr,
bool& success);
256 void setSegmentationNodeSelectorVisible(
bool);
258 void setMasterVolumeNodeSelectorVisible(
bool);
262 void setAutoShowMasterVolumeNode(
bool);
264 void setSwitchToSegmentationsButtonVisible(
bool);
266 void setUndoEnabled(
bool);
268 void setMaximumNumberOfUndoStates(
int);
270 void setReadOnly(
bool aReadOnly);
272 void toggleMasterVolumeIntensityMaskEnabled();
283 void installKeyboardShortcuts(QWidget* parent =
nullptr);
286 void uninstallKeyboardShortcuts();
291 bool turnOffLightboxes();
294 void hideLabelLayer();
298 void setEffectButtonStyle(Qt::ToolButtonStyle toolButtonStyle);
301 void updateEffectLayouts();
306 void updateEffectList();
312 void showMasterVolumeInSliceViewers(
bool forceShowInBackground = false,
bool fitSlice = false);
316 void rotateSliceViewsToSegmentation();
323 void selectPreviousSegment();
326 void selectNextSegment();
331 void selectSegmentAtOffset (
int offset);
338 void setJumpToSelectedSegmentEnabled(
bool enable);
342 void currentSegmentIDChanged(const QString&);
358 void onSegmentSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
361 void onInteractionNodeModified();
364 void onEffectButtonClicked(QAbstractButton* button);
369 void onSelectEffectShortcut();
372 void onSelectSegmentShortcut();
377 void onRemoveSegment();
379 void onSwitchToSegmentations();
381 void onCreateSurfaceToggled(
bool on);
383 void onSegmentAddedRemoved();
385 void onMasterVolumeImageDataModified();
387 void onLayoutChanged(
int layoutIndex);
389 void onSegmentationDisplayModified();
392 void onMaskModeChanged(
int);
395 void onMasterVolumeIntensityMaskChecked(
bool checked);
397 void onMasterVolumeIntensityMaskRangeChanged(
double low,
double high);
400 void onOverwriteModeChanged(
int);
403 void onMRMLSceneEndCloseEvent();
406 void initializeParameterSetNode();
409 void onSegmentationHistoryChanged();
412 void anchorClicked(const QUrl &url);
415 void onEnableSurfaceSmoothingToggled(
bool enabled);
416 void onSurfaceSmoothingFactorChanged(
double newSmoothingFactor);
418 void onImportExportActionClicked();
420 void onExportToFilesActionClicked();
423 void updateMaskingSection();
426 void updateSliceRotateWarningButtonVisibility();
429 void showSegmentationGeometryDialog();
433 static
void processEvents(vtkObject* caller,
unsigned long eid,
void* clientData,
void* callData);
435 void updateWidgetFromSegmentationNode();
436 void updateWidgetFromMasterVolumeNode();
437 void updateEffectsSectionFromMRML();
441 bool setMasterRepresentationToBinaryLabelmap();
447 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 ...