Input/output of files

Input and output of images. More...

## Data Structures

class | C2DIOVectorfield
| a class for the IO of 2D vector fields More...
class | C2DTransformIOPluginHandlerImpl
| The non-singleton plug-in handler for 3D transformations. More...
class | C3DImageVector
| A class to interface images with image IO plugins. More...
class | C3DIOVectorfield
| An interface class to wrap a vector field into something, IO plugins can understand. More...
class | C3DTransformIOPluginHandlerImpl
| The non-singleton plug-in handler for 3D transformations. More...
class | CDatapool
| temporary data storage to avoid storing on disk More...
class | CFile
| A wrapper for the cstdio file type that closes the file automatically when the scope is left. More...
class | CInputFile
| A stdio FILE for opening a file for reading. More...
class | CIOData
| helper class to derive from for data that can be loaded and stored to a disk. More...
class | COutputFile
| A stdio FILE for opening a file for writing. More...

## Typedefs

typedef THandlerSingleton< C2DImageIOPPH > | C2DImageIOPluginHandler
typedef C2DRGBImageIOPluginPluginHandler::Instance::DataKey | C2DRGBImageDataKey
| The data key type for the CDatapool storage.
typedef mia::THandlerSingleton< mia::TIOPluginHandler< C2DRGBImageIOPlugin > > | C2DRGBImageIOPluginPluginHandler
| The 2D RGB image plugin handler.
typedef C2DTransformationIOPluginHandler::Instance::DataKey | C2DTransformationDataKey
| The data key type for the CDatapool storage.
typedef TIOPlugin< C2DTransformation > | C2DTransformationIO
| The base class for 2D transformation IO plugins.
typedef THandlerSingleton< C2DTransformIOPluginHandlerImpl > | C2DTransformationIOPluginHandler
| The 2D transformationb plugin handler.
typedef C3DImageIOPluginHandler::Instance::DataKey | C3DImageDataKey
| Data key type used to load and store to the CDatapool.
typedef TIOPlugin< io_3dimage_data > | C3DImageIOPlugin
| The 3D image io plugin base class.
typedef THandlerSingleton< TIOPluginHandler< C3DImageIOPlugin > > | C3DImageIOPluginHandler
| Handler for the plug-ins that store and load 3D images.
typedef C3DLandmarklistIOPluginHandler::Instance::DataKey | C3DLandmarklistDataKey
| 3D Landmark list data key to load and store to the CDatapool
typedef THandlerSingleton< TIOPluginHandler< C3DLandmarklistIOPlugin > > | C3DLandmarklistIOPluginHandler
| 3D Landmark list IO plugin handler
typedef C3DTransformationIOPluginHandler::Instance::DataKey | C3DTransformationDataKey
| data key type for temporary storage of 3D transformations
typedef TIOPlugin< C3DTransformation > | C3DTransformationIO
| Base class for the generic IO of transformations.
typedef THandlerSingleton< C3DTransformIOPluginHandlerImpl > | C3DTransformationIOPluginHandler
| Plug-in handler for the transformation IO plug-ins.
typedef TTransformCreator< C3DTransformation > | C3DTransformCreator
| base class for the creators of 3D transformations
typedef THandlerSingleton< TFactoryPluginHandler< C3DTransformCreatorPlugin > > | C3DTransformCreatorHandler
| Transform creator plugin handler.
typedef TTransformCreatorPlugin< C3DTransformation > | C3DTransformCreatorPlugin
| Base class for the transform creator plugins.
typedef TIOPlugin< C3DIOVectorfield > | C3DVFIOPlugin
| Base class for vector field IO plug-ins.
typedef THandlerSingleton< TIOPluginHandler< C3DVFIOPlugin > > | C3DVFIOPluginHandler
| Plug-in handler for vector field IO.
typedef C3DImageIOPluginHandler::Instance::PData | P3DImageVector
| pointer type to the images
typedef std::shared_ptr< C3DTransformCreator > | P3DTransformationFactory
| pointer type of the class for the creators of 3D transformations

## Functions

P2DTransformation | load_2dtransform (const std::string &file)
| convenienance function to load a transformation
P3DTransformation | load_3dtransform (const std::string &file)
| convenienance function to load a transformation
P2DImage EXPORT_2D | load_image2d (const std::string &filename)
P3DImage EXPORT_3D | load_image3d (const std::string &filename)
template<>
P2DImage | load_image< P2DImage > (const std::string &filename)
template<>
P3DImage EXPORT_3D | load_image< P3DImage > (const std::string &filename)
C2DImageGroupedSeries EXPORT_2D | load_image_series (const std::vector< std::string > &filenames, CProgressCallback *cb=NULL)
template<typename T>
T | load_transform (const std::string &MIA_PARAM_UNUSED(file))
| template to unify transformation loading
template<>
P2DTransformation | load_transform< P2DTransformation > (const std::string &file)
| specialized version to load a transformation
template<>
P3DTransformation | load_transform< P3DTransformation > (const std::string &file)
| specialized version to load a transformation
bool EXPORT_2D | save_image (const std::string &filename, C2DImage &image)
bool EXPORT_3D | save_image (const std::string &filename, C3DImage &image)
bool EXPORT_2D | save_image (const std::string &filename, P2DImage image)
bool EXPORT_3D | save_image (const std::string &filename, P3DImage image)
bool | save_transform (const std::string &file, const C2DTransformation &transform)
| convenienance function to save a transformation
bool | save_transform (const std::string &file, const C3DTransformation &transform)
| convenienance function to save a transformation

## Variables

NS_MIA_BEGIN typedef TIOPlugin< C3DLandmarklist > | C3DLandmarklistIOPlugin
| 3D Landmark list IO plugin base

## Detailed Description

Input and output of images.

## Typedef Documentation

## C2DImageIOPluginHandler

typedef THandlerSingleton< C2DImageIOPPH > C2DImageIOPluginHandler

The 2D image IO plugin handler that also provides the interface to load and store 2D images.

Definition at line 87 of file 2d/imageio.hh.

## C2DRGBImageDataKey

typedef C2DRGBImageIOPluginPluginHandler::Instance::DataKey C2DRGBImageDataKey

The data key type for the CDatapool storage.

Definition at line 101 of file rgbimageio.hh.

## C2DRGBImageIOPluginPluginHandler

typedef mia::THandlerSingleton< mia::TIOPluginHandler<C2DRGBImageIOPlugin> > C2DRGBImageIOPluginPluginHandler

The 2D RGB image plugin handler.

Definition at line 95 of file rgbimageio.hh.

## C2DTransformationDataKey

typedef C2DTransformationIOPluginHandler::Instance::DataKey C2DTransformationDataKey

The data key type for the CDatapool storage.

Definition at line 66 of file 2d/transformio.hh.

## C2DTransformationIO

typedef TIOPlugin<C2DTransformation> C2DTransformationIO

The base class for 2D transformation IO plugins.

Definition at line 38 of file 2d/transformio.hh.

## C2DTransformationIOPluginHandler

typedef THandlerSingleton< C2DTransformIOPluginHandlerImpl > C2DTransformationIOPluginHandler

The 2D transformationb plugin handler.

Definition at line 60 of file 2d/transformio.hh.

## C3DImageDataKey

typedef C3DImageIOPluginHandler::Instance::DataKey C3DImageDataKey

Data key type used to load and store to the CDatapool.

Definition at line 75 of file 3d/imageio.hh.

## C3DImageIOPlugin

typedef TIOPlugin<io_3dimage_data> C3DImageIOPlugin

The 3D image io plugin base class.

Definition at line 54 of file 3d/imageio.hh.

## C3DImageIOPluginHandler

typedef THandlerSingleton<TIOPluginHandler<C3DImageIOPlugin> > C3DImageIOPluginHandler

Handler for the plug-ins that store and load 3D images.

Definition at line 63 of file 3d/imageio.hh.

## C3DLandmarklistDataKey

typedef C3DLandmarklistIOPluginHandler::Instance::DataKey C3DLandmarklistDataKey

3D Landmark list data key to load and store to the CDatapool

Definition at line 60 of file landmarklistio.hh.

## C3DLandmarklistIOPluginHandler

typedef THandlerSingleton<TIOPluginHandler<C3DLandmarklistIOPlugin> > C3DLandmarklistIOPluginHandler

3D Landmark list IO plugin handler

Definition at line 54 of file landmarklistio.hh.

## C3DTransformationDataKey

typedef C3DTransformationIOPluginHandler::Instance::DataKey C3DTransformationDataKey

data key type for temporary storage of 3D transformations

See also
  CDatapool

Definition at line 62 of file 3d/transformio.hh.

## C3DTransformationIO

typedef TIOPlugin<C3DTransformation> C3DTransformationIO

Base class for the generic IO of transformations.

Definition at line 34 of file 3d/transformio.hh.

## C3DTransformationIOPluginHandler

typedef THandlerSingleton< C3DTransformIOPluginHandlerImpl > C3DTransformationIOPluginHandler

Plug-in handler for the transformation IO plug-ins.

Definition at line 56 of file 3d/transformio.hh.

## C3DTransformCreator

typedef TTransformCreator<C3DTransformation> C3DTransformCreator

base class for the creators of 3D transformations

Todo
  rename this to factory

Definition at line 35 of file 3d/transformfactory.hh.

## C3DTransformCreatorHandler

typedef THandlerSingleton<TFactoryPluginHandler<C3DTransformCreatorPlugin> > C3DTransformCreatorHandler

Transform creator plugin handler.

Definition at line 53 of file 3d/transformfactory.hh.

## C3DTransformCreatorPlugin

typedef TTransformCreatorPlugin<C3DTransformation> C3DTransformCreatorPlugin

Base class for the transform creator plugins.

Definition at line 47 of file 3d/transformfactory.hh.

## C3DVFIOPlugin

typedef TIOPlugin<C3DIOVectorfield> C3DVFIOPlugin

Base class for vector field IO plug-ins.

Definition at line 64 of file 3d/vfio.hh.

## C3DVFIOPluginHandler

typedef THandlerSingleton<TIOPluginHandler<C3DVFIOPlugin> > C3DVFIOPluginHandler

Plug-in handler for vector field IO.

Definition at line 76 of file 3d/vfio.hh.

## P3DImageVector

typedef C3DImageIOPluginHandler::Instance::PData P3DImageVector

pointer type to the images

Definition at line 81 of file 3d/imageio.hh.

## P3DTransformationFactory

typedef std::shared_ptr<C3DTransformCreator > P3DTransformationFactory

pointer type of the class for the creators of 3D transformations

Definition at line 41 of file 3d/transformfactory.hh.

## Function Documentation

## load_2dtransform()

P2DTransformation load_2dtransform | ( | const std::string & | file | ) |

inline

convenienance function to load a transformation

Parameters

  file | file name to load the transformation from

Returns
  the loaded transformation or an empty std::shared_ptr

Definition at line 75 of file 2d/transformio.hh.

References THandlerSingleton< C2DTransformIOPluginHandlerImpl >::instance(), and TIOPluginHandler< I >::load().

Referenced by load_transform< P2DTransformation >().

## load_3dtransform()

P3DTransformation load_3dtransform | ( | const std::string & | file | ) |

inline

convenienance function to load a transformation

Parameters

  file | file name to load the transformation from

Returns
  the loaded transformation or an empty std::shared_ptr

Definition at line 71 of file 3d/transformio.hh.

References THandlerSingleton< C3DTransformIOPluginHandlerImpl >::instance(), and TIOPluginHandler< I >::load().

Referenced by load_transform< P3DTransformation >().

## load_image2d()

P2DImage EXPORT_2D load_image2d | ( | const std::string & | filename | ) |

Convenience function to load one 2D image from a file

Parameters

  filename |

Returns
  image

References EXPORT_2D.

Referenced by load_image< P2DImage >().

## load_image3d()

P3DImage EXPORT_3D load_image3d | ( | const std::string & | filename | ) |

convenience function to load a single image from a file.

Exceptions

  std::invalid_argument | if the image could not be loaded

Parameters

  filename | input file

Returns
  the loaded image

References EXPORT_3D.

Referenced by load_image< P3DImage >().

## load_image< P2DImage >()

template<>

P2DImage load_image< P2DImage > | ( | const std::string & | filename | ) |

inline

Convenience function to load one 2D image from a file

Parameters

  filename |

Returns
  image

Definition at line 133 of file 2d/imageio.hh.

References load_image2d().

## load_image< P3DImage >()

template<>

P3DImage EXPORT_3D load_image< P3DImage > | ( | const std::string & | filename | ) |

inline

convenience function to load a single image from a file.

Exceptions

  std::invalid_argument | if the image could not be loaded

Parameters

  filename | input file

Returns
  the loaded image

Definition at line 110 of file 3d/imageio.hh.

References cvdebug(), EXPORT_3D, and load_image3d().

## load_image_series()

C2DImageGroupedSeries EXPORT_2D load_image_series | ( | const std::vector< std::string > & | filenames,
|  | CProgressCallback * | cb = NULL )

Convenience function to load a series of images and group them into sets based on the acquisition parameters if available. If these parameters are not available, then the order of the input files is used to sort the files but no grouping takes place.

Parameters

  filenames | list of file names
  cb | optionally provide a call back function that shows loading progress

Returns
  grouped set of files.

References EXPORT_2D, and NS_MIA_END.

## load_transform()

template<typename T>

T load_transform | ( | const std::string & | MIA_PARAM_UNUSEDfile | ) |

template to unify transformation loading

Template Parameters

  T | the type of the transformation to be loaded

Parameters

  file | the file name of the transformation to be loaded

Returns
  the loaded transformation or an empty shared:ptr

Definition at line 121 of file transformation.hh.

## load_transform< P2DTransformation >()

template<>

P2DTransformation load_transform< P2DTransformation > | ( | const std::string & | file | ) |

inline

specialized version to load a transformation

Parameters

  file | file name to load the transformation from

Returns
  the loaded transformation or an empty std::shared_ptr

Definition at line 87 of file 2d/transformio.hh.

References load_2dtransform().

## load_transform< P3DTransformation >()

template<>

P3DTransformation load_transform< P3DTransformation > | ( | const std::string & | file | ) |

inline

specialized version to load a transformation

Parameters

  file | file name to load the transformation from

Returns
  the loaded transformation or an empty std::shared_ptr

Definition at line 83 of file 3d/transformio.hh.

References load_3dtransform().

## save_image() [1/4]

bool EXPORT_2D save_image | ( | const std::string & | filename,
|  | C2DImage & | image )

Convenience function to save one 2D image to a file

Parameters

  filename |
  image |

Returns
  true if saving was successfull

References EXPORT_2D.

## save_image() [2/4]

bool EXPORT_3D save_image | ( | const std::string & | filename,
|  | C3DImage & | image )

Convenience function to save one 3D image to a file

Parameters

  filename |
  image |

Returns
  true if saving was successfull

References EXPORT_3D, and NS_MIA_END.

## save_image() [3/4]

bool EXPORT_2D save_image | ( | const std::string & | filename,
|  | P2DImage | image )

Convenience function to save one 2D image to a file

Parameters

  filename |
  image |

Returns
  true if saving was successfull

References EXPORT_2D.

## save_image() [4/4]

bool EXPORT_3D save_image | ( | const std::string & | filename,
|  | P3DImage | image )

convenience function to save a single image to a file.

Parameters

  filename | input file
  image | image to be saved

Returns
  true if successful and false otherwise

References EXPORT_3D.

## save_transform() [1/2]

bool save_transform | ( | const std::string & | file,
|  | const C2DTransformation & | transform )

inline

convenienance function to save a transformation

Parameters

  file | file name to store the transformation in
  transform | the transformation to be stored

Definition at line 99 of file 2d/transformio.hh.

References THandlerSingleton< C2DTransformIOPluginHandlerImpl >::instance(), and TIOPluginHandler< I >::save().

## save_transform() [2/2]

bool save_transform | ( | const std::string & | file,
|  | const C3DTransformation & | transform )

inline

convenienance function to save a transformation

Parameters

  file | file name to store the transformation in
  transform | the transformation to be stored

Definition at line 95 of file 3d/transformio.hh.

References THandlerSingleton< C3DTransformIOPluginHandlerImpl >::instance(), and TIOPluginHandler< I >::save().

## Variable Documentation

## C3DLandmarklistIOPlugin

NS_MIA_BEGIN typedef TIOPlugin<C3DLandmarklist> C3DLandmarklistIOPlugin

3D Landmark list IO plugin base

Definition at line 34 of file landmarklistio.hh.