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-2013 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 
66 class EXPORT_2D C2DImageIOPPH: public TIOPluginHandler<C2DImageIOPlugin> {
67 public:
70 protected:
71  C2DImageIOPPH();
72 };
74 
75 
82 
86 typedef C2DImageIOPluginHandler::Instance::DataKey C2DImageDataKey;
87 
91 typedef C2DImageIOPluginHandler::Instance::PData P2DImageVector;
92 
98 struct EXPORT_2D C2DImageIOPluginHandlerTestPath {
99  C2DImageIOPluginHandlerTestPath();
100 };
102 
113 
114 
122 P2DImage EXPORT_2D load_image2d(const std::string& filename);
123 
130 template <>
131 inline P2DImage load_image<P2DImage>(const std::string& filename)
132 {
133  return load_image2d(filename);
134 }
135 
144 bool EXPORT_2D save_image(const std::string& filename, P2DImage image);
145 
153 bool EXPORT_2D save_image(const std::string& filename, C2DImage& image);
154 
155 
167 C2DImageGroupedSeries EXPORT_2D load_image_series(const std::vector<std::string>& filenames,
168  CProgressCallback *cb = NULL);
169 
170 
175 extern EXPORT_2D const char * IDModality;
176 extern EXPORT_2D const char * IDPatientOrientation;
177 extern EXPORT_2D const char * IDPatientPosition;
178 extern EXPORT_2D const char * IDAcquisitionDate;
179 extern EXPORT_2D const char * IDAcquisitionNumber;
180 extern EXPORT_2D const char * IDImageType;
181 extern EXPORT_2D const char * IDInstanceNumber;
182 
183 extern EXPORT_2D const char * IDSeriesNumber;
184 extern EXPORT_2D const char * IDSliceLocation;
185 extern EXPORT_2D const char * IDStudyID;
186 extern EXPORT_2D const char * IDSmallestImagePixelValue;
187 extern EXPORT_2D const char * IDLargestImagePixelValue;
188 extern EXPORT_2D const char * IDProtocolName;
190 
192 
193 #endif