Slicer  5.3
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:
41  static vtkMRMLMarkupsFiducialNode *New();
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
46  const char* GetIcon() override {return ":/Icons/MarkupsFiducial.png";}
47  const char* GetAddIcon() override {return ":/Icons/MarkupsFiducialMouseModePlace.png";}
48  const char* GetPlaceAddIcon() override {return ":/Icons/MarkupsFiducialMouseModePlaceAdd.png";}
49 
50  //--------------------------------------------------------------------------
51  // MRMLNode methods
52  //--------------------------------------------------------------------------
53 
54  vtkMRMLNode* CreateNodeInstance() override;
55 
57  const char* GetNodeTagName() override {return "MarkupsFiducial";}
58 
60  const char* GetMarkupType() override {return "Fiducial";};
61 
62  // Get markup type GUI display name
63  const char* GetTypeDisplayName() override {return "Point List";};
64 
66  const char* GetDefaultNodeNamePrefix() override {return "F";};
67 
69  void ReadXMLAttributes( const char** atts) override;
70 
72  void WriteXML(ostream& of, int indent) override;
73 
77 
86  vtkSetMacro(MaximumNumberOfControlPoints, int);
87 
91  vtkSetMacro(RequiredNumberOfControlPoints, int);
92 
94  void CreateDefaultDisplayNodes() override;
95 
96  //-----------------------------------------------------------
97  // All public methods below are deprecated
98  //
99  // These methods are either deprecated because they use old terms (markup instead of control point),
100  // or include "array", "vector", "pointer" in the name (it is redundant, as input arguments can be
101  // deduced from the type; and return type for vectors is always vtkVectorNd).
102  //
103 
106  {
107  vtkWarningMacro("vtkMRMLMarkupsFiducialNode::GetNumberOfFiducials method is deprecated, please use GetNumberOfControlPoints instead");
108  return this->GetNumberOfControlPoints();
109  };
111  int AddFiducial(double x, double y, double z, std::string label = std::string())
112  {
113  vtkWarningMacro("vtkMRMLMarkupsFiducialNode::AddFiducial method is deprecated, please use AddControlPoint instead");
114  return this->AddControlPoint(vtkVector3d(x, y, z), label);
115  }
118  int AddFiducialFromArray(double pos[3], std::string label = std::string())
119  {
120  vtkWarningMacro("vtkMRMLMarkupsFiducialNode::AddFiducialFromArray method is deprecated, please use AddControlPoint instead");
121  return this->AddControlPoint(pos, label);
122  }
124  void GetNthFiducialPosition(int n, double pos[3])
125  {
126  vtkWarningMacro("vtkMRMLMarkupsFiducialNode::GetNthFiducialPosition method is deprecated, please use GetNthControlPointPosition instead");
127  this->GetNthControlPointPosition(n, pos);
128  }
130  void SetNthFiducialPosition(int n, double x, double y, double z)
131  {
132  vtkWarningMacro("vtkMRMLMarkupsFiducialNode::SetNthFiducialPosition method is deprecated, please use SetNthControlPointPosition instead");
133  this->SetNthControlPointPosition(n, x, y, z);
134  };
136  void SetNthFiducialPositionFromArray(int n, double pos[3])
137  {
138  vtkWarningMacro("vtkMRMLMarkupsFiducialNode::SetNthFiducialPositionFromArray method is deprecated, please use SetNthControlPointPositionFromArray instead");
140  };
142  bool GetNthFiducialSelected(int n = 0)
143  {
144  vtkWarningMacro("vtkMRMLMarkupsFiducialNode::GetNthFiducialSelected method is deprecated, please use GetNthControlPointSelected instead");
145  return this->GetNthControlPointSelected(n);
146  };
148  void SetNthFiducialSelected(int n, bool flag)
149  {
150  vtkWarningMacro("vtkMRMLMarkupsFiducialNode::SetNthFiducialSelected method is deprecated, please use SetNthControlPointSelected instead");
151  this->SetNthControlPointSelected(n, flag);
152  };
154  bool GetNthFiducialLocked(int n = 0)
155  {
156  vtkWarningMacro("vtkMRMLMarkupsFiducialNode::GetNthFiducialLocked method is deprecated, please use GetNthControlPointLocked instead");
157  return this->GetNthControlPointLocked(n);
158  };
160  void SetNthFiducialLocked(int n, bool flag)
161  {
162  vtkWarningMacro("vtkMRMLMarkupsFiducialNode::SetNthFiducialLocked method is deprecated, please use SetNthControlPointLocked instead");
163  this->SetNthControlPointLocked(n, flag);
164  };
167  {
168  vtkWarningMacro("vtkMRMLMarkupsFiducialNode::GetNthFiducialVisibility method is deprecated, please use GetNthControlPointVisibility instead");
169  return this->GetNthControlPointVisibility(n);
170  };
172  void SetNthFiducialVisibility(int n, bool flag)
173  {
174  vtkWarningMacro("vtkMRMLMarkupsFiducialNode::SetNthFiducialVisibility method is deprecated, please use SetNthControlPointVisibility instead");
175  this->SetNthControlPointVisibility(n, flag);
176  };
178  std::string GetNthFiducialLabel(int n = 0)
179  {
180  vtkWarningMacro("vtkMRMLMarkupsFiducialNode::GetNthFiducialLabel method is deprecated, please use GetNthControlPointLabel instead");
181  return this->GetNthControlPointLabel(n);
182  };
184  void SetNthFiducialLabel(int n, std::string label)
185  {
186  vtkWarningMacro("vtkMRMLMarkupsFiducialNode::SetNthFiducialLabel method is deprecated, please use SetNthControlPointLabel instead");
187  this->SetNthControlPointLabel(n, label);
188  };
190  std::string GetNthFiducialAssociatedNodeID(int n = 0)
191  {
192  vtkWarningMacro("vtkMRMLMarkupsFiducialNode::GetNthFiducialAssociatedNodeID method is deprecated, please use GetNthControlPointAssociatedNodeID instead");
194  };
196  void SetNthFiducialAssociatedNodeID(int n, const char* id)
197  {
198  vtkWarningMacro("vtkMRMLMarkupsFiducialNode::SetNthFiducialAssociatedNodeID method is deprecated, please use SetNthControlPointAssociatedNodeID instead");
199  this->SetNthControlPointAssociatedNodeID(n, (id ? std::string(id) : ""));
200  };
202  void SetNthFiducialWorldCoordinates(int n, double coords[4])
203  {
204  vtkWarningMacro("vtkMRMLMarkupsFiducialNode::SetNthFiducialWorldCoordinates method is deprecated, please use SetNthControlPointPositionWorld instead");
205  this->SetNthControlPointPositionWorld(n, coords[0], coords[1], coords[2]);
206  };
208  void GetNthFiducialWorldCoordinates(int n, double coords[4])
209  {
210  vtkWarningMacro("vtkMRMLMarkupsFiducialNode::GetNthFiducialWorldCoordinates method is deprecated, please use GetNthControlPointPositionWorld instead");
211  this->GetNthControlPointPositionWorld(n, coords);
212  };
213 
214 protected:
216  ~vtkMRMLMarkupsFiducialNode() override;
219 
220 };
221 
222 #endif
bool GetNthControlPointSelected(int n=0)
void GetNthFiducialWorldCoordinates(int n, double coords[4])
int GetNumberOfControlPoints()
Return the number of control points that are stored in this node.
void SetNthControlPointLabel(int n, std::string label)
const char * GetDefaultNodeNamePrefix() override
Get markup short name.
int AddFiducial(double x, double y, double z, std::string label=std::string())
void GetNthFiducialPosition(int n, double pos[3])
void SetNthControlPointPositionFromArray(const int pointIndex, const double pos[3], int positionStatus=PositionDefined)
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 SetNthControlPointLocked(int n, bool flag)
void operator=(const vtkMRMLMarkupsNode &)
const char * GetAddIcon() override
void SetNthFiducialPosition(int n, double x, double y, double z)
void SetNthFiducialSelected(int n, bool flag)
void CreateDefaultDisplayNodes() override
Create and observe default display node(s)
void SetNthControlPointAssociatedNodeID(int n, std::string id)
void SetNthControlPointPositionWorld(const int pointIndex, const double x, const double y, const double z, int positionStatus=PositionDefined)
void SetNthFiducialLabel(int n, std::string label)
vtkMRMLCopyContentMacro(vtkMRMLMarkupsNode)
std::string GetNthControlPointAssociatedNodeID(int n=0)
void SetNthControlPointSelected(int n, bool flag)
void SetNthFiducialPositionFromArray(int n, double pos[3])
const char * GetTypeDisplayName() override
void SetNthFiducialVisibility(int n, bool flag)
vtkMRMLNode * CreateNodeInstance() override=0
MRMLNode methods.
void SetNthFiducialWorldCoordinates(int n, double coords[4])
const char * GetPlaceAddIcon() override
void GetNthControlPointPosition(int pointIndex, double point[3])
bool GetNthControlPointVisibility(int n=0)
std::string GetNthControlPointLabel(int n=0)
std::string GetNthFiducialAssociatedNodeID(int n=0)
void SetNthControlPointVisibility(int n, bool flag)
void ReadXMLAttributes(const char **atts) override
Read node attributes from XML file.
void SetNthFiducialAssociatedNodeID(int n, const char *id)
void SetNthFiducialLocked(int n, bool flag)
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
int AddFiducialFromArray(double pos[3], std::string label=std::string())
bool GetNthControlPointLocked(int n=0)
const char * GetMarkupType() override
Get markup type internal name.
int GetNthControlPointPositionWorld(int pointIndex, double worldxyz[3])
void SetNthControlPointPosition(const int pointIndex, const double x, const double y, const double z, int positionStatus=PositionDefined)
Set of the Nth control point position from coordinates.
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
int AddControlPoint(vtkVector3d point, std::string label=std::string())
void PrintSelf(ostream &os, vtkIndent indent) override