My Project
3d/imageio.hh
Go to the documentation of this file.
1/* -*- mia-c++ -*-
2 *
3 * This file is part of MIA - a toolbox for medical image analysis
4 * Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
5 *
6 * MIA is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with MIA; if not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21#ifndef mia_3d_3dimageui_hh
22#define mia_3d_3dimageui_hh
23
24#include <set>
25#include <vector>
26#include <mia/core/ioplugin.hh>
27#include <mia/core/iohandler.hh>
28#include <mia/3d/image.hh>
29
31
32
37class EXPORT_3D C3DImageVector: public std::vector< std::shared_ptr<C3DImage >>,
38 public CIOData
39{
40public:
42 C3DImageVector *clone() const __attribute__((warn_unused_result));
43
44};
45
48 static const char *data_descr;
49};
55
57extern template class EXPORT_3D TIOPlugin<io_3dimage_data>;
58
64
65template <>
68};
69
70
75typedef C3DImageIOPluginHandler::Instance::DataKey C3DImageDataKey;
76
81typedef C3DImageIOPluginHandler::Instance::PData P3DImageVector;
82
90
99P3DImage EXPORT_3D load_image3d(const std::string& filename);
100
101
109template <>
110inline P3DImage EXPORT_3D load_image<P3DImage>(const std::string& filename)
111{
112 cvdebug() << "Load image " << filename << "\n";
113 return load_image3d(filename);
114}
115
124bool EXPORT_3D save_image(const std::string& filename, P3DImage image);
125
126
134bool EXPORT_3D save_image(const std::string& filename, C3DImage& image);
135
136
138
139#endif
C3DImage::Pointer P3DImage
define a shortcut to the 3D image shared pointer.
Definition: 3d/image.hh:135
P3DImageVector EXPORT_3D create_image3d_vector(P3DImage image)
A class to interface images with image IO plugins.
Definition: 3d/imageio.hh:39
C3DImageVector * clone() const __attribute__((warn_unused_result))
returns a dynamically created copy of the image vector
The generic base type of a 3D image.
Definition: 3d/image.hh:47
helper class to derive from for data that can be loaded and stored to a disk.
Definition: iodata.hh:37
the singleton that a plug-in handler really is
Definition: handler.hh:159
The templatex basis class of all IO plug-ins.
Definition: ioplugin.hh:58
The generic base for all plug-ins.
Definition: plugin_base.hh:172
#define EXPORT_3D
Definition: defines3d.hh:45
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition: defines.hh:33
#define NS_MIA_END
conveniance define to end the mia namespace
Definition: defines.hh:36
C3DImageIOPluginHandler::Instance::PData P3DImageVector
pointer type to the images
Definition: 3d/imageio.hh:81
TIOPlugin< io_3dimage_data > C3DImageIOPlugin
The 3D image io plugin base class.
Definition: 3d/imageio.hh:54
THandlerSingleton< TIOPluginHandler< C3DImageIOPlugin > > C3DImageIOPluginHandler
Handler for the plug-ins that store and load 3D images.
Definition: 3d/imageio.hh:63
P3DImage EXPORT_3D load_image3d(const std::string &filename)
C3DImageIOPluginHandler::Instance::DataKey C3DImageDataKey
Data key type used to load and store to the CDatapool.
Definition: 3d/imageio.hh:75
bool EXPORT_3D save_image(const std::string &filename, P3DImage image)
P3DImage EXPORT_3D load_image< P3DImage >(const std::string &filename)
Definition: 3d/imageio.hh:110
CDebugSink & cvdebug()
Definition: msgstream.hh:226
C3DImageIOPluginHandler type
Definition: 3d/imageio.hh:67
static const char * data_descr
Definition: 3d/imageio.hh:48
C3DImageVector type
Definition: 3d/imageio.hh:47