aimsdata  5.1.2
Neuroimaging data handling
aims::FileFormatDictionary< T > Class Template Reference

Formats holder for each format of Aims object, used by Reader and Writer. More...

#include <aims/io/fileFormat.h>

Static Public Member Functions

static void registerFormat (const std::string &formatID, FileFormat< T > *format, const std::vector< std::string > &extensions, const std::string &before="")
 
static void unregisterFormat (const std::string &formatID)
 
static FileFormat< T > * fileFormat (const std::string &format)
 
static const std::map< std::string, std::list< std::string > > & extensions ()
 
static std::set< std::string > formats ()
 
static void registerBaseFormats ()
 builds base formats maps. More...
 
static std::string fileExtension (const std::string &filename)
 
static void init ()
 

Detailed Description

template<class T>
class aims::FileFormatDictionary< T >

Formats holder for each format of Aims object, used by Reader and Writer.

FileFormatDictionary is a plug-in mechanism to allow new formats to be registered. It uses at lower level specific IO classes for each format (JpegFormat for JPEG, which in turn use JpegReader and JpegWriter, AimsVidaReader for Vida, AimsSpmReader for SPM, etc., and IO classes for other object types (meshes, buckets, textures, ...))

Adding new IO formats

The standard Aims library includes a set of already compiled Readers and writers, for the following types:

  • AimsData<int8_t>
  • AimsData<uint8_t>
  • AimsData<int16_t>
  • AimsData<uint16_t>
  • AimsData<int32_t>
  • AimsData<uint32_t>
  • AimsData<float>
  • AimsData<double>
  • AimsData<cfloat>
  • AimsData<cdouble>
  • AimsData<AimsRGB>
  • AimsData<AimsRGBA>
  • AimsData<Point3df>
  • AimsSurfaceTriangle
  • Texture1d
  • Texture2d
  • AimsBucket<Void>

If you need to use other types, you'll have to include aims/io/reader_d.h and / or aims/io/writer_d.h in order to have the template functions definitions, aims/io/reader.h and aims/io/writer.h are only the class declarations. In addition, you may want to specialize the registerBaseFormats() functions of specific FileFormatDictionary specializations.

See also
Reader Writer Finder Process

Definition at line 139 of file fileFormat.h.

Member Function Documentation

◆ extensions()

template<class T >
const std::map< std::string, std::list< std::string > > & aims::FileFormatDictionary< T >::extensions
static

Definition at line 105 of file fileFormat_d.h.

Referenced by aims::Reader< T >::read(), and aims::Writer< T >::write().

◆ fileExtension()

template<class T >
std::string aims::FileFormatDictionary< T >::fileExtension ( const std::string &  filename)
static

Definition at line 126 of file fileFormat_d.h.

References carto::FileUtil::extension().

◆ fileFormat()

template<class T >
FileFormat< T > * aims::FileFormatDictionary< T >::fileFormat ( const std::string &  format)
static

Definition at line 199 of file fileFormat_d.h.

Referenced by aims::Reader< T >::read(), and aims::Writer< T >::write().

◆ formats()

template<class T >
std::set< std::string > aims::FileFormatDictionary< T >::formats
static

Definition at line 211 of file fileFormat_d.h.

◆ init()

◆ registerBaseFormats()

template<class T >
static void aims::FileFormatDictionary< T >::registerBaseFormats ( )
static

builds base formats maps.

Currently:

  • Volume formats:
    • SPM
    • VIDA
    • DICOM
    • ECAT
  • Mesh formats:
    • MESH
    • TRI
  • Texture formats:
    • TEX
  • Bucket formats:
    • BCK The formats list is dynamically extensible, you can register your own whenever you want to

◆ registerFormat()

template<class T >
void aims::FileFormatDictionary< T >::registerFormat ( const std::string &  formatID,
FileFormat< T > *  format,
const std::vector< std::string > &  extensions,
const std::string &  before = "" 
)
static

Definition at line 132 of file fileFormat_d.h.

◆ unregisterFormat()

template<class T >
void aims::FileFormatDictionary< T >::unregisterFormat ( const std::string &  formatID)
static

Definition at line 163 of file fileFormat_d.h.


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