00001 /*========================================================================= 00002 00003 Program: 3DMed 00004 Date: $Date: 2014-02-25 18:30:00 +0800 $ 00005 Version: $Version: 4.6.0 $ 00006 Copyright: MIPG, Institute of Automation, Chinese Academy of Sciences 00007 00008 =========================================================================*/ 00009 00010 00011 #ifndef __mitkFBFBPReconCFGPU_h 00012 #define __mitkFBFBPReconCFGPU_h 00013 00014 00015 #include "mitkFanBeamReconFromCirle.h" 00016 #include "mitk2DBeamPD.h" 00017 #include "mitkReconstructionCGIncludes.h" 00018 00019 00020 //BP////////////////////////////////////////////////////////////////////////// 00021 #include "mitkBackProjectionUsingGPU.h" 00022 00023 /* 00024 #include <GL/glew.h> 00025 #include <GL/glut.h> 00026 #include <Cg/cgGL.h> 00027 00028 #define BLOCKNUM 7 00029 #define FANWINDOWSIZE 7 00030 00031 00032 00033 00034 00035 */ 00037 00044 00045 00046 class MITK_RECONSTRUCTION_CG_API mitkFBFBPReconCFGPU : public mitkFanBeamReconFromCirle 00047 { 00048 public: 00049 template<class Ty> friend int t_ExecuteFBFBPReconCFGPU(mitk2DBeamPD *input,mitkVolume *outdata,mitkFBFBPReconCFGPU *self, Ty *a); 00050 00051 MITK_TYPE(mitkFBFBPReconCFGPU , mitkFanBeamReconFromCirle) 00052 00053 virtual void PrintSelf(ostream& os); 00054 00055 mitkFBFBPReconCFGPU(); 00056 00057 protected: 00058 00059 virtual ~mitkFBFBPReconCFGPU(); 00060 00061 virtual bool Execute(); 00062 00063 private: 00064 mitkFBFBPReconCFGPU(const mitkFBFBPReconCFGPU &); 00065 //BP////////////////////////////////////////////////////////////////////////// 00066 /* 00067 void initWindow(); 00068 00069 void initFBO(); 00070 00071 void initCG(); 00072 00073 void CheckForCgError(const char *situation); 00074 00075 bool CreateTexture(); 00076 00077 void AttachFBO(); 00078 00079 void InputPrjectData(float *data); 00080 00081 void ReadData(int slice, float *out); 00082 00083 void SetTexMatrix(float angle); 00084 00085 void EnableFshader(); 00086 00087 void EnableVshader(); 00088 00089 void DrawQuad(int h); 00090 00091 void SetDtheta(float m) {dthetaDegree = m;} 00092 00093 void SetFrustum(float zn,float zf,float zc, float detectorLength); 00094 00095 void DestroyAll(); 00096 */ 00098 00099 00101 // for temp use 00103 00104 00105 // BP///////////////////////////////////////////////////////////////////// 00106 00107 private: 00108 00109 /* struct TexParam 00110 { 00111 const char *name; 00112 int unit; 00113 int target; 00114 int tex; 00115 }; 00116 std::vector<TexParam> m_texParams; 00117 00118 float dthetaDegree; 00119 float zNear; 00120 float zFar; //L 00121 float zCenter; //D 00122 float nearDetectorLengthX; 00123 GLfloat frustum[16]; 00124 00125 GLuint windowHandle; 00126 CGcontext cgContext; 00127 CGprofile fProfile ,vProfile; 00128 CGprogram fProgram ,vProgram; 00129 CGparameter mvpMatrixParam,preResultTexParam, 00130 texMatrixParam[BLOCKNUM]; 00131 00132 GLuint *projectDataID, fbotex, *ResultID; 00133 GLuint fb; 00134 GLint m_preFboId; 00135 00136 void _bindCurrentFBO(); 00137 void _unBind(); 00138 void _scanTexParams(CGprogram m_prog); 00139 void _setTexture(char *name, GLuint tex); 00140 void _bindTextures(); 00142 */ 00143 00144 void operator = (const mitkFBFBPReconCFGPU&); 00145 00146 }; 00147 00148 //#define DEFINED_mitkFBFBPReconCFGPU 00149 00150 00151 #endif 00152