Slicer  4.13
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLMarkupsFiducialNode.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Portions (c) Copyright Brigham and Women's Hospital (BWH) All Rights Reserved.
6 
7  See COPYRIGHT.txt
8  or http://www.slicer.org/copyright/copyright.txt for details.
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16 ==============================================================================*/
17 
18 #ifndef __vtkMRMLMarkupsFiducialNode_h
19 #define __vtkMRMLMarkupsFiducialNode_h
20 
21 // MRML includes
22 #include "vtkMRMLDisplayableNode.h"
23 
24 // Markups includes
25 #include "vtkSlicerMarkupsModuleMRMLExport.h"
27 #include "vtkMRMLMarkupsNode.h"
28 
38 class VTK_SLICER_MARKUPS_MODULE_MRML_EXPORT vtkMRMLMarkupsFiducialNode : public vtkMRMLMarkupsNode
39 {
40 public:
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
46  const char* GetIcon() override {return ":/Icons/MarkupsMouseModePlace.png";}
47 
48  //--------------------------------------------------------------------------
49  // MRMLNode methods
50  //--------------------------------------------------------------------------
51 
52  vtkMRMLNode* CreateNodeInstance() override;
54  const char* GetNodeTagName() override {return "MarkupsFiducial";}
55 
57  void ReadXMLAttributes( const char** atts) override;
58 
60  void WriteXML(ostream& of, int indent) override;
61 
63  void Copy(vtkMRMLNode *node) override;
64 
73  vtkSetMacro(MaximumNumberOfControlPoints, int);
74 
78  vtkSetMacro(RequiredNumberOfControlPoints, int);
79 
81  int GetNumberOfFiducials() { return this->GetNumberOfControlPoints(); } ;
83  int AddFiducial(double x, double y, double z);
84  int AddFiducial(double x, double y, double z, std::string label);
86  int AddFiducialFromArray(double pos[3], std::string label = std::string());
88  void GetNthFiducialPosition(int n, double pos[3]);
90  void SetNthFiducialPosition(int n, double x, double y, double z);
92  void SetNthFiducialPositionFromArray(int n, double pos[3]);
94  bool GetNthFiducialSelected(int n = 0);
96  void SetNthFiducialSelected(int n, bool flag);
98  bool GetNthFiducialLocked(int n = 0);
100  void SetNthFiducialLocked(int n, bool flag);
102  bool GetNthFiducialVisibility(int n = 0);
110  void SetNthFiducialVisibility(int n, bool flag);
112  std::string GetNthFiducialLabel(int n = 0);
114  void SetNthFiducialLabel(int n, std::string label);
116  std::string GetNthFiducialAssociatedNodeID(int n = 0);
118  void SetNthFiducialAssociatedNodeID(int n, const char* id);
120  void SetNthFiducialWorldCoordinates(int n, double coords[4]);
122  void GetNthFiducialWorldCoordinates(int n, double coords[4]);
123 
125  void CreateDefaultDisplayNodes() override;
126 
127 protected:
129  ~vtkMRMLMarkupsFiducialNode() override;
132 
133 };
134 
135 #endif
int GetNumberOfControlPoints()
Return the number of control points that are stored in this node.
static vtkMRMLMarkupsNode * New()
MRML node to represent a fiducial markup Fiducial Markups nodes contain a list of control points...
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
void operator=(const vtkMRMLMarkupsNode &)
void CreateDefaultDisplayNodes() override
Create and observe default display node(s)
void Copy(vtkMRMLNode *node) override
Copy the node's attributes to this object
vtkMRMLNode * CreateNodeInstance() override
MRMLNode methods.
int GetNumberOfFiducials()
Get the number of fiducials in this node.
void ReadXMLAttributes(const char **atts) override
Read node attributes from XML file.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
void PrintSelf(ostream &os, vtkIndent indent) override