Go to the documentation of this file.00001
00022 #ifndef DGVVOLUMEPLOTVTK_H
00023 #define DGVVOLUMEPLOTVTK_H
00024
00025 #include <QtGui/QtGui>
00026
00027 #include "QVTKWidget.h"
00028 #include "vtkAlgorithmOutput.h"
00029 #include "vtkPiecewiseFunction.h"
00030 #include "vtkColorTransferFunction.h"
00031 #include "vtkVolumeProperty.h"
00032 #include "vtkFixedPointVolumeRayCastMapper.h"
00033 #include "vtkVolumeRayCastMapper.h"
00034 #include "vtkVolumeRayCastCompositeFunction.h"
00035 #include "vtkVolume.h"
00036 #include "vtkCubeAxesActor2D.h"
00037 #include "vtkRenderer.h"
00038 #include "vtkRenderWindow.h"
00039
00040 #include "DGVAliases.h"
00041 #include "DGVBlitzArrayCasterVTK.h"
00042 #include "DGVSurfacePlotVTK.h"
00043
00074 class DGV_VTK_EXPORT DGVVolumePlotVTK : public QVTKWidget
00075 {
00076 Q_OBJECT
00077
00078 public:
00083 DGVVolumePlotVTK(QWidget *parent = 0);
00088 virtual ~DGVVolumePlotVTK();
00089
00094 void setName(QString filename);
00099 void setData(Array<imageType,3> &data);
00106 void setData(Array<complex<imageType>,3> &data);
00111 void setData(vtkImageData *data);
00116 void SetInputConnection(vtkAlgorithmOutput *data);
00117
00122 void generatePlot();
00127 void generateAxes();
00128
00134 inline void unsignedCharModeOn()
00135 { unsignedCharMode = true; }
00140 inline void unsignedCharModeOff()
00141 { unsignedCharMode = false; }
00146 void setXLabel(QString text);
00151 void setYLabel(QString text);
00156 void setZLabel(QString text);
00161 void setBackground(double r, double g, double b);
00166 void setAxesAsClosestTriad();
00171 void setAxesAsOuterEdges();
00172
00177 bool saveVTI(const QString filename);
00182 bool saveVTK(const QString filename);
00183
00188 QString strippedName();
00193 QString strippedNamePrefix();
00198 inline Array<imageType,3>& data()
00199 { return plotArray; }
00200
00201 public slots:
00206 void scanVolume();
00211 void xLabel();
00216 void yLabel();
00221 void zLabel();
00226 void opacity();
00231 void background();
00236 void axesProperties();
00241 void toggleAxesAsClosestTriad();
00246 void toggleAntiAliasing();
00251 void save();
00256 void renameData();
00257
00258 signals:
00263 void surfacePlotAvailable(DGVSurfacePlotVTK *);
00264
00265 protected:
00266 bool loaded;
00267 bool externalData;
00268 bool mapper;
00269 bool generated;
00270 bool axisGenerated;
00271 bool closestTriad;
00272 bool antiAliasing;
00273 bool imageDataSource;
00274 QString name;
00275
00276 bool unsignedCharMode;
00277
00279 QMenu *contextMenu;
00280 QAction *surfaceAct;
00281
00282 QAction *xLabelAct;
00283 QAction *yLabelAct;
00284 QAction *zLabelAct;
00285 QAction *opacityAct;
00286 QAction *backgroundAct;
00287 QAction *axesAct;
00288 QAction *triadAct;
00289 QAction *antiAliasingAct;
00290
00291 QAction *saveAct;
00292 QAction *renameAct;
00293 QAction *closeAct;
00294
00295 vtkImageData *plotData;
00296 DGVBlitzArrayCasterVTK<imageType> Blitz;
00297 Array<imageType,3> plotArray;
00298
00299 vtkAlgorithmOutput *inputConnection;
00300
00302 vtkPiecewiseFunction *opacityTransferFunction;
00303 vtkColorTransferFunction *colorTransferFunction;
00304 vtkVolumeProperty *volumeProperty;
00305
00306 vtkFixedPointVolumeRayCastMapper *volumeMapper_Fixed;
00307 vtkVolumeRayCastMapper *volumeMapper;
00308 vtkVolumeRayCastCompositeFunction *compositeFunction;
00309
00310 vtkVolume *volume;
00311 vtkCubeAxesActor2D *axes;
00312
00313 vtkRenderer *renderer;
00314 vtkRenderWindow *renderWin;
00315
00320 void setupEvents();
00325 void contextMenuEvent(QContextMenuEvent *event);
00326 };
00327
00328 #endif // DGVVOLUMEPLOTVTK_H