3d/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_3d_3dimageui_hh
#define mia_3d_3dimageui_hh
#include <set>
#include <vector>
#include <mia/core/ioplugin.hh>
#include <mia/core/iohandler.hh>
#include <mia/3d/image.hh>
NS_MIA_BEGIN
class EXPORT_3D C3DImageVector: public std::vector< std::shared_ptr<C3DImage >>,
public CIOData
{
public:
C3DImageVector *clone() const __attribute__((warn_unused_result));
};
struct EXPORT_3D io_3dimage_data {
typedef C3DImageVector type;
static const char *data_descr;
};
typedef TIOPlugin<io_3dimage_data> C3DImageIOPlugin;
extern template class EXPORT_3D TPlugin<io_3dimage_data, io_plugin_type>;
extern template class EXPORT_3D TIOPlugin<io_3dimage_data>;
typedef THandlerSingleton<TIOPluginHandler<C3DImageIOPlugin>> C3DImageIOPluginHandler;
template <>
struct IOHandler_of<C3DImage> {
typedef C3DImageIOPluginHandler type;
};
typedef C3DImageIOPluginHandler::Instance::DataKey C3DImageDataKey;
typedef C3DImageIOPluginHandler::Instance::PData P3DImageVector;
P3DImageVector EXPORT_3D create_image3d_vector(P3DImage image);
P3DImage EXPORT_3D load_image3d(const std::string& filename);
template <>
inline P3DImage EXPORT_3D load_image<P3DImage>(const std::string& filename)
{
cvdebug() << "Load image " << filename << "\n";
return load_image3d(filename);
}
bool EXPORT_3D save_image(const std::string& filename, P3DImage image);
bool EXPORT_3D save_image(const std::string& filename, C3DImage& image);
NS_MIA_END
#endif
image.hh
P3DImage
C3DImage::Pointer P3DImage
define a shortcut to the 3D image shared pointer.
Definition 3d/image.hh:135
create_image3d_vector
P3DImageVector EXPORT_3D create_image3d_vector(P3DImage image)
C3DImageVector
A class to interface images with image IO plugins.
Definition 3d/imageio.hh:39
C3DImageVector::clone
C3DImageVector * clone() const __attribute__((warn_unused_result))
returns a dynamically created copy of the image vector
C3DImage
The generic base type of a 3D image.
Definition 3d/image.hh:47
CIOData
helper class to derive from for data that can be loaded and stored to a disk.
Definition iodata.hh:37
THandlerSingleton
the singleton that a plug-in handler really is
Definition handler.hh:159
TIOPluginHandler::DataKey
TDelayedParameter< PData > DataKey
The type of the key used for the CDatapool access.
Definition iohandler.hh:64
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_3D
#define EXPORT_3D
Definition defines3d.hh:45
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
P3DImageVector
C3DImageIOPluginHandler::Instance::PData P3DImageVector
pointer type to the images
Definition 3d/imageio.hh:81
C3DImageIOPlugin
TIOPlugin< io_3dimage_data > C3DImageIOPlugin
The 3D image io plugin base class.
Definition 3d/imageio.hh:54
C3DImageIOPluginHandler
THandlerSingleton< TIOPluginHandler< C3DImageIOPlugin > > C3DImageIOPluginHandler
Handler for the plug-ins that store and load 3D images.
Definition 3d/imageio.hh:63
load_image3d
P3DImage EXPORT_3D load_image3d(const std::string &filename)
C3DImageDataKey
C3DImageIOPluginHandler::Instance::DataKey C3DImageDataKey
Data key type used to load and store to the CDatapool.
Definition 3d/imageio.hh:75
load_image< P3DImage >
P3DImage EXPORT_3D load_image< P3DImage >(const std::string &filename)
Definition 3d/imageio.hh:110
save_image
bool EXPORT_2D save_image(const std::string &filename, P2DImage image)
iohandler.hh
ioplugin.hh
cvdebug
CDebugSink & cvdebug()
Definition msgstream.hh:226
IOHandler_of< C3DImage >::type
C3DImageIOPluginHandler type
Definition 3d/imageio.hh:67
IOHandler_of
Definition iohandler.hh:185
io_3dimage_data
Definition 3d/imageio.hh:46
io_3dimage_data::data_descr
static const char * data_descr
Definition 3d/imageio.hh:48
io_3dimage_data::type
C3DImageVector type
Definition 3d/imageio.hh:47