open_iA 2023.02
A tool for the visual analysis and processing of volumetric datasets, with a focus on industrial computed tomography.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
iAFileIO Class Referenceabstract

Base class for dataset readers within open_iA Derived classes loading specific file types can be registered via iAFileTypeRegistry. More...

#include <iAFileIO.h>

Inheritance diagram for iAFileIO:
[legend]
Collaboration diagram for iAFileIO:
[legend]

Public Types

enum  Operation { Load , Save }
 

Public Member Functions

 iAFileIO (iADataSetTypes readTypes, iADataSetTypes writeTypes)
 create a file I/O for the given dataset type
 
virtual ~iAFileIO ()
 virtual destructor, to enable proper destruction in derived classes and to avoid warnings
 
bool checkParams (QVariantMap &paramValues, Operation op, QString const &fileName)
 Check whether the given values contain all required parameters; set to default if not.
 
virtual QStringList extensions () const =0
 The file extensions that this file IO should be used for.
 
QStringList filterExtensions ()
 list of extensions as required by Qt's open/save file dialogs
 
QString filterString ()
 a filter string for the type of files supported by the I/O class
 
virtual bool isDataSetSupported (std::shared_ptr< iADataSet > dataSet, QString const &fileName) const
 Whether this IO can be used for storing the given data set.
 
std::shared_ptr< iADataSetload (QString const &fileName, QVariantMap const &paramValues, iAProgress const &progress=iAProgress())
 Load the (list of) dataset(s); store parameters in the resulting datasets.
 
virtual QString name () const =0
 The name of the file type that this IO supports.
 
iAAttributes const & parameter (Operation op) const
 Required parameters for loading/saving the file.
 
void save (QString const &fileName, std::shared_ptr< iADataSet > dataSet, QVariantMap const &paramValues, iAProgress const &progress=iAProgress())
 Save the (list of) dataset(s); modify input datasets to reflect the new file name this data is now stored under.
 
iADataSetTypes supportedDataSetTypes (Operation op) const
 Types of dataset contained in this file format, which this IO can load/save.
 

Static Public Attributes

static const QString CompressionStr
 

Protected Member Functions

virtual std::shared_ptr< iADataSetloadData (QString const &fileName, QVariantMap const &paramValues, iAProgress const &progress)
 I/O for specific file formats should override this to load data from the file with given name.
 
virtual void saveData (QString const &fileName, std::shared_ptr< iADataSet > dataSet, QVariantMap const &paramValues, iAProgress const &progress)
 I/O for specific file formats should override this to save data to the file with given name.
 

Protected Attributes

std::array< iAAttributes, 2 > m_params
 

Detailed Description

Base class for dataset readers within open_iA Derived classes loading specific file types can be registered via iAFileTypeRegistry.

Member Enumeration Documentation

◆ Operation

Enumerator
Load 
Save 

Constructor & Destructor Documentation

◆ iAFileIO()

iAFileIO::iAFileIO ( iADataSetTypes  readTypes,
iADataSetTypes  writeTypes 
)

create a file I/O for the given dataset type

◆ ~iAFileIO()

iAFileIO::~iAFileIO ( )
virtualdefault

virtual destructor, to enable proper destruction in derived classes and to avoid warnings

Member Function Documentation

◆ checkParams()

bool iAFileIO::checkParams ( QVariantMap &  paramValues,
Operation  op,
QString const &  fileName 
)

Check whether the given values contain all required parameters; set to default if not.

◆ extensions()

virtual QStringList iAFileIO::extensions ( ) const
pure virtual

◆ filterExtensions()

QStringList iAFileIO::filterExtensions ( )

list of extensions as required by Qt's open/save file dialogs

◆ filterString()

QString iAFileIO::filterString ( )

a filter string for the type of files supported by the I/O class

◆ isDataSetSupported()

bool iAFileIO::isDataSetSupported ( std::shared_ptr< iADataSet dataSet,
QString const &  fileName 
) const
virtual

Whether this IO can be used for storing the given data set.

It could for example check whether the format supports the data types in the dataset The default implementation here always returns true

Reimplemented in iAImageStackFileIO.

◆ load()

std::shared_ptr< iADataSet > iAFileIO::load ( QString const &  fileName,
QVariantMap const &  paramValues,
iAProgress const &  progress = iAProgress() 
)

Load the (list of) dataset(s); store parameters in the resulting datasets.

◆ loadData()

std::shared_ptr< iADataSet > iAFileIO::loadData ( QString const &  fileName,
QVariantMap const &  paramValues,
iAProgress const &  progress 
)
protectedvirtual

I/O for specific file formats should override this to load data from the file with given name.

default implementation does nothing (instead of being pure virtual, to allow for I/O's that only save a dataset but don't load one)

Reimplemented in iAAmiraVolumeFileIO, iADCMFileIO, iAGraphFileIO, iAImageStackFileIO, iAITKFileIO, iAMetaFileIO, iANKCFileIO, iAOIFFileIO, iAParsFileIO, iAProjectFileIO, iARawFileIO, iASTLFileIO, iAVGIFileIO, iAVolStackFileIO, iAVTIFileIO, and iAVTKFileIO.

◆ name()

virtual QString iAFileIO::name ( ) const
pure virtual

◆ parameter()

iAAttributes const & iAFileIO::parameter ( Operation  op) const

Required parameters for loading/saving the file.

◆ save()

void iAFileIO::save ( QString const &  fileName,
std::shared_ptr< iADataSet dataSet,
QVariantMap const &  paramValues,
iAProgress const &  progress = iAProgress() 
)

Save the (list of) dataset(s); modify input datasets to reflect the new file name this data is now stored under.

◆ saveData()

void iAFileIO::saveData ( QString const &  fileName,
std::shared_ptr< iADataSet dataSet,
QVariantMap const &  paramValues,
iAProgress const &  progress 
)
protectedvirtual

I/O for specific file formats should override this to save data to the file with given name.

default implementation does nothing (instead of being pure virtual, to allow for I/O's that only load a dataset but don't save one). The file name and all Save parameter values (m_params[Save]) will be set in save() Derived classes must add any potentially necessary metadata in the dataSets so that there is all information in there to load the dataSet again from the given fileName

Reimplemented in iAAmiraVolumeFileIO, iACSVImageFileIO, iADCMFileIO, iAImageStackFileIO, iAITKFileIO, iAMetaFileIO, iAProjectFileIO, iARawFileIO, iASTLFileIO, iAVolStackFileIO, and iAVTIFileIO.

◆ supportedDataSetTypes()

iADataSetTypes iAFileIO::supportedDataSetTypes ( Operation  op) const

Types of dataset contained in this file format, which this IO can load/save.

Member Data Documentation

◆ CompressionStr

const QString iAFileIO::CompressionStr
static

◆ m_params

std::array<iAAttributes, 2> iAFileIO::m_params
protected

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