Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Public Types | Properties | Public Slots | Public Member Functions | Static Public Member Functions | Protected Attributes
qSlicerSegmentEditorAbstractEffect Class Referenceabstract

Abstract class for segment editor effects. More...

#include <Modules/Loadable/Segmentations/EditorEffects/qSlicerSegmentEditorAbstractEffect.h>

Inheritance diagram for qSlicerSegmentEditorAbstractEffect:
Inheritance graph
[legend]
Collaboration diagram for qSlicerSegmentEditorAbstractEffect:
Collaboration graph
[legend]

Public Types

enum  ModificationMode { ModificationModeSet, ModificationModeAdd, ModificationModeRemove, ModificationModeRemoveAll }
 
typedef QObject Superclass
 

Properties

QString name
 
bool perSegment
 
bool requireSegments
 
bool showEffectCursorInSliceView
 
bool showEffectCursorInThreeDView
 

Public Slots

virtual void updateGUIFromMRML ()=0
 
virtual void updateMRMLFromGUI ()=0
 

Public Member Functions

virtual Q_INVOKABLE void activate ()
 
virtual Q_INVOKABLE bool active ()
 Returns true if the effect is currently active (activated and has not deactivated since then) More...
 
Q_INVOKABLE void addActor2D (qMRMLWidget *viewWidget, vtkActor2D *actor)
 
Q_INVOKABLE void addActor3D (qMRMLWidget *viewWidget, vtkProp3D *actor)
 
Q_INVOKABLE QWidget * addLabeledOptionsWidget (QString label, QWidget *newOptionsWidget)
 
Q_INVOKABLE QWidget * addLabeledOptionsWidget (QString label, QLayout *newOptionsWidget)
 
Q_INVOKABLE void addOptionsWidget (QWidget *newOptionsWidget)
 
Q_INVOKABLE void addOptionsWidget (QLayout *newOptionsWidget)
 
virtual qSlicerSegmentEditorAbstractEffectclone ()=0
 Clone editor effect. Override to return a new instance of the effect sub-class. More...
 
Q_INVOKABLE bool commonParameterDefined (QString name)
 Returns true if the common parameter is already defined. More...
 
virtual QCursor createCursor (qMRMLWidget *viewWidget)
 Create a cursor customized for the given effect, potentially for each view. More...
 
Q_INVOKABLE void cursorOff (qMRMLWidget *viewWidget)
 Turn off cursor and save cursor to restore later. More...
 
Q_INVOKABLE void cursorOn (qMRMLWidget *viewWidget)
 Restore saved cursor. More...
 
virtual Q_INVOKABLE void deactivate ()
 
Q_INVOKABLE vtkOrientedImageDatadefaultModifierLabelmap ()
 
Q_INVOKABLE double doubleParameter (QString name)
 Convenience function to get double parameter. More...
 
virtual Q_INVOKABLE const QString helpText () const
 Get help text for effect to be displayed in the help box. More...
 
virtual QIcon icon ()
 Get icon for effect to be displayed in segment editor. More...
 
Q_INVOKABLE int integerParameter (QString name)
 Convenience function to get integer parameter. More...
 
virtual void interactionNodeModified (vtkMRMLInteractionNode *interactionNode)
 
virtual void layoutChanged ()
 Simple mechanism to let the effects know that the layout has changed. More...
 
Q_INVOKABLE vtkOrientedImageDatamaskLabelmap ()
 
Q_INVOKABLE vtkOrientedImageDatamasterVolumeImageData ()
 
virtual void masterVolumeNodeChanged ()
 
Q_INVOKABLE vtkOrientedImageDatamodifierLabelmap ()
 
virtual Q_INVOKABLE void modifySegmentByLabelmap (vtkMRMLSegmentationNode *segmentationNode, const char *segmentID, vtkOrientedImageData *modifierLabelmap, ModificationMode modificationMode, bool bypassMasking=false)
 
virtual Q_INVOKABLE void modifySegmentByLabelmap (vtkMRMLSegmentationNode *segmentationNode, const char *segmentID, vtkOrientedImageData *modifierLabelmap, ModificationMode modificationMode, const int modificationExtent[6], bool bypassMasking=false)
 
virtual Q_INVOKABLE void modifySelectedSegmentByLabelmap (vtkOrientedImageData *modifierLabelmap, ModificationMode modificationMode, const int modificationExtent[6], bool bypassMasking=false)
 
virtual Q_INVOKABLE void modifySelectedSegmentByLabelmap (vtkOrientedImageData *modifierLabelmap, ModificationMode modificationMode, bool bypassMasking=false)
 
virtual Q_INVOKABLE void modifySelectedSegmentByLabelmap (vtkOrientedImageData *modifierLabelmap, ModificationMode modificationMode, QList< int > extent, bool bypassMasking=false)
 
virtual QString name () const
 Get name of effect. More...
 
Q_INVOKABLE QFrame * optionsFrame ()
 Get effect options frame. More...
 
Q_INVOKABLE QFormLayout * optionsLayout ()
 Get layout of options frame. More...
 
Q_INVOKABLE QString parameter (QString name)
 Get effect or common parameter from effect parameter set node. More...
 
Q_INVOKABLE bool parameterDefined (QString name)
 Returns true if the effect-specific parameter is already defined. More...
 
Q_INVOKABLE vtkMRMLSegmentEditorNodeparameterSetNode ()
 Get segment editor parameter set node. More...
 
virtual bool perSegment () const
 Get flag indicating whether effect operates on segments (true) or the whole segmentation (false). More...
 
virtual bool processInteractionEvents (vtkRenderWindowInteractor *callerInteractor, unsigned long eid, qMRMLWidget *viewWidget)
 
virtual void processViewNodeEvents (vtkMRMLAbstractViewNode *callerViewNode, unsigned long eid, qMRMLWidget *viewWidget)
 
 qSlicerSegmentEditorAbstractEffect (QObject *parent=nullptr)
 
virtual void referenceGeometryChanged ()
 
Q_INVOKABLE vtkOrientedImageDatareferenceGeometryImage ()
 
Q_INVOKABLE void removeActor2D (qMRMLWidget *viewWidget, vtkActor2D *actor)
 Remove actor from the renderer of the widget. More...
 
Q_INVOKABLE void removeActor3D (qMRMLWidget *viewWidget, vtkProp3D *actor)
 Remove actor from the renderer of the widget. More...
 
virtual bool requireSegments () const
 If this property is set to true then this effect is enabled only when the segmentation has segment(s) in it. More...
 
Q_INVOKABLE void saveStateForUndo ()
 
Q_INVOKABLE vtkMRMLScenescene ()
 Get MRML scene (from parameter set node) More...
 
Q_INVOKABLE bool segmentationDisplayableInView (vtkMRMLAbstractViewNode *viewNode)
 
Q_INVOKABLE vtkOrientedImageDataselectedSegmentLabelmap ()
 
Q_INVOKABLE void selectEffect (QString effectName)
 
void setCallbackSlots (QObject *receiver, const char *selectEffectSlot, const char *updateVolumeSlot, const char *saveStateForUndoSlot)
 
Q_INVOKABLE void setCommonParameter (QString name, QString value)
 
Q_INVOKABLE void setCommonParameter (QString name, int value)
 Convenience function to set integer common parameter. More...
 
Q_INVOKABLE void setCommonParameter (QString name, double value)
 Convenience function to set double common parameter. More...
 
Q_INVOKABLE void setCommonParameterDefault (QString name, QString value)
 
Q_INVOKABLE void setCommonParameterDefault (QString name, int value)
 
Q_INVOKABLE void setCommonParameterDefault (QString name, double value)
 
virtual void setMRMLDefaults ()=0
 
virtual void setName (QString name)
 
Q_INVOKABLE void setParameter (QString name, QString value)
 
Q_INVOKABLE void setParameter (QString name, int value)
 
Q_INVOKABLE void setParameter (QString name, double value)
 
Q_INVOKABLE void setParameterDefault (QString name, QString value)
 
Q_INVOKABLE void setParameterDefault (QString name, int value)
 
Q_INVOKABLE void setParameterDefault (QString name, double value)
 
Q_INVOKABLE void setParameterSetNode (vtkMRMLSegmentEditorNode *node)
 Set segment editor parameter set node. More...
 
virtual void setPerSegment (bool perSegment)
 
virtual void setRequireSegments (bool requireSegments)
 If this property is set to true then this effect is enabled only when the segmentation has segment(s) in it. More...
 
void setShowEffectCursorInSliceView (bool show)
 
void setShowEffectCursorInThreeDView (bool show)
 
virtual void setupOptionsFrame ()
 
void setVolumes (vtkOrientedImageData *alignedMasterVolume, vtkOrientedImageData *modifierLabelmap, vtkOrientedImageData *maskLabelmap, vtkOrientedImageData *selectedSegmentLabelmap, vtkOrientedImageData *referenceGeometryImage)
 Called by the editor widget. More...
 
bool showEffectCursorInSliceView ()
 
bool showEffectCursorInThreeDView ()
 
 ~qSlicerSegmentEditorAbstractEffect () override
 

Static Public Member Functions

static Q_INVOKABLE void applyImageMask (vtkOrientedImageData *input, vtkOrientedImageData *mask, double fillValue, bool notMask=false)
 
static Q_INVOKABLE void forceRender (qMRMLWidget *viewWidget)
 
static QPoint rasToXy (double ras[3], qMRMLSliceWidget *sliceWidget)
 Convert RAS position to XY in-slice position. More...
 
static Q_INVOKABLE QPoint rasToXy (QVector3D ras, qMRMLSliceWidget *sliceWidget)
 Convert RAS position to XY in-slice position, python accessor method. More...
 
static Q_INVOKABLE vtkRenderer * renderer (qMRMLWidget *viewWidget)
 Get renderer for view widget. More...
 
static Q_INVOKABLE vtkRenderWindow * renderWindow (qMRMLWidget *viewWidget)
 Get render window for view widget. More...
 
static Q_INVOKABLE void scheduleRender (qMRMLWidget *viewWidget)
 
static Q_INVOKABLE double sliceSpacing (qMRMLSliceWidget *sliceWidget)
 
static Q_INVOKABLE vtkMRMLAbstractViewNodeviewNode (qMRMLWidget *viewWidget)
 Get node for view widget. More...
 
static void xyToIjk (QPoint xy, int outputIjk[3], qMRMLSliceWidget *sliceWidget, vtkOrientedImageData *image)
 Convert XY in-slice position to image IJK position. More...
 
static void xyToIjk (double xy[2], int outputIjk[3], qMRMLSliceWidget *sliceWidget, vtkOrientedImageData *image)
 Convert XY in-slice position to image IJK position. More...
 
static Q_INVOKABLE QVector3D xyToIjk (QPoint xy, qMRMLSliceWidget *sliceWidget, vtkOrientedImageData *image)
 Convert XY in-slice position to image IJK position, python accessor method. More...
 
static void xyToRas (QPoint xy, double outputRas[3], qMRMLSliceWidget *sliceWidget)
 Convert XY in-slice position to RAS position. More...
 
static void xyToRas (double xy[2], double outputRas[3], qMRMLSliceWidget *sliceWidget)
 Convert XY in-slice position to RAS position. More...
 
static Q_INVOKABLE QVector3D xyToRas (QPoint xy, qMRMLSliceWidget *sliceWidget)
 Convert XY in-slice position to RAS position, python accessor method. More...
 
static void xyzToIjk (double inputXyz[3], int outputIjk[3], qMRMLSliceWidget *sliceWidget, vtkOrientedImageData *image)
 Convert XYZ slice view position to image IJK position,. More...
 
static Q_INVOKABLE QVector3D xyzToIjk (QVector3D inputXyz, qMRMLSliceWidget *sliceWidget, vtkOrientedImageData *image)
 Convert XYZ slice view position to image IJK position, python accessor method,. More...
 
static void xyzToRas (double inputXyz[3], double outputRas[3], qMRMLSliceWidget *sliceWidget)
 
static Q_INVOKABLE QVector3D xyzToRas (QVector3D inputXyz, qMRMLSliceWidget *sliceWidget)
 Convert XYZ slice view position to RAS position, python accessor method. More...
 

Protected Attributes

QScopedPointer< qSlicerSegmentEditorAbstractEffectPrivate > d_ptr
 
bool m_Active
 
double m_EraseValue
 
double m_FillValue
 
QString m_Name
 Name of the effect. More...
 
bool m_PerSegment
 
bool m_RequireSegments
 
bool m_ShowEffectCursorInSliceView
 
bool m_ShowEffectCursorInThreeDView
 

Detailed Description

Abstract class for segment editor effects.

Definition at line 57 of file qSlicerSegmentEditorAbstractEffect.h.

Member Typedef Documentation

◆ Superclass

Definition at line 89 of file qSlicerSegmentEditorAbstractEffect.h.

Member Enumeration Documentation

◆ ModificationMode

Enumerator
ModificationModeSet 
ModificationModeAdd 
ModificationModeRemove 
ModificationModeRemoveAll 

Definition at line 96 of file qSlicerSegmentEditorAbstractEffect.h.

Property Documentation

◆ name

QString qSlicerSegmentEditorAbstractEffect::name
readwrite

This property stores the name of the effect Cannot be empty.

See also
name(),
setName()

Definition at line 66 of file qSlicerSegmentEditorAbstractEffect.h.

◆ perSegment

bool qSlicerSegmentEditorAbstractEffect::perSegment
readwrite

This property stores the flag indicating whether effect operates on individual segments (true) or the whole segmentation (false). True by default.

See also
perSegment(),
setPerSegment

Definition at line 72 of file qSlicerSegmentEditorAbstractEffect.h.

◆ requireSegments

bool qSlicerSegmentEditorAbstractEffect::requireSegments
readwrite

If this property is set to true then this effect is enabled only when the segmentation has segment(s) in it. It can be set to false in effects which create new segments. True by default.

See also
requireSegments(),
setRequireSegments

Definition at line 78 of file qSlicerSegmentEditorAbstractEffect.h.

◆ showEffectCursorInSliceView

bool qSlicerSegmentEditorAbstractEffect::showEffectCursorInSliceView
readwrite

Show effect cursor in slice view. If false then default arrow cursor will be shown. True by default.

Definition at line 82 of file qSlicerSegmentEditorAbstractEffect.h.

◆ showEffectCursorInThreeDView

bool qSlicerSegmentEditorAbstractEffect::showEffectCursorInThreeDView
readwrite

Show effect cursor in slice view. If false then default arrow cursor will be shown. False by default.

Definition at line 86 of file qSlicerSegmentEditorAbstractEffect.h.

Constructor & Destructor Documentation

◆ qSlicerSegmentEditorAbstractEffect()

qSlicerSegmentEditorAbstractEffect::qSlicerSegmentEditorAbstractEffect ( QObject *  parent = nullptr)

◆ ~qSlicerSegmentEditorAbstractEffect()

qSlicerSegmentEditorAbstractEffect::~qSlicerSegmentEditorAbstractEffect ( )
override

Member Function Documentation

◆ activate()

virtual Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::activate ( )
virtual

Perform actions to activate the effect (show options frame, etc.) NOTE: Base class implementation needs to be called BEFORE the effect-specific implementation

Reimplemented in qSlicerSegmentEditorScriptedEffect, and qSlicerSegmentEditorScriptedLabelEffect.

◆ active()

virtual Q_INVOKABLE bool qSlicerSegmentEditorAbstractEffect::active ( )
virtual

Returns true if the effect is currently active (activated and has not deactivated since then)

◆ addActor2D()

Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::addActor2D ( qMRMLWidget viewWidget,
vtkActor2D *  actor 
)

Add actor to the renderer of the view widget. The effect is responsible for removing the actor when the effect is deactivated.

◆ addActor3D()

Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::addActor3D ( qMRMLWidget viewWidget,
vtkProp3D *  actor 
)

Add actor to the renderer of the view widget. The effect is responsible for removing the actor when the effect is deactivated.

◆ addLabeledOptionsWidget() [1/2]

Q_INVOKABLE QWidget* qSlicerSegmentEditorAbstractEffect::addLabeledOptionsWidget ( QString  label,
QWidget *  newOptionsWidget 
)

◆ addLabeledOptionsWidget() [2/2]

Q_INVOKABLE QWidget* qSlicerSegmentEditorAbstractEffect::addLabeledOptionsWidget ( QString  label,
QLayout *  newOptionsWidget 
)

◆ addOptionsWidget() [1/2]

Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::addOptionsWidget ( QWidget *  newOptionsWidget)

Add effect options widget to options frame layout The implemented effects need to create their options UI widget, make the connections, then call this function to add the options UI to the effect options frame

◆ addOptionsWidget() [2/2]

Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::addOptionsWidget ( QLayout *  newOptionsWidget)

◆ applyImageMask()

static Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::applyImageMask ( vtkOrientedImageData input,
vtkOrientedImageData mask,
double  fillValue,
bool  notMask = false 
)
static

Apply mask image on an input image. This method is kept here for backward compatibility only and will be removed in the future. Use vtkOrientedImageDataResample::ApplyImageMask method instead.

◆ clone()

virtual qSlicerSegmentEditorAbstractEffect* qSlicerSegmentEditorAbstractEffect::clone ( )
pure virtual

◆ commonParameterDefined()

Q_INVOKABLE bool qSlicerSegmentEditorAbstractEffect::commonParameterDefined ( QString  name)

Returns true if the common parameter is already defined.

◆ createCursor()

virtual QCursor qSlicerSegmentEditorAbstractEffect::createCursor ( qMRMLWidget viewWidget)
virtual

Create a cursor customized for the given effect, potentially for each view.

Reimplemented in qSlicerSegmentEditorScriptedEffect, and qSlicerSegmentEditorScriptedLabelEffect.

◆ cursorOff()

Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::cursorOff ( qMRMLWidget viewWidget)

Turn off cursor and save cursor to restore later.

◆ cursorOn()

Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::cursorOn ( qMRMLWidget viewWidget)

Restore saved cursor.

◆ deactivate()

virtual Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::deactivate ( )
virtual

Perform actions to deactivate the effect (hide options frame, destroy actors, etc.) NOTE: Base class implementation needs to be called BEFORE the effect-specific implementation

Reimplemented in qSlicerSegmentEditorScriptedEffect, qSlicerSegmentEditorScriptedLabelEffect, qSlicerSegmentEditorScissorsEffect, and qSlicerSegmentEditorPaintEffect.

◆ defaultModifierLabelmap()

Q_INVOKABLE vtkOrientedImageData* qSlicerSegmentEditorAbstractEffect::defaultModifierLabelmap ( )

Reset modifier labelmap to default (resets geometry, clears content) and return it.

◆ doubleParameter()

Q_INVOKABLE double qSlicerSegmentEditorAbstractEffect::doubleParameter ( QString  name)

Convenience function to get double parameter.

◆ forceRender()

static Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::forceRender ( qMRMLWidget viewWidget)
static

◆ helpText()

virtual Q_INVOKABLE const QString qSlicerSegmentEditorAbstractEffect::helpText ( ) const
inlinevirtual

◆ icon()

virtual QIcon qSlicerSegmentEditorAbstractEffect::icon ( )
inlinevirtual

◆ integerParameter()

Q_INVOKABLE int qSlicerSegmentEditorAbstractEffect::integerParameter ( QString  name)

Convenience function to get integer parameter.

◆ interactionNodeModified()

virtual void qSlicerSegmentEditorAbstractEffect::interactionNodeModified ( vtkMRMLInteractionNode interactionNode)
virtual

Let the effect know that the interaction node is modified. Default behavior is to deactivate the effect if not in view mode.

Reimplemented in qSlicerSegmentEditorScriptedEffect, and qSlicerSegmentEditorScriptedLabelEffect.

◆ layoutChanged()

virtual void qSlicerSegmentEditorAbstractEffect::layoutChanged ( )
inlinevirtual

Simple mechanism to let the effects know that the layout has changed.

Reimplemented in qSlicerSegmentEditorScriptedEffect, and qSlicerSegmentEditorScriptedLabelEffect.

Definition at line 173 of file qSlicerSegmentEditorAbstractEffect.h.

◆ maskLabelmap()

Q_INVOKABLE vtkOrientedImageData* qSlicerSegmentEditorAbstractEffect::maskLabelmap ( )

◆ masterVolumeImageData()

Q_INVOKABLE vtkOrientedImageData* qSlicerSegmentEditorAbstractEffect::masterVolumeImageData ( )

Get image data of master volume aligned with the modifier labelmap.

Returns
Pointer to the image data

◆ masterVolumeNodeChanged()

virtual void qSlicerSegmentEditorAbstractEffect::masterVolumeNodeChanged ( )
inlinevirtual

Simple mechanism to let the effects know that master volume has changed NOTE: Base class implementation needs to be called with the effect-specific implementation

Reimplemented in qSlicerSegmentEditorScriptedEffect, qSlicerSegmentEditorScriptedLabelEffect, and qSlicerSegmentEditorAbstractLabelEffect.

Definition at line 171 of file qSlicerSegmentEditorAbstractEffect.h.

◆ modifierLabelmap()

Q_INVOKABLE vtkOrientedImageData* qSlicerSegmentEditorAbstractEffect::modifierLabelmap ( )

◆ modifySegmentByLabelmap() [1/2]

virtual Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::modifySegmentByLabelmap ( vtkMRMLSegmentationNode segmentationNode,
const char *  segmentID,
vtkOrientedImageData modifierLabelmap,
ModificationMode  modificationMode,
bool  bypassMasking = false 
)
virtual

◆ modifySegmentByLabelmap() [2/2]

virtual Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::modifySegmentByLabelmap ( vtkMRMLSegmentationNode segmentationNode,
const char *  segmentID,
vtkOrientedImageData modifierLabelmap,
ModificationMode  modificationMode,
const int  modificationExtent[6],
bool  bypassMasking = false 
)
virtual

◆ modifySelectedSegmentByLabelmap() [1/3]

virtual Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::modifySelectedSegmentByLabelmap ( vtkOrientedImageData modifierLabelmap,
ModificationMode  modificationMode,
const int  modificationExtent[6],
bool  bypassMasking = false 
)
virtual

◆ modifySelectedSegmentByLabelmap() [2/3]

virtual Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::modifySelectedSegmentByLabelmap ( vtkOrientedImageData modifierLabelmap,
ModificationMode  modificationMode,
bool  bypassMasking = false 
)
virtual

◆ modifySelectedSegmentByLabelmap() [3/3]

virtual Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::modifySelectedSegmentByLabelmap ( vtkOrientedImageData modifierLabelmap,
ModificationMode  modificationMode,
QList< int >  extent,
bool  bypassMasking = false 
)
virtual

◆ name()

virtual QString qSlicerSegmentEditorAbstractEffect::name ( ) const
virtual

Get name of effect.

◆ optionsFrame()

Q_INVOKABLE QFrame* qSlicerSegmentEditorAbstractEffect::optionsFrame ( )

Get effect options frame.

◆ optionsLayout()

Q_INVOKABLE QFormLayout* qSlicerSegmentEditorAbstractEffect::optionsLayout ( )

Get layout of options frame.

◆ parameter()

Q_INVOKABLE QString qSlicerSegmentEditorAbstractEffect::parameter ( QString  name)

Get effect or common parameter from effect parameter set node.

◆ parameterDefined()

Q_INVOKABLE bool qSlicerSegmentEditorAbstractEffect::parameterDefined ( QString  name)

Returns true if the effect-specific parameter is already defined.

◆ parameterSetNode()

Q_INVOKABLE vtkMRMLSegmentEditorNode* qSlicerSegmentEditorAbstractEffect::parameterSetNode ( )

Get segment editor parameter set node.

◆ perSegment()

virtual bool qSlicerSegmentEditorAbstractEffect::perSegment ( ) const
virtual

Get flag indicating whether effect operates on segments (true) or the whole segmentation (false).

◆ processInteractionEvents()

virtual bool qSlicerSegmentEditorAbstractEffect::processInteractionEvents ( vtkRenderWindowInteractor *  callerInteractor,
unsigned long  eid,
qMRMLWidget viewWidget 
)
inlinevirtual

Callback function invoked when interaction happens

Parameters
callerInteractorInteractor object that was observed to catch the event
eidEvent identifier
viewWidgetWidget of the Slicer layout view. Can be
See also
qMRMLSliceWidget or
qMRMLThreeDWidget
Returns
return true to abort the event (prevent other views to receive the event)

Reimplemented in qSlicerSegmentEditorScriptedEffect, qSlicerSegmentEditorScriptedLabelEffect, qSlicerSegmentEditorScissorsEffect, and qSlicerSegmentEditorPaintEffect.

Definition at line 152 of file qSlicerSegmentEditorAbstractEffect.h.

◆ processViewNodeEvents()

virtual void qSlicerSegmentEditorAbstractEffect::processViewNodeEvents ( vtkMRMLAbstractViewNode callerViewNode,
unsigned long  eid,
qMRMLWidget viewWidget 
)
inlinevirtual

Callback function invoked when view node is modified

Parameters
callerViewNodeView node that was observed to catch the event. Can be either
See also
vtkMRMLSliceNode or
vtkMRMLViewNode
Parameters
eidEvent identifier
viewWidgetWidget of the Slicer layout view. Can be
See also
qMRMLSliceWidget or
qMRMLThreeDWidget

Reimplemented in qSlicerSegmentEditorScriptedEffect, qSlicerSegmentEditorScriptedLabelEffect, and qSlicerSegmentEditorPaintEffect.

Definition at line 159 of file qSlicerSegmentEditorAbstractEffect.h.

◆ rasToXy() [1/2]

static QPoint qSlicerSegmentEditorAbstractEffect::rasToXy ( double  ras[3],
qMRMLSliceWidget sliceWidget 
)
static

Convert RAS position to XY in-slice position.

◆ rasToXy() [2/2]

static Q_INVOKABLE QPoint qSlicerSegmentEditorAbstractEffect::rasToXy ( QVector3D  ras,
qMRMLSliceWidget sliceWidget 
)
static

Convert RAS position to XY in-slice position, python accessor method.

◆ referenceGeometryChanged()

virtual void qSlicerSegmentEditorAbstractEffect::referenceGeometryChanged ( )
inlinevirtual

Simple mechanism to let the effects know that reference geometry has changed NOTE: Base class implementation needs to be called with the effect-specific implementation.

Reimplemented in qSlicerSegmentEditorScriptedEffect, qSlicerSegmentEditorScriptedLabelEffect, qSlicerSegmentEditorPaintEffect, and qSlicerSegmentEditorAbstractLabelEffect.

Definition at line 168 of file qSlicerSegmentEditorAbstractEffect.h.

◆ referenceGeometryImage()

Q_INVOKABLE vtkOrientedImageData* qSlicerSegmentEditorAbstractEffect::referenceGeometryImage ( )

◆ removeActor2D()

Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::removeActor2D ( qMRMLWidget viewWidget,
vtkActor2D *  actor 
)

Remove actor from the renderer of the widget.

◆ removeActor3D()

Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::removeActor3D ( qMRMLWidget viewWidget,
vtkProp3D *  actor 
)

Remove actor from the renderer of the widget.

◆ renderer()

static Q_INVOKABLE vtkRenderer* qSlicerSegmentEditorAbstractEffect::renderer ( qMRMLWidget viewWidget)
static

Get renderer for view widget.

◆ renderWindow()

static Q_INVOKABLE vtkRenderWindow* qSlicerSegmentEditorAbstractEffect::renderWindow ( qMRMLWidget viewWidget)
static

Get render window for view widget.

◆ requireSegments()

virtual bool qSlicerSegmentEditorAbstractEffect::requireSegments ( ) const
virtual

If this property is set to true then this effect is enabled only when the segmentation has segment(s) in it.

◆ saveStateForUndo()

Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::saveStateForUndo ( )

Signal to the editor that current state has to be saved (for allowing reverting to current segmentation state by undo operation)

◆ scene()

Q_INVOKABLE vtkMRMLScene* qSlicerSegmentEditorAbstractEffect::scene ( )

Get MRML scene (from parameter set node)

◆ scheduleRender()

static Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::scheduleRender ( qMRMLWidget viewWidget)
static

◆ segmentationDisplayableInView()

Q_INVOKABLE bool qSlicerSegmentEditorAbstractEffect::segmentationDisplayableInView ( vtkMRMLAbstractViewNode viewNode)

◆ selectedSegmentLabelmap()

Q_INVOKABLE vtkOrientedImageData* qSlicerSegmentEditorAbstractEffect::selectedSegmentLabelmap ( )

◆ selectEffect()

Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::selectEffect ( QString  effectName)

Emit signal that causes active effect to be changed to the specified one. If the effect name is empty, then the active effect is de-selected.

◆ setCallbackSlots()

void qSlicerSegmentEditorAbstractEffect::setCallbackSlots ( QObject *  receiver,
const char *  selectEffectSlot,
const char *  updateVolumeSlot,
const char *  saveStateForUndoSlot 
)

Connect callback signals. Callbacks are called by the editor effect to request operations from the editor widget.

Parameters
selectEffectSlotcalled from the active effect to initiate switching to another effect (or de-select).
updateVolumeSlotcalled to request update of a volume (modifierLabelmap, alignedMasterVolume, maskLabelmap).
saveStateForUndoSlotcalled to request saving of segmentation state for undo operation

◆ setCommonParameter() [1/3]

Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::setCommonParameter ( QString  name,
QString  value 
)

Set parameters that are common for multiple effects. Typically used by base class effects, such as label

See also
setParameter By default the parameter names are prefixed for each effect, so they are unique for effects. This method does not prefix the parameter, so can be the same for multiple effects. Note: Parameter getter functions look for effect parameters first, then common parameter if the effect-specific is not found.

◆ setCommonParameter() [2/3]

Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::setCommonParameter ( QString  name,
int  value 
)

Convenience function to set integer common parameter.

See also
setCommonParameter

◆ setCommonParameter() [3/3]

Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::setCommonParameter ( QString  name,
double  value 
)

Convenience function to set double common parameter.

See also
setCommonParameter

◆ setCommonParameterDefault() [1/3]

Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::setCommonParameterDefault ( QString  name,
QString  value 
)

Set parameter only if it is not defined already.

See also
setCommonParameter

◆ setCommonParameterDefault() [2/3]

Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::setCommonParameterDefault ( QString  name,
int  value 
)

Set parameter only if it is not defined already.

See also
setCommonParameter

◆ setCommonParameterDefault() [3/3]

Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::setCommonParameterDefault ( QString  name,
double  value 
)

Set parameter only if it is not defined already.

See also
setCommonParameter

◆ setMRMLDefaults()

virtual void qSlicerSegmentEditorAbstractEffect::setMRMLDefaults ( )
pure virtual

Set default parameters in the parameter MRML node NOTE: Base class implementation needs to be called with the effect-specific implementation

Implemented in qSlicerSegmentEditorScriptedEffect, qSlicerSegmentEditorScriptedLabelEffect, qSlicerSegmentEditorPaintEffect, qSlicerSegmentEditorAbstractLabelEffect, and qSlicerSegmentEditorScissorsEffect.

◆ setName()

virtual void qSlicerSegmentEditorAbstractEffect::setName ( QString  name)
virtual

Set the name of the effect NOTE: name must be defined in constructor in C++ effects, this can only be used in python scripted ones

Reimplemented in qSlicerSegmentEditorScriptedLabelEffect, and qSlicerSegmentEditorScriptedEffect.

◆ setParameter() [1/3]

Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::setParameter ( QString  name,
QString  value 
)

Set effect parameter in effect parameter set node. This function is called by both convenience functions.

Parameters
nameParameter name string
valueParameter value string

◆ setParameter() [2/3]

Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::setParameter ( QString  name,
int  value 
)

Convenience function to set integer parameter

Parameters
nameParameter name string
valueParameter value integer

◆ setParameter() [3/3]

Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::setParameter ( QString  name,
double  value 
)

Convenience function to set double parameter

Parameters
nameParameter name string
valueParameter value double

◆ setParameterDefault() [1/3]

Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::setParameterDefault ( QString  name,
QString  value 
)

Set parameter only if it is not defined already.

See also
setParameter

◆ setParameterDefault() [2/3]

Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::setParameterDefault ( QString  name,
int  value 
)

Set parameter only if it is not defined already.

See also
setParameter

◆ setParameterDefault() [3/3]

Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::setParameterDefault ( QString  name,
double  value 
)

Set parameter only if it is not defined already.

See also
setParameter

◆ setParameterSetNode()

Q_INVOKABLE void qSlicerSegmentEditorAbstractEffect::setParameterSetNode ( vtkMRMLSegmentEditorNode node)

Set segment editor parameter set node.

◆ setPerSegment()

virtual void qSlicerSegmentEditorAbstractEffect::setPerSegment ( bool  perSegment)
virtual

Set flag indicating whether effect operates on segments (true) or the whole segmentation (false). NOTE: name must be defined in constructor in C++ effects, this can only be used in python scripted ones

Reimplemented in qSlicerSegmentEditorScriptedLabelEffect, and qSlicerSegmentEditorScriptedEffect.

◆ setRequireSegments()

virtual void qSlicerSegmentEditorAbstractEffect::setRequireSegments ( bool  requireSegments)
virtual

If this property is set to true then this effect is enabled only when the segmentation has segment(s) in it.

Reimplemented in qSlicerSegmentEditorScriptedEffect.

◆ setShowEffectCursorInSliceView()

void qSlicerSegmentEditorAbstractEffect::setShowEffectCursorInSliceView ( bool  show)

◆ setShowEffectCursorInThreeDView()

void qSlicerSegmentEditorAbstractEffect::setShowEffectCursorInThreeDView ( bool  show)

◆ setupOptionsFrame()

virtual void qSlicerSegmentEditorAbstractEffect::setupOptionsFrame ( )
inlinevirtual

Create options frame widgets, make connections, and add them to the main options frame using

See also
addOptionsWidget NOTE: Base class implementation needs to be called BEFORE the effect-specific implementation

Reimplemented in qSlicerSegmentEditorScriptedEffect, qSlicerSegmentEditorScriptedLabelEffect, qSlicerSegmentEditorPaintEffect, qSlicerSegmentEditorAbstractLabelEffect, and qSlicerSegmentEditorScissorsEffect.

Definition at line 142 of file qSlicerSegmentEditorAbstractEffect.h.

◆ setVolumes()

void qSlicerSegmentEditorAbstractEffect::setVolumes ( vtkOrientedImageData alignedMasterVolume,
vtkOrientedImageData modifierLabelmap,
vtkOrientedImageData maskLabelmap,
vtkOrientedImageData selectedSegmentLabelmap,
vtkOrientedImageData referenceGeometryImage 
)

Called by the editor widget.

◆ showEffectCursorInSliceView()

bool qSlicerSegmentEditorAbstractEffect::showEffectCursorInSliceView ( )

◆ showEffectCursorInThreeDView()

bool qSlicerSegmentEditorAbstractEffect::showEffectCursorInThreeDView ( )

◆ sliceSpacing()

static Q_INVOKABLE double qSlicerSegmentEditorAbstractEffect::sliceSpacing ( qMRMLSliceWidget sliceWidget)
static

◆ updateGUIFromMRML

virtual void qSlicerSegmentEditorAbstractEffect::updateGUIFromMRML ( )
pure virtualslot

Update user interface from parameter set node NOTE: Base class implementation needs to be called with the effect-specific implementation

◆ updateMRMLFromGUI

virtual void qSlicerSegmentEditorAbstractEffect::updateMRMLFromGUI ( )
pure virtualslot

Update parameter set node from user interface NOTE: Base class implementation needs to be called with the effect-specific implementation

◆ viewNode()

static Q_INVOKABLE vtkMRMLAbstractViewNode* qSlicerSegmentEditorAbstractEffect::viewNode ( qMRMLWidget viewWidget)
static

Get node for view widget.

◆ xyToIjk() [1/3]

static void qSlicerSegmentEditorAbstractEffect::xyToIjk ( QPoint  xy,
int  outputIjk[3],
qMRMLSliceWidget sliceWidget,
vtkOrientedImageData image 
)
static

Convert XY in-slice position to image IJK position.

◆ xyToIjk() [2/3]

static void qSlicerSegmentEditorAbstractEffect::xyToIjk ( double  xy[2],
int  outputIjk[3],
qMRMLSliceWidget sliceWidget,
vtkOrientedImageData image 
)
static

Convert XY in-slice position to image IJK position.

◆ xyToIjk() [3/3]

static Q_INVOKABLE QVector3D qSlicerSegmentEditorAbstractEffect::xyToIjk ( QPoint  xy,
qMRMLSliceWidget sliceWidget,
vtkOrientedImageData image 
)
static

Convert XY in-slice position to image IJK position, python accessor method.

◆ xyToRas() [1/3]

static void qSlicerSegmentEditorAbstractEffect::xyToRas ( QPoint  xy,
double  outputRas[3],
qMRMLSliceWidget sliceWidget 
)
static

Convert XY in-slice position to RAS position.

◆ xyToRas() [2/3]

static void qSlicerSegmentEditorAbstractEffect::xyToRas ( double  xy[2],
double  outputRas[3],
qMRMLSliceWidget sliceWidget 
)
static

Convert XY in-slice position to RAS position.

◆ xyToRas() [3/3]

static Q_INVOKABLE QVector3D qSlicerSegmentEditorAbstractEffect::xyToRas ( QPoint  xy,
qMRMLSliceWidget sliceWidget 
)
static

Convert XY in-slice position to RAS position, python accessor method.

◆ xyzToIjk() [1/2]

static void qSlicerSegmentEditorAbstractEffect::xyzToIjk ( double  inputXyz[3],
int  outputIjk[3],
qMRMLSliceWidget sliceWidget,
vtkOrientedImageData image 
)
static

Convert XYZ slice view position to image IJK position,.

See also
xyzToRas

◆ xyzToIjk() [2/2]

static Q_INVOKABLE QVector3D qSlicerSegmentEditorAbstractEffect::xyzToIjk ( QVector3D  inputXyz,
qMRMLSliceWidget sliceWidget,
vtkOrientedImageData image 
)
static

Convert XYZ slice view position to image IJK position, python accessor method,.

See also
xyzToRas

◆ xyzToRas() [1/2]

static void qSlicerSegmentEditorAbstractEffect::xyzToRas ( double  inputXyz[3],
double  outputRas[3],
qMRMLSliceWidget sliceWidget 
)
static

Convert XYZ slice view position to RAS position: x,y uses slice (canvas) coordinate system and actually has a 3rd z component (index into the slice you're looking at), hence xyToRAS is really performing xyzToRAS. RAS is patient world coordinate system. Note the 1 is because the transform uses homogeneous coordinates.

◆ xyzToRas() [2/2]

static Q_INVOKABLE QVector3D qSlicerSegmentEditorAbstractEffect::xyzToRas ( QVector3D  inputXyz,
qMRMLSliceWidget sliceWidget 
)
static

Convert XYZ slice view position to RAS position, python accessor method.

Member Data Documentation

◆ d_ptr

QScopedPointer<qSlicerSegmentEditorAbstractEffectPrivate> qSlicerSegmentEditorAbstractEffect::d_ptr
protected

Definition at line 414 of file qSlicerSegmentEditorAbstractEffect.h.

◆ m_Active

bool qSlicerSegmentEditorAbstractEffect::m_Active
protected

Definition at line 397 of file qSlicerSegmentEditorAbstractEffect.h.

◆ m_EraseValue

double qSlicerSegmentEditorAbstractEffect::m_EraseValue
protected

Definition at line 411 of file qSlicerSegmentEditorAbstractEffect.h.

◆ m_FillValue

double qSlicerSegmentEditorAbstractEffect::m_FillValue
protected

Definition at line 410 of file qSlicerSegmentEditorAbstractEffect.h.

◆ m_Name

QString qSlicerSegmentEditorAbstractEffect::m_Name
protected

Name of the effect.

Definition at line 396 of file qSlicerSegmentEditorAbstractEffect.h.

◆ m_PerSegment

bool qSlicerSegmentEditorAbstractEffect::m_PerSegment
protected

Flag indicating whether effect operates on individual segments (true) or the whole segmentation (false). If the selected effect works on whole segmentation, selection of the segments does not trigger creation of modifier labelmap, but it is set to empty in the parameter set node. True by default.

Definition at line 403 of file qSlicerSegmentEditorAbstractEffect.h.

◆ m_RequireSegments

bool qSlicerSegmentEditorAbstractEffect::m_RequireSegments
protected

Definition at line 405 of file qSlicerSegmentEditorAbstractEffect.h.

◆ m_ShowEffectCursorInSliceView

bool qSlicerSegmentEditorAbstractEffect::m_ShowEffectCursorInSliceView
protected

Definition at line 407 of file qSlicerSegmentEditorAbstractEffect.h.

◆ m_ShowEffectCursorInThreeDView

bool qSlicerSegmentEditorAbstractEffect::m_ShowEffectCursorInThreeDView
protected

Definition at line 408 of file qSlicerSegmentEditorAbstractEffect.h.


The documentation for this class was generated from the following file: