Slicer 5.13
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkMRMLNodeWriter Class Reference

#include <Libs/MRML/Logic/vtkMRMLNodeWriter.h>

Inheritance diagram for vtkMRMLNodeWriter:
Collaboration diagram for vtkMRMLNodeWriter:

Public Types

typedef vtkMRMLFileWriter Superclass
 
- Public Types inherited from vtkMRMLFileWriter
typedef vtkMRMLFileIOHandler Superclass
 
- Public Types inherited from vtkMRMLFileIOHandler
typedef vtkObject Superclass
 

Public Member Functions

bool CanWriteObject (vtkObject *object) override
 Return true if the object is a storable node of any of the node class names.
 
virtual const char * GetClassName ()
 
std::vector< std::string > GetNameFiltersForObject (vtkObject *object) override
 
virtual vtkMRMLNode * GetNodeByID (const std::string &id)
 Get node from the scene by node ID.
 
void GetOptionsDescription (vtkMRMLIOOptionsDescription *description) override
 
virtual bool GetSupportUseCompression ()
 Some storage nodes don't support the compression option.
 
virtual int IsA (const char *type)
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
virtual void SetSupportUseCompression (bool)
 
virtual void SupportUseCompressionOff ()
 
virtual void SupportUseCompressionOn ()
 
bool Write (vtkMRMLIOProperties *properties) override
 
bool WriteNode (vtkMRMLStorableNode *node, vtkMRMLIOProperties *properties)
 
- Public Member Functions inherited from vtkMRMLFileWriter
void AddNodeClassName (const std::string &className)
 
void AddWrittenNodeID (const std::string &nodeID)
 
virtual double CanWriteObjectConfidence (vtkObject *object)
 
void ClearWrittenNodeIDs ()
 
virtual double GetConfidenceForMatchingClass ()
 What a writer that only knows its node class answers for a node of that class.
 
std::string GetNodeClassName () const
 
const std::vector< std::string > & GetNodeClassNames () const
 
const std::vector< std::string > & GetWrittenNodeIDs () const
 The nodes the last Write wrote, by node ID.
 
bool IsWriter () const override
 Whether this writes rather than reads.
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
virtual void SetConfidenceForMatchingClass (double)
 
void SetNodeClassName (const std::string &className)
 
void SetNodeClassNames (const std::vector< std::string > &classNames)
 The classes of nodes this writer is for.
 
void SetWrittenNodeIDs (const std::vector< std::string > &nodeIDs)
 
- Public Member Functions inherited from vtkMRMLFileIOHandler
void FillOptionsDescription (vtkMRMLIOProperties *properties, vtkMRMLIOOptionsDescription *description)
 
virtual std::string GetDescription ()
 What to call this in a file dialog ("Volume", "Mimics project").
 
const std::vector< std::string > & GetExtensions () const
 
vtkMRMLFileIOManager * GetFileIOManager () const
 
virtual std::string GetFileType ()
 
virtual std::string GetMatchedExtension (const std::string &filePath) const
 The longest matching extension of filePath, or an empty string.
 
const std::vector< std::string > & GetNameFilters () const
 
vtkMRMLIOProperties * GetOptionDefaults ()
 
std::string GetOptionsDescriptionJSON (vtkMRMLIOProperties *properties)
 
void GetOptionValues (vtkMRMLIOProperties *properties, vtkMRMLIOProperties *values)
 
vtkMRMLScene * GetScene () const
 
vtkMRMLMessageCollection * GetUserMessages () const
 
virtual bool MatchesExtension (const std::string &filePath) const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
virtual void SetDescription (std::string)
 
void SetFileIOManager (vtkMRMLFileIOManager *manager)
 
virtual void SetFileType (std::string)
 
void SetNameFilters (const std::vector< std::string > &filters)
 The name filters, as Slicer writes them: "Mimics project (*.mcs *.mcs.gz)".
 
virtual void SetScene (vtkMRMLScene *scene)
 Where the nodes go, and where messages for the user are collected.
 

Static Public Member Functions

static vtkSmartPointer< vtkMRMLNodeWriter > CreateNodeWriter (const std::string &description, const std::string &fileType, const std::vector< std::string > &nodeClassNames, bool supportUseCompression=true)
 
static int IsTypeOf (const char *type)
 
static vtkMRMLNodeWriter * New ()
 
static vtkMRMLNodeWriter * SafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkMRMLFileWriter
static int IsTypeOf (const char *type)
 
static vtkMRMLFileWriter * New ()
 
static vtkMRMLFileWriter * SafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkMRMLFileIOHandler
static std::vector< std::string > ExtensionsFromNameFilter (const std::string &nameFilter)
 The extensions named by a filter such as "Mimics project (*.mcs *.mcs.gz)".
 
static std::vector< std::string > GetMatchingNameFilters (const std::string &filePath, const std::vector< std::string > &nameFilters, bool requireReadableFile, int *longestExtensionMatch=nullptr)
 
static int IsTypeOf (const char *type)
 
static std::string LongestMatchingExtension (const std::string &filePath, const std::vector< std::string > &extensions)
 
static std::vector< std::string > NameFilterToWildcards (const std::string &nameFilter)
 
static vtkMRMLFileIOHandler * New ()
 
static vtkMRMLFileIOHandler * SafeDownCast (vtkObject *o)
 
static bool WildcardMatch (const std::string &pattern, const std::string &text)
 Case-insensitive wildcard matching of the whole text. Supported wildcards: '*', '?', and character sets ("[abc]", "[!abc]").
 

Protected Member Functions

 vtkMRMLNodeWriter ()
 
 ~vtkMRMLNodeWriter () override
 
- Protected Member Functions inherited from vtkMRMLFileWriter
 vtkMRMLFileWriter ()
 
 ~vtkMRMLFileWriter () override
 
- Protected Member Functions inherited from vtkMRMLFileIOHandler
 vtkMRMLFileIOHandler ()
 
 ~vtkMRMLFileIOHandler () override
 

Protected Attributes

bool SupportUseCompression { true }
 
- Protected Attributes inherited from vtkMRMLFileWriter
double ConfidenceForMatchingClass { 0.5 }
 
std::vector< std::string > NodeClassNames
 
std::vector< std::string > WrittenNodeIDs
 
- Protected Attributes inherited from vtkMRMLFileIOHandler
std::string Description
 
std::vector< std::string > Extensions
 
vtkWeakPointer< vtkMRMLFileIOManager > FileIOManager
 
std::string FileType
 
std::vector< std::string > NameFilters
 
vtkNew< vtkMRMLIOProperties > OptionDefaults
 
vtkWeakPointer< vtkMRMLScene > Scene
 
vtkNew< vtkMRMLMessageCollection > UserMessages
 

Detailed Description

Writer that is ready to use for most of the nodes: it writes a storable node using its storage node.

qSlicerNodeWriter is the Qt interface of this class, kept for backward compatibility.

Definition at line 32 of file vtkMRMLNodeWriter.h.

Member Typedef Documentation

◆ Superclass

Constructor & Destructor Documentation

◆ vtkMRMLNodeWriter()

vtkMRMLNodeWriter::vtkMRMLNodeWriter ( )
protected

◆ ~vtkMRMLNodeWriter()

vtkMRMLNodeWriter::~vtkMRMLNodeWriter ( )
overrideprotected

Member Function Documentation

◆ CanWriteObject()

bool vtkMRMLNodeWriter::CanWriteObject ( vtkObject * object)
overridevirtual

Return true if the object is a storable node of any of the node class names.

Reimplemented from vtkMRMLFileWriter.

◆ CreateNodeWriter()

static vtkSmartPointer< vtkMRMLNodeWriter > vtkMRMLNodeWriter::CreateNodeWriter ( const std::string & description,
const std::string & fileType,
const std::vector< std::string > & nodeClassNames,
bool supportUseCompression = true )
static

Create a writer that writes nodes of the specified classes using their storage nodes. The writer is not registered in any file IO manager.

See also
vtkMRMLFileIOManager::RegisterNodeWriter()

◆ GetClassName()

virtual const char * vtkMRMLNodeWriter::GetClassName ( )
virtual

◆ GetNameFiltersForObject()

std::vector< std::string > vtkMRMLNodeWriter::GetNameFiltersForObject ( vtkObject * object)
overridevirtual

Return the list of the supported file formats for a particular object. Example: "NRRD (.nrrd)", "Model (.vtk)".

Reimplemented from vtkMRMLFileWriter.

Reimplemented in vtkSlicerMarkupsWriter.

◆ GetNodeByID()

virtual vtkMRMLNode * vtkMRMLNodeWriter::GetNodeByID ( const std::string & id)
virtual

Get node from the scene by node ID.

◆ GetOptionsDescription()

void vtkMRMLNodeWriter::GetOptionsDescription ( vtkMRMLIOOptionsDescription * description)
overridevirtual

Options: "useCompression", "compressionParameter" (if SupportUseCompression is enabled). Default values are taken from the storage node of the node that is written ("nodeID" property).

Reimplemented from vtkMRMLFileIOHandler.

Reimplemented in vtkSlicerSegmentationsNodeWriter.

◆ GetSupportUseCompression()

virtual bool vtkMRMLNodeWriter::GetSupportUseCompression ( )
virtual

Some storage nodes don't support the compression option.

◆ IsA()

virtual int vtkMRMLNodeWriter::IsA ( const char * type)
virtual

◆ IsTypeOf()

static int vtkMRMLNodeWriter::IsTypeOf ( const char * type)
static

◆ New()

static vtkMRMLNodeWriter * vtkMRMLNodeWriter::New ( )
static

◆ PrintSelf()

void vtkMRMLNodeWriter::PrintSelf ( ostream & os,
vtkIndent indent )
override

◆ SafeDownCast()

static vtkMRMLNodeWriter * vtkMRMLNodeWriter::SafeDownCast ( vtkObject * o)
static

◆ SetSupportUseCompression()

virtual void vtkMRMLNodeWriter::SetSupportUseCompression ( bool )
virtual

◆ SupportUseCompressionOff()

virtual void vtkMRMLNodeWriter::SupportUseCompressionOff ( )
virtual

◆ SupportUseCompressionOn()

virtual void vtkMRMLNodeWriter::SupportUseCompressionOn ( )
virtual

◆ Write()

bool vtkMRMLNodeWriter::Write ( vtkMRMLIOProperties * properties)
overridevirtual

Write the node referenced by "nodeID" into the "fileName" file. Optionally, "useCompression", "compressionParameter", and "fileFormat" can be specified. Return true on success, false otherwise. Create a storage node if the storable node doesn't have any.

Reimplemented from vtkMRMLFileWriter.

Reimplemented in vtkSlicerMarkupsWriter, and vtkSlicerSegmentationsNodeWriter.

◆ WriteNode()

bool vtkMRMLNodeWriter::WriteNode ( vtkMRMLStorableNode * node,
vtkMRMLIOProperties * properties )

Write the specified node into the "fileName" file, without checking if the writer can write the node. Optionally, "useCompression", "compressionParameter", and "fileFormat" can be specified. The node is added to the written node IDs on success. Written node IDs are not cleared. It allows subclasses and Qt-based writers (qSlicerNodeWriter) to use a custom method for finding the node and checking if it can be written. Return true on success, false otherwise.

Member Data Documentation

◆ SupportUseCompression

bool vtkMRMLNodeWriter::SupportUseCompression { true }
protected

Definition at line 84 of file vtkMRMLNodeWriter.h.


The documentation for this class was generated from the following file: