Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

vpvolume.h

Go to the documentation of this file.
00001 //deprecated
00003 //
00004 //  PROJECT.....: vpat - Creating Virtual Patients
00005 //  RESPONSIBLE.: Carla Freitas e Luciana Nedel
00006 //
00007 //  FILE........: vpvolume.h
00008 //  DESCRIPTION.: Contain the VPVolume class hierarchy declarations.
00009 //
00010 //  AUTHOR......: Isabel Harb Manssour
00011 //  DATE........: December/04/2000
00012 //  DESCRIPTION.: Class declarations.
00013 //
00014 //  AUTHOR......: Isabel Harb Manssour
00015 //  DATE........: June/04/2001
00016 //  DESCRIPTION.: New constants, attributes (view dimension, 
00017 //                activeCamera) and methods inclusion.
00018 //
00019 //  AUTHOR......: Isabel Harb Manssour
00020 //  DATE........: July/09/2001
00021 //  DESCRIPTION.: New structs, attributes and methods inclusion,
00022 //                due to Gouraud shading implementation.
00023 //
00025 
00026 
00027 #ifndef __VPVOLUME_H
00028 #define __VPVOLUME_H
00029 
00030 
00031 #include    <vpimage.h>
00032 #include    <vpslice.h>
00033 #include    <vptable.h>
00034 #include    <vpraycasting.h>
00035 
00036 
00037 // To foresee several "includes"
00038 #ifndef __GL_STUFF
00039 #define __GL_STUFF  
00040 #include <FL/Fl_Gl_Window.h> 
00041 #include <FL/gl.h>
00042 #include <GL/glu.h>
00043 #endif  // __GL_STUFF
00044 
00045 
00046 // File contents constants
00047 #define     NONE            1001
00048 #define     ARQCT           1002
00049 #define     ARQMRI          1003
00050 #define     ARQPET          1004
00051 #define     ARQSPECT        1005
00052 
00053 
00054 // Type of opacity computation
00055 #define     LINEAROPAC      100
00056 #define     TABLEOPAC       101
00057 #define     GRADIENTOPAC    102
00058 
00059 
00060 // Shading methods
00061 #define     LOCALSHADING    200
00062 #define     GOURAUDSHADING  201
00063 #define     PHONGSHADING    202
00064 
00065 
00066 // Auxiliary constants
00067 #define     red         0
00068 #define     green       1
00069 #define     blue        2
00070 
00071 
00072 // Another constants and structs to read .vol volumes
00073 #define C_VR_MAGIC_NUMBER_OLD           192837465
00074 #define C_VR_MAGIC_NUMBER               192837466
00075 #define C_MANUFACTURER_STRING_LENGTH    20
00076 #define C_ORIG_FILENAME_STRING_LENGTH   128
00077 #define C_UNSIGNED_BYTE                 1001
00078 #define C_UNSIGNED_SHORT                1002
00079 #define C_INTENSITY8                    2001
00080 #define C_INTENSITY16                   2002
00081 #define C_INDEX4_INTENSITY12            2003
00082 #define C_INDEX8_INTENSITY8             2004
00083 
00084 typedef struct {
00085     int x;
00086     int y;
00087     int z;
00088 }xyz;
00089 typedef unsigned short int  sword;
00090 
00091 
00092 // Structs to store volume gradients
00093 typedef struct {
00094     unsigned char x;
00095     unsigned char y;
00096     unsigned char z;
00097 }xyzc;
00098 
00099 
00100 //-----------------------------------------------------------------
00101 // V P V O L U M E
00102 //-----------------------------------------------------------------
00103 
00104 
00106 // Class Name: VPVolume
00107 // Superclass: VPImage
00108 // Subclasses: -
00110 
00111 class VPVolume : public VPImage{
00112 
00113     private:
00114         int visualizationType;
00115         int opacityComputation;
00116         int fileType;
00117         int zDimension;
00118         int fileBits;       // number of bits read from the file
00119         int topSlice;       // axial slice
00120         int sideSlice;      // sagittal slice
00121         int frontSlice;     // coronal slice
00122         unsigned int **grayImage;   // \ load gray level image that will be
00123                                     // / generated by the visualization algorithm
00124         unsigned int ***colorImage; // \ load color level image that will be
00125                                     // / generated by the visualization algorithm
00126         unsigned int maxVolumeColor;    // highest volume density value
00127         unsigned int minVolumeColor;    // smallest volume density value
00128         unsigned int ***volumeMatrix;   // to store volume data
00129         unsigned int ***volumeMatrix2;  // to store volume data
00130         unsigned char ***volumeLightedMatrix;   // to store light volume information
00131         VPPoint3D scale;                // Volume scale (e.g. for slices adjustment)
00132         VPPoint3D centerFocalPoint;     // Volume center focal point
00133         VPTable controlTables;          // Opacity and Color Table
00134         VPCamera *activeCamera;         // to set VPScene active camera, which is determined by the view
00135         VPRayCasting rayCasting;        // volume visualization algorithms
00136         VPSlice slice;                  // slice visualization algorithms
00137         bool allocMemory();             // allocates the volume data matrix
00138         bool allocMemory2();                // allocates the volume data matrix
00139         VPPoint3D cameraLocationForInnerStructure;
00140     public:
00141         VPVolume(); 
00142         VPVolume (const char *n, int t, int dh, int dv, int s, int b);
00143         ~VPVolume();
00144         void  vpReadRawFile(const char *n);
00145         void  vpReadIFile(const char *n, char *p);
00146         void  vpReadVolFile(const char *n);
00147         float vpGetLightValue(int i, int j, int k);
00148         unsigned int vpGetValue(int i, int j, int k);
00149         inline int   vpGetZDimension() {    return zDimension; }
00150         void  vpRender();
00151         void  vpAllocateGrayImage(int h, int w);
00152         void  vpAllocateColorImage(int h, int w);
00153         void  vpProcessLightedVolume(VPVector3D ld, float al);
00154         VPVector3D   vpGetSobelGradient(int i, int j, int k);
00155         VPVector3D   vpGetLinearGradientEstimation(int i, int j, int k);
00156         VPVector3D   vpGetCentralDifferenceGradient(int i, int j, int k);
00157         void  vpSetSliceTopCamera();
00158         void  vpSetSliceFrontCamera();
00159         void  vpSetSliceSideCamera();
00160         void  vpDisplayGray();
00161         void  vpDisplayColor();
00162         void  vpRotate();
00163         void  vpTranslate(VPPoint3D t);
00164         void  vpScale(VPPoint3D s);
00165         void  vpSetVisualizationType(int vp);
00166         int   vpGetVisualizationType();
00167         void  vpSetTopSlice(int v);
00168         int   vpGetTopSlice();
00169         void  vpSetSideSlice(int v);
00170         int   vpGetSideSlice();
00171         void  vpSetFrontSlice(int v);
00172         int   vpGetFrontSlice();
00173         void  vpSetActiveCamera(VPCamera *c);
00174         void  vpSetRayCastingSBand(VPPoint3D sb, int vt);
00175         int   vpGetRayCastingSBand();
00176         void  vpSetRayCastingTBand(VPPoint3D tb, int vt);
00177         int   vpGetRayCastingTBand();
00178         void  vpSetRayCastingSampleStep(float s);
00179         float vpGetRayCastingSampleStep();
00180         void  vpSetRayCastingAmbientLight(float a);
00181         float vpGetRayCastingAmbientLight();
00182         void  vpSetRayCastingDiffuseLight(float d);
00183         float vpGetRayCastingDiffuseLight();
00184         void  vpSetRayCastingSpecularExponent(int s);
00185         int   vpGetRayCastingSpecularExponent();
00186         void  vpSetRayCastingSpecular(bool s);
00187         bool  vpGetRayCastingSpecular();
00188         void  vpSetRayCastingShadingMethod(int sm);
00189         int   vpGetRayCastingShadingMethod();
00190         void  vpSetRayCastingTypeOfCuttingTool(int t);
00191         int   vpGetRayCastingTypeOfCuttingTool();
00192         void  vpSetOpacityComputation(int oc);
00193         int   vpGetOpacityComputation();
00194         void  vpSetOpacityTable(float t[]);
00195         float * vpGetOpacityTable();
00196         void  vpSetColorTable(VPColor c[]);
00197         VPColor       * vpGetColorTable();
00198         void  vpSetControlPoints (int cp[], int n);
00199         void  vpGetControlPoints(int cp[], int &n);
00200         void  vpSetControlPoints (int cp[], VPColor c[], int n);
00201         void  vpGetControlPoints(int cp[], VPColor c[],int &n);
00202         void  vpProcessHistogram();
00203         void  vpProcessCenterFocalPoint();
00204         VPPoint3D    vpGetCenterFocalPoint();
00205         unsigned int vpGetMinVolumeColor();
00206         unsigned int vpGetMaxVolumeColor();
00207         VPTable      vpGetControlTables();
00208         GLvoid       vpSwapBytes(GLint *intPtr, int sizeBytes);
00209         void      vpAdjustScale(int x, int y, int z);
00210         VPPoint3D vpGetScale();
00211         VPPoint2D vpGetSliceViewSBandPoint();
00212         VPPoint2D vpGetSliceViewTBandPoint();
00213         int       vpGetFileType();
00214         void      vpSetCameraLocationForInnerStructure(VPPoint3D c);
00215         VPPoint3D vpGetCameraLocationForInnerStructure();
00216 };
00217 
00218 
00219 
00220 #endif  // __VPVOLUME_H

Generated on Tue Sep 6 10:00:08 2005 for VPAT by  doxygen 1.4.4