24#ifndef __vtkSlicerMarkupsLogic_h
25#define __vtkSlicerMarkupsLogic_h
57#include "vtkSlicerMarkupsModuleLogicExport.h"
72 void PrintSelf(ostream& os, vtkIndent indent)
override;
76 void *callData )
override;
152 char*
LoadAnnotation(
const char *filename,
const char *name,
int annotationFileType);
229 vtkSetMacro(AutoCreateDisplayNodes,
bool);
230 vtkGetMacro(AutoCreateDisplayNodes,
bool);
231 vtkBooleanMacro(AutoCreateDisplayNodes,
bool);
260 static bool FitSurfaceProjectWarp(vtkPoints* curvePoints, vtkPolyData* surface,
double radiusScalingFactor = 1.0, vtkIdType numberOfInternalGridPoints=225);
271 static bool FitSurfaceDiskWarp(vtkPoints* curvePoints, vtkPolyData* surface,
double radiusScalingFactor = 1.0);
292 bool createPushButton=
true,
330 int startRow = 0,
int numberOfRows = -1);
355 vtkWarningMacro(
"vtkSlicerMarkupsLogic::CopyNthMarkupToNewList method is deprecated, please use CopyNthControlPointToNewList instead");
362 vtkWarningMacro(
"vtkSlicerMarkupsLogic::MoveNthMarkupToNewList method is deprecated, please use MoveNthControlPointToNewListAtIndex instead");
368 vtkWarningMacro(
"vtkSlicerMarkupsLogic::AddFiducial method is deprecated, please use AddControlPoint instead");
374 vtkWarningMacro(
"vtkSlicerMarkupsLogic::SetAllMarkupsVisibility method is deprecated, please use SetAllControlPointsVisibility instead");
380 vtkWarningMacro(
"vtkSlicerMarkupsLogic::ToggleAllMarkupsVisibility method is deprecated, please use ToggleAllControlPointsVisibility instead");
386 vtkWarningMacro(
"vtkSlicerMarkupsLogic::SetAllMarkupsLocked method is deprecated, please use SetAllControlPointsLocked instead");
392 vtkWarningMacro(
"vtkSlicerMarkupsLogic::ToggleAllMarkupsLocked method is deprecated, please use ToggleAllControlPointsLocked instead");
398 vtkWarningMacro(
"vtkSlicerMarkupsLogic::SetAllMarkupsSelected method is deprecated, please use SetAllControlPointsSelected instead");
404 vtkWarningMacro(
"vtkSlicerMarkupsLogic::ToggleAllMarkupsSelected method is deprecated, please use ToggleAllControlPointsSelected instead");
410 vtkWarningMacro(
"vtkSlicerMarkupsLogic::RenameAllMarkupsFromCurrentFormat method is deprecated, please use RenameAllControlPointsFromCurrentFormat instead");
447 bool AutoCreateDisplayNodes;
450 vtkInternal* Internal;
MRML node to represent a closed curve markup Closed Curve Markups nodes contain N control points....
Abstract Superclass for all specific types of MRML nodes.
A set of MRML Nodes that supports serialization and undo/redo.
MRML node for storing information about the active nodes in the scene.
MRML node for storing a slice through RAS space.
MRML node to represent a table object.
void ToggleAllMarkupsLocked(vtkMRMLMarkupsNode *node)
void OnMRMLSceneEndImport() override
std::string AddNewDisplayNodeForMarkupsNode(vtkMRMLNode *mrmlNode)
void FocusCameraOnNthPointInMarkup(const char *cameraNodeID, const char *markupNodeID, int n)
void UpdateFromMRMLScene() override
bool CopyNthMarkupToNewList(int n, vtkMRMLMarkupsNode *markupsNode, vtkMRMLMarkupsNode *newMarkupsNode)
static vtkSlicerMarkupsLogic * New()
static bool FitSurfaceDiskWarp(vtkPoints *curvePoints, vtkPolyData *surface, double radiusScalingFactor=1.0)
std::string GetActiveListID()
vtkVector3d GenerateUniqueColor()
void RenameAllControlPointsFromCurrentFormat(vtkMRMLMarkupsNode *markupsNode)
static bool FitSurfaceProjectWarp(vtkPoints *curvePoints, vtkPolyData *surface, double radiusScalingFactor=1.0, vtkIdType numberOfInternalGridPoints=225)
static double GetClosedCurveSurfaceArea(vtkMRMLMarkupsClosedCurveNode *curveNode, vtkPolyData *surface=nullptr, bool projectWarp=true)
void UpdatePlaceNodeClassNamesInSelectionNode()
Update list of place node class names in selection node based on currently registered markups.
void SetAllMarkupsSelected(vtkMRMLMarkupsNode *node, bool flag)
void OnMRMLSceneNodeAdded(vtkMRMLNode *node) override
void FocusCamerasOnNthPointInMarkup(const char *id, int n)
void SetAllControlPointsSelected(vtkMRMLMarkupsNode *node, bool flag)
std::string GetJsonStorageNodeClassNameForMarkupsType(std::string markupsType)
void SetAllControlPointsLocked(vtkMRMLMarkupsNode *node, bool flag)
void JumpSlicesToNthPointInMarkup(const char *id, int n, bool centered=false, int viewGroup=-1, vtkMRMLSliceNode *exclude=nullptr)
void SetActiveList(vtkMRMLMarkupsNode *markupsNode)
void ConvertAnnotationLinesROIsToMarkups(vtkStringArray *addedNodeIds=nullptr, vtkStringArray *removedNodeIds=nullptr)
vtkMRMLMarkupsDisplayNode * GetDefaultMarkupsDisplayNode()
static bool ExportControlPointsToTable(vtkMRMLMarkupsNode *markupsNode, vtkMRMLTableNode *tableNode, int coordinateSystem=vtkMRMLStorageNode::CoordinateSystemRAS)
static bool IsPolygonClockwise(vtkPoints *points, vtkIdList *pointIds=nullptr)
std::string AddNewFiducialNode(const char *name="F", vtkMRMLScene *scene=nullptr)
static bool ImportControlPointsFromCSV(vtkMRMLMarkupsNode *markupsNode, const std::string filename)
void ObserveMRMLScene() override
void ToggleAllMarkupsVisibility(vtkMRMLMarkupsNode *node)
std::string GetSelectionNodeID()
void SetAllControlPointsVisibility(vtkMRMLMarkupsNode *node, bool flag)
vtkSlicerMarkupsInteractionWidget * GetInteractionWidgetByMarkupsType(const char *markupsType) const
Returns the interaction widget for the specified markups type.
void JumpSlicesToLocation(double x, double y, double z, bool centered, int viewGroup=-1, vtkMRMLSliceNode *exclude=nullptr)
void ToggleAllControlPointsVisibility(vtkMRMLMarkupsNode *node)
int AddFiducial(double r=0.0, double a=0.0, double s=0.0)
char * LoadAnnotation(const char *filename, const char *name, int annotationFileType)
vtkMRMLMarkupsJsonStorageNode * AddNewJsonStorageNodeForMarkupsType(std::string markupsType)
bool IsMarkupsNodeRegistered(const char *nodeType) const
void SetAndObserveSelectionNode(vtkMRMLSelectionNode *selectionNode)
char * LoadMarkups(const char *fileName, const char *fidsName=nullptr, vtkMRMLMessageCollection *userMessages=nullptr)
vtkMRMLMarkupsNode * GetNodeByMarkupsType(const char *markupsType) const
void SetAllMarkupsVisibility(vtkMRMLMarkupsNode *node, bool flag)
void SetMRMLSceneInternal(vtkMRMLScene *newScene) override
Initialize listening to MRML events.
static bool ExportControlPointsToCSV(vtkMRMLMarkupsNode *markupsNode, const std::string filename, bool lps=true)
void RegisterMarkupsNode(vtkMRMLMarkupsNode *markupsNode, vtkSlicerMarkupsWidget *markupsWidget, bool createPushButton=true, vtkSlicerMarkupsInteractionWidget *interactionWidget=nullptr)
bool MoveNthControlPointToNewListAtIndex(int n, vtkMRMLMarkupsNode *markupsNode, vtkMRMLMarkupsNode *newMarkupsNode, int newIndex)
void SetAllMarkupsLocked(vtkMRMLMarkupsNode *node, bool flag)
vtkMRMLMarkupsNode * AddNewMarkupsNode(std::string className, std::string nodeName=std::string(), vtkMRMLScene *scene=nullptr)
vtkSlicerMarkupsWidget * GetWidgetByMarkupsType(const char *markupsType) const
bool StartPlaceMode(bool persistent, vtkMRMLInteractionNode *interactionNode=nullptr)
void GenerateUniqueColor(double color[3])
void UnregisterMarkupsNode(vtkMRMLMarkupsNode *markupsNode)
void RegisterJsonStorageNodeForMarkupsType(std::string markupsType, std::string storageNodeClassName)
static bool GetBestFitPlane(vtkMRMLMarkupsNode *curveNode, vtkPlane *plane)
Get best fit plane for a markup.
void OnMRMLSceneNodeRemoved(vtkMRMLNode *node) override
void SetDisplayDefaultsFromNode(vtkMRMLMarkupsDisplayNode *displayNode)
utility method to set defaults from display node
void CopyBasicDisplayProperties(vtkMRMLMarkupsDisplayNode *sourceDisplayNode, vtkMRMLMarkupsDisplayNode *targetDisplayNode)
int AddControlPoint(double r=0.0, double a=0.0, double s=0.0)
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 LoadMarkup...
void RenameAllMarkupsFromCurrentFormat(vtkMRMLMarkupsNode *markupsNode)
void ToggleAllMarkupsSelected(vtkMRMLMarkupsNode *node)
char * LoadMarkupsFromFcsv(const char *fileName, const char *nodeName=nullptr, vtkMRMLMessageCollection *userMessages=nullptr)
void PrintSelf(ostream &os, vtkIndent indent) override
void ConvertAnnotationHierarchyToSubjectHierarchy(vtkMRMLScene *scene)
bool GetCreateMarkupsPushButton(const char *markupName) const
This returns the flags that indicates whether the GUI push button should be created.
void SetActiveListID(vtkMRMLMarkupsNode *markupsNode)
void ToggleAllControlPointsLocked(vtkMRMLMarkupsNode *node)
bool MoveNthMarkupToNewList(int n, vtkMRMLMarkupsNode *markupsNode, vtkMRMLMarkupsNode *newMarkupsNode, int newIndex)
const std::list< std::string > & GetRegisteredMarkupsTypes() const
This returns the list of the markups registered in the logic.
void ToggleAllControlPointsSelected(vtkMRMLMarkupsNode *node)
void SetDisplayNodeToDefaults(vtkMRMLMarkupsDisplayNode *displayNode)
char * LoadMarkupsFromJson(const char *fileName, const char *nodeName=nullptr, vtkMRMLMessageCollection *userMessages=nullptr)
void ProcessMRMLNodesEvents(vtkObject *caller, unsigned long event, void *callData) override
static bool ImportControlPointsFromTable(vtkMRMLMarkupsNode *markupsNode, vtkMRMLTableNode *tableNode, int startRow=0, int numberOfRows=-1)
~vtkSlicerMarkupsLogic() override
void ConvertAnnotationFiducialsToMarkups(vtkStringArray *addedNodeIds=nullptr, vtkStringArray *removedNodeIds=nullptr)
bool CopyNthControlPointToNewList(int n, vtkMRMLMarkupsNode *markupsNode, vtkMRMLMarkupsNode *newMarkupsNode)
void RegisterNodes() override
Register MRML Node classes to Scene. Gets called automatically when the MRMLScene is attached to this...