OpenWalnut  1.4.0
WDataHandlerEnums.h
00001 //---------------------------------------------------------------------------
00002 //
00003 // Project: OpenWalnut ( http://www.openwalnut.org )
00004 //
00005 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
00006 // For more information see http://www.openwalnut.org/copying
00007 //
00008 // This file is part of OpenWalnut.
00009 //
00010 // OpenWalnut is free software: you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as published by
00012 // the Free Software Foundation, either version 3 of the License, or
00013 // (at your option) any later version.
00014 //
00015 // OpenWalnut is distributed in the hope that it will be useful,
00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018 // GNU Lesser General Public License for more details.
00019 //
00020 // You should have received a copy of the GNU Lesser General Public License
00021 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
00022 //
00023 //---------------------------------------------------------------------------
00024 
00025 #ifndef WDATAHANDLERENUMS_H
00026 #define WDATAHANDLERENUMS_H
00027 
00028 #include <stdint.h>
00029 
00030 /**
00031  *  Data types and number values taken from the nifti1.h, at this point it's unknown if it makes sense
00032  *  to keep the bit coding, but it doesn't hurt either
00033  * \ingroup dataHandler
00034  */
00035 enum dataType
00036 {
00037     W_DT_NONE            =        0,
00038     W_DT_UNKNOWN         =        0,     /* what it says, dude           */
00039     W_DT_BINARY          =        1,     /* binary (1 bit/voxel)         */
00040     W_DT_UNSIGNED_CHAR   =        2,     /* unsigned char (8 bits/voxel) */
00041     W_DT_SIGNED_SHORT    =        4,     /* signed short (16 bits/voxel) */
00042     W_DT_SIGNED_INT      =        8,     /* signed int (32 bits/voxel)   */
00043     W_DT_FLOAT           =       16,     /* float (32 bits/voxel)        */
00044     W_DT_COMPLEX         =       32,     /* complex (64 bits/voxel)      */
00045     W_DT_DOUBLE          =       64,     /* double (64 bits/voxel)       */
00046     W_DT_RGB             =      128,     /* RGB triple (24 bits/voxel)   */
00047     W_DT_ALL             =      255,     /* not very useful (?)          */
00048     W_DT_INT8            =      256,     /* signed char (8 bits)         */
00049     W_DT_UINT16          =      512,     /* unsigned short (16 bits)     */
00050     W_DT_UINT8           =        2,     /* alias for unsigned char (8 bits/voxel) */
00051     W_DT_INT16           =        4,     /* unsigned short (16 bits) alias name for W_DT_SIGNED_SHORT */
00052     W_DT_UINT32          =      768,     /* unsigned int (32 bits)       */
00053     W_DT_INT64           =     1024,     /* long long (64 bits)          */
00054     W_DT_UINT64          =     1280,     /* unsigned long long (64 bits) */
00055     W_DT_FLOAT128        =     1536,     /* long double (128 bits)       */
00056     W_DT_COMPLEX128      =     1792,     /* double pair (128 bits)       */
00057     W_DT_COMPLEX256      =     2048,     /* long double pair (256 bits)  */
00058     W_DT_RGBA32          =     2304      /* 4 byte RGBA (32 bits/voxel)  */
00059 };
00060 
00061 /**
00062  * An object that knows an appropriate dataType flag for the typename T.
00063  */
00064 template< typename T >
00065 struct DataType
00066 {
00067 };
00068 
00069 /**
00070  * Convert a runtime type to a C++ type
00071  *
00072  * \tparam rtType the runtime type
00073  */
00074 template< int rtType >
00075 struct DataTypeRT
00076 {
00077 };
00078 
00079 /**
00080  * Specialization for a specific datatype.
00081  */
00082 template<>
00083 struct DataType< int8_t >
00084 {
00085     //! the dataType flag
00086     static dataType const type = W_DT_INT8;
00087 };
00088 
00089 /**
00090  * Specialization for a specific type
00091  */
00092 template<>
00093 struct DataTypeRT< W_DT_INT8 >
00094 {
00095     //! correct C++ type for this runtime type
00096     typedef int8_t type;
00097 };
00098 
00099 /**
00100  * Specialization for a specific datatype.
00101  */
00102 template<>
00103 struct DataType< uint8_t >
00104 {
00105     //! the dataType flag
00106     static dataType const type = W_DT_UINT8;
00107 };
00108 
00109 /**
00110  * Specialization for a specific type
00111  */
00112 template<>
00113 struct DataTypeRT< W_DT_UINT8 >
00114 {
00115     //! correct C++ type for this runtime type
00116     typedef uint8_t type;
00117 };
00118 
00119 /**
00120  * Specialization for a specific datatype.
00121  */
00122 template<>
00123 struct DataType< int16_t >
00124 {
00125     //! the dataType flag
00126     static dataType const type = W_DT_INT16;
00127 };
00128 
00129 /**
00130  * Specialization for a specific type
00131  */
00132 template<>
00133 struct DataTypeRT< W_DT_INT16 >
00134 {
00135     //! correct C++ type for this runtime type
00136     typedef int16_t type;
00137 };
00138 
00139 /**
00140  * Specialization for a specific datatype.
00141  */
00142 template<>
00143 struct DataType< uint16_t >
00144 {
00145     //! the dataType flag
00146     static dataType const type = W_DT_UINT16;
00147 };
00148 
00149 /**
00150  * Specialization for a specific type
00151  */
00152 template<>
00153 struct DataTypeRT< W_DT_UINT16 >
00154 {
00155     //! correct C++ type for this runtime type
00156     typedef uint16_t type;
00157 };
00158 
00159 /**
00160  * Specialization for a specific datatype.
00161  */
00162 template<>
00163 struct DataType< int32_t >
00164 {
00165     //! the dataType flag
00166     static dataType const type = W_DT_SIGNED_INT;
00167 };
00168 
00169 /**
00170  * Specialization for a specific type
00171  */
00172 template<>
00173 struct DataTypeRT< W_DT_SIGNED_INT >
00174 {
00175     //! correct C++ type for this runtime type
00176     typedef int32_t type;
00177 };
00178 
00179 /**
00180  * Specialization for a specific datatype.
00181  */
00182 template<>
00183 struct DataType< uint32_t >
00184 {
00185     //! the dataType flag
00186     static dataType const type = W_DT_UINT32;
00187 };
00188 
00189 /**
00190  * Specialization for a specific type
00191  */
00192 template<>
00193 struct DataTypeRT< W_DT_UINT32 >
00194 {
00195     //! correct C++ type for this runtime type
00196     typedef uint32_t type;
00197 };
00198 
00199 /**
00200  * Specialization for a specific datatype.
00201  */
00202 template<>
00203 struct DataType< int64_t >
00204 {
00205     //! the dataType flag
00206     static dataType const type = W_DT_INT64;
00207 };
00208 
00209 /**
00210  * Specialization for a specific type
00211  */
00212 template<>
00213 struct DataTypeRT< W_DT_INT64 >
00214 {
00215     //! correct C++ type for this runtime type
00216     typedef int64_t type;
00217 };
00218 
00219 /**
00220  * Specialization for a specific datatype.
00221  */
00222 template<>
00223 struct DataType< uint64_t >
00224 {
00225     //! the dataType flag
00226     static dataType const type = W_DT_UINT64;
00227 };
00228 
00229 /**
00230  * Specialization for a specific type
00231  */
00232 template<>
00233 struct DataTypeRT< W_DT_UINT64 >
00234 {
00235     //! correct C++ type for this runtime type
00236     typedef uint64_t type;
00237 };
00238 
00239 /**
00240  * Specialization for a specific datatype.
00241  */
00242 template<>
00243 struct DataType< float >
00244 {
00245     //! the dataType flag
00246     static dataType const type = W_DT_FLOAT;
00247 };
00248 
00249 /**
00250  * Specialization for a specific type
00251  */
00252 template<>
00253 struct DataTypeRT< W_DT_FLOAT >
00254 {
00255     //! correct C++ type for this runtime type
00256     typedef float type;
00257 };
00258 
00259 /**
00260  * Specialization for a specific datatype.
00261  */
00262 template<>
00263 struct DataType< double >
00264 {
00265     //! the dataType flag
00266     static dataType const type = W_DT_DOUBLE;
00267 };
00268 
00269 /**
00270  * Specialization for a specific type
00271  */
00272 template<>
00273 struct DataTypeRT< W_DT_DOUBLE >
00274 {
00275     //! correct C++ type for this runtime type
00276     typedef double type;
00277 };
00278 
00279 /**
00280  * Specialization for a specific datatype.
00281  */
00282 template<>
00283 struct DataType< long double >
00284 {
00285     //! the dataType flag
00286     static dataType const type = W_DT_FLOAT128;
00287 };
00288 
00289 /**
00290  * Specialization for a specific type
00291  */
00292 template<>
00293 struct DataTypeRT< W_DT_FLOAT128 >
00294 {
00295     //! correct C++ type for this runtime type
00296     typedef long double type;
00297 };
00298 
00299 enum qformOrientation
00300 {
00301     Left_to_Right,
00302     Posterior_to_Anterior,
00303     Inferior_to_Superior
00304 };
00305 
00306 /**
00307  *  Data set types. Not complete! Only those used for distinctions so far.
00308  * \ingroup dataHandler
00309  */
00310 enum DataSetType
00311 {
00312     W_DATASET_NONE               =        0,
00313     W_DATASET_SINGLE             =        1,
00314     W_DATASET_SPHERICALHARMONICS =        2
00315 };
00316 
00317 /**
00318  * \defgroup dataHandler Data Handler
00319  *
00320  * \brief
00321  * This library implements the data storage facility of OpenWalnut.
00322  */
00323 #endif  // WDATAHANDLERENUMS_H