1 #define FREEGLUT_STATIC 14 #include <sys/types.h> 26 #include <GL/freeglut.h> 28 #include "vmtkRender3D.h" 33 GLfloat spin_x=0.0, spin_y=0.0, spin_z=0.0;
34 GLuint VIEWPORT_WIDTH=600, VIEWPORT_HEIGHT=600;
41 volumeRender.
initialize(VIEWPORT_WIDTH, VIEWPORT_HEIGHT);
44 void keyboard(
unsigned char key,
int x,
int y)
81 spin_x = spin_y = spin_z = 0.0;
121 if(threshold<=0){threshold=0;}
129 void reshape(
int w,
int h)
131 volumeRender.
resize(w, h);
134 void drawProxyGeometry()
140 int main(
int argc,
char *argv[])
148 cerr <<
"Usage: " << endl;
149 cerr << argv[0] <<
" inputVolume1 inputVolume2 registeredMatrix" << endl;
155 data1.umax = -pow(2,30);
156 data1.umin = pow(2,30);
158 std::cout << path1 <<
" Cannot be imported!" << std::endl;
164 data2.umax = -pow(2,30);
165 data2.umin = pow(2,30);
167 std::cout << path1 <<
" Cannot be imported!" << std::endl;
176 glutInit(&argc, argv);
177 glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
180 glutCreateWindow(
"VMTK-SPS");
181 std::cout <<
"OpenGL version supported by this platform: " << glGetString(GL_VERSION) << std::endl;
187 glutPositionWindow(10, 10);
188 glutReshapeWindow(VIEWPORT_WIDTH, VIEWPORT_HEIGHT);
190 glutReshapeFunc(reshape);
191 glutDisplayFunc(drawProxyGeometry);
192 glutKeyboardFunc(keyboard);
void render()
renders the data with the specified redering mode.
void initialize(int width, int height)
initializes 3D volume rendering
void resize(int width, int height)
resizes the dimensions of the display
void setThreshold(int threshold)
sets the threshold.
void setBlender(float blender)
sets the blender factor.
void setClipLeftX(float left_x)
sets the clipping plane.
int DICOMImage(std::string &filename, ImgFormat *imgformat)
Destructor.
bool readMatrix(const char *s)
reads the co-register matrix.
void setRotation(float ax, float ay, float az)
sets the rotation matrix.
int getMaxSliceLeft()
gets the maximum number of the slices from the axis X.
void main(void)
Main function.
void setAcquisition(Import::ImgFormat *acq1, Import::ImgFormat *acq2)
sets the volumes to be registered