00001 #ifndef GLWIDGET_H
00002 #define GLWIDGET_H
00003
00004 #include "VolumeBuffer.h"
00005 #include "VolumeRender.h"
00006
00007 #include <QGLWidget>
00008 #include <QProgressBar>
00009 #include <QThread>
00010 #include <QProcess>
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #define PROCESS_FIELD_SIZE 10
00033
00034 class vrGLWidget : public QGLWidget
00035 {
00036 Q_OBJECT
00037
00038 public:
00039 vrGLWidget(QWidget *parent = 0);
00040 ~vrGLWidget();
00041
00042 QSize minimumSizeHint() const;
00043 QSize sizeHint() const;
00044
00045 void setVolumeRender(VolumeRender *volume_render) { m_vr = volume_render; }
00046
00047 public slots:
00048 void setSampling(int x);
00049 void loadData();
00050 void setTFtexture(QImage &tfimg);
00051 void updateHistogram();
00052
00053 void computeScaleSpaceData(QList<QString> &threshold,QList<QString> &scales_values,int hw_optimization);
00054 void convertToFloat();
00055 void computeThreshold();
00056 void computeScaleSpaceVesselness();
00057 void ScaleDone();
00058 void mergeAndUpScale();
00059 void mergeFiles();
00060 void destroyTemporaryFiles();
00061
00062 signals:
00063 void samplingChanged(int angle);
00064 void histogramChanged(QList<int> &histogram_list);
00065 void scaleSpaceComputationProgress();
00066
00067 protected:
00068 void initializeGL();
00069 void paintGL();
00070 void resizeGL(int width, int height);
00071 void mousePressEvent(QMouseEvent *event);
00072 void mouseMoveEvent(QMouseEvent *event);
00073
00074 private:
00075 void rotateBy(int xAngle, int yAngle, int zAngle);
00076 void loadMHDFile(QString fileName);
00077 void loadf3dFile(QString fileName);
00078
00079 void computeVesselness(int f3dprocess_id, QString filter_width);
00080 void ConvertToChar();
00081
00082 GLuint object;
00083 int xRot;
00084 int yRot;
00085 int zRot;
00086 QPoint lastPos;
00087 QColor trolltechGreen;
00088 QColor trolltechPurple;
00089
00090 VolumeRender *m_vr;
00091 VolumeBuffer *m_vb;
00092
00093
00094 QImage m_tfimg;
00095 unsigned char* m_tf_texture;
00096
00097
00098
00099 QList<QString> m_threshold;
00100 QList<QString> m_scales_values;
00101 int m_hw_optimization;
00102
00103
00104
00105
00106
00107
00108
00109 QProcess *m_f3d2f3d_thld;
00110 QProcess *m_f3dthreshold;
00111 QString m_f3d2f3d_thld_filename;
00112 QString m_threshold_filename;
00113
00114 QProcess *m_f3d2f3d_char;
00115
00116 QString m_f3dmerge_filename;
00117
00118 QProcess *m_f3dmerge_upscale;
00119 QProcess *m_f3dmerge;
00120
00121
00122 QProcess *m_del_process;
00123
00124 QList<QProcess *> m_f3d2f3d_process_list;
00125 QList<QProcess *> m_f3dgauss_process_list;
00126 QList<QProcess *> m_f3dhess_process_list;
00127
00128 QList<QString> m_scale_filenames;
00129 QList<QString> m_files_to_upscale;
00130 QList<QString> m_files_to_merge;
00131
00132 QList<QString> m_temporary_files;
00133
00134 int m_scales_computed;
00135 int m_scale_last_offset;
00136 int m_scale_step;
00137
00138 int m_files_upscaled;
00139 };
00140
00141 #endif