Slicer 4.2
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLAnnotationFiducialNode.h
Go to the documentation of this file.
00001 // .NAME vtkMRMLAnnotationFiducialNode - MRML node to represent a fiber bundle from tractography in DTI data.
00002 // .SECTION Description
00003 // Annotation nodes contains control points, internally represented as vtkPolyData.
00004 // A Annotation node contains many control points  and forms the smallest logical unit of tractography 
00005 // that MRML will manage/read/write. Each control point has accompanying data.  
00006 // Visualization parameters for these nodes are controlled by the vtkMRMLAnnotationPointDisplayNode class.
00007 //
00008 
00009 #ifndef __vtkMRMLAnnotationFiducialNode_h
00010 #define __vtkMRMLAnnotationFiducialNode_h
00011 
00012 #include "vtkSlicerAnnotationsModuleMRMLExport.h"
00013 #include "vtkMRMLAnnotationControlPointsNode.h" 
00014 
00015 #include <vtkStdString.h>
00016 class vtkStringArray;
00017 class vtkMRMLStorageNode;
00018 
00020 class  VTK_SLICER_ANNOTATIONS_MODULE_MRML_EXPORT vtkMRMLAnnotationFiducialNode : public vtkMRMLAnnotationControlPointsNode
00021 {
00022 public:
00023   static vtkMRMLAnnotationFiducialNode *New();
00024   vtkTypeMacro(vtkMRMLAnnotationFiducialNode,vtkMRMLAnnotationControlPointsNode);
00025 
00026   //--------------------------------------------------------------------------
00027   // MRMLNode methods
00028   //--------------------------------------------------------------------------
00029 
00030   virtual vtkMRMLNode* CreateNodeInstance();
00031   // Description:
00032   // Get node XML tag name (like Volume, Model)
00033   virtual const char* GetNodeTagName() {return "AnnotationFiducials";};
00034 
00035   virtual const char* GetIcon() {return ":/Icons/AnnotationPoint.png";};
00036 
00037   int  SetFiducial(double newControl[3],int selectedFlag, int visibleFlag);
00038   
00039   // Selected and visible are currently always set to 1 and are controlled by selected and visible flag - we can change this later
00040   void SetFiducialLabel(const char* newLabel) 
00041     {
00042     this->SetText(0,newLabel,1,1);
00043     }
00044 
00045   vtkStdString GetFiducialLabel() 
00046     {
00047     return this->GetText(0);
00048     }
00049 
00050   void SetFiducialValue(const char* newValue) 
00051     {
00052     this->SetText(1,newValue,1,1);
00053     }
00054 
00055   // return atoi(this->GetText(1).c_str());
00056   int GetFiducialValue() 
00057     { 
00058     return 0;
00059     }
00060 
00061   int SetFiducialCoordinates(double newCoord[3], int selFlag = 1, int visFlag = 1) 
00062     {
00063     return this->SetControlPoint(0,newCoord,selFlag,visFlag);
00064     }
00065 
00066   int SetFiducialWorldCoordinates(double newCoord[3], int selFlag = 1, int visFlag = 1) 
00067     {
00068     return this->SetControlPointWorldCoordinates(0,newCoord,selFlag,visFlag);
00069     }
00070 
00071   int SetFiducialCoordinates(double x, double y, double z) 
00072     {
00073     double newCoord[3];
00074     newCoord[0] = x;
00075     newCoord[1] = y;
00076     newCoord[2] = z;
00077     return this->SetFiducialCoordinates(newCoord);
00078     }
00079 
00080   double* GetFiducialCoordinates() 
00081     {
00082     return this->GetControlPointCoordinates(0);
00083     }
00084 
00085   void GetFiducialWorldCoordinates(double *point) 
00086     {
00087     this->GetControlPointWorldCoordinates(0, point);
00088     }
00089 
00091   bool GetFiducialCoordinates(double coord[3]);
00092 
00093   enum
00094   {
00095     FiducialNodeAddedEvent = 0,
00096     ValueModifiedEvent,
00097   };
00098 
00099 protected:
00100   vtkMRMLAnnotationFiducialNode();
00101   virtual ~vtkMRMLAnnotationFiducialNode();
00102   vtkMRMLAnnotationFiducialNode(const vtkMRMLAnnotationFiducialNode&);
00103   void operator=(const vtkMRMLAnnotationFiducialNode&);
00104 
00105   void SetTextFromID();
00106 
00107 };
00108 
00109 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines