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)
94 ModificationModeRemove
98 virtual QIcon
icon() {
return QIcon(); };
101 Q_INVOKABLE
virtual const QString
helpText()
const {
return QString(); };
108 Q_INVOKABLE
virtual void activate();
112 Q_INVOKABLE
virtual void deactivate();
115 Q_INVOKABLE
virtual bool active();
134 virtual QCursor createCursor(
qMRMLWidget* viewWidget);
142 { Q_UNUSED(callerInteractor); Q_UNUSED(eid); Q_UNUSED(viewWidget);
return false; };
149 { Q_UNUSED(callerViewNode); Q_UNUSED(eid); Q_UNUSED(viewWidget); };
153 virtual void setMRMLDefaults() = 0;
170 virtual void updateGUIFromMRML() = 0;
174 virtual void updateMRMLFromGUI() = 0;
187 Q_INVOKABLE QFrame* optionsFrame();
190 Q_INVOKABLE QFormLayout* optionsLayout();
194 Q_INVOKABLE
void addActor2D(
qMRMLWidget* viewWidget, vtkActor2D* actor);
197 Q_INVOKABLE
void removeActor2D(
qMRMLWidget* viewWidget, vtkActor2D* actor);
201 Q_INVOKABLE
void addActor3D(
qMRMLWidget* viewWidget, vtkProp3D* actor);
204 Q_INVOKABLE
void removeActor3D(
qMRMLWidget* viewWidget, vtkProp3D* actor);
209 Q_INVOKABLE
void addOptionsWidget(QWidget* newOptionsWidget);
210 Q_INVOKABLE
void addOptionsWidget(QLayout* newOptionsWidget);
212 Q_INVOKABLE QWidget* addLabeledOptionsWidget(QString label, QWidget* newOptionsWidget);
213 Q_INVOKABLE QWidget* addLabeledOptionsWidget(QString label, QLayout* newOptionsWidget);
216 virtual QString name()
const;
219 virtual void setName(QString name);
222 virtual bool perSegment()
const;
225 virtual void setPerSegment(
bool perSegment);
228 Q_INVOKABLE
void cursorOff(
qMRMLWidget* viewWidget);
230 Q_INVOKABLE
void cursorOn(
qMRMLWidget* viewWidget);
234 Q_INVOKABLE
void selectEffect(QString effectName);
240 void setCallbackSlots(QObject* receiver,
const char* selectEffectSlot,
const char* updateVolumeSlot,
const char* saveStateForUndoSlot);
249 Q_INVOKABLE QString parameter(QString name);
252 Q_INVOKABLE
int integerParameter(QString name);
255 Q_INVOKABLE
double doubleParameter(QString name);
260 Q_INVOKABLE
void setParameter(QString name, QString value);
263 Q_INVOKABLE
void setParameterDefault(QString name, QString value);
270 Q_INVOKABLE
void setCommonParameter(QString name, QString value);
273 Q_INVOKABLE
void setCommonParameterDefault(QString name, QString value);
278 Q_INVOKABLE
void setParameter(QString name,
int value);
281 Q_INVOKABLE
void setParameterDefault(QString name,
int value);
283 Q_INVOKABLE
void setCommonParameter(QString name,
int value);
286 Q_INVOKABLE
void setCommonParameterDefault(QString name,
int value);
291 Q_INVOKABLE
void setParameter(QString name,
double value);
294 Q_INVOKABLE
void setParameterDefault(QString name,
double value);
296 Q_INVOKABLE
void setCommonParameter(QString name,
double value);
299 Q_INVOKABLE
void setCommonParameterDefault(QString name,
double value);
304 Q_INVOKABLE
bool parameterDefined(QString name);
307 Q_INVOKABLE
bool commonParameterDefined(QString name);
321 void setShowEffectCursorInSliceView(
bool show);
322 void setShowEffectCursorInThreeDView(
bool show);
324 bool showEffectCursorInSliceView();
325 bool showEffectCursorInThreeDView();
333 Q_INVOKABLE
void saveStateForUndo();
336 Q_INVOKABLE
static vtkRenderWindow* renderWindow(
qMRMLWidget* viewWidget);
338 Q_INVOKABLE
static vtkRenderer* renderer(
qMRMLWidget* viewWidget);
345 Q_INVOKABLE
static QPoint rasToXy(QVector3D ras,
qMRMLSliceWidget* sliceWidget);
350 static void xyzToRas(
double inputXyz[3],
double outputRas[3],
qMRMLSliceWidget* sliceWidget);
352 Q_INVOKABLE
static QVector3D xyzToRas(QVector3D inputXyz,
qMRMLSliceWidget* sliceWidget);
354 static void xyToRas(QPoint xy,
double outputRas[3],
qMRMLSliceWidget* sliceWidget);
356 static void xyToRas(
double xy[2],
double outputRas[3],
qMRMLSliceWidget* sliceWidget);
358 Q_INVOKABLE
static QVector3D xyToRas(QPoint xy,
qMRMLSliceWidget* sliceWidget);
370 Q_INVOKABLE
static void forceRender(
qMRMLWidget* viewWidget);
371 Q_INVOKABLE
static void scheduleRender(
qMRMLWidget* viewWidget);
395 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 ...