2d/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_2d_2dimageui_hh
22 #define mia_2d_2dimageui_hh
23 
24 #include <set>
25 #include <vector>
26 #include <mia/core/ioplugin.hh>
27 #include <mia/core/iohandler.hh>
28 #include <mia/core/callback.hh>
29 
30 #include <mia/2d/image.hh>
31 
33 
39  public CIOData {
40 public:
41 
43  C2DImageVector *clone() const __attribute__((warn_unused_result));
44 };
45 
46 
48 class EXPORT_2D io_2dimage_type {
49 public:
50  typedef C2DImageVector type;
51  static const char *data_descr;
52 };
54 
57 
58 
60 
62 extern template class EXPORT_2D TIOPlugin<io_2dimage_type>;
63 
69 class EXPORT_2D C2DImageIOPPH: public TIOPluginHandler<C2DImageIOPlugin> {
70 public:
73 protected:
74  C2DImageIOPPH();
75 };
77 
78 
85 
86 template <>
89 };
90 
91 
95 typedef C2DImageIOPluginHandler::Instance::DataKey C2DImageDataKey;
96 
100 typedef C2DImageIOPluginHandler::Instance::PData P2DImageVector;
101 
112 
113 
121 P2DImage EXPORT_2D load_image2d(const std::string& filename);
122 
129 template <>
130 inline P2DImage load_image<P2DImage>(const std::string& filename)
131 {
132  return load_image2d(filename);
133 }
134 
143 bool EXPORT_2D save_image(const std::string& filename, P2DImage image);
144 
152 bool EXPORT_2D save_image(const std::string& filename, C2DImage& image);
153 
154 
166 C2DImageGroupedSeries EXPORT_2D load_image_series(const std::vector<std::string>& filenames,
167  CProgressCallback *cb = NULL);
168 
169 
170 
172 
173 #endif
C2DImageIOPluginHandler::Instance::PData P2DImageVector
Definition: 2d/imageio.hh:100
the singleton that a plug-in handler really is
Definition: handler.hh:157
C2DImage::Pointer P2DImage
Shared pointer representation of the 2D Image.
Definition: 2d/image.hh:119
std::map< std::string, C2DImageSeriesGroup > C2DImageGroupedSeries
Definition: 2d/image.hh:127
C2DImageGroupedSeries EXPORT_2D load_image_series(const std::vector< std::string > &filenames, CProgressCallback *cb=NULL)
C2DImageIOPluginHandler::Instance::DataKey C2DImageDataKey
Definition: 2d/imageio.hh:95
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
std::shared_ptr< Data > PData
Shared pointer to the data hadnled by this plug-in.
Definition: iohandler.hh:51
P2DImage load_image< P2DImage >(const std::string &filename)
Definition: 2d/imageio.hh:130
Vector of 2D images to load and store series of images to one file.
Definition: 2d/imageio.hh:38
#define EXPORT_2D
Definition: defines2d.hh:37
helper class to derive from for data that can be loaded and stored to a disk.
Definition: iodata.hh:36
C2DImageIOPluginHandler type
Definition: 2d/imageio.hh:88
TIOPlugin< io_2dimage_type > C2DImageIOPlugin
Base type for 2D image IO plugins.
Definition: 2d/imageio.hh:56
std::multimap< std::string, std::string > CSuffixmap
The map that maps file name suffixes to IO plug-ins.
Definition: iohandler.hh:60
THandlerSingleton< C2DImageIOPPH > C2DImageIOPluginHandler
Definition: 2d/imageio.hh:84
Template for all plug-in handlers that are responsible for data IO.
Definition: iohandler.hh:44
P2DImageVector EXPORT_2D create_image2d_vector(P2DImage image)
This is the base class for 2D images that can hold generic pixel data.
Definition: 2d/image.hh:47
bool EXPORT_2D save_image(const std::string &filename, P2DImage image)
std::vector< P2DImage > C2DImageSeries
helper type for image series
Definition: 2d/image.hh:122
P2DImage EXPORT_2D load_image2d(const std::string &filename)
a class to provide a feedback mechanism to show progress
Definition: callback.hh:41
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