![]() |
aimsdata
5.0.5
Neuroimaging data handling
|
A class to read an object of type T, even if the type on file is different. More...
#include <aims/utility/anytype_reader.h>
Public Types | |
typedef AnyTypeReaderProcess< T, TConvertorFamily > | Base |
Public Member Functions | |
AnyTypeReader (std::string filename) | |
initialize with the name of the file to be read. More... | |
void | read (T &out) |
read file and get result. More... | |
A class to read an object of type T, even if the type on file is different.
Conversion is taken care of by convertor classes, indexed by the TConvertorFamily "template typename". These convertors have to be able to allocate the output if necessary. NB: error checking during conversion is left to the convertors – no tests are done inside AnyTypeReader to check that the conversion succeeded, or even that a convertion is possible at all. Therefore, it is as safe as the Convertors you provide.
Example:
If you want to read an image as an AimsData<float>, whatever the type on file:
std::string filename = "toto.ima"; AnyTypeReader<AimsData<float> > reader(filename); AimsData<float> im; reader.read(im);
Definition at line 195 of file anytype_reader.h.
typedef AnyTypeReaderProcess<T, TConvertorFamily> aims::AnyTypeReader< T, TConvertorFamily >::Base |
Definition at line 199 of file anytype_reader.h.
|
explicit |
initialize with the name of the file to be read.
Definition at line 107 of file anytype_reader_details.h.
void aims::AnyTypeReader< T, TConvertorFamily >::read | ( | T & | out | ) |
read file and get result.
Definition at line 114 of file anytype_reader_details.h.
References aims::Process::execute().