Slicer
4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
|
#include <Modules/Loadable/Markups/Logic/vtkSlicerMarkupsLogic.h>
Public Types | |
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 | 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) |
vtkMRMLMarkupsJsonStorageNode * | AddNewJsonStorageNodeForMarkupsType (std::string markupsType) |
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 () |
vtkMRMLMarkupsDisplayNode * | GetDefaultMarkupsDisplayNode () |
std::string | GetJsonStorageNodeClassNameForMarkupsType (std::string markupsType) |
std::string | GetSelectionNodeID () |
int | GetSliceIntersectionsVisibility () |
virtual int | IsA (const char *type) |
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) |
char * | LoadMarkupsFiducials (const char *fileName, const char *fidsName=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) |
char * | LoadMarkupsFromJson (const char *fileName, const char *nodeName) |
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 | RenameAllMarkupsFromCurrentFormat (vtkMRMLMarkupsNode *markupsNode) |
void | SetActiveListID (vtkMRMLMarkupsNode *markupsNode) |
void | SetAllMarkupsLocked (vtkMRMLMarkupsNode *node, bool flag) |
void | SetAllMarkupsSelected (vtkMRMLMarkupsNode *node, bool flag) |
void | SetAllMarkupsVisibility (vtkMRMLMarkupsNode *node, bool flag) |
Utility methods to operate on all markups in a markups node. More... | |
virtual void | SetAutoCreateDisplayNodes (bool) |
void | SetDisplayDefaultsFromNode (vtkMRMLMarkupsDisplayNode *displayNode) |
utility method to set defaults from display node More... | |
void | SetDisplayNodeToDefaults (vtkMRMLMarkupsDisplayNode *displayNode) |
utility method to set up a display node from the defaults More... | |
void | SetSliceIntersectionsVisibility (bool flag) |
bool | StartPlaceMode (bool persistent, vtkMRMLInteractionNode *interactionNode=nullptr) |
void | ToggleAllMarkupsLocked (vtkMRMLMarkupsNode *node) |
void | ToggleAllMarkupsSelected (vtkMRMLMarkupsNode *node) |
void | ToggleAllMarkupsVisibility (vtkMRMLMarkupsNode *node) |
Public Member Functions inherited from vtkSlicerModuleLogic | |
virtual vtkSlicerApplicationLogic * | GetApplicationLogic () |
Get access to overall application state. More... | |
virtual vtkMRMLAbstractLogic * | GetModuleLogic (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 vtkMRMLApplicationLogic * | GetMRMLApplicationLogic () const |
Get access to overall application state. More... | |
vtkMRMLScene * | GetMRMLScene () 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 | FitSurfaceDiskWarp (vtkPoints *curvePoints, vtkPolyData *surface, double radiusScalingFactor=1.0) |
static bool | FitSurfaceProjectWarp (vtkPoints *curvePoints, vtkPolyData *surface, double radiusScalingFactor=1.0) |
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 | IsPolygonClockwise (vtkPoints *points) |
Return tru if the polygon points are oriented clockwise. More... | |
static int | IsTypeOf (const char *type) |
static vtkSlicerMarkupsLogic * | New () |
static vtkSlicerMarkupsLogic * | SafeDownCast (vtkObject *o) |
Static Public Member Functions inherited from vtkSlicerModuleLogic | |
static int | IsTypeOf (const char *type) |
static vtkSlicerModuleLogic * | New () |
The Usual vtk class functions. More... | |
static vtkSlicerModuleLogic * | SafeDownCast (vtkObject *o) |
Static Public Member Functions inherited from vtkMRMLAbstractLogic | |
static int | IsTypeOf (const char *type) |
static vtkMRMLAbstractLogic * | New () |
static vtkMRMLAbstractLogic * | SafeDownCast (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 |
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 () |
vtkObserverManager * | GetMRMLLogicsObserverManager () const |
vtkCallbackCommand * | GetMRMLNodesCallbackCommand () |
vtkObserverManager * | GetMRMLNodesObserverManager () const |
vtkCallbackCommand * | GetMRMLSceneCallbackCommand () |
vtkObserverManager * | GetMRMLSceneObserverManager () 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 | |
Protected Attributes | |
std::map< std::string, std::string > | MarkupsTypeStorageNodes |
vtkMRMLSelectionNode * | SelectionNode {nullptr} |
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) |
Definition at line 48 of file vtkSlicerMarkupsLogic.h.
Definition at line 54 of file vtkSlicerMarkupsLogic.h.
|
protected |
|
overrideprotected |
int vtkSlicerMarkupsLogic::AddFiducial | ( | double | r = 0.0 , |
double | a = 0.0 , |
||
double | s = 0.0 |
||
) |
Add a new fiducial to the currently active list at the given RAS coordinates (default 0,0,0). Will create a list is one is not active. Returns -1 on failure, index of the added fiducial on success.
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.
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.
vtkMRMLMarkupsJsonStorageNode* vtkSlicerMarkupsLogic::AddNewJsonStorageNodeForMarkupsType | ( | std::string | markupsType | ) |
|
virtual |
|
virtual |
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.
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.
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
|
inline |
Definition at line 146 of file vtkSlicerMarkupsLogic.h.
|
static |
Create a "soap bubble" surface that fits on the provided point list. 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.
curvePoints | points to fit the surface to |
radiusScalingFactor | size 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. |
|
static |
Create a "soap bubble" surface that fits on the provided point list. 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.
curvePoints | points to fit the surface to |
radiusScalingFactor | size 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. |
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
void vtkSlicerMarkupsLogic::FocusCamerasOnNthPointInMarkup | ( | const char * | id, |
int | n | ||
) |
refocus all of the 3D cameras to the nth markup with the mrml id id
std::string vtkSlicerMarkupsLogic::GetActiveListID | ( | ) |
Utility method to return the id of the active place node. Returns an empty string on failure.
|
virtual |
|
static |
Get best fit plane for a markup.
|
virtual |
Reimplemented from vtkSlicerModuleLogic.
|
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.
curveNode | points to fit the surface to |
surface | if not nullptr then the generated surface is saved into that |
vtkMRMLMarkupsDisplayNode* vtkSlicerMarkupsLogic::GetDefaultMarkupsDisplayNode | ( | ) |
std::string vtkSlicerMarkupsLogic::GetJsonStorageNodeClassNameForMarkupsType | ( | std::string | markupsType | ) |
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.
int vtkSlicerMarkupsLogic::GetSliceIntersectionsVisibility | ( | ) |
Inspect all the slice composite nodes in the scene. Return 1 if all have SliceIntersectionVisibility set to true, 0 if all have it set to false, 2 if it's a combination of true and false, -1 on error
|
virtual |
Reimplemented from vtkSlicerModuleLogic.
|
static |
Return tru if the polygon points are oriented clockwise.
|
static |
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.
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
char* vtkSlicerMarkupsLogic::LoadMarkups | ( | const char * | fileName, |
const char * | fidsName = nullptr |
||
) |
Load a markups fiducial list from fileName, return nullptr on error, node ID string otherwise. Adds the appropriate storage and display nodes to the scene as well.
char* vtkSlicerMarkupsLogic::LoadMarkupsFiducials | ( | const char * | fileName, |
const char * | fidsName = nullptr |
||
) |
This method is deprecated. It is kept for backward compatibility only, it does the same as LoadMarkups method.
char* vtkSlicerMarkupsLogic::LoadMarkupsFromFcsv | ( | const char * | fileName, |
const char * | nodeName | ||
) |
char* vtkSlicerMarkupsLogic::LoadMarkupsFromJson | ( | const char * | fileName, |
const char * | nodeName | ||
) |
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.
|
inline |
Definition at line 163 of file vtkSlicerMarkupsLogic.h.
|
static |
|
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.
Reimplemented from vtkMRMLAbstractLogic.
|
overrideprotectedvirtual |
If vtkMRMLScene::NodeAddedEvent has been set to be observed in SetMRMLSceneInternal, it is called when the scene fires the event
Reimplemented from vtkMRMLAbstractLogic.
|
overrideprotectedvirtual |
If vtkMRMLScene::NodeRemovedEvent has been set to be observed in SetMRMLSceneInternal, it is called when the scene fires the event
Reimplemented from vtkMRMLAbstractLogic.
|
override |
|
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.
Reimplemented from vtkMRMLAbstractLogic.
void vtkSlicerMarkupsLogic::RegisterJsonStorageNodeForMarkupsType | ( | std::string | markupsType, |
std::string | storageNodeClassName | ||
) |
|
overrideprotectedvirtual |
Register MRML Node classes to Scene. Gets called automatically when the MRMLScene is attached to this logic class.
Reimplemented from vtkMRMLAbstractLogic.
void vtkSlicerMarkupsLogic::RenameAllMarkupsFromCurrentFormat | ( | vtkMRMLMarkupsNode * | markupsNode | ) |
Iterate over the markups in the list and reset the markup labels using the current MarkupLabelFormat 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.
|
static |
void vtkSlicerMarkupsLogic::SetActiveListID | ( | vtkMRMLMarkupsNode * | markupsNode | ) |
Utility method to set the active place node from the passed markups node. Does not set the interaction mode to place.
void vtkSlicerMarkupsLogic::SetAllMarkupsLocked | ( | vtkMRMLMarkupsNode * | node, |
bool | flag | ||
) |
void vtkSlicerMarkupsLogic::SetAllMarkupsSelected | ( | vtkMRMLMarkupsNode * | node, |
bool | flag | ||
) |
void vtkSlicerMarkupsLogic::SetAllMarkupsVisibility | ( | vtkMRMLMarkupsNode * | node, |
bool | flag | ||
) |
Utility methods to operate on all markups in a markups node.
|
protected |
|
virtual |
void vtkSlicerMarkupsLogic::SetDisplayDefaultsFromNode | ( | vtkMRMLMarkupsDisplayNode * | displayNode | ) |
utility method to set defaults from display node
void vtkSlicerMarkupsLogic::SetDisplayNodeToDefaults | ( | vtkMRMLMarkupsDisplayNode * | displayNode | ) |
utility method to set up a display node from the defaults
|
overrideprotectedvirtual |
Initialize listening to MRML events.
Reimplemented from vtkMRMLAbstractLogic.
void vtkSlicerMarkupsLogic::SetSliceIntersectionsVisibility | ( | bool | flag | ) |
Set the slice intersections visbility on all the slice composite nodes in the scene
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.
void vtkSlicerMarkupsLogic::ToggleAllMarkupsLocked | ( | vtkMRMLMarkupsNode * | node | ) |
void vtkSlicerMarkupsLogic::ToggleAllMarkupsSelected | ( | vtkMRMLMarkupsNode * | node | ) |
void vtkSlicerMarkupsLogic::ToggleAllMarkupsVisibility | ( | vtkMRMLMarkupsNode * | node | ) |
|
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).
Reimplemented from vtkMRMLAbstractLogic.
|
protected |
Definition at line 261 of file vtkSlicerMarkupsLogic.h.
|
protected |
Definition at line 262 of file vtkSlicerMarkupsLogic.h.