21#ifndef __qSlicerCoreIOManager_h
22#define __qSlicerCoreIOManager_h
38#include "qSlicerBaseQTCoreExport.h"
46class qSlicerCoreIOManagerPrivate;
149 const
qSlicerIO::IOProperties& parameters,
150 vtkCollection* loadedNodes =
nullptr,
157 vtkCollection* loadedNodes =
nullptr,
165 const
qSlicerIO::IOProperties& parameters,
172 Q_INVOKABLE
bool loadScene(const QString& fileName,
bool clear = true,
190 const
qSlicerIO::IOProperties& parameters,
205 bool hardenTransforms,
214 const QStringList& nodeIDs,
215 const QStringList& fileNames,
216 const
qSlicerIO::IOProperties& commonParameterMap,
217 bool hardenTransforms,
226 Q_INVOKABLE
bool saveScene(const QString& fileName, QImage screenShot,
281 Q_INVOKABLE
bool examineFileInfoList(QFileInfoList &fileInfoList, QFileInfo &archetypeEntry, QString &readerDescription,
qSlicerIO::IOProperties &ioProperties)const;
324 QScopedPointer<qSlicerCoreIOManagerPrivate>
d_ptr;
Q_INVOKABLE QStringList fileWriterExtensions(vtkObject *object) const
virtual Q_INVOKABLE bool loadNodes(const qSlicerIO::IOFileType &fileType, const qSlicerIO::IOProperties ¶meters, vtkCollection *loadedNodes=nullptr, vtkMRMLMessageCollection *userMessages=nullptr)
Q_INVOKABLE QString completeSlicerWritableFileNameSuffix(vtkMRMLStorableNode *node) const
Q_INVOKABLE bool loadFile(const QString &fileName, vtkMRMLMessageCollection *userMessages=nullptr)
Q_INVOKABLE QString extractKnownExtension(const QString &fileName, vtkObject *object)
Q_INVOKABLE void emitFileSaved(const QVariantMap &savedFileParameters)
Q_INVOKABLE QStringList allReadableFileExtensions() const
void newFileLoaded(const qSlicerIO::IOProperties &loadedFileParameters)
Q_INVOKABLE bool loadScene(const QString &fileName, bool clear=true, vtkMRMLMessageCollection *userMessages=nullptr)
Q_INVOKABLE qSlicerIO::IOFileType fileWriterFileType(vtkObject *object, const QString &extension=QString()) const
Return the file type of the best file writer for the input VTK object.
Q_INVOKABLE QList< qSlicerIO::IOFileType > fileTypes(const QString &file) const
Return all supported file types for reading a file.
Q_INVOKABLE qSlicerIO::IOFileType fileTypeFromDescription(const QString &fileDescription) const
Return the most likely file description (SegmentationFile, TextFile, ...) for reading a file.
const QList< qSlicerFileReader * > & readers() const
Returns the list of registered readers.
const QList< qSlicerFileWriter * > & writers() const
Returns the list of registered writers.
Q_INVOKABLE QString stripKnownExtension(const QString &fileName, vtkObject *object)
void registerIO(qSlicerIO *io)
QScopedPointer< qSlicerCoreIOManagerPrivate > d_ptr
qSlicerFileWriter * writer(vtkObject *object, const QString &extension=QString()) const
Return best file writer for this object.
qSlicerFileReader * reader(const QString &ioDescription) const
void setDefaultMaximumFileNameLength(int)
int defaultMaximumFileNameLength
Q_INVOKABLE QStringList fileDescriptions(const QString &file) const
static Q_INVOKABLE QRegExp fileNameRegExp(const QString &extension=QString())
static Q_INVOKABLE vtkMRMLStorageNode * createAndAddDefaultStorageNode(vtkMRMLStorableNode *node)
}@
vtkMRMLNode * loadNodesAndGetFirst(qSlicerIO::IOFileType fileType, const qSlicerIO::IOProperties ¶meters, vtkMRMLMessageCollection *userMessages=nullptr)
void fileSaved(const qSlicerIO::IOProperties &savedFileParameters)
Q_INVOKABLE bool exportNodes(const QList< qSlicerIO::IOProperties > ¶meterMaps, bool hardenTransforms, vtkMRMLMessageCollection *userMessages=nullptr)
qSlicerIOOptions * fileWriterOptions(vtkObject *object, const QString &extension) const
Return the file write options of the best file writer for the input VTK object.
Q_INVOKABLE void emitNewFileLoaded(const QVariantMap &loadedFileParameters)
Q_INVOKABLE qSlicerIO::IOFileType fileType(const QString &file) const
Return the most likely file type (SegmentationFile, TextFile, ...) for reading a file.
qSlicerIOOptions * fileOptions(const QString &fileDescription) const
Return the file read options for the best reader associated with a file type.
Q_INVOKABLE bool examineFileInfoList(QFileInfoList &fileInfoList, QFileInfo &archetypeEntry, QString &readerDescription, qSlicerIO::IOProperties &ioProperties) const
Q_INVOKABLE QStringList fileWriterDescriptions(const qSlicerIO::IOFileType &fileType) const
void setDefaultSceneFileType(QString)
QStringList fileDescriptionsByType(const qSlicerIO::IOFileType fileType) const
Q_INVOKABLE void addDefaultStorageNodes()
Q_INVOKABLE bool saveScene(const QString &fileName, QImage screenShot, vtkMRMLMessageCollection *userMessages=nullptr)
QString defaultSceneFileType
Q_INVOKABLE int registeredFileWriterCount(const qSlicerIO::IOFileType &fileType) const
qSlicerCoreIOManager(QObject *parent=nullptr)
Q_INVOKABLE QString forceFileNameMaxLength(const QString &filename, int extensionLength, int maxLength=-1)
static Q_INVOKABLE QString forceFileNameValidCharacters(const QString &filename)
Remove characters that are likely to cause problems in a filename.
Q_INVOKABLE int registeredFileReaderCount(const qSlicerIO::IOFileType &fileType) const
Q_INVOKABLE QStringList allWritableFileExtensions() const
Q_INVOKABLE bool saveNodes(qSlicerIO::IOFileType fileType, const qSlicerIO::IOProperties ¶meters, vtkMRMLMessageCollection *userMessages=nullptr, vtkMRMLScene *scene=nullptr)
Base class for qSlicerFileReader and qSlicerFileWriter.
Abstract Superclass for all specific types of MRML nodes.
A set of MRML Nodes that supports serialization and undo/redo.
MRML node to represent a 3D surface model.
A superclass for other storage nodes.