global_definitions.h

Go to the documentation of this file.
00001 //--------------------------------------------------
00011 //--------------------------------------------------
00012 
00013 #ifndef GLOBAL_DEFINITIONS_H__
00014 #define GLOBAL_DEFINITIONS_H__
00015 
00016 #ifdef WIN32
00017 #pragma warning(disable:4290)
00018 #endif
00019 
00020 //#define DEBUG
00021 
00022 #include <iostream>
00023 #include <string>
00024 #include <vector>
00025 #include <map>
00026 
00027 #include <boost/shared_ptr.hpp>
00028 #include <boost/numeric/ublas/matrix.hpp>
00029 
00030 #define X_DIMENSION 0
00031 #define Y_DIMENSION 1
00032 #define Z_DIMENSION 2
00033 #define DIRECTORY_SEPARATOR '/'
00034   
00035 
00036 
00037 namespace imedgine 
00038 {
00039   //--------------------------------------------------
00041   //--------------------------------------------------
00042   
00043   class Dataset;
00044   class Metadata;
00045 
00046   typedef std::string dataset_key_type;
00047   typedef std::vector<dataset_key_type> dataset_key_container_type;
00048   typedef boost::shared_ptr<Dataset> dataset_pointer_type;
00049   typedef boost::shared_ptr<Metadata> metadata_pointer_type; 
00050   typedef std::map<std::string, metadata_pointer_type> metadata_container_type;
00051   
00052   enum _dataset_type_ {
00053     UNDEF_DATASET,
00054     ONE_BYTE_IMAGE_PIXEL_DATASET,
00055     TWO_BYTE_IMAGE_PIXEL_DATASET,
00056     FOUR_BYTE_IMAGE_PIXEL_DATASET,
00057     ONE_BYTE_VOLUME_PIXEL_DATASET,
00058     TWO_BYTE_VOLUME_PIXEL_DATASET,
00059     FOUR_BYTE_VOLUME_PIXEL_DATASET,
00060     MATRIX_DATASET
00061   };
00062   
00063   typedef enum _dataset_type_ dataset_type;
00064   
00065   enum _dataset_attribute_type_ {
00066     DATASET_ATTRIBUTE_UNSPECIFIED,
00067     DATASET_ATTRIBUTE_DATA,
00068     DATASET_ATTRIBUTE_INTENSITY,
00069     DATASET_ATTRIBUTE_FOCUS_POINT,
00070     DATASET_ATTRIBUTE_TRANSFORMATION,
00071     DATASET_ATTRIBUTE_TRANSLATION
00072   };
00073   
00074   typedef enum _dataset_attribute_type_ dataset_attribute_type;
00075   
00076   typedef unsigned char external_pixel_type;
00077   typedef unsigned char one_byte_pixel_type;
00078   typedef signed short two_byte_pixel_type;
00079   typedef float four_byte_pixel_type;
00080   
00081   typedef external_pixel_type* external_data_pointer_type;
00082   typedef external_pixel_type const* const_external_data_pointer_type;
00083   
00084   //--------------------------------------------------
00087   typedef unsigned int index_type;
00088 
00089   //--------------------------------------------------
00091   typedef std::vector<index_type> dataset_position_type;
00092   
00093   //--------------------------------------------------
00095   typedef boost::numeric::ublas::matrix<double> matrix_type;
00096   
00097   //--------------------------------------------------
00099   typedef boost::numeric::ublas::identity_matrix<double> identity_matrix_type;
00100 
00101   //--------------------------------------------------
00103   typedef std::vector<double> offset_vector_type;
00104   
00105   //--------------------------------------------------
00107   typedef unsigned long size_type;
00108   
00109   //--------------------------------------------------
00111   typedef std::vector<double> spacings_type;
00112   
00113   //--------------------------------------------------
00115   //--------------------------------------------------
00116  
00117   class View;
00118   
00119   //--------------------------------------------------
00121   
00122   typedef boost::shared_ptr<View> view_pointer_type;
00123   
00124   //--------------------------------------------------
00126   
00127   typedef std::vector<unsigned int> view_id_container_type;
00128   
00129   
00130   //--------------------------------------------------
00132   
00133   enum _view_type_ {
00134     UNDEF_VIEW,
00135     VOXEL_VIEW,
00136     IMAGE_PIXEL_VIEW,
00137     XY_SLICE_VIEW, 
00138     XZ_SLICE_VIEW, 
00139     YZ_SLICE_VIEW, 
00140     META_VOLUME_PIXEL_VIEW,
00141   };
00142   
00143   typedef enum _view_type_ view_type;
00144   
00145   //--------------------------------------------------
00147   
00148   enum _slice_type_ {
00149     UNDEF_SLICE,
00150     AXIAL_SLICE,
00151     CORONAL_SLICE,
00152     SAGITTAL_SLICE
00153 
00154   };
00155   
00156   typedef enum _slice_type_ slice_type;
00157 
00158   //--------------------------------------------------
00161   typedef std::vector<float*> region_of_interest_type;  
00162   
00163   //--------------------------------------------------
00165   //--------------------------------------------------
00166   
00167   //--------------------------------------------------
00169   
00170   enum _exception_type_ 
00171   {
00172     UNDEF_EXCEPTION = 0, 
00173     NULL_POINTER_EXCEPTION,
00174     INDEX_OUT_OF_BOUNDS_EXCEPTION,
00175     ALGORITHM_FACTORY_EXCEPTION,
00176     ALGORITHM_NOT_FOUND_EXCEPTION, 
00177     METADATA_NOT_FOUND_EXCEPTION,
00178     DATASET_NOT_FOUND_EXCEPTION,
00179     INVALID_CAST_EXCEPTION,
00180     FORMAT_NOT_SUPPORTED_EXCEPTION
00181   };
00182             
00183   typedef enum _exception_type_ exception_type; 
00184 
00185   //--------------------------------------------------
00187   //--------------------------------------------------
00188   
00189   class ConfigWidget;
00190   class Algorithm;
00191   class Configuration;
00192   
00193   typedef std::multimap<std::string, std::string> algorithm_name_container_type;
00194   typedef ConfigWidget* config_widget_pointer_type; 
00195   typedef boost::shared_ptr<Configuration> configuration_pointer_type;
00196   
00197   //--------------------------------------------------
00199   enum _dataset_part_type_
00200   {
00201     WHOLE_DATASET_PART,
00202     AXIAL_SLICE_PART,
00203     CORONAL_SLICE_PART,
00204     SAGITTAL_SLICE_PART
00205   };
00206   
00207   typedef enum _dataset_part_type_ dataset_part_type;
00208   
00209   //--------------------------------------------------
00212   typedef std::string config_dataset_id_type;
00213   
00214   //--------------------------------------------------
00216   struct InputDatasetAttributes
00217   {
00218     dataset_key_type dataset_key;
00219     dataset_part_type dataset_part;
00220     bool is_in_place;
00221   };
00222   
00223   //--------------------------------------------------
00228   typedef std::map<config_dataset_id_type, InputDatasetAttributes> 
00229       config_dataset_id_to_input_map_type;
00230       
00231   //--------------------------------------------------
00234   typedef std::map<config_dataset_id_type, dataset_type> 
00235       config_dataset_id_to_output_map_type;
00236 
00237   //--------------------------------------------------
00239   //--------------------------------------------------
00240   
00241   enum _gui_interaction_mode_type_
00242   {
00243     STANDARD_MODE = 0,
00244     ZOOM_IN_MODE,
00245     ZOOM_OUT_MODE,
00246     PAN_MODE,
00247     ROTATION_MODE,
00248     REGION_OF_INTEREST_RECTANGLE_MODE,
00249     REGION_OF_INTEREST_ELLIPSE_MODE,
00250     REGION_OF_INTEREST_POLY_LINE_MODE,
00251     REGION_OF_INTEREST_FREEHAND_MODE
00252   };
00253 
00254   typedef enum _gui_interaction_mode_type_ gui_interaction_mode_type;
00255 
00256 }
00257 
00258 #endif // GLOBAL_DEFINITIONS_H__

Generated on Sun Aug 13 18:19:39 2006 for iMEDgine by  doxygen 1.4.6