15#ifndef __vtkMRMLStorageNode_h
16#define __vtkMRMLStorageNode_h
20#include "vtkCommand.h"
39 void PrintSelf(ostream& os, vtkIndent indent)
override;
71 void WriteXML(ostream& of,
int indent)
override;
91 virtual std::string
GetSupportedFileExtension(
const char* fileName =
nullptr,
bool includeReadable =
true,
bool includeWriteable =
true);
245 return (
int)this->
URIList.size();
393 static std::string
ClampFileName(
const std::string& filename,
int extensionLength,
int maxFileNameLength,
int hashLength = 4);
MRML node to represent a 3D surface model.
static const char * GetCoordinateSystemTypeAsString(int id)
Convert between coordinate system ID and name.
vtkStringArray * SupportedWriteFileTypes
void Copy(vtkMRMLNode *node) override
Copy the node's attributes to this object.
const char * GetNodeTagName() override=0
Get node XML tag name (like Storage, Model)
const char * GetNthURI(int n)
Get the nth URI from the list of URI's.
void SetWriteStateCancelled()
virtual int WriteData(vtkMRMLNode *refNode)
void ResetNthFileName(int n, const char *fileName)
Set the nth file in FileNameList, checks that it is already defined.
void SetWriteStatePending()
virtual std::string GetSupportedFileExtension(const char *fileName=nullptr, bool includeReadable=true, bool includeWriteable=true)
void SetURIPrefix(const char *uriPrefix)
Set a new URI base for all URI's.
void SetWriteStateTransferring()
vtkMRMLMessageCollection * GetUserMessages()
virtual vtkStringArray * GetSupportedWriteFileTypes()
void SetReadStateCancelled()
virtual void SetWriteFileFormat(const char *writeFileFormat)
void SetReadStateTransferring()
void ReadXMLAttributes(const char **atts) override
Read node attributes from XML file.
virtual void UpdateCompressionPresets()
void ResetURIList()
Clear the array of URIs.
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
virtual int GetNumberOfCompressionPresets()
Get the number of compression presets.
std::vector< std::string > URIList
An array of URI's, should contain the URI but may not.
static std::string GetLowercaseExtensionFromFileName(const std::string &filename)
virtual void SetURIHandler(vtkURIHandler *uriHandler)
void SetReadStatePending()
~vtkMRMLStorageNode() override
std::string GetFileNameWithoutExtension(const char *fileName=nullptr)
virtual int ReadDataInternal(vtkMRMLNode *refNode)
vtkTimeStamp * StoredTime
const char * GetNthFileName(int n) const
return the nth file name, null if doesn't exist
virtual std::string GetDisplayNameFromCompressionParameter(const std::string &preset)
Returns the name of the specified preset.
unsigned int AddURI(const char *uri)
Add in another URI to the list of URI's.
std::string CompressionParameter
virtual vtkStringArray * GetSupportedReadFileTypes()
void PrintSelf(ostream &os, vtkIndent indent) override
virtual int WriteDataInternal(vtkMRMLNode *refNode)
const vtkMRMLMessageCollection * GetUserMessages() const
std::vector< CompressionPreset > CompressionPresets
virtual void ConfigureForDataExchange()
std::string GetFullNameFromFileName()
vtkMRMLMessageCollection * UserMessages
const char * GetStateAsString(int state)
vtkTimeStamp GetStoredTime()
void SetWriteStateSkippedNoData()
virtual std::vector< std::string > GetCompressionPresetDisplayNames()
Returns a list of displayable names of the supported compression presets.
vtkMRMLStorageNode(const vtkMRMLStorageNode &)
vtkStringArray * SupportedReadFileTypes
List of supported extensions to read in.
unsigned int AddFileName(const char *fileName)
Add in another file name to the list of file names.
std::vector< std::string > FileNameList
An array of file names, should contain the FileName but may not.
vtkWeakPointer< vtkMRMLStorableNode > LastFoundStorableNode
int FileNameIsInList(const char *fileName)
void ResetNthURI(int n, const char *uri)
Set the nth URI in URIList, checks that it is already defined.
void SetWriteStateTransferDone()
void SetReadStateSkippedNoData()
void SetWriteState(int writeState)
std::string GetFullNameFromNthFileName(int n)
void ProcessMRMLEvents(vtkObject *caller, unsigned long event, void *callData) override
Propagate Progress Event generated in ReadData.
virtual int SupportedFileType(const char *fileName)
int GetNumberOfFileNames() const
See how many file names were generated during ExecuteInformation.
virtual bool CanWriteFromReferenceNode(vtkMRMLNode *refNode)
void SetWriteStateScheduled()
virtual void InitializeSupportedWriteFileTypes()
const char * GetWriteStateAsString()
static std::string ClampFileName(const std::string &filename, int extensionLength, int maxFileNameLength, int hashLength=4)
void ResetFileNameList()
Clear the array of file names.
virtual vtkMRMLStorableNode * GetStorableNode()
std::string DefaultWriteFileExtension
List of supported extensions to write in.
virtual std::string GetCompressionParameterFromDisplayName(const std::string &name)
Returns a string representing the specified preset.
vtkURIHandler * URIHandler
void SetDataDirectory(const char *dataDirName)
Set a new data directory for all files.
const char * GetReadStateAsString()
vtkMRMLNode * CreateNodeInstance() override=0
Create instance of the default node. Like New only virtual.
virtual const char * GetDefaultWriteFileExtension()
static int GetCoordinateSystemTypeFromString(const char *name)
virtual const std::vector< CompressionPreset > GetCompressionPresets()
Get a list of all supported compression presets.
int GetNumberOfURIs()
Return how many URI names this storage node holds in it's list.
void SetReadStateTransferDone()
virtual void GetFileExtensionsFromFileTypes(vtkStringArray *inputFileTypes, vtkStringArray *outputFileExtensions)
int IsFilePathRelative(const char *filepath)
@ RAS
for backward compatibility
@ CoordinateSystemType_Last
@ LPS
for backward compatibility
virtual void SetReadState(int)
void StageWriteData(vtkMRMLNode *refNode)
virtual bool CanReadInReferenceNode(vtkMRMLNode *refNode)=0
void operator=(const vtkMRMLStorageNode &)
virtual void InitializeSupportedReadFileTypes()
void StageReadData(vtkMRMLNode *refNode)
virtual void SetDefaultWriteFileExtension(const char *ext)
void SetReadStateScheduled()
virtual int ReadData(vtkMRMLNode *refNode, bool temporaryFile=false)
const char * GetAbsoluteFilePath(const char *inputPath)
CompressionPreset(const std::string ¶meter, const std::string &name)
std::string CompressionParameter
CompressionPreset()=default