Slicer 5.4
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
17class VTK_SLICER_ANNOTATIONS_MODULE_MRML_EXPORT vtkMRMLAnnotationStorageNode : public vtkMRMLStorageNode
18{
19public:
22 void PrintSelf(ostream& os, vtkIndent indent) override;
23
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
33protected:
38
39 int WriteAnnotationDisplayProperties(fstream & of, vtkMRMLAnnotationDisplayNode *refNode, std::string preposition);
40 int WriteAnnotationTextDisplayProperties(fstream & of, vtkMRMLAnnotationTextDisplayNode *refNode, std::string preposition);
41
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
57
58 int OpenFileToRead(fstream& of, vtkMRMLNode *refNode);
59 const char* GetAnnotationStorageType() { return "text"; }
60
63
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
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.
Abstract Superclass for all specific types of MRML nodes.
A superclass for other storage nodes.