Go to the documentation of this file.00001
00022 #ifndef DGVSURFACEPLOTVTK_H
00023 #define DGVSURFACEPLOTVTK_H
00024
00025 #include <QtGui/QtGui>
00026
00027 #include "QVTKWidget.h"
00028 #include "vtkImageData.h"
00029 #include "vtkImageDataGeometryFilter.h"
00030 #include "vtkImageLogarithmicScale.h"
00031 #include "vtkWarpScalar.h"
00032 #include "vtkCubeAxesActor2D.h"
00033 #include "vtkPolyDataNormals.h"
00034 #include "vtkPolyDataMapper.h"
00035 #include "vtkLODActor.h"
00036
00037 #include "vtkRenderer.h"
00038 #include "vtkRenderWindow.h"
00039
00040 #include "DGVAliases.h"
00041 #include "DGVBlitzArrayCasterVTK.h"
00042 #include "DGVConsole.h"
00043
00044 #include "ui/ThresholdForm.h"
00045
00073 class DGV_VTK_EXPORT DGVSurfacePlotVTK : public QVTKWidget
00074 {
00075 Q_OBJECT
00076
00077 public:
00082 DGVSurfacePlotVTK(QWidget *parent = 0);
00087 virtual ~DGVSurfacePlotVTK();
00088
00093 void setName(QString filename);
00098 void setData(Array<imageType,2> data);
00103 void SetInput(vtkImageData *newData);
00108 void setScaleFactor(double factor);
00113 inline void autoScaleSurface(bool autoScale)
00114 { autoScaleZ = autoScale; }
00119 void setThresholdLevels(double low, double high);
00124 void setXLabel(QString text);
00129 void setYLabel(QString text);
00134 void setZLabel(QString text);
00139 void setAxesAsClosestTriad();
00144 void setAxesAsOuterEdges();
00149 void setBackground(double r, double g, double b);
00154 bool saveVTI(const QString filename);
00155
00160 void generatePlot();
00165 void generatePlotMergedWith(vtkImageData *image);
00170 void generateAxes();
00175 void animateFromSlices(Array<imageType,3> *data, int interval);
00176
00181 QString strippedName();
00186 QString strippedNamePrefix();
00191 inline Array<imageType,2>& data()
00192 { return plotArray; }
00197 void setConsole(DGVConsole *newConsole);
00202 inline void setVerboseMode(bool verbose)
00203 { verboseMode = verbose; }
00204
00205 public slots:
00210 void refresh();
00215 void renameData();
00220 void scale();
00225 void threshold();
00230 void thresholdUpper(double value);
00235 void thresholdLower(double value);
00240 void xLabel();
00245 void yLabel();
00250 void zLabel();
00255 void background();
00260 void axesProperties();
00265 void updateDisplayData();
00270 void toggleAxesAsClosestTriad();
00275 void toggleAntiAliasing();
00280 void save();
00285 void updateSlice();
00290 inline void firstSlice()
00291 { currentSlice = 0; }
00296 void pauseAnimation();
00297
00298
00299 protected:
00300 bool loaded;
00301 bool generated;
00302 bool axisGenerated;
00303 bool externalData;
00304 bool verboseMode;
00305 bool consoleAssigned;
00306 bool closestTriad;
00307 bool antiAliasing;
00308 bool thresholded;
00309 bool autoScaleZ;
00310 bool logScaled;
00311 bool animating;
00312 bool pausedAnimation;
00313 QString name;
00314
00316 QMenu *contextMenu;
00317 QAction *scaleAct;
00318 QAction *thresholdAct;
00319
00320 QAction *xLabelAct;
00321 QAction *yLabelAct;
00322 QAction *zLabelAct;
00323 QAction *backgroundAct;
00324 QAction *axesAct;
00325 QAction *logAct;
00326 QAction *triadAct;
00327 QAction *antiAliasingAct;
00328
00329 QAction *startAct;
00330 QAction *pauseAct;
00331
00332 QAction *saveAct;
00333 QAction *refreshAct;
00334 QAction *renameAct;
00335 QAction *closeAct;
00336
00337 int bounds[6];
00338 double scaling;
00339 vtkImageData *plotData;
00340 DGVBlitzArrayCasterVTK<imageType> Blitz;
00341 Array<imageType,2> plotArray;
00342 Array<imageType,3> *volumeData;
00343 int currentSlice;
00344
00345 DGVConsole *console;
00346 ThresholdForm *thresholder;
00347
00348 vtkImageLogarithmicScale *logData;
00349 vtkImageDataGeometryFilter *geometry;
00350 vtkWarpScalar *warp;
00351 vtkPolyDataNormals *surfaceNormals;
00352 vtkPolyDataMapper *mapper;
00353 vtkLODActor *lod;
00354 vtkCubeAxesActor2D *axes;
00355
00356 vtkRenderer *renderer;
00357 vtkRenderWindow *renderWin;
00358
00363 void setupEvents();
00368 void setupSurface();
00373 void contextMenuEvent(QContextMenuEvent *event);
00378 void printError(QString msg);
00383 void printWarning(QString msg);
00388 void printInfo(QString msg);
00393 void createActions();
00398 void createConnections();
00399 };
00400
00401 #endif // DGVSURFACEPLOTVTK_H