15 #ifndef __vtkMRMLStorageNode_h 16 #define __vtkMRMLStorageNode_h 20 #include "vtkCommand.h" 39 void PrintSelf(ostream& os, vtkIndent indent)
override;
60 virtual int ReadData(
vtkMRMLNode *refNode,
bool temporaryFile =
false);
71 void WriteXML(ostream& of,
int indent)
override;
83 vtkSetStringMacro(FileName);
84 vtkGetStringMacro(FileName);
91 virtual std::string GetSupportedFileExtension(
const char* fileName =
nullptr,
bool includeReadable =
true,
bool includeWriteable =
true);
95 const char *GetNthFileName(
int n)
const;
99 vtkBooleanMacro(UseCompression,
int);
100 vtkGetMacro(UseCompression,
int);
101 vtkSetMacro(UseCompression,
int);
105 vtkSetStringMacro(URI);
106 vtkGetStringMacro(URI);
113 void ProcessMRMLEvents ( vtkObject *caller,
unsigned long event,
void *callData )
override;
138 vtkGetMacro(ReadState,
int);
139 vtkSetMacro(ReadState,
int);
147 const char *GetStateAsString(
int state);
152 vtkGetMacro(WriteState,
int);
153 vtkSetMacro(WriteState,
int);
166 std::string GetFullNameFromFileName();
167 std::string GetFullNameFromNthFileName(
int n);
180 virtual int SupportedFileType(
const char *fileName);
185 virtual vtkStringArray* GetSupportedReadFileTypes();
190 virtual vtkStringArray* GetSupportedWriteFileTypes();
197 virtual void GetFileExtensionsFromFileTypes(vtkStringArray* inputFileTypes, vtkStringArray* outputFileExtensions);
201 vtkSetStringMacro(WriteFileFormat);
202 vtkGetStringMacro(WriteFileFormat);
206 unsigned int AddFileName (
const char *fileName);
209 void ResetFileNameList();
215 return (
int)this->FileNameList.size();
221 int FileNameIsInList(
const char *fileName);
225 unsigned int AddURI(
const char *uri);
229 const char *GetNthURI(
int n);
239 return (
int)this->URIList.size();
244 void SetDataDirectory(
const char* dataDirName);
247 void SetURIPrefix(
const char *uriPrefix);
251 virtual const char* GetDefaultWriteFileExtension();
257 virtual void SetDefaultWriteFileExtension(
const char* ext);
261 void ResetNthFileName(
int n,
const char *fileName);
264 void ResetNthURI(
int n,
const char *uri);
270 int IsFilePathRelative(
const char * filepath);
276 const char *GetAbsoluteFilePath(
const char *inputPath);
280 vtkSetStringMacro(TempFileName);
281 vtkGetStringMacro(TempFileName);
286 void InvalidateFile();
290 vtkTimeStamp GetStoredTime();
298 virtual bool CanReadInReferenceNode(
vtkMRMLNode* refNode) = 0;
304 virtual bool CanWriteFromReferenceNode(
vtkMRMLNode* refNode);
314 static std::string GetLowercaseExtensionFromFileName(
const std::string& filename);
318 std::string GetFileNameWithoutExtension(
const char* fileName =
nullptr);
321 vtkSetMacro(CompressionParameter, std::string);
322 vtkGetMacro(CompressionParameter, std::string);
325 virtual std::vector<std::string> GetCompressionPresetDisplayNames();
328 virtual std::string GetCompressionParameterFromDisplayName(
const std::string& name);
331 virtual std::string GetDisplayNameFromCompressionParameter(
const std::string& preset);
334 virtual int GetNumberOfCompressionPresets();
343 : CompressionParameter(parameter)
353 virtual const std::vector<CompressionPreset> GetCompressionPresets();
363 CoordinateSystemRAS = 0,
365 CoordinateSystemLPS = 1,
367 CoordinateSystemType_Last
372 static const char *GetCoordinateSystemTypeAsString(
int id);
373 static int GetCoordinateSystemTypeFromString(
const char *name);
387 virtual int ReadDataInternal(
vtkMRMLNode* refNode);
392 virtual int WriteDataInternal(
vtkMRMLNode* refNode);
430 virtual void InitializeSupportedReadFileTypes();
434 virtual void InitializeSupportedWriteFileTypes();
439 virtual void UpdateCompressionPresets();
void SetWriteStateCancelled()
void SetWriteStateScheduled()
void SetWriteStateSkippedNoData()
void SetWriteStateTransferring()
void SetReadStateScheduled()
const vtkMRMLMessageCollection * GetUserMessages() const
vtkWeakPointer< vtkMRMLStorableNode > LastFoundStorableNode
std::vector< std::string > FileNameList
An array of file names, should contain the FileName but may not
vtkMRMLMessageCollection * GetUserMessages()
virtual void ConfigureForDataExchange()
std::string CompressionParameter
int GetNumberOfFileNames() const
See how many file names were generated during ExecuteInformation
vtkMRMLMessageCollection * UserMessages
virtual void ReadXMLAttributes(const char **atts)
void SetReadStatePending()
void operator=(const vtkMRMLNode &)
virtual vtkMRMLNode * CreateNodeInstance()=0
Create instance of the default node. Like New only virtual.
void SetReadStateSkippedNoData()
void SetWriteStateTransferDone()
virtual void ProcessMRMLEvents(vtkObject *caller, unsigned long event, void *callData)
Propagate events generated in mrml.
vtkStringArray * SupportedReadFileTypes
List of supported extensions to read in.
virtual void Copy(vtkMRMLNode *node)
Copy node contents from another node of the same type. Does not copy node ID and Scene. Performs deep copy - an independent copy is created from all data, including bulk data.
MRML node to represent a 3D surface model.
void SetReadStateTransferring()
vtkStringArray * SupportedWriteFileTypes
void SetReadStateTransferDone()
void SetWriteStatePending()
A superclass for other storage nodes.
virtual void WriteXML(ostream &of, int indent)
vtkURIHandler * URIHandler
std::string DefaultWriteFileExtension
List of supported extensions to write in.
const char * GetWriteStateAsString()
vtkTimeStamp * StoredTime
std::vector< std::string > URIList
An array of URI's, should contain the URI but may not
void PrintSelf(ostream &os, vtkIndent indent) override
CompressionPreset(const std::string ¶meter, const std::string &name)
virtual const char * GetNodeTagName()=0
void SetReadStateCancelled()
Abstract Superclass for all specific types of MRML nodes.
std::string CompressionParameter
std::vector< CompressionPreset > CompressionPresets
const char * GetReadStateAsString()
int GetNumberOfURIs()
Return how many uri names this storage node holds in it's list