aimsgui  5.1.2
qtformatsheader.h
Go to the documentation of this file.
1 /* This software and supporting documentation are distributed by
2  * Institut Federatif de Recherche 49
3  * CEA/NeuroSpin, Batiment 145,
4  * 91191 Gif-sur-Yvette cedex
5  * France
6  *
7  * This software is governed by the CeCILL license version 2 under
8  * French law and abiding by the rules of distribution of free software.
9  * You can use, modify and/or redistribute the software under the
10  * terms of the CeCILL license version 2 as circulated by CEA, CNRS
11  * and INRIA at the following URL "http://www.cecill.info".
12  *
13  * As a counterpart to the access to the source code and rights to copy,
14  * modify and redistribute granted by the license, users are provided only
15  * with a limited warranty and the software's author, the holder of the
16  * economic rights, and the successive licensors have only limited
17  * liability.
18  *
19  * In this respect, the user's attention is drawn to the risks associated
20  * with loading, using, modifying and/or developing or reproducing the
21  * software by the user in light of its specific status of free software,
22  * that may mean that it is complicated to manipulate, and that also
23  * therefore means that it is reserved for developers and experienced
24  * professionals having in-depth computer knowledge. Users are therefore
25  * encouraged to load and test the software's suitability as regards their
26  * requirements in conditions enabling the security of their systems and/or
27  * data to be ensured and, more generally, to use and operate it in the
28  * same conditions as regards security.
29  *
30  * The fact that you are presently reading this means that you have had
31  * knowledge of the CeCILL license version 2 and that you accept its terms.
32  */
33 
34 #ifndef AIMS_IO_QTFORMATSHEADER_H
35 #define AIMS_IO_QTFORMATSHEADER_H
36 
38 #include <aims/def/general.h>
39 #include <string>
40 #include <vector>
41 
42 class QImage;
43 
44 namespace carto
45 {
46  class Mutex;
47 }
48 
49 namespace aims
50 {
51  template<typename T> class QtFormatsReader;
52 
57  {
58  public:
59  QtFormatsHeader( const std::string& name,
60  const std::string& type="UNKNOWN",
61  int x=1, int y=1, int z=1, int t=1,
62  float sx=1, float sy=1, float sz=1, float st=1 );
63  virtual ~QtFormatsHeader();
64 
65  int dimX() const { return _dimX; }
66  int dimY() const { return _dimY; }
67  int dimZ() const { return _dimZ; }
68  int dimT() const { return _dimT; }
69 
70  float sizeX() const { return _sizeX; }
71  float sizeY() const { return _sizeY; }
72  float sizeZ() const { return _sizeZ; }
73  float sizeT() const { return _sizeT; }
74 
76  std::string dataType() const { return _type; }
77  void setType( const std::string & t );
79  std::string name() const { return _name; }
80  std::vector<std::string> possibleDataTypes() const;
81 
82  virtual std::string extension() const;
83  virtual std::set<std::string> extensions() const;
84 
85  virtual void read();
86  void reset();
87  bool hasRead() const;
88  virtual std::string removeExtension( const std::string & ) const;
90 
91  private:
92  template<typename T> friend class QtFormatsReader;
93  struct Private;
94 
95  std::string _type;
96  int _dimX;
97  int _dimY;
98  int _dimZ;
99  int _dimT;
100  float _sizeX;
101  float _sizeY;
102  float _sizeZ;
103  float _sizeT;
104  Private *d;
105 
106  QImage & qimage();
107  };
108 
109 }
110 
111 #endif
112 
The descriptor class of the .dim GIS header.
void setType(const std::string &t)
bool hasRead() const
static carto::Mutex & qformatsMutex()
virtual ~QtFormatsHeader()
virtual std::string removeExtension(const std::string &) const
std::vector< std::string > possibleDataTypes() const
virtual std::set< std::string > extensions() const
std::string dataType() const
Get type of items ("U08", "S08", "U16", "S16", ...)
QtFormatsHeader(const std::string &name, const std::string &type="UNKNOWN", int x=1, int y=1, int z=1, int t=1, float sx=1, float sy=1, float sz=1, float st=1)
virtual void read()
virtual std::string extension() const
std::string name() const
Get the file name of the header.
virtual std::string type() const