A.I.M.S


general.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-B license 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-B license 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-B license and that you accept its terms.
32  */
33 
34 /*
35  * General definitions
36  */
37 #ifndef AIMS_DEF_GENERAL_H
38 #define AIMS_DEF_GENERAL_H
39 
41 #include <cartobase/type/types.h>
42 //#include <soma-io/allocator/allocator.h>
43 #include <aims/memmap/allocator.h>
44 
45 namespace aims
46 {
47  std::string aimsVersion();
48 }
49 
50 // ABCD in ASCII
51 #define AIMS_MAGIC_NUMBER 0x41424344
52 
53 // Ignore __attribute__ on non-GCC compilers
54 #if !(defined(__GNUC__) || defined(__attribute__))
55 #define __attribute__(a) /* nothing */
56 #endif
57 
65 {
70 };
71 
72 
77 {
83 };
84 
85 
89 AIMSDATA_API void AimsClear (void);
92 AIMSDATA_API void AimsPrintVersion (void);
94 AIMSDATA_API std::string AimsStringTypeOf(int type);
96 AIMSDATA_API int AimsNCompOf (int type);
98 AIMSDATA_API double AimsMinValOf (int type);
100 AIMSDATA_API double AimsMaxValOf (int type);
102 AIMSDATA_API bool AimsIsSignedType (int type);
104 AIMSDATA_API bool AimsIsComplexType(int type);
106 
107 
108 
111 AIMSDATA_API void AimsScanNflush(char **str,char *strRef);
114 AIMSDATA_API void AimsError(const std::string& message) __attribute__((__noreturn__));
116 AIMSDATA_API void AimsWarning(const std::string& message);
118 
119 
120 
125 AIMSDATA_API int AimsSpaceLevelOf (const std::string& filename);
127 AIMSDATA_API int AimsFileDimXOf (const std::string& filename);
129 AIMSDATA_API int AimsFileDimYOf (const std::string& filename);
131 AIMSDATA_API int AimsFileDimZOf (const std::string& filename);
133 AIMSDATA_API int AimsFileDimTOf (const std::string& filename);
135 AIMSDATA_API bool AimsIsComplexData (const std::string& filename);
137 AIMSDATA_API bool AimsIsPoint2dData (const std::string& filename);
139 AIMSDATA_API bool AimsIsPoint3dData (const std::string& filename);
141 
142 
143 #endif
144 
145 // mode:C++
AIMSDATA_API int AimsFileDimZOf(const std::string &filename)
Return the Z dimension of a text file.
AIMSDATA_API int AimsSpaceLevelOf(const std::string &filename)
Return the dimemsion of the space data (1D, 2D, 3D or 4D)
AimsBasicType
The 5 basic types of data.
Definition: general.h:76
Mathematical formalism.
Definition: general.h:67
AIMSDATA_API int AimsFileDimXOf(const std::string &filename)
Return the X dimension of a text file.
AIMSDATA_API void AimsPrintVersion(void)
Print A.I.M.S. version.
AIMSDATA_API bool AimsIsPoint3dData(const std::string &filename)
Return true if the file contains 3D point data.
AimsDisplayFormalism
Display formalism.
Definition: general.h:64
#define AIMSDATA_API
AIMSDATA_API bool AimsIsPoint2dData(const std::string &filename)
Return true if the file contains 2D point data.
AIMSDATA_API std::string AimsStringTypeOf(int type)
Send a string containing AIMS_XXXX.
AIMSDATA_API bool AimsIsComplexType(int type)
Return True if AIMS_XXXX is complex.
AIMSDATA_API int AimsNCompOf(int type)
Return the number of components of AIMS_XXXX.
AIMSDATA_API int AimsFileDimYOf(const std::string &filename)
Return the Y dimension of a text file.
Image formalism.
Definition: general.h:69
AIMSDATA_API void AimsClear(void)
Clear the screen.
AIMSDATA_API double AimsMaxValOf(int type)
Return the maximum value of a AIMS_XXXX data.
AIMSDATA_API double AimsMinValOf(int type)
Return the minimum value of a AIMS_XXXX data.
AIMSDATA_API bool AimsIsScientificNumberChar(int c)
std::string aimsVersion()
AIMSDATA_API bool AimsIsSignedType(int type)
Return True if AIMS_XXXX is signed.
AIMSDATA_API void AimsWarning(const std::string &message)
Give a warning message on display.
AIMSDATA_API void AimsError(const std::string &message) __attribute__((__noreturn__))
Give an error message on display.
#define __attribute__(a)
AIMSDATA_API bool AimsIsComplexData(const std::string &filename)
Return true if the file contains complex data.
AIMSDATA_API void AimsScanNflush(char **str, char *strRef)
Read the next word from *str, put it in strRef and move *str behind the word.
AIMSDATA_API int AimsFileDimTOf(const std::string &filename)
Return the T dimension of a text file.