Slicer  5.3
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 | Protected Attributes
qSlicerSegmentEditorPaintEffect Class Reference

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

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

Public Types

typedef qSlicerSegmentEditorAbstractLabelEffect Superclass
 
- Public Types inherited from qSlicerSegmentEditorAbstractLabelEffect
typedef qSlicerSegmentEditorAbstractEffect Superclass
 
- Public Types inherited from qSlicerSegmentEditorAbstractEffect
enum  ConfirmationResult { NotConfirmed, ConfirmedWithoutDialog, ConfirmedWithDialog }
 
enum  ModificationMode { ModificationModeSet, ModificationModeAdd, ModificationModeRemove, ModificationModeRemoveAll }
 
typedef QObject Superclass
 

Properties

bool delayedPaint
 
double minimumPaintPointDistance
 
- Properties inherited from qSlicerSegmentEditorAbstractEffect
QString name
 
bool perSegment
 
bool requireSegments
 
bool showEffectCursorInSliceView
 
bool showEffectCursorInThreeDView
 

Public Slots

void setDelayedPaint (bool delayed)
 
void setMinimumPaintPointDistance (double dist)
 
void updateGUIFromMRML () override
 Update user interface from parameter set node. More...
 
void updateMRMLFromGUI () override
 Update parameter set node from user interface. More...
 
- Public Slots inherited from qSlicerSegmentEditorAbstractLabelEffect
void updateGUIFromMRML () override
 Update user interface from parameter set node. More...
 
void updateMRMLFromGUI () override
 Update parameter set node from user interface. More...
 
- Public Slots inherited from qSlicerSegmentEditorAbstractEffect
virtual void updateGUIFromMRML ()=0
 
virtual void updateMRMLFromGUI ()=0
 

Public Member Functions

Q_INVOKABLE void clearBrushes ()
 
qSlicerSegmentEditorAbstractEffectclone () override
 Clone editor effect. More...
 
void deactivate () override
 Perform actions to deactivate the effect (such as destroy actors, etc.) More...
 
Q_INVOKABLE bool delayedPaint ()
 If enabled then segmentation is only modified when the mouse button is released. More...
 
const QString helpText () const override
 Get help text for effect to be displayed in the help box. More...
 
QIcon icon () override
 Get icon for effect to be displayed in segment editor. More...
 
Q_INVOKABLE double minimumPaintPointDistance ()
 
virtual Q_INVOKABLE void paintApply (qMRMLWidget *viewWidget)
 Paint labelmap. More...
 
Q_INVOKABLE QList< int > paintBrushesIntoLabelmap (vtkOrientedImageData *labelmap, qMRMLWidget *viewWidget)
 
Q_INVOKABLE QFrame * paintOptionsFrame ()
 
bool processInteractionEvents (vtkRenderWindowInteractor *callerInteractor, unsigned long eid, qMRMLWidget *viewWidget) override
 
void processViewNodeEvents (vtkMRMLAbstractViewNode *callerViewNode, unsigned long eid, qMRMLWidget *viewWidget) override
 
 qSlicerSegmentEditorPaintEffect (QObject *parent=nullptr)
 
void referenceGeometryChanged () override
 Perform actions needed on reference geometry change. More...
 
Q_INVOKABLE void setColorSmudgeCheckboxVisible (bool show)
 
void setMRMLDefaults () override
 Set default parameters in the parameter MRML node. More...
 
void setupOptionsFrame () override
 Create options frame widgets, make connections, and add them to the main options frame using. More...
 
 ~qSlicerSegmentEditorPaintEffect () override
 
- Public Member Functions inherited from qSlicerSegmentEditorAbstractLabelEffect
 qSlicerSegmentEditorAbstractLabelEffect (QObject *parent=nullptr)
 
void sourceVolumeNodeChanged () override
 Perform actions needed on source volume change. More...
 
 ~qSlicerSegmentEditorAbstractLabelEffect () override
 
- Public Member Functions inherited from qSlicerSegmentEditorAbstractEffect
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)
 
Q_INVOKABLE bool commonParameterDefined (QString name)
 Returns true if the common parameter is already defined. More...
 
Q_INVOKABLE int confirmCurrentSegmentVisible ()
 
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...
 
Q_INVOKABLE vtkOrientedImageDatadefaultModifierLabelmap ()
 
Q_INVOKABLE double doubleParameter (QString name)
 Convenience function to get double parameter. 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 ()
 Deprecated. Use sourceVolumeImageData method instead. More...
 
virtual void masterVolumeNodeChanged ()
 Deprecated. Override sourceVolumeNodeChanged() method instead. More...
 
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...
 
 qSlicerSegmentEditorAbstractEffect (QObject *parent=nullptr)
 
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 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)
 
void setVolumes (vtkOrientedImageData *alignedSourceVolume, vtkOrientedImageData *modifierLabelmap, vtkOrientedImageData *maskLabelmap, vtkOrientedImageData *selectedSegmentLabelmap, vtkOrientedImageData *referenceGeometryImage)
 Called by the editor widget. More...
 
bool showEffectCursorInSliceView ()
 
bool showEffectCursorInThreeDView ()
 
Q_INVOKABLE vtkOrientedImageDatasourceVolumeImageData ()
 
 ~qSlicerSegmentEditorAbstractEffect () override
 

Protected Attributes

QScopedPointer< qSlicerSegmentEditorPaintEffectPrivate > d_ptr
 
bool m_AlwaysErase
 
bool m_Erase
 Flag determining whether to paint or erase. More...
 
- Protected Attributes inherited from qSlicerSegmentEditorAbstractLabelEffect
QScopedPointer< qSlicerSegmentEditorAbstractLabelEffectPrivate > d_ptr
 
- Protected Attributes inherited from qSlicerSegmentEditorAbstractEffect
QScopedPointer< qSlicerSegmentEditorAbstractEffectPrivate > d_ptr
 
bool m_Active {false}
 
vtkWeakPointer< vtkSegmentm_AlreadyConfirmedSegmentVisible
 
double m_EraseValue {0.0}
 
double m_FillValue {1.0}
 
QString m_Name
 Name of the effect. More...
 
bool m_PerSegment {true}
 
bool m_RequireSegments {true}
 
bool m_ShowEffectCursorInSliceView {true}
 
bool m_ShowEffectCursorInThreeDView {false}
 

Additional Inherited Members

- Static Public Member Functions inherited from qSlicerSegmentEditorAbstractLabelEffect
static Q_INVOKABLE void appendImage (vtkOrientedImageData *inputImage, vtkOrientedImageData *appendedImage)
 Append image onto image. Resamples appended image and saves result in input image. More...
 
static Q_INVOKABLE void appendPolyMask (vtkOrientedImageData *input, vtkPolyData *polyData, qMRMLSliceWidget *sliceWidget, vtkMRMLSegmentationNode *segmentationNode=nullptr)
 Rasterize a poly data onto the input image into the slice view. More...
 
static Q_INVOKABLE void createMaskImageFromPolyData (vtkPolyData *polyData, vtkOrientedImageData *outputMask, qMRMLSliceWidget *sliceWidget)
 Create a slice view screen space (2D) mask image for the given polydata. More...
 
static Q_INVOKABLE void imageToWorldMatrix (vtkMRMLVolumeNode *node, vtkMatrix4x4 *ijkToRas)
 
static Q_INVOKABLE void imageToWorldMatrix (vtkOrientedImageData *image, vtkMRMLSegmentationNode *node, vtkMatrix4x4 *ijkToRas)
 
- Static Public Member Functions inherited from qSlicerSegmentEditorAbstractEffect
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, vtkMRMLTransformNode *parentTransform=nullptr)
 Convert XY in-slice position to image IJK position. More...
 
static void xyToIjk (double xy[2], int outputIjk[3], qMRMLSliceWidget *sliceWidget, vtkOrientedImageData *image, vtkMRMLTransformNode *parentTransform=nullptr)
 Convert XY in-slice position to image IJK position. More...
 
static Q_INVOKABLE QVector3D xyToIjk (QPoint xy, qMRMLSliceWidget *sliceWidget, vtkOrientedImageData *image, vtkMRMLTransformNode *parentTransform=nullptr)
 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, vtkMRMLTransformNode *parentTransform=nullptr)
 Convert XYZ slice view position to image IJK position,. More...
 
static Q_INVOKABLE QVector3D xyzToIjk (QVector3D inputXyz, qMRMLSliceWidget *sliceWidget, vtkOrientedImageData *image, vtkMRMLTransformNode *parentTransform=nullptr)
 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...
 

Detailed Description

Definition at line 33 of file qSlicerSegmentEditorPaintEffect.h.

Member Typedef Documentation

◆ Superclass

Definition at line 42 of file qSlicerSegmentEditorPaintEffect.h.

Property Documentation

◆ delayedPaint

bool qSlicerSegmentEditorPaintEffect::delayedPaint
readwrite

Definition at line 40 of file qSlicerSegmentEditorPaintEffect.h.

◆ minimumPaintPointDistance

double qSlicerSegmentEditorPaintEffect::minimumPaintPointDistance
readwrite

Definition at line 39 of file qSlicerSegmentEditorPaintEffect.h.

Constructor & Destructor Documentation

◆ qSlicerSegmentEditorPaintEffect()

qSlicerSegmentEditorPaintEffect::qSlicerSegmentEditorPaintEffect ( QObject *  parent = nullptr)

◆ ~qSlicerSegmentEditorPaintEffect()

qSlicerSegmentEditorPaintEffect::~qSlicerSegmentEditorPaintEffect ( )
override

Member Function Documentation

◆ clearBrushes()

Q_INVOKABLE void qSlicerSegmentEditorPaintEffect::clearBrushes ( )

◆ clone()

qSlicerSegmentEditorAbstractEffect* qSlicerSegmentEditorPaintEffect::clone ( )
overridevirtual

Clone editor effect.

Implements qSlicerSegmentEditorAbstractLabelEffect.

Reimplemented in qSlicerSegmentEditorScriptedPaintEffect.

◆ deactivate()

void qSlicerSegmentEditorPaintEffect::deactivate ( )
overridevirtual

Perform actions to deactivate the effect (such as destroy actors, etc.)

Reimplemented from qSlicerSegmentEditorAbstractEffect.

Reimplemented in qSlicerSegmentEditorScriptedPaintEffect.

◆ delayedPaint()

Q_INVOKABLE bool qSlicerSegmentEditorPaintEffect::delayedPaint ( )

If enabled then segmentation is only modified when the mouse button is released.

◆ helpText()

const QString qSlicerSegmentEditorPaintEffect::helpText ( ) const
overridevirtual

Get help text for effect to be displayed in the help box.

Reimplemented from qSlicerSegmentEditorAbstractEffect.

Reimplemented in qSlicerSegmentEditorScriptedPaintEffect.

◆ icon()

QIcon qSlicerSegmentEditorPaintEffect::icon ( )
overridevirtual

Get icon for effect to be displayed in segment editor.

Reimplemented from qSlicerSegmentEditorAbstractEffect.

Reimplemented in qSlicerSegmentEditorScriptedPaintEffect.

◆ minimumPaintPointDistance()

Q_INVOKABLE double qSlicerSegmentEditorPaintEffect::minimumPaintPointDistance ( )

If a new point is added at less than this squared distance (in display coordinate system) then the point is not added. This is an experimental feature that may help in limiting number of paint points to improve performance.

◆ paintApply()

virtual Q_INVOKABLE void qSlicerSegmentEditorPaintEffect::paintApply ( qMRMLWidget viewWidget)
virtual

Paint labelmap.

Reimplemented in qSlicerSegmentEditorScriptedPaintEffect.

◆ paintBrushesIntoLabelmap()

Q_INVOKABLE QList<int> qSlicerSegmentEditorPaintEffect::paintBrushesIntoLabelmap ( vtkOrientedImageData labelmap,
qMRMLWidget viewWidget 
)

◆ paintOptionsFrame()

Q_INVOKABLE QFrame* qSlicerSegmentEditorPaintEffect::paintOptionsFrame ( )

Get frame that contains all paint options (brush size, modes, etc.). This allows subclasses to show/hide these controls or move them to a different position.

◆ processInteractionEvents()

bool qSlicerSegmentEditorPaintEffect::processInteractionEvents ( vtkRenderWindowInteractor *  callerInteractor,
unsigned long  eid,
qMRMLWidget viewWidget 
)
overridevirtual

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

Reimplemented from qSlicerSegmentEditorAbstractEffect.

◆ processViewNodeEvents()

void qSlicerSegmentEditorPaintEffect::processViewNodeEvents ( vtkMRMLAbstractViewNode callerViewNode,
unsigned long  eid,
qMRMLWidget viewWidget 
)
overridevirtual

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 from qSlicerSegmentEditorAbstractEffect.

◆ referenceGeometryChanged()

void qSlicerSegmentEditorPaintEffect::referenceGeometryChanged ( )
overridevirtual

Perform actions needed on reference geometry change.

Reimplemented from qSlicerSegmentEditorAbstractLabelEffect.

Reimplemented in qSlicerSegmentEditorScriptedPaintEffect.

◆ setColorSmudgeCheckboxVisible()

Q_INVOKABLE void qSlicerSegmentEditorPaintEffect::setColorSmudgeCheckboxVisible ( bool  show)

◆ setDelayedPaint

void qSlicerSegmentEditorPaintEffect::setDelayedPaint ( bool  delayed)
slot
See also
delayedPaint

◆ setMinimumPaintPointDistance

void qSlicerSegmentEditorPaintEffect::setMinimumPaintPointDistance ( double  dist)
slot

◆ setMRMLDefaults()

void qSlicerSegmentEditorPaintEffect::setMRMLDefaults ( )
overridevirtual

Set default parameters in the parameter MRML node.

Reimplemented from qSlicerSegmentEditorAbstractLabelEffect.

Reimplemented in qSlicerSegmentEditorScriptedPaintEffect.

◆ setupOptionsFrame()

void qSlicerSegmentEditorPaintEffect::setupOptionsFrame ( )
overridevirtual

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

See also
addOptionsWidget

Reimplemented from qSlicerSegmentEditorAbstractLabelEffect.

Reimplemented in qSlicerSegmentEditorScriptedPaintEffect.

◆ updateGUIFromMRML

void qSlicerSegmentEditorPaintEffect::updateGUIFromMRML ( )
overrideslot

Update user interface from parameter set node.

◆ updateMRMLFromGUI

void qSlicerSegmentEditorPaintEffect::updateMRMLFromGUI ( )
overrideslot

Update parameter set node from user interface.

Member Data Documentation

◆ d_ptr

QScopedPointer<qSlicerSegmentEditorPaintEffectPrivate> qSlicerSegmentEditorPaintEffect::d_ptr
protected

Definition at line 126 of file qSlicerSegmentEditorPaintEffect.h.

◆ m_AlwaysErase

bool qSlicerSegmentEditorPaintEffect::m_AlwaysErase
protected

Flag determining to always erase (not just when smudge from empty region) Overridden in the

See also
qSlicerSegmentEditorEraseEffect subclass

Definition at line 120 of file qSlicerSegmentEditorPaintEffect.h.

◆ m_Erase

bool qSlicerSegmentEditorPaintEffect::m_Erase
protected

Flag determining whether to paint or erase.

Definition at line 123 of file qSlicerSegmentEditorPaintEffect.h.


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