Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Public Types | Public Slots | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | Friends
qSlicerIOManager Class Reference

#include <Base/QTGUI/qSlicerIOManager.h>

Inheritance diagram for qSlicerIOManager:
Inheritance graph
[legend]
Collaboration diagram for qSlicerIOManager:
Collaboration graph
[legend]

Public Types

typedef qSlicerCoreIOManager Superclass
 

Public Slots

bool openAddColorTableDialog ()
 
bool openAddDataDialog ()
 
bool openAddDataDialog (QString fileName)
 
bool openAddFiberBundleDialog ()
 
bool openAddFiducialDialog ()
 
bool openAddMarkupsDialog ()
 
bool openAddModelDialog ()
 
bool openAddScalarOverlayDialog ()
 
bool openAddSceneDialog ()
 
bool openAddTransformDialog ()
 
bool openAddVolumeDialog ()
 
bool openAddVolumesDialog ()
 
bool openLoadSceneDialog ()
 
bool openSaveDataDialog ()
 
void openSceneViewsDialog ()
 
void openScreenshotDialog ()
 
- Public Slots inherited from qSlicerCoreIOManager
void setDefaultSceneFileType (QString)
 

Public Member Functions

void addHistory (const QString &path)
 
void dragEnterEvent (QDragEnterEvent *event)
 
void dropEvent (QDropEvent *event)
 
const QList< QUrl > & favorites () const
 
const QStringList & history () const
 
virtual Q_INVOKABLE bool loadNodes (const qSlicerIO::IOFileType &fileType, const qSlicerIO::IOProperties &parameters, vtkCollection *loadedNodes=0)
 
virtual bool loadNodes (const QList< qSlicerIO::IOProperties > &files, vtkCollection *loadedNodes=0)
 
Q_INVOKABLE bool openDialog (qSlicerIO::IOFileType fileType, qSlicerFileDialog::IOAction action, qSlicerIO::IOProperties ioProperties=qSlicerIO::IOProperties(), vtkCollection *loadedNodes=0)
 
 qSlicerIOManager (QObject *parent=0)
 
void registerDialog (qSlicerFileDialog *dialog)
 
void setFavorites (const QList< QUrl > &urls)
 
virtual ~qSlicerIOManager ()
 
- Public Member Functions inherited from qSlicerCoreIOManager
Q_INVOKABLE void addDefaultStorageNodes ()
 
Q_INVOKABLE QStringList allReadableFileExtensions () const
 
Q_INVOKABLE QStringList allWritableFileExtensions () const
 
Q_INVOKABLE QString completeSlicerWritableFileNameSuffix (vtkMRMLStorableNode *node) const
 
Q_INVOKABLE QString defaultSceneFileType () const
 Defines the file format that should be offered by default when the scene is saved. More...
 
Q_INVOKABLE void emitNewFileLoaded (const QVariantMap &loadedFileParameters)
 
Q_INVOKABLE QStringList fileDescriptions (const QString &file) const
 
QStringList fileDescriptionsByType (const qSlicerIO::IOFileType fileType) const
 
qSlicerIOOptionsfileOptions (const QString &fileDescription) const
 Return the file option associated with a file type. More...
 
Q_INVOKABLE qSlicerIO::IOFileType fileType (const QString &file) const
 Return the file type associated with a file. More...
 
Q_INVOKABLE qSlicerIO::IOFileType fileTypeFromDescription (const QString &fileDescription) const
 
Q_INVOKABLE QList< qSlicerIO::IOFileTypefileTypes (const QString &file) const
 
Q_INVOKABLE QStringList fileWriterDescriptions (const qSlicerIO::IOFileType &fileType) const
 
Q_INVOKABLE QStringList fileWriterExtensions (vtkObject *object) const
 
Q_INVOKABLE qSlicerIO::IOFileType fileWriterFileType (vtkObject *object) const
 Return the file type associated with an VTK object. More...
 
qSlicerIOOptionsfileWriterOptions (vtkObject *object, const QString &extension) const
 
Q_INVOKABLE bool loadFile (const QString &fileName)
 
vtkMRMLNodeloadNodesAndGetFirst (qSlicerIO::IOFileType fileType, const qSlicerIO::IOProperties &parameters)
 
Q_INVOKABLE bool loadScene (const QString &fileName, bool clear=true)
 
 qSlicerCoreIOManager (QObject *parent=0)
 
void registerIO (qSlicerIO *io)
 
Q_INVOKABLE bool saveNodes (qSlicerIO::IOFileType fileType, const QVariantMap &parameters)
 
Q_INVOKABLE bool saveScene (const QString &fileName, QImage screenShot)
 
virtual ~qSlicerCoreIOManager ()
 

Protected Slots

void updateProgressDialog ()
 

Protected Member Functions

const QList< qSlicerFileReader *> & readers () const
 Returns the list of registered readers. More...
 
QList< qSlicerFileReader *> readers (const qSlicerIO::IOFileType &fileType) const
 Returns the list of registered readers or writers associated with fileType. More...
 
- Protected Member Functions inherited from qSlicerCoreIOManager
qSlicerFileReaderreader (const QString &ioDescription) const
 
const QList< qSlicerFileReader * > & readers () const
 Returns the list of registered readers. More...
 
QList< qSlicerFileReader * > readers (const qSlicerIO::IOFileType &fileType) const
 Returns the list of registered readers or writers associated with fileType. More...
 
const QList< qSlicerFileWriter * > & writers () const
 Returns the list of registered writers. More...
 
QList< qSlicerFileWriter * > writers (const qSlicerIO::IOFileType &fileType) const
 Returns the list of registered writers for a given fileType. More...
 

Protected Attributes

QScopedPointer< qSlicerIOManagerPrivate > d_ptr
 
- Protected Attributes inherited from qSlicerCoreIOManager
QScopedPointer< qSlicerCoreIOManagerPrivate > d_ptr
 

Friends

class qSlicerFileDialog
 

Additional Inherited Members

- Properties inherited from qSlicerCoreIOManager
QString defaultSceneFileType
 
- Signals inherited from qSlicerCoreIOManager
void newFileLoaded (const qSlicerIO::IOProperties &loadedFileParameters)
 
- Static Public Member Functions inherited from qSlicerCoreIOManager
static Q_INVOKABLE vtkMRMLStorageNodecreateAndAddDefaultStorageNode (vtkMRMLStorableNode *node)
 Create and add default storage node. More...
 

Detailed Description

Definition at line 26 of file qSlicerIOManager.h.

Member Typedef Documentation

◆ Superclass

Definition at line 31 of file qSlicerIOManager.h.

Constructor & Destructor Documentation

◆ qSlicerIOManager()

qSlicerIOManager::qSlicerIOManager ( QObject *  parent = 0)

◆ ~qSlicerIOManager()

virtual qSlicerIOManager::~qSlicerIOManager ( )
virtual

Member Function Documentation

◆ addHistory()

void qSlicerIOManager::addHistory ( const QString &  path)

◆ dragEnterEvent()

void qSlicerIOManager::dragEnterEvent ( QDragEnterEvent *  event)

dragEnterEvents can be forwarded to the IOManager, if a registered dialog supports it, the event is accepted, otherwise ignored.

See also
dropEvent()

◆ dropEvent()

void qSlicerIOManager::dropEvent ( QDropEvent *  event)

Search, in the list of registered readers, the first dialog that handles the drop event. If the event is accepted by the dialog ( usually the is also used to populate the dialog), the manager opens the dialog, otherwise the next dialog is tested. The order in which dialogs are being tested is the opposite of the dialogs are registered.

See also
dragEnterEvent()

◆ favorites()

const QList<QUrl>& qSlicerIOManager::favorites ( ) const

◆ history()

const QStringList& qSlicerIOManager::history ( ) const

◆ loadNodes() [1/2]

virtual Q_INVOKABLE bool qSlicerIOManager::loadNodes ( const qSlicerIO::IOFileType fileType,
const qSlicerIO::IOProperties parameters,
vtkCollection *  loadedNodes = 0 
)
virtual

Displays a progress dialog if it takes too long to load There is no way to know in advance how long the loading will take, so the progress dialog listens to the scene and increment the progress anytime a node is added.

Reimplemented from qSlicerCoreIOManager.

◆ loadNodes() [2/2]

virtual bool qSlicerIOManager::loadNodes ( const QList< qSlicerIO::IOProperties > &  files,
vtkCollection *  loadedNodes = 0 
)
virtual

If you have a list of nodes to load, it's best to use this function in order to have a unique progress dialog instead of multiple ones. It internally calls loadNodes() for each file.

Reimplemented from qSlicerCoreIOManager.

◆ openAddColorTableDialog

bool qSlicerIOManager::openAddColorTableDialog ( )
inlineslot

Definition at line 166 of file qSlicerIOManager.h.

◆ openAddDataDialog [1/2]

bool qSlicerIOManager::openAddDataDialog ( )
inlineslot

Definition at line 128 of file qSlicerIOManager.h.

◆ openAddDataDialog [2/2]

bool qSlicerIOManager::openAddDataDialog ( QString  fileName)
inlineslot

Definition at line 120 of file qSlicerIOManager.h.

◆ openAddFiberBundleDialog

bool qSlicerIOManager::openAddFiberBundleDialog ( )
inlineslot

Definition at line 184 of file qSlicerIOManager.h.

◆ openAddFiducialDialog

bool qSlicerIOManager::openAddFiducialDialog ( )
inlineslot

Definition at line 172 of file qSlicerIOManager.h.

◆ openAddMarkupsDialog

bool qSlicerIOManager::openAddMarkupsDialog ( )
inlineslot

Definition at line 178 of file qSlicerIOManager.h.

◆ openAddModelDialog

bool qSlicerIOManager::openAddModelDialog ( )
inlineslot

Definition at line 148 of file qSlicerIOManager.h.

◆ openAddScalarOverlayDialog

bool qSlicerIOManager::openAddScalarOverlayDialog ( )
inlineslot

Definition at line 154 of file qSlicerIOManager.h.

◆ openAddSceneDialog

bool qSlicerIOManager::openAddSceneDialog ( )
slot

◆ openAddTransformDialog

bool qSlicerIOManager::openAddTransformDialog ( )
inlineslot

Definition at line 160 of file qSlicerIOManager.h.

◆ openAddVolumeDialog

bool qSlicerIOManager::openAddVolumeDialog ( )
inlineslot

Definition at line 134 of file qSlicerIOManager.h.

◆ openAddVolumesDialog

bool qSlicerIOManager::openAddVolumesDialog ( )
inlineslot

Definition at line 140 of file qSlicerIOManager.h.

◆ openDialog()

Q_INVOKABLE bool qSlicerIOManager::openDialog ( qSlicerIO::IOFileType  fileType,
qSlicerFileDialog::IOAction  action,
qSlicerIO::IOProperties  ioProperties = qSlicerIO::IOProperties(),
vtkCollection *  loadedNodes = 0 
)

Search for the most appropriate dialog based on the action and fileType, and open it. Once the user select the file(s), the action (read or write) is done. Note that to write a node, the "nodeID" property must be passed. If no dialog is registered for a given fileType (e.g. QString("SceneFile")), a default dialog (qSlicerStandardFileDialog) is used. If reading files (action == qSlicerFileDialog::Read) and if loadedNodes is not null, the loadedNodes collection is being populated with the loaded nodes. Returns true on success, false otherwise.

◆ openLoadSceneDialog

bool qSlicerIOManager::openLoadSceneDialog ( )
slot

◆ openSaveDataDialog

bool qSlicerIOManager::openSaveDataDialog ( )
inlineslot

Definition at line 190 of file qSlicerIOManager.h.

◆ openSceneViewsDialog

void qSlicerIOManager::openSceneViewsDialog ( )
slot

◆ openScreenshotDialog

void qSlicerIOManager::openScreenshotDialog ( )
slot

◆ readers() [1/2]

const QList<qSlicerFileReader*>& qSlicerCoreIOManager::readers
protected

Returns the list of registered readers.

◆ readers() [2/2]

QList<qSlicerFileReader*> qSlicerCoreIOManager::readers
protected

Returns the list of registered readers or writers associated with fileType.

◆ registerDialog()

void qSlicerIOManager::registerDialog ( qSlicerFileDialog dialog)

Takes ownership. Any previously set dialog corresponding to the same fileType (only 1 dialog per filetype) is overridden.

◆ setFavorites()

void qSlicerIOManager::setFavorites ( const QList< QUrl > &  urls)

◆ updateProgressDialog

void qSlicerIOManager::updateProgressDialog ( )
protectedslot

Friends And Related Function Documentation

◆ qSlicerFileDialog

friend class qSlicerFileDialog
friend

Definition at line 109 of file qSlicerIOManager.h.

Member Data Documentation

◆ d_ptr

QScopedPointer<qSlicerIOManagerPrivate> qSlicerIOManager::d_ptr
protected

Definition at line 112 of file qSlicerIOManager.h.


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