Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
vtkMRMLAnnotationStorageNode.h
Go to the documentation of this file.
1 // .NAME vtkMRMLAnnotationStorageNode - MRML node for representing a volume storage
2 // .SECTION Description
3 // vtkMRMLAnnotationStorageNode nodes describe the annotation storage
4 // node that allows to read/write point data from/to file.
5 
6 #ifndef __vtkMRMLAnnotationStorageNode_h
7 #define __vtkMRMLAnnotationStorageNode_h
8 
9 #include "vtkSlicerAnnotationsModuleMRMLExport.h"
10 #include "vtkMRMLStorageNode.h"
11 
15 
17 class VTK_SLICER_ANNOTATIONS_MODULE_MRML_EXPORT vtkMRMLAnnotationStorageNode : public vtkMRMLStorageNode
18 {
19 public:
20  static vtkMRMLAnnotationStorageNode *New();
22  void PrintSelf(ostream& os, vtkIndent indent) override;
23 
24  vtkMRMLNode* CreateNodeInstance() override;
25 
26  // Description:
27  // Get node XML tag name (like Storage, Model)
28  const char* GetNodeTagName() override {return "AnnotationStorage";}
29 
31  bool CanReadInReferenceNode(vtkMRMLNode* refNode) override;
32 
33 protected:
35  ~vtkMRMLAnnotationStorageNode() override;
38 
39  int WriteAnnotationDisplayProperties(fstream & of, vtkMRMLAnnotationDisplayNode *refNode, std::string preposition);
40  int WriteAnnotationTextDisplayProperties(fstream & of, vtkMRMLAnnotationTextDisplayNode *refNode, std::string preposition);
41 
42  int WriteAnnotationTextProperties(fstream & of, vtkMRMLAnnotationNode *refNode);
43  int WriteAnnotationData(fstream& of, vtkMRMLAnnotationNode *refNode);
44  int OpenFileToWrite(fstream& of);
45 
46  // Description:
47  // Read data related to vtkMRMLAnnotationDisplayNode
48  int ReadAnnotationDisplayProperties(vtkMRMLAnnotationDisplayNode *annotationDisplayNode, std::string lineString, std::string preposition);
49  int ReadAnnotationTextDisplayProperties(vtkMRMLAnnotationTextDisplayNode *annotationDisplayNode, std::string lineString, std::string preposition);
50 
51  int ReadAnnotationTextData(vtkMRMLAnnotationNode *refNode, char line[1024], int typeColumn, int textColumn, int selColumn,
52  int visColumn, int numColumns);
53  int ReadAnnotationTextProperties(vtkMRMLAnnotationNode *annotationNode, char line[1024], int &typeColumn, int& annotationColumn, int& selColumn, int& visColumn, int& columnNumber);
54  // Description:
55  // assumes that ResetAnnotations is executed
56  int ReadAnnotation(vtkMRMLAnnotationNode *refNode);
57 
58  int OpenFileToRead(fstream& of, vtkMRMLNode *refNode);
59  const char* GetAnnotationStorageType() { return "text"; }
60 
62  void InitializeSupportedReadFileTypes() override;
63 
65  void InitializeSupportedWriteFileTypes() override;
66 
68  int ReadDataInternal(vtkMRMLNode *refNode) override;
69 
71  int WriteDataInternal(vtkMRMLNode *refNode) override;
73  virtual int WriteAnnotationDataInternal(vtkMRMLNode *refNode, fstream &of);
74 
75 };
76 
77 #endif
vtkMRMLNode * CreateNodeInstance() override=0
Create instance of the default node. Like New only virtual.
virtual int ReadDataInternal(vtkMRMLNode *refNode)
virtual void InitializeSupportedReadFileTypes()
void operator=(const vtkMRMLStorageNode &)
void PrintSelf(ostream &os, vtkIndent indent) override
A superclass for other storage nodes.
virtual void InitializeSupportedWriteFileTypes()
virtual int WriteDataInternal(vtkMRMLNode *refNode)
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
virtual bool CanReadInReferenceNode(vtkMRMLNode *refNode)=0
const char * GetNodeTagName() override
Get node XML tag name (like Storage, Model)