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

#include <Base/QTCore/qSlicerFileWriter.h>

Inheritance diagram for qSlicerFileWriter:
Collaboration diagram for qSlicerFileWriter:

Public Member Functions

virtual bool canWriteObject (vtkObject *object) const
 
virtual double canWriteObjectConfidence (vtkObject *object) const
 
virtual QStringList extensions (vtkObject *object) const =0
 
 qSlicerFileWriter (QObject *parent=nullptr)
 
virtual bool write (const qSlicerIO::IOProperties &properties)
 
virtual QStringList writtenNodes () const
 
 ~qSlicerFileWriter () override
 
- Public Member Functions inherited from qSlicerIO
virtual Q_INVOKABLE QString description () const =0
 Unique name of the reader/writer.
 
virtual Q_INVOKABLE qSlicerIO::IOFileType fileType () const =0
 Multiple readers can share the same file type.
 
virtual Q_INVOKABLE vtkMRMLFileIOHandler * ioHandler () const
 
virtual Q_INVOKABLE qSlicerIOOptions * options () const
 
 qSlicerIO (QObject *parent=nullptr)
 
void setMRMLScene (vtkMRMLScene *scene) override
 Set the scene of this object.
 
virtual Q_INVOKABLE vtkMRMLMessageCollection * userMessages () const
 Additional warning or error messages occurred during IO operation.
 
 ~qSlicerIO () override
 
- Public Member Functions inherited from qSlicerObject
vtkMRMLScene * mrmlScene () const
 Return a pointer on the MRML scene.
 
 qSlicerObject ()
 
virtual ~qSlicerObject ()
 

Protected Member Functions

virtual void setWrittenNodes (const QStringList &nodes)
 

Protected Attributes

QScopedPointer< qSlicerFileWriterPrivate > d_ptr
 
- Protected Attributes inherited from qSlicerIO
QScopedPointer< qSlicerIOPrivate > d_ptr
 
- Protected Attributes inherited from qSlicerObject
QScopedPointer< qSlicerObjectPrivate > d_ptr
 

Additional Inherited Members

- Public Types inherited from qSlicerIO
typedef QString IOFileType
 
typedef QVariantMap IOProperties
 
typedef QObject Superclass
 
- Static Public Member Functions inherited from qSlicerIO
static IOProperties fromVTKProperties (vtkMRMLIOProperties *vtkProperties)
 
static bool qImageToVTKImageData (const QImage &image, vtkImageData *imageData)
 Convert Qt image to VTK image (RGBA, unsigned char).
 
static void toVTKProperties (const IOProperties &properties, vtkMRMLIOProperties *vtkProperties)
 
static QImage vtkImageDataToQImage (vtkImageData *imageData)
 Convert VTK image (unsigned char, 1, 3, or 4 components) to Qt image.
 

Detailed Description

Base class of legacy Qt-based file writers.

Deprecated
File writers are implemented as vtkMRMLFileWriter subclasses. This class is kept for backward compatibility and to provide Qt options widgets (see options()). See https://slicer.readthedocs.io/en/latest/developer_guide/mrml_overview.html#qt-interface

Definition at line 35 of file qSlicerFileWriter.h.

Constructor & Destructor Documentation

◆ qSlicerFileWriter()

qSlicerFileWriter::qSlicerFileWriter ( QObject * parent = nullptr)

◆ ~qSlicerFileWriter()

qSlicerFileWriter::~qSlicerFileWriter ( )
override

Member Function Documentation

◆ canWriteObject()

virtual bool qSlicerFileWriter::canWriteObject ( vtkObject * object) const
virtual

Return true if the object is handled by the writer. This method is kept for backward compatibility, writers should override canWriteObjectConfidence method instead of this method to indicate if they can write the object.

Reimplemented in qSlicerVTKFileWriter.

◆ canWriteObjectConfidence()

virtual double qSlicerFileWriter::canWriteObjectConfidence ( vtkObject * object) const
virtual

Returns a positive number (>0) if the writer can write the object to file. The higher the returned value is the more confident the writer it is the most suitable class to write the object. By default, the method calls canWriteObject and if it returns true then it returns confidence value of 0.5.

Reimplemented in qSlicerVTKFileWriter.

◆ extensions()

virtual QStringList qSlicerFileWriter::extensions ( vtkObject * object) const
pure virtual

Return a list of the supported extensions for a particular object. Please read QFileDialog::nameFilters for the allowed formats Example: "Image (*.jpg *.png *.tiff)", "Model (*.vtk)"

Implemented in qSlicerVTKFileWriter.

◆ setWrittenNodes()

virtual void qSlicerFileWriter::setWrittenNodes ( const QStringList & nodes)
protectedvirtual

Reimplemented in qSlicerVTKFileWriter.

◆ write()

virtual bool qSlicerFileWriter::write ( const qSlicerIO::IOProperties & properties)
virtual

Write the node identified by nodeID into the fileName file. Returns true on success Properties available:

  • QString nodeID
  • QString fileName
  • QString fileFormat
  • bool compressed ...

Reimplemented in qSlicerNodeWriter, and qSlicerVTKFileWriter.

◆ writtenNodes()

virtual QStringList qSlicerFileWriter::writtenNodes ( ) const
virtual

Return the list of saved nodes from writing the file(s) in write(). Empty list if write() failed

See also
setWrittenNodes(), write()

Reimplemented in qSlicerVTKFileWriter.

Member Data Documentation

◆ d_ptr

QScopedPointer<qSlicerFileWriterPrivate> qSlicerFileWriter::d_ptr
protected

Definition at line 79 of file qSlicerFileWriter.h.


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