|
Slicer 4.2
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
|
00001 // .NAME vtkMRMLAnnotationControlPointsNode - 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 __vtkMRMLAnnotationControlPointsNode_h 00010 #define __vtkMRMLAnnotationControlPointsNode_h 00011 00012 #include "vtkMRMLAnnotationNode.h" 00013 00014 class vtkMRMLAnnotationPointDisplayNode; 00015 00017 class VTK_SLICER_ANNOTATIONS_MODULE_MRML_EXPORT vtkMRMLAnnotationControlPointsNode : public vtkMRMLAnnotationNode 00018 { 00019 public: 00020 static vtkMRMLAnnotationControlPointsNode *New(); 00021 vtkTypeMacro(vtkMRMLAnnotationControlPointsNode,vtkMRMLAnnotationNode); 00022 00023 // void PrintSelf(ostream& os, vtkIndent indent); 00024 // Description: 00025 // Just prints short summary 00026 virtual void PrintAnnotationInfo(ostream& os, vtkIndent indent, int titleFlag = 1); 00027 00028 //-------------------------------------------------------------------------- 00029 // MRMLNode methods 00030 //-------------------------------------------------------------------------- 00031 00032 virtual vtkMRMLNode* CreateNodeInstance(); 00033 // Description: 00034 // Get node XML tag name (like Volume, Model) 00035 virtual const char* GetNodeTagName() {return "AnnotationControlPoints";}; 00036 00037 // Description: 00038 // Read node attributes from XML file 00039 virtual void ReadXMLAttributes( const char** atts); 00040 00041 // Description: 00042 // Write this node's information to a MRML file in XML format. 00043 virtual void WriteXML(ostream& of, int indent); 00044 00047 virtual void WriteCLI(std::ostringstream& ss, std::string prefix); 00048 00049 // Description: 00050 // Copy the node's attributes to this object 00051 virtual void Copy(vtkMRMLNode *node) {Superclass::Copy(node);} 00052 00053 void UpdateScene(vtkMRMLScene *scene); 00054 00055 // Description: 00056 // alternative method to propagate events generated in Display nodes 00057 virtual void ProcessMRMLEvents ( vtkObject * /*caller*/, 00058 unsigned long /*event*/, 00059 void * /*callData*/ ); 00060 00061 00062 enum 00063 { 00064 ControlPointModifiedEvent = 19010, 00065 }; 00066 00067 virtual void Modified() 00068 { 00069 Superclass::Modified(); 00070 00071 if (!this->GetDisableModifiedEvent()) 00072 { 00073 this->InvokeEvent(vtkMRMLAnnotationControlPointsNode::ControlPointModifiedEvent); 00074 } 00075 } 00076 00081 virtual int InvokePendingModifiedEvent () 00082 { 00083 if ( this->GetModifiedEventPending() ) 00084 { 00085 this->InvokeEvent(vtkMRMLAnnotationControlPointsNode::ControlPointModifiedEvent); 00086 } 00087 return Superclass::InvokePendingModifiedEvent(); 00088 } 00089 00090 // Description: 00091 // get associated display node or NULL if not set 00092 vtkMRMLAnnotationPointDisplayNode* GetAnnotationPointDisplayNode(); 00093 00094 // Description: 00095 // Create default storage node or NULL if does not have one 00096 virtual vtkMRMLStorageNode* CreateDefaultStorageNode(); 00097 00098 int AddControlPoint(double newControl[3],int selectedFlag, int visibleFlag); 00099 00100 int SetControlPoint(int id, double newControl[3],int selectedFlag, int visibleFlag); 00101 00102 int SetControlPointWorldCoordinates(int id, double newControl[3], int selectedFlag, int visibleFlag); 00103 00104 int SetControlPoint(int id, double newControl[3]); 00105 00106 int SetControlPointWorldCoordinates(int id, double newControl[3]); 00107 00108 void DeleteControlPoint(int id); 00112 double* GetControlPointCoordinates(vtkIdType id); 00113 00114 void GetControlPointWorldCoordinates(vtkIdType id, double *point); 00115 00116 int GetNumberOfControlPoints(); 00117 00118 enum 00119 { 00120 CP_SELECTED = vtkMRMLAnnotationNode::NUM_TEXT_ATTRIBUTE_TYPES, 00121 CP_VISIBLE, 00122 NUM_CP_ATTRIBUTE_TYPES 00123 }; 00124 00125 const char *GetAttributeTypesEnumAsString(int val); 00126 00127 00128 // Description: 00129 // Initializes all variables associated with annotations 00130 virtual void ResetAnnotations(); 00131 00132 // Description: 00133 // add display node if not already present 00134 void CreateAnnotationPointDisplayNode(); 00135 00137 enum NumberingSchemes 00138 { 00139 SchemeMin = 0, 00140 UseID = SchemeMin, 00141 UseIndex, 00142 UsePrevious, 00143 SchemeMax = UsePrevious, 00144 }; 00145 00146 00148 virtual void SetNumberingScheme(int numberingScheme); 00149 vtkGetMacro(NumberingScheme, int); 00150 00152 const char* GetNumberingSchemeAsString(); 00153 const char* GetNumberingSchemeAsString(int g); 00154 void SetNumberingSchemeFromString(const char *schemeString); 00155 00156 virtual void Initialize(vtkMRMLScene* mrmlScene); 00157 00158 protected: 00159 vtkMRMLAnnotationControlPointsNode(); 00160 ~vtkMRMLAnnotationControlPointsNode() { }; 00161 vtkMRMLAnnotationControlPointsNode(const vtkMRMLAnnotationControlPointsNode&); 00162 void operator=(const vtkMRMLAnnotationControlPointsNode&); 00163 00164 // Description: 00165 // Create Poly data with substructures necessary for this class 00166 void CreatePolyData(); 00167 00168 // Description: 00169 // Initializes control pointes as well as attributes 00170 void ResetControlPoints(); 00171 00172 // Description: 00173 // Initializes all attributes 00174 void ResetControlPointsAttributesAll(); 00175 00177 int NumberingScheme; 00178 }; 00179 00180 #endif
1.7.4