My Project
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{
41public:
42
44 C2DImageVector *clone() const __attribute__((warn_unused_result));
45};
46
47
49class EXPORT_2D io_2dimage_type
50{
51public:
52 typedef C2DImageVector type;
53 static const char *data_descr;
54};
56
59
60
62
64extern template class EXPORT_2D TIOPlugin<io_2dimage_type>;
65
71class EXPORT_2D C2DImageIOPPH: public TIOPluginHandler<C2DImageIOPlugin>
72{
73public:
76protected:
77 C2DImageIOPPH();
78};
80
81
88
89template <>
93
94
98typedef C2DImageIOPluginHandler::Instance::DataKey C2DImageDataKey;
99
103typedef C2DImageIOPluginHandler::Instance::PData P2DImageVector;
104
115
116
124P2DImage EXPORT_2D load_image2d(const std::string& filename);
125
132template <>
133inline P2DImage load_image<P2DImage>(const std::string& filename)
134{
135 return load_image2d(filename);
136}
137
146bool EXPORT_2D save_image(const std::string& filename, P2DImage image);
147
155bool EXPORT_2D save_image(const std::string& filename, C2DImage& image);
156
157
169C2DImageGroupedSeries EXPORT_2D load_image_series(const std::vector<std::string>& filenames,
170 CProgressCallback *cb = NULL);
171
172
173
175
176#endif
C2DImage::Pointer P2DImage
Shared pointer representation of the 2D Image.
Definition 2d/image.hh:120
std::vector< P2DImage > C2DImageSeries
helper type for image series
Definition 2d/image.hh:123
std::map< std::string, C2DImageSeriesGroup > C2DImageGroupedSeries
Definition 2d/image.hh:128
P2DImageVector EXPORT_2D create_image2d_vector(P2DImage image)
C2DImageIOPluginHandler::Instance::PData P2DImageVector
TIOPlugin< io_2dimage_type > C2DImageIOPlugin
Base type for 2D image IO plugins.
Definition 2d/imageio.hh:58
C2DImageIOPluginHandler::Instance::DataKey C2DImageDataKey
Definition 2d/imageio.hh:98
Vector of 2D images to load and store series of images to one file.
Definition 2d/imageio.hh:40
C2DImageVector * clone() const __attribute__((warn_unused_result))
This is the base class for 2D images that can hold generic pixel data.
Definition 2d/image.hh:48
helper class to derive from for data that can be loaded and stored to a disk.
Definition iodata.hh:37
a class to provide a feedback mechanism to show progress
Definition callback.hh:42
the singleton that a plug-in handler really is
Definition handler.hh:159
Template for all plug-in handlers that are responsible for data IO.
Definition iohandler.hh:45
std::multimap< std::string, std::string > CSuffixmap
The map that maps file name suffixes to IO plug-ins.
Definition iohandler.hh:61
std::shared_ptr< Data > PData
Shared pointer to the data hadnled by this plug-in.
Definition iohandler.hh:52
The templatex basis class of all IO plug-ins.
Definition ioplugin.hh:58
The generic base for all plug-ins.
#define EXPORT_2D
Definition defines2d.hh:37
#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
P2DImage load_image< P2DImage >(const std::string &filename)
bool EXPORT_2D save_image(const std::string &filename, P2DImage image)
P2DImage EXPORT_2D load_image2d(const std::string &filename)
C2DImageGroupedSeries EXPORT_2D load_image_series(const std::vector< std::string > &filenames, CProgressCallback *cb=NULL)
THandlerSingleton< C2DImageIOPPH > C2DImageIOPluginHandler
Definition 2d/imageio.hh:87
C2DImageIOPluginHandler type
Definition 2d/imageio.hh:91