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 
37 class EXPORT_3D C3DImageVector: public std::vector< std::shared_ptr<C3DImage >> ,
38  public CIOData {
39 public:
41  C3DImageVector *clone() const __attribute__((warn_unused_result));
42 
43 };
44 
47  static const char *data_descr;
48 };
54 
56 extern template class EXPORT_3D TIOPlugin<io_3dimage_data>;
57 
63 
64 template <>
67 };
68 
69 
74 typedef C3DImageIOPluginHandler::Instance::DataKey C3DImageDataKey;
75 
80 typedef C3DImageIOPluginHandler::Instance::PData P3DImageVector;
81 
89 
98 P3DImage EXPORT_3D load_image3d(const std::string& filename);
99 
100 
108 template <>
109 inline P3DImage EXPORT_3D load_image<P3DImage>(const std::string& filename)
110 {
111  cvdebug() << "Load image " << filename << "\n";
112  return load_image3d(filename);
113 }
114 
123 bool EXPORT_3D save_image(const std::string& filename, P3DImage image);
124 
125 
133 bool EXPORT_3D save_image(const std::string& filename, C3DImage& image);
134 
135 
137 
138 #endif
TIOPlugin< io_3dimage_data > C3DImageIOPlugin
The 3D image io plugin base class.
Definition: 3d/imageio.hh:53
the singleton that a plug-in handler really is
Definition: handler.hh:157
CDebugSink & cvdebug()
Definition: msgstream.hh:216
C3DImage::Pointer P3DImage
define a shortcut to the 3D image shared pointer.
Definition: 3d/image.hh:134
C3DImageVector type
Definition: 3d/imageio.hh:46
The templatex basis class of all IO plug-ins.
Definition: ioplugin.hh:57
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition: defines.hh:33
#define EXPORT_3D
Definition: defines3d.hh:44
helper class to derive from for data that can be loaded and stored to a disk.
Definition: iodata.hh:36
P3DImage EXPORT_3D load_image3d(const std::string &filename)
The generic base type of a 3D image.
Definition: 3d/image.hh:46
bool EXPORT_3D save_image(const std::string &filename, P3DImage image)
A class to interface images with image IO plugins.
Definition: 3d/imageio.hh:37
P3DImageVector EXPORT_3D create_image3d_vector(P3DImage image)
C3DImageIOPluginHandler::Instance::PData P3DImageVector
pointer type to the images
Definition: 3d/imageio.hh:80
C3DImageIOPluginHandler::Instance::DataKey C3DImageDataKey
Data key type used to load and store to the CDatapool.
Definition: 3d/imageio.hh:74
static const char * data_descr
Definition: 3d/imageio.hh:47
C3DImageIOPluginHandler type
Definition: 3d/imageio.hh:66
THandlerSingleton< TIOPluginHandler< C3DImageIOPlugin > > C3DImageIOPluginHandler
Handler for the plug-ins that store and load 3D images.
Definition: 3d/imageio.hh:62
P3DImage EXPORT_3D load_image< P3DImage >(const std::string &filename)
Definition: 3d/imageio.hh:109
The generic base for all plug-ins.
Definition: plugin_base.hh:170
#define NS_MIA_END
conveniance define to end the mia namespace
Definition: defines.hh:36