22 #include <vtkChartXY.h> 23 #include <vtkSmartVolumeMapper.h> 24 #include <vtkVolume.h> 26 #include "milxQtModel.h" 75 milxQtPlot(QWidget *theParent = 0,
bool contextSystem =
true);
82 void setPlotType2D(
const int indexX = 0,
const int indexY = 1)
86 plotTypeSurface =
false;
87 plotTypeVolume =
false;
91 void setPlotType3D(
const int indexX = 0,
const int indexY = 1,
const int indexZ = 2)
95 plotTypeSurface =
false;
96 plotTypeVolume =
false;
101 inline void setPlotTypeSurface(
const int zAxis = 2)
103 plotTypeSurface =
true;
104 plotTypeVolume =
false;
107 displaceAxis = zAxis;
109 inline void setPlotTypeVolume()
111 plotTypeVolume =
true;
112 plotTypeSurface =
false;
121 void SetSource(vtkSmartPointer<vtkImageData> img,
const bool eightbit,
const bool useGPU =
false)
123 imageData = vtkSmartPointer<vtkImageData>::New();
124 imageData->DeepCopy(img);
126 sourceEightbit = eightbit;
127 plotTypeGPU = useGPU;
135 table->DeepCopy(tbl);
136 printDebug(
"Source Table is " + QString::number(table->GetNumberOfRows()) +
"x" + QString::number(table->GetNumberOfColumns()));
161 return model.Result();
166 inline void setOpacityTransferValues(std::vector<float> values)
168 opacityTransferValues = values;
170 inline std::vector<float> getOpacityTransferValues()
172 return opacityTransferValues;
174 inline void setColourTransferValues(std::vector<float> values)
176 colourTransferValues = values;
178 inline std::vector<float> getColourTransferValues()
180 return colourTransferValues;
208 void scatterPlot(vtkSmartPointer<vtkTable> table,
const int xColumn,
const int yColumn);
213 void scatterPlot(vtkSmartPointer<vtkTable> table,
const int xColumn,
const int yColumn,
const int zColumn);
220 void surfacePlot(vtkSmartPointer<vtkImageData> img,
const int zDirection = 2);
225 void surfacePlot(vtkSmartPointer<vtkTable> table);
232 void volumePlot(vtkSmartPointer<vtkImageData> img,
const bool eightbit,
const bool quiet =
false);
238 void renameAxes(QString xLabel =
"", QString yLabel =
"", QString zLabel =
"");
243 void renameTitle(QString newTitle =
"");
248 void points(
const bool showIt =
true);
253 void logScale(
const bool showIt =
true);
258 void legend(
const bool showIt =
true);
283 virtual void updateVolumePlot(
int value);
304 vtkSmartPointer<vtkVolume> volume;
342 #endif // MILXQTPLOT_H bool logScale
Using custom scalar bar?
std::vector< float > opacityTransferValues
values for volume rendering opacity transfer function
virtual void createMenu(QMenu *menu)
Create the menu for the data in this object. Used for context menu and file menus.
void contextMenuEvent(QContextMenuEvent *event)
The context menu setup member.
bool plotTypeGPU
Use GPU whenever possible?
vtkSmartPointer< vtkTable > GetSource()
Returns the current table source for plot held.
void createActions()
Create the actions for context menu etc.
QAction * titleName
Action for title name.
bool plotType2D
2D plot type?
void createConnections()
Create the connections for context menu etc.
vtkSmartPointer< vtkSmartVolumeMapper > volumeFixedMapper
Maintains volume rendering when needed.
void printDebug(QString msg)
Debug message wrapper for console.
This class represents the MILX Qt Model/Mesh Display object using VTK.
std::vector< float > colourTransferValues
values for volume rendering colour transfer function
virtual void scaleDisplay(const bool forceDisplay=false)
Toggles the scale bar display.
bool plotType3D
3D plot type?
bool sourceEightbit
Table/data loaded is eightbit?
virtual void enableScale(QString title="", const bool quiet=false, double minRange=0.0, double maxRange=0.0, int noOfLabels=3)
Enable scale bar display with the title provided.
#define MILXQT_EXPORT
Define Windows DLL importing.
vtkSmartPointer< vtkChartXY > templateChart
chart (used only for xy scatter plot)
The class provides 1D/2D and 3D plotting capability. This includes scatter and surface plots...
void SetSource(vtkSmartPointer< vtkTable > tbl)
Assigns the table provided to the class, preparing for plot. Call generatePlot() and then show() to d...
QAction * legendAct
Action for showing legend.
vtkSmartPointer< vtkTable > table
data presented as a table
QAction * logScaleAct
Action for showing a log scale.
virtual void updateCoords(vtkObject *obj)
Picks the coordinates and pixel value from the current mouse position in the window.
virtual void updateLookupTable()
Sets the necessary LUTs to model view.
int xIndex
x axis index of table
int displaceAxis
warp axis for surface plots
int yIndex
y axis index of table
vtkSmartPointer< vtkImageData > imageData
data presented as a image
bool sourceLoaded
Table/data loaded in class?
QAction * xAxisName
Action for x-axis name.
int zIndex
z axis index of table
QAction * pointsAct
Action for showing line points.
void SetSource(vtkSmartPointer< vtkImageData > img, const bool eightbit, const bool useGPU=false)
Assigns the image provided to the class, preparing for plot. Call generatePlot() and then show() to d...
void refresh()
Refresh the display of the model including widgets. Camera remains as is.
bool plotTypeVolume
2D plot type?
bool plotTypeSurface
2D plot type?
void refresh()
Refresh the display of the window.
vtkSmartPointer< vtkImageData > GetSourceImage()
Returns the current image source for plot held.
virtual vtkDataSet * GetDataSet()
Get the underlying data, return the vtkImageData object if volume plot else polydata, useful for getting scalar range etc.