21 #ifndef __qSlicerSegmentEditorAbstractEffect_h 22 #define __qSlicerSegmentEditorAbstractEffect_h 25 #include "qSlicerSegmentationsEditorEffectsExport.h" 34 class qSlicerSegmentEditorAbstractEffectPrivate;
44 class vtkRenderWindow;
45 class vtkRenderWindowInteractor;
64 Q_PROPERTY(QString name READ name WRITE setName)
69 Q_PROPERTY(
bool perSegment READ perSegment WRITE setPerSegment)
75 Q_PROPERTY(
bool showEffectCursorInSliceView READ showEffectCursorInSliceView WRITE setShowEffectCursorInSliceView)
79 Q_PROPERTY(
bool showEffectCursorInThreeDView READ showEffectCursorInThreeDView WRITE setShowEffectCursorInThreeDView)
95 ModificationModeRemoveAll
99 virtual QIcon
icon() {
return QIcon(); };
102 Q_INVOKABLE
virtual const QString
helpText()
const {
return QString(); };
109 Q_INVOKABLE
virtual void activate();
113 Q_INVOKABLE
virtual void deactivate();
116 Q_INVOKABLE
virtual bool active();
118 Q_INVOKABLE
virtual void modifySelectedSegmentByLabelmap(
vtkOrientedImageData* modifierLabelmap, ModificationMode modificationMode,
const int modificationExtent[6]);
119 Q_INVOKABLE
virtual void modifySelectedSegmentByLabelmap(
vtkOrientedImageData* modifierLabelmap, ModificationMode modificationMode);
120 Q_INVOKABLE
virtual void modifySelectedSegmentByLabelmap(
vtkOrientedImageData* modifierLabelmap, ModificationMode modificationMode,
QList<int> extent);
132 virtual QCursor createCursor(
qMRMLWidget* viewWidget);
140 { Q_UNUSED(callerInteractor); Q_UNUSED(eid); Q_UNUSED(viewWidget);
return false; };
147 { Q_UNUSED(callerViewNode); Q_UNUSED(eid); Q_UNUSED(viewWidget); };
151 virtual void setMRMLDefaults() = 0;
168 virtual void updateGUIFromMRML() = 0;
172 virtual void updateMRMLFromGUI() = 0;
185 Q_INVOKABLE QFrame* optionsFrame();
188 Q_INVOKABLE QFormLayout* optionsLayout();
192 Q_INVOKABLE
void addActor2D(
qMRMLWidget* viewWidget, vtkActor2D* actor);
195 Q_INVOKABLE
void removeActor2D(
qMRMLWidget* viewWidget, vtkActor2D* actor);
199 Q_INVOKABLE
void addActor3D(
qMRMLWidget* viewWidget, vtkProp3D* actor);
202 Q_INVOKABLE
void removeActor3D(
qMRMLWidget* viewWidget, vtkProp3D* actor);
207 Q_INVOKABLE
void addOptionsWidget(QWidget* newOptionsWidget);
208 Q_INVOKABLE
void addOptionsWidget(QLayout* newOptionsWidget);
210 Q_INVOKABLE QWidget* addLabeledOptionsWidget(QString label, QWidget* newOptionsWidget);
211 Q_INVOKABLE QWidget* addLabeledOptionsWidget(QString label, QLayout* newOptionsWidget);
214 virtual QString name()
const;
217 virtual void setName(QString name);
220 virtual bool perSegment()
const;
223 virtual void setPerSegment(
bool perSegment);
226 Q_INVOKABLE
void cursorOff(
qMRMLWidget* viewWidget);
228 Q_INVOKABLE
void cursorOn(
qMRMLWidget* viewWidget);
232 Q_INVOKABLE
void selectEffect(QString effectName);
238 void setCallbackSlots(QObject* receiver,
const char* selectEffectSlot,
const char* updateVolumeSlot,
const char* saveStateForUndoSlot);
247 Q_INVOKABLE QString parameter(QString name);
250 Q_INVOKABLE
int integerParameter(QString name);
253 Q_INVOKABLE
double doubleParameter(QString name);
258 Q_INVOKABLE
void setParameter(QString name, QString value);
261 Q_INVOKABLE
void setParameterDefault(QString name, QString value);
268 Q_INVOKABLE
void setCommonParameter(QString name, QString value);
271 Q_INVOKABLE
void setCommonParameterDefault(QString name, QString value);
276 Q_INVOKABLE
void setParameter(QString name,
int value);
279 Q_INVOKABLE
void setParameterDefault(QString name,
int value);
281 Q_INVOKABLE
void setCommonParameter(QString name,
int value);
284 Q_INVOKABLE
void setCommonParameterDefault(QString name,
int value);
289 Q_INVOKABLE
void setParameter(QString name,
double value);
292 Q_INVOKABLE
void setParameterDefault(QString name,
double value);
294 Q_INVOKABLE
void setCommonParameter(QString name,
double value);
297 Q_INVOKABLE
void setCommonParameterDefault(QString name,
double value);
302 Q_INVOKABLE
bool parameterDefined(QString name);
305 Q_INVOKABLE
bool commonParameterDefined(QString name);
319 void setShowEffectCursorInSliceView(
bool show);
320 void setShowEffectCursorInThreeDView(
bool show);
322 bool showEffectCursorInSliceView();
323 bool showEffectCursorInThreeDView();
331 Q_INVOKABLE
void saveStateForUndo();
334 Q_INVOKABLE
static vtkRenderWindow* renderWindow(
qMRMLWidget* viewWidget);
336 Q_INVOKABLE
static vtkRenderer* renderer(
qMRMLWidget* viewWidget);
343 Q_INVOKABLE
static QPoint rasToXy(QVector3D ras,
qMRMLSliceWidget* sliceWidget);
348 static void xyzToRas(
double inputXyz[3],
double outputRas[3],
qMRMLSliceWidget* sliceWidget);
350 Q_INVOKABLE
static QVector3D xyzToRas(QVector3D inputXyz,
qMRMLSliceWidget* sliceWidget);
352 static void xyToRas(QPoint xy,
double outputRas[3],
qMRMLSliceWidget* sliceWidget);
354 static void xyToRas(
double xy[2],
double outputRas[3],
qMRMLSliceWidget* sliceWidget);
356 Q_INVOKABLE
static QVector3D xyToRas(QPoint xy,
qMRMLSliceWidget* sliceWidget);
368 Q_INVOKABLE
static void forceRender(
qMRMLWidget* viewWidget);
369 Q_INVOKABLE
static void scheduleRender(
qMRMLWidget* viewWidget);
393 QScopedPointer<qSlicerSegmentEditorAbstractEffectPrivate>
d_ptr;
This class encapsulates a segment that is part of a segmentation.
virtual bool processInteractionEvents(vtkRenderWindowInteractor *callerInteractor, unsigned long eid, qMRMLWidget *viewWidget)
virtual Q_INVOKABLE const QString helpText() const
Get help text for effect to be displayed in the help box.
Abstract class for segment editor effects.
virtual void masterVolumeNodeChanged()
Image data containing orientation information.
virtual void referenceGeometryChanged()
Abstract MRML node to represent a view. The class holds the properties common to any view type (3D...
A set of MRML Nodes that supports serialization and undo/redo.
QString m_Name
Name of the effect.
Parameter set node for the segment editor widget.
virtual void setupOptionsFrame()
bool m_ShowEffectCursorInThreeDView
QScopedPointer< qSlicerSegmentEditorAbstractEffectPrivate > d_ptr
virtual void processViewNodeEvents(vtkMRMLAbstractViewNode *callerViewNode, unsigned long eid, qMRMLWidget *viewWidget)
virtual QIcon icon()
Get icon for effect to be displayed in segment editor.
bool m_ShowEffectCursorInSliceView
virtual void layoutChanged()
Simple mechanism to let the effects know that the layout has changed.
MRML node containing segmentationsSegmentation node stores a set of segments (also known as contours ...