2d/imageio.hh
Go to the documentation of this file.
/* -*- mia-c++ -*-
*
* This file is part of MIA - a toolbox for medical image analysis
* Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
*
* MIA is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MIA; if not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef mia_2d_2dimageui_hh
#define mia_2d_2dimageui_hh
#include <set>
#include <vector>
#include <mia/core/ioplugin.hh>
#include <mia/core/iohandler.hh>
#include <mia/core/callback.hh>
#include <mia/2d/image.hh>
NS_MIA_BEGIN
class EXPORT_2D C2DImageVector: public C2DImageSeries,
public CIOData
{
public:
C2DImageVector *clone() const __attribute__((warn_unused_result));
};
class EXPORT_2D io_2dimage_type
{
public:
typedef C2DImageVector type;
static const char *data_descr;
};
typedef TIOPlugin<io_2dimage_type> C2DImageIOPlugin;
extern template class EXPORT_2D TPlugin<io_2dimage_type, io_plugin_type>;
extern template class EXPORT_2D TIOPlugin<io_2dimage_type>;
class EXPORT_2D C2DImageIOPPH: public TIOPluginHandler<C2DImageIOPlugin>
{
public:
typedef TIOPluginHandler<C2DImageIOPlugin>::CSuffixmap CSuffixmap;
typedef TIOPluginHandler<C2DImageIOPlugin>::PData PData;
protected:
C2DImageIOPPH();
};
typedef THandlerSingleton< C2DImageIOPPH > C2DImageIOPluginHandler;
template <>
struct IOHandler_of<C2DImage> {
typedef C2DImageIOPluginHandler type;
};
typedef C2DImageIOPluginHandler::Instance::DataKey C2DImageDataKey;
typedef C2DImageIOPluginHandler::Instance::PData P2DImageVector;
P2DImageVector EXPORT_2D create_image2d_vector(P2DImage image);
P2DImage EXPORT_2D load_image2d(const std::string& filename);
template <>
inline P2DImage load_image<P2DImage>(const std::string& filename)
{
return load_image2d(filename);
}
bool EXPORT_2D save_image(const std::string& filename, P2DImage image);
bool EXPORT_2D save_image(const std::string& filename, C2DImage& image);
C2DImageGroupedSeries EXPORT_2D load_image_series(const std::vector<std::string>& filenames,
CProgressCallback *cb = NULL);
NS_MIA_END
#endif
image.hh
P2DImage
C2DImage::Pointer P2DImage
Shared pointer representation of the 2D Image.
Definition 2d/image.hh:120
C2DImageSeries
std::vector< P2DImage > C2DImageSeries
helper type for image series
Definition 2d/image.hh:123
C2DImageGroupedSeries
std::map< std::string, C2DImageSeriesGroup > C2DImageGroupedSeries
Definition 2d/image.hh:128
create_image2d_vector
P2DImageVector EXPORT_2D create_image2d_vector(P2DImage image)
P2DImageVector
C2DImageIOPluginHandler::Instance::PData P2DImageVector
Definition 2d/imageio.hh:103
C2DImageIOPlugin
TIOPlugin< io_2dimage_type > C2DImageIOPlugin
Base type for 2D image IO plugins.
Definition 2d/imageio.hh:58
C2DImageDataKey
C2DImageIOPluginHandler::Instance::DataKey C2DImageDataKey
Definition 2d/imageio.hh:98
callback.hh
C2DImageVector
Vector of 2D images to load and store series of images to one file.
Definition 2d/imageio.hh:40
C2DImageVector::clone
C2DImageVector * clone() const __attribute__((warn_unused_result))
C2DImage
This is the base class for 2D images that can hold generic pixel data.
Definition 2d/image.hh:48
CIOData
helper class to derive from for data that can be loaded and stored to a disk.
Definition iodata.hh:37
CProgressCallback
a class to provide a feedback mechanism to show progress
Definition callback.hh:42
type
THandlerSingleton< C2DImageIOPPH >
TIOPluginHandler
Template for all plug-in handlers that are responsible for data IO.
Definition iohandler.hh:45
TIOPluginHandler::CSuffixmap
std::multimap< std::string, std::string > CSuffixmap
The map that maps file name suffixes to IO plug-ins.
Definition iohandler.hh:61
TIOPluginHandler::PData
std::shared_ptr< Data > PData
Shared pointer to the data hadnled by this plug-in.
Definition iohandler.hh:52
TIOPlugin
The templatex basis class of all IO plug-ins.
Definition ioplugin.hh:58
TPlugin
The generic base for all plug-ins.
Definition plugin_base.hh:172
EXPORT_2D
#define EXPORT_2D
Definition defines2d.hh:37
NS_MIA_BEGIN
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition defines.hh:33
NS_MIA_END
#define NS_MIA_END
conveniance define to end the mia namespace
Definition defines.hh:36
load_image< P2DImage >
P2DImage load_image< P2DImage >(const std::string &filename)
Definition 2d/imageio.hh:133
save_image
bool EXPORT_2D save_image(const std::string &filename, P2DImage image)
load_image2d
P2DImage EXPORT_2D load_image2d(const std::string &filename)
load_image_series
C2DImageGroupedSeries EXPORT_2D load_image_series(const std::vector< std::string > &filenames, CProgressCallback *cb=NULL)
C2DImageIOPluginHandler
THandlerSingleton< C2DImageIOPPH > C2DImageIOPluginHandler
Definition 2d/imageio.hh:87
iohandler.hh
ioplugin.hh
IOHandler_of< C2DImage >::type
C2DImageIOPluginHandler type
Definition 2d/imageio.hh:91
IOHandler_of
Definition iohandler.hh:185