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);
70 void WriteXML(ostream& of,
int indent)
override;
82 vtkSetStringMacro(FileName);
83 vtkGetStringMacro(FileName);
90 virtual std::string GetSupportedFileExtension(
const char* fileName =
nullptr,
bool includeReadable =
true,
bool includeWriteable =
true);
94 const char *GetNthFileName(
int n)
const;
98 vtkBooleanMacro(UseCompression,
int);
99 vtkGetMacro(UseCompression,
int);
100 vtkSetMacro(UseCompression,
int);
104 vtkSetStringMacro(URI);
105 vtkGetStringMacro(URI);
112 void ProcessMRMLEvents ( vtkObject *caller,
unsigned long event,
void *callData )
override;
137 vtkGetMacro(ReadState,
int);
138 vtkSetMacro(ReadState,
int);
146 const char *GetStateAsString(
int state);
151 vtkGetMacro(WriteState,
int);
152 vtkSetMacro(WriteState,
int);
165 std::string GetFullNameFromFileName();
166 std::string GetFullNameFromNthFileName(
int n);
179 virtual int SupportedFileType(
const char *fileName);
184 virtual vtkStringArray* GetSupportedReadFileTypes();
189 virtual vtkStringArray* GetSupportedWriteFileTypes();
196 virtual void GetFileExtensionsFromFileTypes(vtkStringArray* inputFileTypes, vtkStringArray* outputFileExtensions);
200 vtkSetStringMacro(WriteFileFormat);
201 vtkGetStringMacro(WriteFileFormat);
205 unsigned int AddFileName (
const char *fileName);
208 void ResetFileNameList();
214 return (
int)this->FileNameList.size();
220 int FileNameIsInList(
const char *fileName);
224 unsigned int AddURI(
const char *uri);
228 const char *GetNthURI(
int n);
238 return (
int)this->URIList.size();
243 void SetDataDirectory(
const char* dataDirName);
246 void SetURIPrefix(
const char *uriPrefix);
250 virtual const char* GetDefaultWriteFileExtension();
256 virtual void SetDefaultWriteFileExtension(
const char* ext);
260 void ResetNthFileName(
int n,
const char *fileName);
263 void ResetNthURI(
int n,
const char *uri);
269 int IsFilePathRelative(
const char * filepath);
275 const char *GetAbsoluteFilePath(
const char *inputPath);
279 vtkSetStringMacro(TempFileName);
280 vtkGetStringMacro(TempFileName);
285 void InvalidateFile();
289 vtkTimeStamp GetStoredTime();
297 virtual bool CanReadInReferenceNode(
vtkMRMLNode* refNode) = 0;
303 virtual bool CanWriteFromReferenceNode(
vtkMRMLNode* refNode);
313 static std::string GetLowercaseExtensionFromFileName(
const std::string& filename);
317 std::string GetFileNameWithoutExtension(
const char* fileName =
nullptr);
320 vtkSetMacro(CompressionParameter, std::string);
321 vtkGetMacro(CompressionParameter, std::string);
324 virtual std::vector<std::string> GetCompressionPresetDisplayNames();
327 virtual std::string GetCompressionParameterFromDisplayName(
const std::string& name);
330 virtual std::string GetDisplayNameFromCompressionParameter(
const std::string& preset);
333 virtual int GetNumberOfCompressionPresets();
342 : CompressionParameter(parameter)
352 virtual const std::vector<CompressionPreset> GetCompressionPresets();
362 CoordinateSystemRAS = 0,
364 CoordinateSystemLPS = 1,
366 CoordinateSystemType_Last
371 static const char *GetCoordinateSystemTypeAsString(
int id);
372 static int GetCoordinateSystemTypeFromString(
const char *name);
386 virtual int ReadDataInternal(
vtkMRMLNode* refNode);
391 virtual int WriteDataInternal(
vtkMRMLNode* refNode);
429 virtual void InitializeSupportedReadFileTypes();
433 virtual void InitializeSupportedWriteFileTypes();
438 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