|
Slicer 4.2
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
|
00001 // .NAME vtkMRMLAnnotationPointDisplayNode - MRML node to represent display properties for tractography. 00002 // .SECTION Description 00003 // vtkMRMLAnnotationPointDisplayNode nodes store display properties of trajectories 00004 // from tractography in diffusion MRI data, including color type (by bundle, by fiber, 00005 // or by scalar invariants), display on/off for tensor glyphs and display of 00006 // trajectory as a line or tube. 00007 // 00008 00009 #ifndef __vtkMRMLAnnotationPointDisplayNode_h 00010 #define __vtkMRMLAnnotationPointDisplayNode_h 00011 00012 #include "vtkMRML.h" 00013 #include "vtkMRMLAnnotationDisplayNode.h" 00014 #include "vtkSlicerAnnotationsModuleMRMLExport.h" 00015 00017 class VTK_SLICER_ANNOTATIONS_MODULE_MRML_EXPORT vtkMRMLAnnotationPointDisplayNode : public vtkMRMLAnnotationDisplayNode 00018 { 00019 public: 00020 static vtkMRMLAnnotationPointDisplayNode *New ( ); 00021 vtkTypeMacro ( vtkMRMLAnnotationPointDisplayNode,vtkMRMLAnnotationDisplayNode ); 00022 void PrintSelf ( ostream& os, vtkIndent indent ); 00023 00024 //-------------------------------------------------------------------------- 00025 // MRMLNode methods 00026 //-------------------------------------------------------------------------- 00027 00028 virtual vtkMRMLNode* CreateNodeInstance ( ); 00029 00030 // Description: 00031 // Read node attributes from XML (MRML) file 00032 virtual void ReadXMLAttributes ( const char** atts ); 00033 00034 // Description: 00035 // Write this node's information to a MRML file in XML format. 00036 virtual void WriteXML ( ostream& of, int indent ); 00037 00038 00039 // Description: 00040 // Copy the node's attributes to this object 00041 virtual void Copy ( vtkMRMLNode *node ); 00042 00043 // Description: 00044 // Get node XML tag name (like Volume, Annotation) 00045 virtual const char* GetNodeTagName() {return "AnnotationPointDisplay";}; 00046 00047 // Description: 00048 // Finds the storage node and read the data 00049 virtual void UpdateScene(vtkMRMLScene *scene); 00050 00051 // Description: 00052 // alternative method to propagate events generated in Display nodes 00053 virtual void ProcessMRMLEvents ( vtkObject * /*caller*/, 00054 unsigned long /*event*/, 00055 void * /*callData*/ ); 00056 00059 enum GlyphShapes 00060 { 00061 GlyphMin = 1, 00062 Vertex2D = GlyphMin, 00063 Dash2D, 00064 Cross2D, 00065 ThickCross2D, 00066 Triangle2D, 00067 Square2D, 00068 Circle2D, 00069 Diamond2D, 00070 Arrow2D, 00071 ThickArrow2D, 00072 HookedArrow2D, 00073 StarBurst2D, 00074 Sphere3D, 00075 Diamond3D, 00076 GlyphMax = Sphere3D, 00077 }; 00079 int GetMinimumGlyphType() { return vtkMRMLAnnotationPointDisplayNode::GlyphMin; }; 00080 int GetMaximumGlyphType() { return vtkMRMLAnnotationPointDisplayNode::GlyphMax; }; 00081 00083 void SetGlyphType(int type); 00084 vtkGetMacro(GlyphType, int); 00086 int GlyphTypeIs3D(int glyphType); 00087 int GlyphTypeIs3D() { return this->GlyphTypeIs3D(this->GlyphType); }; 00088 00090 const char* GetGlyphTypeAsString(); 00091 const char* GetGlyphTypeAsString(int g); 00092 void SetGlyphTypeFromString(const char *glyphString); 00093 00096 void SetGlyphScale(double scale); 00097 vtkGetMacro(GlyphScale,double); 00098 00100 void CreateBackup(); 00102 void RestoreBackup(); 00103 00106 inline void SliceProjectionUseFiducialColorOn(); 00107 00110 inline void SliceProjectionUseFiducialColorOff(); 00111 00115 inline void SliceProjectionOutlinedBehindSlicePlaneOn(); 00116 00120 inline void SliceProjectionOutlinedBehindSlicePlaneOff(); 00121 00127 enum ProjectionFlag 00128 { 00129 ProjectionUseFiducialColor = 0x02, 00130 ProjectionOutlinedBehindSlicePlane = 0x04 00131 }; 00132 00133 protected: 00134 vtkMRMLAnnotationPointDisplayNode(); 00135 ~vtkMRMLAnnotationPointDisplayNode() { }; 00136 vtkMRMLAnnotationPointDisplayNode( const vtkMRMLAnnotationPointDisplayNode& ); 00137 void operator= ( const vtkMRMLAnnotationPointDisplayNode& ); 00138 00139 double GlyphScale; 00140 int GlyphType; 00141 static const char* GlyphTypesNames[GlyphMax+2]; 00142 }; 00143 00144 //---------------------------------------------------------------------------- 00145 void vtkMRMLAnnotationPointDisplayNode 00146 ::SliceProjectionUseFiducialColorOn() 00147 { 00148 this->SetSliceProjection( this->GetSliceProjection() | 00149 vtkMRMLAnnotationPointDisplayNode::ProjectionUseFiducialColor); 00150 } 00151 00152 //---------------------------------------------------------------------------- 00153 void vtkMRMLAnnotationPointDisplayNode 00154 ::SliceProjectionUseFiducialColorOff() 00155 { 00156 this->SetSliceProjection( this->GetSliceProjection() & 00157 ~vtkMRMLAnnotationPointDisplayNode::ProjectionUseFiducialColor); 00158 } 00159 00160 //---------------------------------------------------------------------------- 00161 void vtkMRMLAnnotationPointDisplayNode 00162 ::SliceProjectionOutlinedBehindSlicePlaneOn() 00163 { 00164 this->SetSliceProjection( this->GetSliceProjection() | 00165 vtkMRMLAnnotationPointDisplayNode::ProjectionOutlinedBehindSlicePlane); 00166 } 00167 00168 //---------------------------------------------------------------------------- 00169 void vtkMRMLAnnotationPointDisplayNode 00170 ::SliceProjectionOutlinedBehindSlicePlaneOff() 00171 { 00172 this->SetSliceProjection( this->GetSliceProjection() & 00173 ~vtkMRMLAnnotationPointDisplayNode::ProjectionOutlinedBehindSlicePlane); 00174 } 00175 00176 #endif
1.7.4