Slicer  5.2
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
vtkSlicerMarkupsLogic Class Reference

#include <Modules/Loadable/Markups/Logic/vtkSlicerMarkupsLogic.h>

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

Public Types

enum  Events { MarkupRegistered = vtkCommand::UserEvent + 1, MarkupUnregistered }
 
typedef vtkSlicerModuleLogic Superclass
 
- Public Types inherited from vtkSlicerModuleLogic
typedef vtkMRMLAbstractLogic Superclass
 
- Public Types inherited from vtkMRMLAbstractLogic
typedef vtkObject Superclass
 
typedef void(vtkMRMLAbstractLogic::* TaskFunctionPointer) (void *clientdata)
 

Public Member Functions

int AddControlPoint (double r=0.0, double a=0.0, double s=0.0)
 
int AddFiducial (double r=0.0, double a=0.0, double s=0.0)
 
std::string AddNewDisplayNodeForMarkupsNode (vtkMRMLNode *mrmlNode)
 
std::string AddNewFiducialNode (const char *name="F", vtkMRMLScene *scene=nullptr)
 
vtkMRMLMarkupsJsonStorageNodeAddNewJsonStorageNodeForMarkupsType (std::string markupsType)
 
vtkMRMLMarkupsNodeAddNewMarkupsNode (std::string className, std::string nodeName=std::string(), vtkMRMLScene *scene=nullptr)
 
virtual void AutoCreateDisplayNodesOff ()
 
virtual void AutoCreateDisplayNodesOn ()
 
void ConvertAnnotationFiducialsToMarkups ()
 
void CopyBasicDisplayProperties (vtkMRMLMarkupsDisplayNode *sourceDisplayNode, vtkMRMLMarkupsDisplayNode *targetDisplayNode)
 
bool CopyNthControlPointToNewList (int n, vtkMRMLMarkupsNode *markupsNode, vtkMRMLMarkupsNode *newMarkupsNode)
 
bool CopyNthMarkupToNewList (int n, vtkMRMLMarkupsNode *markupsNode, vtkMRMLMarkupsNode *newMarkupsNode)
 
void FocusCameraOnNthPointInMarkup (const char *cameraNodeID, const char *markupNodeID, int n)
 
void FocusCamerasOnNthPointInMarkup (const char *id, int n)
 
std::string GetActiveListID ()
 
virtual bool GetAutoCreateDisplayNodes ()
 
virtual const char * GetClassName ()
 
bool GetCreateMarkupsPushButton (const char *markupName) const
 This returns the flags that indicates whether the GUI push button should be created. More...
 
vtkMRMLMarkupsDisplayNodeGetDefaultMarkupsDisplayNode ()
 
std::string GetJsonStorageNodeClassNameForMarkupsType (std::string markupsType)
 
vtkMRMLMarkupsNodeGetNodeByMarkupsType (const char *markupsType) const
 
const std::list< std::string > & GetRegisteredMarkupsTypes () const
 This returns the list of the markups registered in the logic. More...
 
std::string GetSelectionNodeID ()
 
vtkSlicerMarkupsWidgetGetWidgetByMarkupsType (const char *markupsType) const
 
virtual int IsA (const char *type)
 
bool IsMarkupsNodeRegistered (const char *nodeType) const
 
void JumpSlicesToLocation (double x, double y, double z, bool centered, int viewGroup=-1, vtkMRMLSliceNode *exclude=nullptr)
 
void JumpSlicesToNthPointInMarkup (const char *id, int n, bool centered=false, int viewGroup=-1, vtkMRMLSliceNode *exclude=nullptr)
 
char * LoadMarkups (const char *fileName, const char *fidsName=nullptr, vtkMRMLMessageCollection *userMessages=nullptr)
 
char * LoadMarkupsFiducials (const char *fileName, const char *fidsName=nullptr, vtkMRMLMessageCollection *userMessages=nullptr)
 This method is deprecated. It is kept for backward compatibility only, it does the same as LoadMarkups method. More...
 
char * LoadMarkupsFromFcsv (const char *fileName, const char *nodeName=nullptr, vtkMRMLMessageCollection *userMessages=nullptr)
 
char * LoadMarkupsFromJson (const char *fileName, const char *nodeName=nullptr, vtkMRMLMessageCollection *userMessages=nullptr)
 
bool MoveNthControlPointToNewListAtIndex (int n, vtkMRMLMarkupsNode *markupsNode, vtkMRMLMarkupsNode *newMarkupsNode, int newIndex)
 
bool MoveNthMarkupToNewList (int n, vtkMRMLMarkupsNode *markupsNode, vtkMRMLMarkupsNode *newMarkupsNode, int newIndex)
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
void ProcessMRMLNodesEvents (vtkObject *caller, unsigned long event, void *callData) override
 
void RegisterJsonStorageNodeForMarkupsType (std::string markupsType, std::string storageNodeClassName)
 
void RegisterMarkupsNode (vtkMRMLMarkupsNode *markupsNode, vtkSlicerMarkupsWidget *markupsWidget, bool createPushButton=true)
 
void RenameAllControlPointsFromCurrentFormat (vtkMRMLMarkupsNode *markupsNode)
 
void RenameAllMarkupsFromCurrentFormat (vtkMRMLMarkupsNode *markupsNode)
 
void SetActiveList (vtkMRMLMarkupsNode *markupsNode)
 
void SetActiveListID (vtkMRMLMarkupsNode *markupsNode)
 
void SetAllMarkupsLocked (vtkMRMLMarkupsNode *node, bool flag)
 
void SetAllMarkupsSelected (vtkMRMLMarkupsNode *node, bool flag)
 
void SetAllMarkupsVisibility (vtkMRMLMarkupsNode *node, bool flag)
 
virtual void SetAutoCreateDisplayNodes (bool)
 
void SetDisplayDefaultsFromNode (vtkMRMLMarkupsDisplayNode *displayNode)
 utility method to set defaults from display node More...
 
void SetDisplayNodeToDefaults (vtkMRMLMarkupsDisplayNode *displayNode)
 
bool StartPlaceMode (bool persistent, vtkMRMLInteractionNode *interactionNode=nullptr)
 
void ToggleAllMarkupsLocked (vtkMRMLMarkupsNode *node)
 
void ToggleAllMarkupsSelected (vtkMRMLMarkupsNode *node)
 
void ToggleAllMarkupsVisibility (vtkMRMLMarkupsNode *node)
 
void UnregisterMarkupsNode (vtkMRMLMarkupsNode *markupsNode)
 
void SetAllControlPointsVisibility (vtkMRMLMarkupsNode *node, bool flag)
 
void ToggleAllControlPointsVisibility (vtkMRMLMarkupsNode *node)
 
void SetAllControlPointsLocked (vtkMRMLMarkupsNode *node, bool flag)
 
void ToggleAllControlPointsLocked (vtkMRMLMarkupsNode *node)
 
void SetAllControlPointsSelected (vtkMRMLMarkupsNode *node, bool flag)
 
void ToggleAllControlPointsSelected (vtkMRMLMarkupsNode *node)
 
vtkVector3d GenerateUniqueColor ()
 
void GenerateUniqueColor (double color[3])
 
- Public Member Functions inherited from vtkSlicerModuleLogic
virtual vtkSlicerApplicationLogicGetApplicationLogic ()
 Get access to overall application state. More...
 
virtual vtkMRMLAbstractLogicGetModuleLogic (const char *moduleName)
 Convenience method for getting another module's logic from the application logic. More...
 
std::string GetModuleShareDirectory () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
void SetModuleShareDirectory (const std::string &shareDirectory)
 
- Public Member Functions inherited from vtkMRMLAbstractLogic
virtual vtkMRMLApplicationLogicGetMRMLApplicationLogic () const
 Get access to overall application state. More...
 
vtkMRMLSceneGetMRMLScene () const
 Return a reference to the current MRML scene. More...
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
virtual void SetMRMLApplicationLogic (vtkMRMLApplicationLogic *logic)
 
void SetMRMLScene (vtkMRMLScene *newScene)
 Set and observe the MRMLScene. More...
 

Static Public Member Functions

static bool ExportControlPointsToCSV (vtkMRMLMarkupsNode *markupsNode, const std::string filename, bool lps=true)
 
static bool ExportControlPointsToTable (vtkMRMLMarkupsNode *markupsNode, vtkMRMLTableNode *tableNode, int coordinateSystem=vtkMRMLStorageNode::CoordinateSystemRAS)
 
static bool FitSurfaceDiskWarp (vtkPoints *curvePoints, vtkPolyData *surface, double radiusScalingFactor=1.0)
 
static bool FitSurfaceProjectWarp (vtkPoints *curvePoints, vtkPolyData *surface, double radiusScalingFactor=1.0, vtkIdType numberOfInternalGridPoints=225)
 
static bool GetBestFitPlane (vtkMRMLMarkupsNode *curveNode, vtkPlane *plane)
 Get best fit plane for a markup. More...
 
static double GetClosedCurveSurfaceArea (vtkMRMLMarkupsClosedCurveNode *curveNode, vtkPolyData *surface=nullptr, bool projectWarp=true)
 
static bool ImportControlPointsFromCSV (vtkMRMLMarkupsNode *markupsNode, const std::string filename)
 
static bool ImportControlPointsFromTable (vtkMRMLMarkupsNode *markupsNode, vtkMRMLTableNode *tableNode, int startRow=0, int numberOfRows=-1)
 
static bool IsPolygonClockwise (vtkPoints *points, vtkIdList *pointIds=nullptr)
 
static int IsTypeOf (const char *type)
 
static vtkSlicerMarkupsLogicNew ()
 
static vtkSlicerMarkupsLogicSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkSlicerModuleLogic
static int IsTypeOf (const char *type)
 
static vtkSlicerModuleLogicNew ()
 The Usual vtk class functions. More...
 
static vtkSlicerModuleLogicSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkMRMLAbstractLogic
static int IsTypeOf (const char *type)
 
static vtkMRMLAbstractLogicNew ()
 
static vtkMRMLAbstractLogicSafeDownCast (vtkObject *o)
 

Protected Member Functions

void ObserveMRMLScene () override
 
void OnMRMLSceneNodeAdded (vtkMRMLNode *node) override
 
void OnMRMLSceneNodeRemoved (vtkMRMLNode *node) override
 
void RegisterNodes () override
 Register MRML Node classes to Scene. Gets called automatically when the MRMLScene is attached to this logic class. More...
 
void SetAndObserveSelectionNode (vtkMRMLSelectionNode *selectionNode)
 
void SetMRMLSceneInternal (vtkMRMLScene *newScene) override
 Initialize listening to MRML events. More...
 
void UpdateFromMRMLScene () override
 
void UpdatePlaceNodeClassNamesInSelectionNode ()
 Update list of place node class names in selection node based on currently registered markups. More...
 
 vtkSlicerMarkupsLogic ()
 
 ~vtkSlicerMarkupsLogic () override
 
- Protected Member Functions inherited from vtkSlicerModuleLogic
 vtkSlicerModuleLogic ()
 
 ~vtkSlicerModuleLogic () override
 
- Protected Member Functions inherited from vtkMRMLAbstractLogic
int EndModify (bool wasModifying)
 
virtual bool EnterMRMLLogicsCallback () const
 
virtual bool EnterMRMLNodesCallback () const
 
virtual bool EnterMRMLSceneCallback () const
 
bool GetDisableModifiedEvent () const
 
int GetInMRMLLogicsCallbackFlag () const
 
int GetInMRMLNodesCallbackFlag () const
 
int GetInMRMLSceneCallbackFlag () const
 
vtkCallbackCommand * GetMRMLLogicsCallbackCommand ()
 
vtkObserverManagerGetMRMLLogicsObserverManager () const
 
vtkCallbackCommand * GetMRMLNodesCallbackCommand ()
 
vtkObserverManagerGetMRMLNodesObserverManager () const
 
vtkCallbackCommand * GetMRMLSceneCallbackCommand ()
 
vtkObserverManagerGetMRMLSceneObserverManager () const
 
int GetPendingModifiedEventCount () const
 
int GetProcessingMRMLSceneEvent () const
 Return the event id currently processed or 0 if any. More...
 
int InvokePendingModifiedEvent ()
 
void Modified () override
 
virtual void OnMRMLNodeModified (vtkMRMLNode *)
 
virtual void OnMRMLSceneEndBatchProcess ()
 
virtual void OnMRMLSceneEndClose ()
 
virtual void OnMRMLSceneEndImport ()
 
virtual void OnMRMLSceneEndRestore ()
 
virtual void OnMRMLSceneNew ()
 
virtual void OnMRMLSceneStartBatchProcess ()
 
virtual void OnMRMLSceneStartClose ()
 
virtual void OnMRMLSceneStartImport ()
 
virtual void OnMRMLSceneStartRestore ()
 
virtual void ProcessMRMLLogicsEvents (vtkObject *caller, unsigned long event, void *callData)
 
virtual void ProcessMRMLSceneEvents (vtkObject *caller, unsigned long event, void *callData)
 
void SetAndObserveMRMLSceneEventsInternal (vtkMRMLScene *newScene, vtkIntArray *events, vtkFloatArray *priorities=nullptr)
 
void SetDisableModifiedEvent (bool onOff)
 
void SetInMRMLLogicsCallbackFlag (int flag)
 
void SetInMRMLNodesCallbackFlag (int flag)
 
void SetInMRMLSceneCallbackFlag (int flag)
 
void SetProcessingMRMLSceneEvent (int event)
 
bool StartModify ()
 
virtual void UnobserveMRMLScene ()
 
 vtkMRMLAbstractLogic ()
 
 ~vtkMRMLAbstractLogic () override
 

Additional Inherited Members

- Static Protected Member Functions inherited from vtkMRMLAbstractLogic
static void MRMLLogicsCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData)
 MRMLLogicCallback is a static function to relay modified events from the logics. More...
 
static void MRMLNodesCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData)
 MRMLNodesCallback is a static function to relay modified events from the nodes. More...
 
static void MRMLSceneCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData)
 

Detailed Description

Definition at line 57 of file vtkSlicerMarkupsLogic.h.

Member Typedef Documentation

◆ Superclass

Definition at line 68 of file vtkSlicerMarkupsLogic.h.

Member Enumeration Documentation

◆ Events

Enumerator
MarkupRegistered 
MarkupUnregistered 

Definition at line 62 of file vtkSlicerMarkupsLogic.h.

Constructor & Destructor Documentation

◆ vtkSlicerMarkupsLogic()

vtkSlicerMarkupsLogic::vtkSlicerMarkupsLogic ( )
protected

◆ ~vtkSlicerMarkupsLogic()

vtkSlicerMarkupsLogic::~vtkSlicerMarkupsLogic ( )
overrideprotected

Member Function Documentation

◆ AddControlPoint()

int vtkSlicerMarkupsLogic::AddControlPoint ( double  r = 0.0,
double  a = 0.0,
double  s = 0.0 
)

Add a new control point to the currently active markups fiducial node at the given RAS coordinates (default 0,0,0). Will create a markups fiducial node if one is not active. Returns -1 on failure, index of the added control point on success.

◆ AddFiducial()

int vtkSlicerMarkupsLogic::AddFiducial ( double  r = 0.0,
double  a = 0.0,
double  s = 0.0 
)
inline
Deprecated:
Use AddControlPoint instead.

Definition at line 335 of file vtkSlicerMarkupsLogic.h.

◆ AddNewDisplayNodeForMarkupsNode()

std::string vtkSlicerMarkupsLogic::AddNewDisplayNodeForMarkupsNode ( vtkMRMLNode mrmlNode)

Create a new display node and observe it on the markups node. On success, return the id, on failure return an empty string. If a display node already exists for this node, return the id of that node.

◆ AddNewFiducialNode()

std::string vtkSlicerMarkupsLogic::AddNewFiducialNode ( const char *  name = "F",
vtkMRMLScene scene = nullptr 
)

Create a new markups fiducial node and associated display node, adding both to the scene. If the scene argument is null use the scene set on the logic class, and also make it the active on on the selection node, otherwise add to the passed scene. On success, return the id, on failure return an empty string.

◆ AddNewJsonStorageNodeForMarkupsType()

vtkMRMLMarkupsJsonStorageNode* vtkSlicerMarkupsLogic::AddNewJsonStorageNodeForMarkupsType ( std::string  markupsType)

◆ AddNewMarkupsNode()

vtkMRMLMarkupsNode* vtkSlicerMarkupsLogic::AddNewMarkupsNode ( std::string  className,
std::string  nodeName = std::string(),
vtkMRMLScene scene = nullptr 
)

Create a new markups node and associated display node, adding both to the scene. For ROI nodes, each new node will have a unique color.

◆ AutoCreateDisplayNodesOff()

virtual void vtkSlicerMarkupsLogic::AutoCreateDisplayNodesOff ( )
virtual

◆ AutoCreateDisplayNodesOn()

virtual void vtkSlicerMarkupsLogic::AutoCreateDisplayNodesOn ( )
virtual

◆ ConvertAnnotationFiducialsToMarkups()

void vtkSlicerMarkupsLogic::ConvertAnnotationFiducialsToMarkups ( )

Searches the scene for annotation fidicual nodes, collecting a list of annotation hierarchy nodes. Then iterates through those hierarchy nodes and moves the fiducials that are under them into new markups nodes. Leaves the top level hierarchy nodes intact as they may be parents to ruler or ROIs but deletes the 1:1 hierarchy nodes.

◆ CopyBasicDisplayProperties()

void vtkSlicerMarkupsLogic::CopyBasicDisplayProperties ( vtkMRMLMarkupsDisplayNode sourceDisplayNode,
vtkMRMLMarkupsDisplayNode targetDisplayNode 
)

Copies basic display properties between markups display nodes. This is used for updating a display node to defaults.

◆ CopyNthControlPointToNewList()

bool vtkSlicerMarkupsLogic::CopyNthControlPointToNewList ( int  n,
vtkMRMLMarkupsNode markupsNode,
vtkMRMLMarkupsNode newMarkupsNode 
)

utility method to copy a control point from one list to another, adding it to the end of the new list

See also
vtkMRMLMarkupsNode::AddControlPoint Returns true on success, false on failure

◆ CopyNthMarkupToNewList()

bool vtkSlicerMarkupsLogic::CopyNthMarkupToNewList ( int  n,
vtkMRMLMarkupsNode markupsNode,
vtkMRMLMarkupsNode newMarkupsNode 
)
inline
Deprecated:
Use CopyNthControlPointToNewList instead.

Definition at line 321 of file vtkSlicerMarkupsLogic.h.

◆ ExportControlPointsToCSV()

static bool vtkSlicerMarkupsLogic::ExportControlPointsToCSV ( vtkMRMLMarkupsNode markupsNode,
const std::string  filename,
bool  lps = true 
)
static

Export markups node control points to CSV file.

Parameters
markupsNodeNode that the control points are exported to.
filenameOutput filename.
lpsSave files in LPS coordinate system. If set to false then RAS coordinate system is used.

◆ ExportControlPointsToTable()

static bool vtkSlicerMarkupsLogic::ExportControlPointsToTable ( vtkMRMLMarkupsNode markupsNode,
vtkMRMLTableNode tableNode,
int  coordinateSystem = vtkMRMLStorageNode::CoordinateSystemRAS 
)
static

◆ FitSurfaceDiskWarp()

static bool vtkSlicerMarkupsLogic::FitSurfaceDiskWarp ( vtkPoints *  curvePoints,
vtkPolyData *  surface,
double  radiusScalingFactor = 1.0 
)
static

Create a "soap bubble" surface that fits on the provided point list. Compared to FitSurfaceProjectWarp, this method can tolerate more if points are not on a plane but it may not be able to fill complicated shapes (with sharp edges or many indentations). A triangulated disk is warped so that its boundary matches the provided curve points using thin-plate spline transform. The generated surface may go beyond the boundary of the input points if the boundary is highly concave or curved.

Parameters
curvePointspoints to fit the surface to
radiusScalingFactorsize of the surface.Value of 1.0 (default) means the surface edge fits on the points. Larger values increase the generated soap bubble outer radius, which may be useful to avoid coincident points when using this surface for cutting another surface.

◆ FitSurfaceProjectWarp()

static bool vtkSlicerMarkupsLogic::FitSurfaceProjectWarp ( vtkPoints *  curvePoints,
vtkPolyData *  surface,
double  radiusScalingFactor = 1.0,
vtkIdType  numberOfInternalGridPoints = 225 
)
static

Create a "soap bubble" surface that fits on the provided point list. It can fill arbitrarily complex (non-self-intersecting) polygons in a plane or in a slightly curved plane. First the contour points projected to best fit plane, triangulated in 2D, and warped to the non-planar shape. Convex surfaces are triangulated correctly. If the contour is self-intersecting after projected to best fit plane then the surface will be invalid.

Parameters
curvePointspoints to fit the surface to
radiusScalingFactorsize of the surface. Value of 1.0 (default) means the surface edge fits on the points. Larger values increase the generated soap bubble outer radius, which may be useful to avoid coincident points when using this surface for cutting another surface.
numberOfInternalGridPointsspecifies the number of additional grid points that are added to get a more evenly triangulated surface. Default is 225, which corresponds to 15x15 subdivisions for a square shaped region.
Warning
Specifying radiusScalingFactor has no effect. Associated feature is not yet implemented.

◆ FocusCameraOnNthPointInMarkup()

void vtkSlicerMarkupsLogic::FocusCameraOnNthPointInMarkup ( const char *  cameraNodeID,
const char *  markupNodeID,
int  n 
)

refocus the camera with the given cameraNodeID on the nth markup in the markups node with id markupNodeID

See also
FocusCamerasOnNthPointInMarkup

◆ FocusCamerasOnNthPointInMarkup()

void vtkSlicerMarkupsLogic::FocusCamerasOnNthPointInMarkup ( const char *  id,
int  n 
)

refocus all of the 3D cameras to the nth markup with the mrml id id

See also
FocusCameraOnNthPointInMarkup

◆ GenerateUniqueColor() [1/2]

vtkVector3d vtkSlicerMarkupsLogic::GenerateUniqueColor ( )

Generate a unique color for a markup node. In the current implementation, the color is not globally unique, but colors are generated by iterating through the items in "MediumChart" color table.

◆ GenerateUniqueColor() [2/2]

void vtkSlicerMarkupsLogic::GenerateUniqueColor ( double  color[3])

◆ GetActiveListID()

std::string vtkSlicerMarkupsLogic::GetActiveListID ( )

Utility method to return the id of the active place node. Returns an empty string on failure.

See also
SetActiveListID

◆ GetAutoCreateDisplayNodes()

virtual bool vtkSlicerMarkupsLogic::GetAutoCreateDisplayNodes ( )
virtual

◆ GetBestFitPlane()

static bool vtkSlicerMarkupsLogic::GetBestFitPlane ( vtkMRMLMarkupsNode curveNode,
vtkPlane *  plane 
)
static

Get best fit plane for a markup.

◆ GetClassName()

virtual const char* vtkSlicerMarkupsLogic::GetClassName ( )
virtual

Reimplemented from vtkSlicerModuleLogic.

◆ GetClosedCurveSurfaceArea()

static double vtkSlicerMarkupsLogic::GetClosedCurveSurfaceArea ( vtkMRMLMarkupsClosedCurveNode curveNode,
vtkPolyData *  surface = nullptr,
bool  projectWarp = true 
)
static

Measure surface area of the smooth surface that fits on the closed curve in world coordinate system. If projectWarp option is enabled then FitSurfaceProjectWarp method is used otherwise FitSurfaceDiskWarp is used. FitSurfaceProjectWarp produces accurate results for all quasi-planar curves (while FitSurfaceDiskWarp may significantly overestimate surface area for planar convex curves). FitSurfaceDiskWarp is kept for compatison only and may be removed in the future.

Parameters
curveNodepoints to fit the surface to
surfaceif not nullptr then the generated surface is saved into that

◆ GetCreateMarkupsPushButton()

bool vtkSlicerMarkupsLogic::GetCreateMarkupsPushButton ( const char *  markupName) const

This returns the flags that indicates whether the GUI push button should be created.

◆ GetDefaultMarkupsDisplayNode()

vtkMRMLMarkupsDisplayNode* vtkSlicerMarkupsLogic::GetDefaultMarkupsDisplayNode ( )

◆ GetJsonStorageNodeClassNameForMarkupsType()

std::string vtkSlicerMarkupsLogic::GetJsonStorageNodeClassNameForMarkupsType ( std::string  markupsType)

◆ GetNodeByMarkupsType()

vtkMRMLMarkupsNode* vtkSlicerMarkupsLogic::GetNodeByMarkupsType ( const char *  markupsType) const

This returns an instance to a corresponding vtkMRMLMarkupsNode associated to the indicated markups name.

Parameters
makrupsTyperegistered class to retrieve the associated widget.
Returns
pointer to associated vtkSLicerMarkupsWidget or nullptr if the MRML node class is not registered.

◆ GetRegisteredMarkupsTypes()

const std::list<std::string>& vtkSlicerMarkupsLogic::GetRegisteredMarkupsTypes ( ) const

This returns the list of the markups registered in the logic.

◆ GetSelectionNodeID()

std::string vtkSlicerMarkupsLogic::GetSelectionNodeID ( )

Utility method to return the id of the selection node. Checks the mrml application logic if set, otherwise checks the scene for a singleton selection node. Returns an empty string on failure.

◆ GetWidgetByMarkupsType()

vtkSlicerMarkupsWidget* vtkSlicerMarkupsLogic::GetWidgetByMarkupsType ( const char *  markupsType) const

This returns an instance to a corresponding vtkSlicerMarkupsWidget associated to the indicated markups name.

Parameters
markupsTyperegistered class to retrieve the associated widget.
Returns
pointer to associated vtkSLicerMarkupsWidget or nullptr if the MRML node class is not registered.

◆ ImportControlPointsFromCSV()

static bool vtkSlicerMarkupsLogic::ImportControlPointsFromCSV ( vtkMRMLMarkupsNode markupsNode,
const std::string  filename 
)
static

Import markups node control points from CSV file.

Parameters
markupsNodeNode that the control points are imported from.
filenameInput filename.

◆ ImportControlPointsFromTable()

static bool vtkSlicerMarkupsLogic::ImportControlPointsFromTable ( vtkMRMLMarkupsNode markupsNode,
vtkMRMLTableNode tableNode,
int  startRow = 0,
int  numberOfRows = -1 
)
static

Import markups control points from table node Column names: label, r, a, s, (or l, p, s), defined, selected, visible, locked, description.

◆ IsA()

virtual int vtkSlicerMarkupsLogic::IsA ( const char *  type)
virtual

Reimplemented from vtkSlicerModuleLogic.

◆ IsMarkupsNodeRegistered()

bool vtkSlicerMarkupsLogic::IsMarkupsNodeRegistered ( const char *  nodeType) const

Returns true if the provided class name is a known markups class (it has ben registered in the logic using RegisterMarkupsNode).

◆ IsPolygonClockwise()

static bool vtkSlicerMarkupsLogic::IsPolygonClockwise ( vtkPoints *  points,
vtkIdList *  pointIds = nullptr 
)
static

Return true if the polygon points are oriented clockwise. If pointIds is null then point IDs will be 0, 1, 2, ... n-1.

◆ IsTypeOf()

static int vtkSlicerMarkupsLogic::IsTypeOf ( const char *  type)
static

◆ JumpSlicesToLocation()

void vtkSlicerMarkupsLogic::JumpSlicesToLocation ( double  x,
double  y,
double  z,
bool  centered,
int  viewGroup = -1,
vtkMRMLSliceNode exclude = nullptr 
)

jump the slice windows to the given coordinate If viewGroup is -1 then all all slice views are updated, otherwise only those views that are in the specified group.

◆ JumpSlicesToNthPointInMarkup()

void vtkSlicerMarkupsLogic::JumpSlicesToNthPointInMarkup ( const char *  id,
int  n,
bool  centered = false,
int  viewGroup = -1,
vtkMRMLSliceNode exclude = nullptr 
)

jump the slice windows to the nth markup with the mrml id id

See also
JumpSlicesToLocation

◆ LoadMarkups()

char* vtkSlicerMarkupsLogic::LoadMarkups ( const char *  fileName,
const char *  fidsName = nullptr,
vtkMRMLMessageCollection userMessages = nullptr 
)

Load a markups node from fileName, return nullptr on error, node ID string otherwise. Adds the appropriate storage and display nodes to the scene as well.

◆ LoadMarkupsFiducials()

char* vtkSlicerMarkupsLogic::LoadMarkupsFiducials ( const char *  fileName,
const char *  fidsName = nullptr,
vtkMRMLMessageCollection userMessages = nullptr 
)

This method is deprecated. It is kept for backward compatibility only, it does the same as LoadMarkups method.

◆ LoadMarkupsFromFcsv()

char* vtkSlicerMarkupsLogic::LoadMarkupsFromFcsv ( const char *  fileName,
const char *  nodeName = nullptr,
vtkMRMLMessageCollection userMessages = nullptr 
)

◆ LoadMarkupsFromJson()

char* vtkSlicerMarkupsLogic::LoadMarkupsFromJson ( const char *  fileName,
const char *  nodeName = nullptr,
vtkMRMLMessageCollection userMessages = nullptr 
)

◆ MoveNthControlPointToNewListAtIndex()

bool vtkSlicerMarkupsLogic::MoveNthControlPointToNewListAtIndex ( int  n,
vtkMRMLMarkupsNode markupsNode,
vtkMRMLMarkupsNode newMarkupsNode,
int  newIndex 
)

utility method to move a control point from one list to another, trying to insert it at the given new index. If the new index is larger than the number of control points in the list, adds it to the end. If new index is smaller than 0, adds it at the beginning. Otherwise inserts at that index.

See also
vtkMRMLMarkupsNode::InsertControlPoint Returns true on success, false on failure

◆ MoveNthMarkupToNewList()

bool vtkSlicerMarkupsLogic::MoveNthMarkupToNewList ( int  n,
vtkMRMLMarkupsNode markupsNode,
vtkMRMLMarkupsNode newMarkupsNode,
int  newIndex 
)
inline
Deprecated:
Use MoveNthControlPointToNewList instead.

Definition at line 328 of file vtkSlicerMarkupsLogic.h.

◆ New()

static vtkSlicerMarkupsLogic* vtkSlicerMarkupsLogic::New ( )
static

◆ ObserveMRMLScene()

void vtkSlicerMarkupsLogic::ObserveMRMLScene ( )
overrideprotectedvirtual

Called after a scene is set to the logic and nodes are registered (RegisterNodes()). The scene events to observe are already set in SetMRMLSceneInternal(). By default, ObserveMRMLScene() calls UpdateFromMRMLScene(). Override for a custom behavior.

See also
SetMRMLSceneInternal, RegisterNodes, UnobserveMRMLScene
UpdateFromMRMLScene

Reimplemented from vtkMRMLAbstractLogic.

◆ OnMRMLSceneNodeAdded()

void vtkSlicerMarkupsLogic::OnMRMLSceneNodeAdded ( vtkMRMLNode )
overrideprotectedvirtual

If vtkMRMLScene::NodeAddedEvent has been set to be observed in SetMRMLSceneInternal, it is called when the scene fires the event

See also
ProcessMRMLSceneEvents, SetMRMLSceneInternal
OnMRMLSceneNodeRemoved, vtkMRMLScene::NodeAboutToBeAdded

Reimplemented from vtkMRMLAbstractLogic.

◆ OnMRMLSceneNodeRemoved()

void vtkSlicerMarkupsLogic::OnMRMLSceneNodeRemoved ( vtkMRMLNode )
overrideprotectedvirtual

If vtkMRMLScene::NodeRemovedEvent has been set to be observed in SetMRMLSceneInternal, it is called when the scene fires the event

See also
ProcessMRMLSceneEvents, SetMRMLSceneInternal
OnMRMLSceneNodeAdded, vtkMRMLScene::NodeAboutToBeRemoved

Reimplemented from vtkMRMLAbstractLogic.

◆ PrintSelf()

void vtkSlicerMarkupsLogic::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
override

◆ ProcessMRMLNodesEvents()

void vtkSlicerMarkupsLogic::ProcessMRMLNodesEvents ( vtkObject *  caller,
unsigned long  event,
void *  callData 
)
overridevirtual

Receives all the events fired by the nodes. To listen to a node, you can add an observer using GetMRMLNodesCallbackCommand() or use the utility macros vtk[SetAndObserve|Observe]MRMLNode[Event]Macro ProcessMRMLNodesEvents calls OnMRMLNodeModified when event is vtkCommand::ModifiedEvent.

See also
ProcessMRMLSceneEvents, ProcessMRMLLogicsEvents, OnMRMLNodeModified(), vtkSetAndObserveMRMLNodeMacro, vtkObserveMRMLNodeMacro, vtkSetAndObserveMRMLNodeEventMacro

Reimplemented from vtkMRMLAbstractLogic.

◆ RegisterJsonStorageNodeForMarkupsType()

void vtkSlicerMarkupsLogic::RegisterJsonStorageNodeForMarkupsType ( std::string  markupsType,
std::string  storageNodeClassName 
)

◆ RegisterMarkupsNode()

void vtkSlicerMarkupsLogic::RegisterMarkupsNode ( vtkMRMLMarkupsNode markupsNode,
vtkSlicerMarkupsWidget markupsWidget,
bool  createPushButton = true 
)

Registers a markup and its corresponding widget to be handled by the Markups module. For a markup to be handled by this module (processed by the displayable manager, UI and subject hierarchy) it needs to be registered using this method. The method also registers the markupsNode class in the scene.

Parameters
markupsNodeMRMLMarkups node to be registered.
markupsWidgetvtkSlicerWidget associated to the MRMLMarkups node registered.

◆ RegisterNodes()

void vtkSlicerMarkupsLogic::RegisterNodes ( )
overrideprotectedvirtual

Register MRML Node classes to Scene. Gets called automatically when the MRMLScene is attached to this logic class.

Reimplemented from vtkMRMLAbstractLogic.

◆ RenameAllControlPointsFromCurrentFormat()

void vtkSlicerMarkupsLogic::RenameAllControlPointsFromCurrentFormat ( vtkMRMLMarkupsNode markupsNode)

Iterate over the control points in the list and reset the control point labels using the current ControlPointLabelFormat setting. Try to keep current numbering. Will work if there's a d, g or f in the format string, but precision is not handled.

◆ RenameAllMarkupsFromCurrentFormat()

void vtkSlicerMarkupsLogic::RenameAllMarkupsFromCurrentFormat ( vtkMRMLMarkupsNode markupsNode)
inline
Deprecated:
Use RenameAllControlPointsFromCurrentFormat instead.

Definition at line 377 of file vtkSlicerMarkupsLogic.h.

◆ SafeDownCast()

static vtkSlicerMarkupsLogic* vtkSlicerMarkupsLogic::SafeDownCast ( vtkObject *  o)
static

◆ SetActiveList()

void vtkSlicerMarkupsLogic::SetActiveList ( vtkMRMLMarkupsNode markupsNode)

Utility method to set the active place node from the passed markups node. Does not set the interaction mode to place.

See also
GetActiveListID, StartPlaceMode
vtkMRMLSelectionNode::SetReferenceActivePlaceNodeClassName
vtkMRMLSelectionNode::SetActivePlaceNodeID

◆ SetActiveListID()

void vtkSlicerMarkupsLogic::SetActiveListID ( vtkMRMLMarkupsNode markupsNode)

This method is deprecated due to its confusing name. It is kept for backward compatibility only, SetActiveList method should be used instead.

◆ SetAllControlPointsLocked()

void vtkSlicerMarkupsLogic::SetAllControlPointsLocked ( vtkMRMLMarkupsNode node,
bool  flag 
)

◆ SetAllControlPointsSelected()

void vtkSlicerMarkupsLogic::SetAllControlPointsSelected ( vtkMRMLMarkupsNode node,
bool  flag 
)

◆ SetAllControlPointsVisibility()

void vtkSlicerMarkupsLogic::SetAllControlPointsVisibility ( vtkMRMLMarkupsNode node,
bool  flag 
)

Utility methods to operate on all control points in a markups node

◆ SetAllMarkupsLocked()

void vtkSlicerMarkupsLogic::SetAllMarkupsLocked ( vtkMRMLMarkupsNode node,
bool  flag 
)
inline
Deprecated:
Use SetAllControlPointsLocked instead.

Definition at line 353 of file vtkSlicerMarkupsLogic.h.

◆ SetAllMarkupsSelected()

void vtkSlicerMarkupsLogic::SetAllMarkupsSelected ( vtkMRMLMarkupsNode node,
bool  flag 
)
inline
Deprecated:
Use SetAllControlPointsSelected instead.

Definition at line 365 of file vtkSlicerMarkupsLogic.h.

◆ SetAllMarkupsVisibility()

void vtkSlicerMarkupsLogic::SetAllMarkupsVisibility ( vtkMRMLMarkupsNode node,
bool  flag 
)
inline
Deprecated:
Use SetAllControlPointsVisibility instead.

Definition at line 341 of file vtkSlicerMarkupsLogic.h.

◆ SetAndObserveSelectionNode()

void vtkSlicerMarkupsLogic::SetAndObserveSelectionNode ( vtkMRMLSelectionNode selectionNode)
protected

◆ SetAutoCreateDisplayNodes()

virtual void vtkSlicerMarkupsLogic::SetAutoCreateDisplayNodes ( bool  )
virtual

◆ SetDisplayDefaultsFromNode()

void vtkSlicerMarkupsLogic::SetDisplayDefaultsFromNode ( vtkMRMLMarkupsDisplayNode displayNode)

utility method to set defaults from display node

◆ SetDisplayNodeToDefaults()

void vtkSlicerMarkupsLogic::SetDisplayNodeToDefaults ( vtkMRMLMarkupsDisplayNode displayNode)

Utility method to set up a display node from the defaults. Point labels visibility and properties label visibility setting is not saved to defaults, as typically it is better to initialize these based on the node type (point labels are more useful for fiducials, while properties label is more useful for other markups).

◆ SetMRMLSceneInternal()

void vtkSlicerMarkupsLogic::SetMRMLSceneInternal ( vtkMRMLScene newScene)
overrideprotectedvirtual

Initialize listening to MRML events.

Reimplemented from vtkMRMLAbstractLogic.

◆ StartPlaceMode()

bool vtkSlicerMarkupsLogic::StartPlaceMode ( bool  persistent,
vtkMRMLInteractionNode interactionNode = nullptr 
)

Put the interaction node into place mode, and set the persistence of place mode according to the persistent flag. Return true on successfully going into place mode, false otherwise. By default, the default interaction node is updated.

See also
SetActiveIDList

◆ ToggleAllControlPointsLocked()

void vtkSlicerMarkupsLogic::ToggleAllControlPointsLocked ( vtkMRMLMarkupsNode node)

◆ ToggleAllControlPointsSelected()

void vtkSlicerMarkupsLogic::ToggleAllControlPointsSelected ( vtkMRMLMarkupsNode node)

◆ ToggleAllControlPointsVisibility()

void vtkSlicerMarkupsLogic::ToggleAllControlPointsVisibility ( vtkMRMLMarkupsNode node)

◆ ToggleAllMarkupsLocked()

void vtkSlicerMarkupsLogic::ToggleAllMarkupsLocked ( vtkMRMLMarkupsNode node)
inline
Deprecated:
Use ToggleAllControlPointsLocked instead.

Definition at line 359 of file vtkSlicerMarkupsLogic.h.

◆ ToggleAllMarkupsSelected()

void vtkSlicerMarkupsLogic::ToggleAllMarkupsSelected ( vtkMRMLMarkupsNode node)
inline
Deprecated:
Use ToggleAllControlPointsSelected instead.

Definition at line 371 of file vtkSlicerMarkupsLogic.h.

◆ ToggleAllMarkupsVisibility()

void vtkSlicerMarkupsLogic::ToggleAllMarkupsVisibility ( vtkMRMLMarkupsNode node)
inline
Deprecated:
Use ToggleAllControlPointsVisibility instead.

Definition at line 347 of file vtkSlicerMarkupsLogic.h.

◆ UnregisterMarkupsNode()

void vtkSlicerMarkupsLogic::UnregisterMarkupsNode ( vtkMRMLMarkupsNode markupsNode)

Unregisters a markup and its corresponding widget. This will trigger the vtkSlicerMarkupsLogic::MarkupUnregistered event.

Parameters
markupsNodeMRMLMarkups node to be unregistered.

◆ UpdateFromMRMLScene()

void vtkSlicerMarkupsLogic::UpdateFromMRMLScene ( )
overrideprotectedvirtual

Called every time the scene has been significantly changed. If the scene BatchProcessState events are observed (in SetMRMLSceneInternal() ), UpdateFromMRMLScene is called after each batch process (Close, Import, Restore...). It is also being called by default when a new scene is set (SetMRMLScene).

See also
SetMRMLSceneInternal, UnobserveMRMLScene, ObserveMRMLScene

Reimplemented from vtkMRMLAbstractLogic.

◆ UpdatePlaceNodeClassNamesInSelectionNode()

void vtkSlicerMarkupsLogic::UpdatePlaceNodeClassNamesInSelectionNode ( )
protected

Update list of place node class names in selection node based on currently registered markups.


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