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(
int effectColumnCount READ effectColumnCount WRITE setEffectColumnCount)
78 Q_PROPERTY(
bool unorderedEffectsVisible READ unorderedEffectsVisible WRITE setUnorderedEffectsVisible)
79 Q_PROPERTY(QString defaultTerminologyEntrySettingsKey READ defaultTerminologyEntrySettingsKey WRITE setDefaultTerminologyEntrySettingsKey)
80 Q_PROPERTY(QString defaultTerminologyEntry READ defaultTerminologyEntry WRITE setDefaultTerminologyEntry)
81 Q_PROPERTY(
bool jumpToSelectedSegmentEnabled READ jumpToSelectedSegmentEnabled WRITE setJumpToSelectedSegmentEnabled)
96 Q_INVOKABLE QString segmentationNodeID()const;
100 Q_INVOKABLE QString masterVolumeNodeID()const;
103 Q_INVOKABLE QString currentSegmentID()const;
117 Q_INVOKABLE QStringList availableEffectNames();
121 Q_INVOKABLE
void setEffectNameOrder(const QStringList& effectNames);
126 Q_INVOKABLE QStringList effectNameOrder() const;
131 void setUnorderedEffectsVisible(
bool visible);
135 bool unorderedEffectsVisible() const;
139 Q_INVOKABLE
int effectCount();
149 Q_INVOKABLE
void setupViewObservations();
154 Q_INVOKABLE
void removeViewObservations();
157 bool segmentationNodeSelectorVisible() const;
159 bool masterVolumeNodeSelectorVisible() const;
163 bool autoShowMasterVolumeNode() const;
165 bool switchToSegmentationsButtonVisible() const;
167 bool undoEnabled() const;
169 int maximumNumberOfUndoStates() const;
171 bool readOnly() const;
175 Qt::ToolButtonStyle effectButtonStyle() const;
179 int effectColumnCount() const;
183 Q_INVOKABLE
void segmentationNodeSelectorAddAttribute(const QString& nodeType,
184 const QString& attributeName,
185 const QVariant& attributeValue = QVariant());
188 Q_INVOKABLE
void segmentationNodeSelectorRemoveAttribute(const QString& nodeType,
189 const QString& attributeName);
193 Q_INVOKABLE
void masterVolumeNodeSelectorAddAttribute(const QString& nodeType,
194 const QString& attributeName,
195 const QVariant& attributeValue = QVariant());
198 Q_INVOKABLE
void masterVolumeNodeSelectorRemoveAttribute(const QString& nodeType,
199 const QString& attributeName);
211 void setDefaultTerminologyEntrySettingsKey(const QString& terminologyEntrySettingsKey);
214 QString defaultTerminologyEntrySettingsKey() const;
218 void setDefaultTerminologyEntry(const QString& terminologyEntry);
221 QString defaultTerminologyEntry();
224 bool jumpToSelectedSegmentEnabled()const;
234 virtual
void updateWidgetFromMRML();
239 void setSegmentationNodeID(const QString& nodeID);
245 void setMasterVolumeNodeID(const QString& nodeID);
248 void setCurrentSegmentID(const QString segmentID);
251 void setActiveEffectByName(QString effectName);
255 void saveStateForUndo();
258 void updateVolume(
void* volumePtr,
bool& success);
261 void setSegmentationNodeSelectorVisible(
bool);
263 void setMasterVolumeNodeSelectorVisible(
bool);
267 void setAutoShowMasterVolumeNode(
bool);
269 void setSwitchToSegmentationsButtonVisible(
bool);
271 void setUndoEnabled(
bool);
273 void setMaximumNumberOfUndoStates(
int);
275 void setReadOnly(
bool aReadOnly);
277 void toggleMasterVolumeIntensityMaskEnabled();
288 void installKeyboardShortcuts(QWidget* parent =
nullptr);
291 void uninstallKeyboardShortcuts();
296 bool turnOffLightboxes();
299 void hideLabelLayer();
303 void setEffectButtonStyle(Qt::ToolButtonStyle toolButtonStyle);
306 void setEffectColumnCount(
int columnCount);
311 void updateEffectList();
317 void showMasterVolumeInSliceViewers(
bool forceShowInBackground = false,
bool fitSlice = false);
321 void rotateSliceViewsToSegmentation();
328 void selectPreviousSegment();
331 void selectNextSegment();
336 void selectSegmentAtOffset (
int offset);
343 void setJumpToSelectedSegmentEnabled(
bool enable);
347 void currentSegmentIDChanged(const QString&);
363 void onSegmentSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
366 void onInteractionNodeModified();
369 void onEffectButtonClicked(QAbstractButton* button);
374 void onSelectEffectShortcut();
377 void onSelectSegmentShortcut();
382 void onRemoveSegment();
384 void onSwitchToSegmentations();
386 void onCreateSurfaceToggled(
bool on);
388 void onSegmentAddedRemoved();
390 void onMasterVolumeImageDataModified();
392 void onLayoutChanged(
int layoutIndex);
394 void onSegmentationDisplayModified();
397 void onMaskModeChanged(
int);
400 void onMasterVolumeIntensityMaskChecked(
bool checked);
402 void onMasterVolumeIntensityMaskRangeChanged(
double low,
double high);
405 void onOverwriteModeChanged(
int);
408 void onMRMLSceneEndCloseEvent();
411 void initializeParameterSetNode();
414 void updateUndoRedoButtonsState();
417 void onSegmentationHistoryChanged();
420 void onImportExportActionClicked();
422 void onExportToFilesActionClicked();
425 void updateMaskingSection();
428 void updateSliceRotateWarningButtonVisibility();
431 void showSegmentationGeometryDialog();
435 static
void processEvents(vtkObject* caller,
unsigned long eid,
void* clientData,
void* callData);
437 void updateWidgetFromSegmentationNode();
438 void updateWidgetFromMasterVolumeNode();
439 void updateEffectsSectionFromMRML();
443 bool setMasterRepresentationToBinaryLabelmap();
449 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 ...