Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
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
16class VTK_SLICER_ANNOTATIONS_MODULE_MRML_EXPORT vtkMRMLAnnotationStorageNode : public vtkMRMLStorageNode
17{
18public:
21 void PrintSelf(ostream& os, vtkIndent indent) override;
22
24
25 // Description:
26 // Get node XML tag name (like Storage, Model)
27 const char* GetNodeTagName() override { return "AnnotationStorage"; }
28
30 bool CanReadInReferenceNode(vtkMRMLNode* refNode) override;
31
32protected:
37
38 int WriteAnnotationDisplayProperties(fstream& of, vtkMRMLAnnotationDisplayNode* refNode, std::string preposition);
39 int WriteAnnotationTextDisplayProperties(fstream& of, vtkMRMLAnnotationTextDisplayNode* refNode, std::string preposition);
40
42 int WriteAnnotationData(fstream& of, vtkMRMLAnnotationNode* refNode);
43 int OpenFileToWrite(fstream& of);
44
45 // Description:
46 // Read data related to vtkMRMLAnnotationDisplayNode
47 int ReadAnnotationDisplayProperties(vtkMRMLAnnotationDisplayNode* annotationDisplayNode, std::string lineString, std::string preposition);
48 int ReadAnnotationTextDisplayProperties(vtkMRMLAnnotationTextDisplayNode* annotationDisplayNode, std::string lineString, std::string preposition);
49
50 int ReadAnnotationTextData(vtkMRMLAnnotationNode* refNode, char line[1024], int typeColumn, int textColumn, int selColumn, int visColumn, int numColumns);
52 char line[1024],
53 int& typeColumn,
54 int& annotationColumn,
55 int& selColumn,
56 int& visColumn,
57 int& columnNumber);
58 // Description:
59 // assumes that ResetAnnotations is executed
61
62 int OpenFileToRead(fstream& of, vtkMRMLNode* refNode);
63 const char* GetAnnotationStorageType() { return "text"; }
64
67
70
72 int ReadDataInternal(vtkMRMLNode* refNode) override;
73
75 int WriteDataInternal(vtkMRMLNode* refNode) override;
77 virtual int WriteAnnotationDataInternal(vtkMRMLNode* refNode, fstream& of);
78};
79
80#endif
const char * GetNodeTagName() override
Get node XML tag name (like Storage, Model)
static vtkMRMLAnnotationStorageNode * New()
int WriteAnnotationDisplayProperties(fstream &of, vtkMRMLAnnotationDisplayNode *refNode, std::string preposition)
int ReadAnnotationDisplayProperties(vtkMRMLAnnotationDisplayNode *annotationDisplayNode, std::string lineString, std::string preposition)
int ReadAnnotationTextData(vtkMRMLAnnotationNode *refNode, char line[1024], int typeColumn, int textColumn, int selColumn, int visColumn, int numColumns)
vtkMRMLNode * CreateNodeInstance() override
Create instance of the default node. Like New only virtual.
~vtkMRMLAnnotationStorageNode() override
int OpenFileToRead(fstream &of, vtkMRMLNode *refNode)
void operator=(const vtkMRMLAnnotationStorageNode &)
virtual int WriteAnnotationDataInternal(vtkMRMLNode *refNode, fstream &of)
Write data from a referenced node into a passed stream.
void PrintSelf(ostream &os, vtkIndent indent) override
vtkMRMLAnnotationStorageNode(const vtkMRMLAnnotationStorageNode &)
int ReadAnnotationTextDisplayProperties(vtkMRMLAnnotationTextDisplayNode *annotationDisplayNode, std::string lineString, std::string preposition)
int OpenFileToWrite(fstream &of)
int ReadAnnotationTextProperties(vtkMRMLAnnotationNode *annotationNode, char line[1024], int &typeColumn, int &annotationColumn, int &selColumn, int &visColumn, int &columnNumber)
bool CanReadInReferenceNode(vtkMRMLNode *refNode) override
Return true if the node can be read in.
int ReadDataInternal(vtkMRMLNode *refNode) override
Read data and set it in the referenced node.
int ReadAnnotation(vtkMRMLAnnotationNode *refNode)
int WriteAnnotationTextDisplayProperties(fstream &of, vtkMRMLAnnotationTextDisplayNode *refNode, std::string preposition)
int WriteAnnotationTextProperties(fstream &of, vtkMRMLAnnotationNode *refNode)
int WriteDataInternal(vtkMRMLNode *refNode) override
Write data from a referenced node.
int WriteAnnotationData(fstream &of, vtkMRMLAnnotationNode *refNode)
void InitializeSupportedWriteFileTypes() override
Initialize all the supported write file types.
void InitializeSupportedReadFileTypes() override
Initialize all the supported read file types.