24 #ifndef __vtkSlicerMarkupsLogic_h 25 #define __vtkSlicerMarkupsLogic_h 34 #include "vtkVector.h" 40 #include "vtkSlicerMarkupsModuleLogicExport.h" 63 MarkupRegistered = vtkCommand::UserEvent + 1,
69 void PrintSelf(ostream& os, vtkIndent indent)
override;
73 void *callData )
override;
79 std::string GetSelectionNodeID();
84 std::string GetActiveListID();
101 std::string AddNewDisplayNodeForMarkupsNode(
vtkMRMLNode *mrmlNode);
108 std::string AddNewFiducialNode(
const char *name =
"F",
vtkMRMLScene *scene =
nullptr);
118 int AddControlPoint(
double r=0.0,
double a=0.0,
double s=0.0);
123 void JumpSlicesToLocation(
double x,
double y,
double z,
bool centered,
int viewGroup = -1,
vtkMRMLSliceNode* exclude =
nullptr);
126 void JumpSlicesToNthPointInMarkup(
const char *
id,
int n,
bool centered =
false,
int viewGroup = -1,
vtkMRMLSliceNode* exclude =
nullptr);
129 void FocusCamerasOnNthPointInMarkup(
const char *
id,
int n);
133 void FocusCameraOnNthPointInMarkup(
const char *cameraNodeID,
const char *markupNodeID,
int n);
138 char* LoadMarkups(
const char* fileName,
const char* fidsName=
nullptr,
vtkMRMLMessageCollection* userMessages=
nullptr);
141 char* LoadMarkupsFiducials(
const char* fileName,
const char* fidsName=
nullptr,
vtkMRMLMessageCollection* userMessages=
nullptr);
143 char* LoadMarkupsFromFcsv(
const char* fileName,
const char* nodeName=
nullptr,
vtkMRMLMessageCollection* userMessages=
nullptr);
144 char* LoadMarkupsFromJson(
const char* fileName,
const char* nodeName=
nullptr,
vtkMRMLMessageCollection* userMessages=
nullptr);
187 void ConvertAnnotationFiducialsToMarkups();
202 vtkSetMacro(AutoCreateDisplayNodes,
bool);
203 vtkGetMacro(AutoCreateDisplayNodes,
bool);
204 vtkBooleanMacro(AutoCreateDisplayNodes,
bool);
233 static bool FitSurfaceProjectWarp(vtkPoints* curvePoints, vtkPolyData* surface,
double radiusScalingFactor = 1.0, vtkIdType numberOfInternalGridPoints=225);
244 static bool FitSurfaceDiskWarp(vtkPoints* curvePoints, vtkPolyData* surface,
double radiusScalingFactor = 1.0);
248 static bool IsPolygonClockwise(vtkPoints* points, vtkIdList* pointIds=
nullptr);
253 std::string GetJsonStorageNodeClassNameForMarkupsType(std::string markupsType);
254 void RegisterJsonStorageNodeForMarkupsType(std::string markupsType, std::string storageNodeClassName);
265 bool createPushButton=
true);
274 bool IsMarkupsNodeRegistered(
const char* nodeType)
const;
291 const std::list<std::string>& GetRegisteredMarkupsTypes()
const;
294 bool GetCreateMarkupsPushButton(
const char* markupName)
const;
299 int startRow = 0,
int numberOfRows = -1);
308 static bool ExportControlPointsToCSV(
vtkMRMLMarkupsNode* markupsNode,
const std::string filename,
bool lps =
true);
313 static bool ImportControlPointsFromCSV(
vtkMRMLMarkupsNode* markupsNode,
const std::string filename);
324 vtkWarningMacro(
"vtkSlicerMarkupsLogic::CopyNthMarkupToNewList method is deprecated, please use CopyNthControlPointToNewList instead");
325 return this->CopyNthControlPointToNewList(
n, markupsNode, newMarkupsNode);
331 vtkWarningMacro(
"vtkSlicerMarkupsLogic::MoveNthMarkupToNewList method is deprecated, please use MoveNthControlPointToNewListAtIndex instead");
332 return this->MoveNthControlPointToNewListAtIndex(
n, markupsNode, newMarkupsNode, newIndex);
337 vtkWarningMacro(
"vtkSlicerMarkupsLogic::AddFiducial method is deprecated, please use AddControlPoint instead");
338 return this->AddControlPoint(r, a, s);
343 vtkWarningMacro(
"vtkSlicerMarkupsLogic::SetAllMarkupsVisibility method is deprecated, please use SetAllControlPointsVisibility instead");
344 this->SetAllControlPointsVisibility(node, flag);
349 vtkWarningMacro(
"vtkSlicerMarkupsLogic::ToggleAllMarkupsVisibility method is deprecated, please use ToggleAllControlPointsVisibility instead");
350 this->ToggleAllControlPointsVisibility(node);
355 vtkWarningMacro(
"vtkSlicerMarkupsLogic::SetAllMarkupsLocked method is deprecated, please use SetAllControlPointsLocked instead");
356 this->SetAllControlPointsLocked(node, flag);
361 vtkWarningMacro(
"vtkSlicerMarkupsLogic::ToggleAllMarkupsLocked method is deprecated, please use ToggleAllControlPointsLocked instead");
362 this->ToggleAllControlPointsLocked(node);
367 vtkWarningMacro(
"vtkSlicerMarkupsLogic::SetAllMarkupsSelected method is deprecated, please use SetAllControlPointsSelected instead");
368 this->SetAllControlPointsSelected(node, flag);
373 vtkWarningMacro(
"vtkSlicerMarkupsLogic::ToggleAllMarkupsSelected method is deprecated, please use ToggleAllControlPointsSelected instead");
374 this->ToggleAllControlPointsSelected(node);
379 vtkWarningMacro(
"vtkSlicerMarkupsLogic::RenameAllMarkupsFromCurrentFormat method is deprecated, please use RenameAllControlPointsFromCurrentFormat instead");
380 this->RenameAllControlPointsFromCurrentFormat(markupsNode);
384 vtkVector3d GenerateUniqueColor();
388 void GenerateUniqueColor(
double color[3]);
402 void UpdatePlaceNodeClassNamesInSelectionNode();
415 bool AutoCreateDisplayNodes;
418 vtkInternal* Internal;
void PrintSelf(ostream &os, vtkIndent indent) override
static vtkSlicerModuleLogic * New()
The Usual vtk class functions.
void ToggleAllMarkupsLocked(vtkMRMLMarkupsNode *node)
void SetAllMarkupsVisibility(vtkMRMLMarkupsNode *node, bool flag)
MRML node for storing a slice through RAS space.
void SetAllMarkupsSelected(vtkMRMLMarkupsNode *node, bool flag)
virtual void ProcessMRMLNodesEvents(vtkObject *caller, unsigned long event, void *callData)
A set of MRML Nodes that supports serialization and undo/redo.
virtual void OnMRMLSceneNodeAdded(vtkMRMLNode *)
virtual void RegisterNodes()
virtual void OnMRMLSceneNodeRemoved(vtkMRMLNode *)
virtual void ObserveMRMLScene()
int AddFiducial(double r=0.0, double a=0.0, double s=0.0)
virtual void SetMRMLSceneInternal(vtkMRMLScene *newScene)
void ToggleAllMarkupsSelected(vtkMRMLMarkupsNode *node)
void SetAllMarkupsLocked(vtkMRMLMarkupsNode *node, bool flag)
bool MoveNthMarkupToNewList(int n, vtkMRMLMarkupsNode *markupsNode, vtkMRMLMarkupsNode *newMarkupsNode, int newIndex)
MRML node to represent a table object.
virtual void UpdateFromMRMLScene()
Abstract Superclass for all specific types of MRML nodes.
void ToggleAllMarkupsVisibility(vtkMRMLMarkupsNode *node)
MRML node for storing information about the active nodes in the scene.
MRML node to represent a closed curve markup Closed Curve Markups nodes contain N control points...
bool CopyNthMarkupToNewList(int n, vtkMRMLMarkupsNode *markupsNode, vtkMRMLMarkupsNode *newMarkupsNode)
void RenameAllMarkupsFromCurrentFormat(vtkMRMLMarkupsNode *markupsNode)