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 sourceVolumeNodeSelectorVisible READ sourceVolumeNodeSelectorVisible WRITE setSourceVolumeNodeSelectorVisible)
71 Q_PROPERTY(
bool autoShowSourceVolumeNode READ autoShowSourceVolumeNode WRITE setAutoShowSourceVolumeNode)
72 Q_PROPERTY(
bool masterVolumeNodeSelectorVisible READ masterVolumeNodeSelectorVisible WRITE setMasterVolumeNodeSelectorVisible)
73 Q_PROPERTY(
bool autoShowMasterVolumeNode READ autoShowMasterVolumeNode WRITE setAutoShowMasterVolumeNode)
74 Q_PROPERTY(
bool switchToSegmentationsButtonVisible READ switchToSegmentationsButtonVisible WRITE setSwitchToSegmentationsButtonVisible)
75 Q_PROPERTY(
bool undoEnabled READ undoEnabled WRITE setUndoEnabled)
76 Q_PROPERTY(
int maximumNumberOfUndoStates READ maximumNumberOfUndoStates WRITE setMaximumNumberOfUndoStates)
77 Q_PROPERTY(
bool readOnly READ readOnly WRITE setReadOnly)
78 Q_PROPERTY(Qt::ToolButtonStyle effectButtonStyle READ effectButtonStyle WRITE setEffectButtonStyle)
79 Q_PROPERTY(
int effectColumnCount READ effectColumnCount WRITE setEffectColumnCount)
80 Q_PROPERTY(
bool unorderedEffectsVisible READ unorderedEffectsVisible WRITE setUnorderedEffectsVisible)
81 Q_PROPERTY(QString defaultTerminologyEntrySettingsKey READ defaultTerminologyEntrySettingsKey WRITE setDefaultTerminologyEntrySettingsKey)
82 Q_PROPERTY(QString defaultTerminologyEntry READ defaultTerminologyEntry WRITE setDefaultTerminologyEntry)
83 Q_PROPERTY(
bool jumpToSelectedSegmentEnabled READ jumpToSelectedSegmentEnabled WRITE setJumpToSelectedSegmentEnabled)
98 Q_INVOKABLE QString segmentationNodeID()const;
102 Q_INVOKABLE QString sourceVolumeNodeID()const;
107 qWarning(
"qMRMLSegmentEditorWidget::masterVolumeNode is deprecated, use sourceVolumeNode() method instead.");
108 return this->sourceVolumeNode();
113 qWarning(
"qMRMLSegmentEditorWidget::masterVolumeNodeID is deprecated, use sourceVolumeNodeID() method instead.");
114 return this->sourceVolumeNodeID();
117 Q_INVOKABLE QString currentSegmentID()
const;
131 Q_INVOKABLE QStringList availableEffectNames();
135 Q_INVOKABLE
void setEffectNameOrder(
const QStringList& effectNames);
140 Q_INVOKABLE QStringList effectNameOrder()
const;
145 void setUnorderedEffectsVisible(
bool visible);
149 bool unorderedEffectsVisible()
const;
153 Q_INVOKABLE
int effectCount();
163 Q_INVOKABLE
void setupViewObservations();
168 Q_INVOKABLE
void removeViewObservations();
171 bool segmentationNodeSelectorVisible()
const;
173 bool sourceVolumeNodeSelectorVisible()
const;
177 bool autoShowSourceVolumeNode()
const;
182 qWarning(
"qMRMLSegmentEditorWidget::masterVolumeNodeSelectorVisible is deprecated, use sourceVolumeNodeSelectorVisible() method instead.");
183 return this->sourceVolumeNodeSelectorVisible();
188 qWarning(
"qMRMLSegmentEditorWidget::autoShowMasterVolumeNode is deprecated, use autoShowSourceVolumeNode() method instead.");
189 return this->autoShowSourceVolumeNode();
193 bool switchToSegmentationsButtonVisible()
const;
195 bool undoEnabled()
const;
197 int maximumNumberOfUndoStates()
const;
199 bool readOnly()
const;
203 Qt::ToolButtonStyle effectButtonStyle()
const;
207 int effectColumnCount()
const;
211 Q_INVOKABLE
void segmentationNodeSelectorAddAttribute(
const QString& nodeType,
212 const QString& attributeName,
213 const QVariant& attributeValue = QVariant());
216 Q_INVOKABLE
void segmentationNodeSelectorRemoveAttribute(
const QString& nodeType,
217 const QString& attributeName);
221 Q_INVOKABLE
void sourceVolumeNodeSelectorAddAttribute(
const QString& nodeType,
222 const QString& attributeName,
223 const QVariant& attributeValue = QVariant());
226 Q_INVOKABLE
void sourceVolumeNodeSelectorRemoveAttribute(
const QString& nodeType,
227 const QString& attributeName);
231 const QString& attributeName,
232 const QVariant& attributeValue = QVariant())
234 qWarning(
"qMRMLSegmentEditorWidget::masterVolumeNodeSelectorAddAttribute is deprecated, use sourceVolumeNodeSelectorAddAttribute method instead.");
235 this->sourceVolumeNodeSelectorAddAttribute(nodeType, attributeName, attributeValue);
239 const QString& attributeName)
241 qWarning(
"qMRMLSegmentEditorWidget::masterVolumeNodeSelectorRemoveAttribute is deprecated," 242 " use sourceVolumeNodeSelectorRemoveAttribute instead.");
243 this->sourceVolumeNodeSelectorRemoveAttribute(nodeType, attributeName);
256 void setDefaultTerminologyEntrySettingsKey(
const QString& terminologyEntrySettingsKey);
259 QString defaultTerminologyEntrySettingsKey()
const;
263 void setDefaultTerminologyEntry(
const QString& terminologyEntry);
266 QString defaultTerminologyEntry();
269 bool jumpToSelectedSegmentEnabled()
const;
279 virtual void updateWidgetFromMRML();
284 void setSegmentationNodeID(
const QString& nodeID);
290 void setSourceVolumeNodeID(
const QString& nodeID);
295 qWarning(
"qMRMLSegmentEditorWidget::setMasterVolumeNode is deprecated, use setSourceVolumeNode method instead.");
296 this->setSourceVolumeNode(node);
301 qWarning(
"qMRMLSegmentEditorWidget::setMasterVolumeNodeID is deprecated, use setSourceVolumeNodeID method instead.");
302 this->setSourceVolumeNodeID(nodeID);
306 void setCurrentSegmentID(
const QString segmentID);
309 void setActiveEffectByName(QString effectName);
313 void saveStateForUndo();
316 void updateVolume(
void* volumePtr,
bool& success);
319 void setSegmentationNodeSelectorVisible(
bool);
321 void setSourceVolumeNodeSelectorVisible(
bool);
325 void setAutoShowSourceVolumeNode(
bool);
327 void setSwitchToSegmentationsButtonVisible(
bool);
329 void setUndoEnabled(
bool);
331 void setMaximumNumberOfUndoStates(
int);
333 void setReadOnly(
bool aReadOnly);
335 void toggleSourceVolumeIntensityMaskEnabled();
340 qWarning(
"qMRMLSegmentEditorWidget::setMasterVolumeNodeSelectorVisible is deprecated, use setSourceVolumeNodeSelectorVisible method instead.");
341 this->setSourceVolumeNodeSelectorVisible(visible);
346 qWarning(
"qMRMLSegmentEditorWidget::setAutoShowMasterVolumeNode is deprecated, use setAutoShowSourceVolumeNode method instead.");
347 this->setAutoShowSourceVolumeNode(autoShow);
352 qWarning(
"qMRMLSegmentEditorWidget::toggleMasterVolumeIntensityMaskEnabled is deprecated, use toggleSourceVolumeIntensityMaskEnabled method instead.");
353 this->toggleSourceVolumeIntensityMaskEnabled();
365 void installKeyboardShortcuts(QWidget* parent =
nullptr);
368 void uninstallKeyboardShortcuts();
373 bool turnOffLightboxes();
376 void hideLabelLayer();
380 void setEffectButtonStyle(Qt::ToolButtonStyle toolButtonStyle);
383 void setEffectColumnCount(
int columnCount);
388 void updateEffectList();
394 void showSourceVolumeInSliceViewers(
bool forceShowInBackground =
false,
bool fitSlice =
false);
399 qWarning(
"qMRMLSegmentEditorWidget::showMasterVolumeInSliceViewers is deprecated, use showSourceVolumeInSliceViewers method instead.");
400 this->showSourceVolumeInSliceViewers(forceShowInBackground, fitSlice);
405 void rotateSliceViewsToSegmentation();
412 void selectPreviousSegment();
415 void selectNextSegment();
420 void selectSegmentAtOffset (
int offset);
427 void setJumpToSelectedSegmentEnabled(
bool enable);
431 void currentSegmentIDChanged(
const QString&);
450 void onSegmentSelectionChanged(
const QItemSelection &selected,
const QItemSelection &deselected);
453 void onInteractionNodeModified();
456 void onEffectButtonClicked(QAbstractButton* button);
461 void onSelectEffectShortcut();
464 void onSelectSegmentShortcut();
469 void onRemoveSegment();
471 void onSwitchToSegmentations();
473 void onCreateSurfaceToggled(
bool on);
475 void onSegmentAddedRemoved();
477 void onSourceVolumeImageDataModified();
479 void onLayoutChanged(
int layoutIndex);
481 void onSegmentationDisplayModified();
484 void onMaskModeChanged(
int);
487 void onSourceVolumeIntensityMaskChecked(
bool checked);
489 void onSourceVolumeIntensityMaskRangeChanged(
double low,
double high);
492 void onOverwriteModeChanged(
int);
495 void onMRMLSceneEndCloseEvent();
498 void onMRMLSceneEndBatchProcessEvent();
501 void initializeParameterSetNode();
504 void updateUndoRedoButtonsState();
507 void onSegmentationHistoryChanged();
510 void onImportExportActionClicked();
512 void onExportToFilesActionClicked();
515 void updateMaskingSection();
518 void updateSliceRotateWarningButtonVisibility();
521 void showSegmentationGeometryDialog();
525 static void processEvents(vtkObject* caller,
unsigned long eid,
void* clientData,
void* callData);
527 void updateWidgetFromSegmentationNode();
528 void updateWidgetFromSourceVolumeNode();
529 void updateEffectsSectionFromMRML();
533 bool setMasterRepresentationToBinaryLabelmap();
539 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 ...