23#ifndef __vtkMRMLTableStorageNode_h
24#define __vtkMRMLTableStorageNode_h
49 void PrintSelf(ostream& os, vtkIndent indent)
override;
60 static bool WriteTable(std::string filename, vtkTable* table, std::string delimiter,
61 std::map<vtkIdType, std::vector<std::string>> componentNamesMap);
MRML node to represent a table object.
struct StructColumnInfo ColumnInfo
std::string FindSchemaFileName(const char *fileName)
Finds schema file corresponding to a table file.
vtkMRMLTableStorageNode()
void FillDataFromStringArray(vtkStringArray *stringComponentArray, vtkDataArray *dataArray, std::string nullValueString="")
Casts the data in the string array to the correct type and stores it in the data array.
bool ReadTable(std::string filename, vtkMRMLTableNode *tableNode)
int WriteDataInternal(vtkMRMLNode *refNode) override
Write data from a referenced node. Returns 0 on failure.
vtkMRMLNode * CreateNodeInstance() override
Create instance of the default node. Like New only virtual.
int ReadDataInternal(vtkMRMLNode *refNode) override
Read data and set it in the referenced node. Returns 0 on failure.
virtual std::string GetSchemaFileName()
virtual void SetSchemaFileName(const char *schemaFileName)
Get/Set schema file name, which contain description of data type of each column.
~vtkMRMLTableStorageNode() override
vtkMRMLTableStorageNode(const vtkMRMLTableStorageNode &)
void operator=(const vtkMRMLTableStorageNode &)
void PrintSelf(ostream &os, vtkIndent indent) override
void AddColumnToTable(vtkTable *table, ColumnInfo columnInfo)
std::vector< ColumnInfo > GetColumnInfo(vtkMRMLTableNode *tableNode, vtkTable *rawTable)
void InitializeSupportedWriteFileTypes() override
Initialize all the supported write file types.
bool CanReadInReferenceNode(vtkMRMLNode *refNode) override
Return true if the node can be read in.
virtual std::string GetFieldDelimiterCharacters(std::string filename)
static bool WriteTable(std::string filename, vtkTable *table, std::string delimiter, std::map< vtkIdType, std::vector< std::string > > componentNamesMap)
Helper function to write out table to file.
const char * GetNodeTagName() override
Get node XML tag name (like Storage, Model)
std::string GenerateSchemaFileName(const char *fileName)
static vtkMRMLTableStorageNode * New()
bool WriteSchema(std::string filename, vtkMRMLTableNode *tableNode)
bool ReadSchema(std::string filename, vtkMRMLTableNode *tableNode)
void InitializeSupportedReadFileTypes() override
Initialize all the supported write file types.
std::vector< std::string > ComponentNames
std::string NullValueString
std::vector< vtkAbstractArray * > RawComponentArrays