SMILX  1.01
Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
milxQtModel Class Reference

This class represents the MILX Qt Model/Mesh Display object using VTK. More...

#include <milxQtModel.h>

Inheritance diagram for milxQtModel:
milxQtRenderWindow milxQtWindow milxQtAnimateModel milxQtDiffusionTensorModel milxQtPlot

Public Slots

void refresh ()
 Refresh the display of the model.
 
void reset ()
 Reset the display of the model, includes camera and regeneration.
 
void toggleInterpolation (bool quiet=false)
 Toggles the interpolation of the mesh between Phong and Gouraud. Default is Gouraud.
 
void interpolateDisplay (bool quiet=false)
 
void disableInterpolateDisplay (bool quiet=false)
 
void enableInterpolateDisplay (bool quiet=false)
 
void toggleSpecular (bool quiet=false)
 Toggles the specular or shininess of the mesh between Flat and Shiny. Default is Shiny.
 
void specularDisplay (bool quiet=false)
 
void disableSpecularDisplay (bool quiet=false)
 
void enableSpecularDisplay (bool quiet=false)
 
virtual void copyToContextMenu (QMenu *copyMenu)
 Copies the menu, by duplicating the entries, to the context menu. Connections are assumed to be made before hand. More...
 
coordinate & centroid ()
 Computes and returns the centroid of the model currently held. More...
 
double centroidSize (bool average=false)
 Computes and returns the centroid size of the model currently held which can be used for rescaling.
 
vnl_matrix< double > & covarianceMatrix ()
 Computes and returns the covariance matrix of the model currently held.
 
void undoProcessing ()
 Undo/Redo the processing last done. Only applies to processing such as clean() etc.
 
void clean ()
 Clean the model of duplicate points by merging appropriately.
 
void triangulate ()
 Triangulate the model cells.
 
void decimate (double factor=0.0)
 Reduce the polygon count (decimate) the model. Factor to reduce by is acquired by input a dialog.
 
void quadricDecimate (double factor=0.0)
 Reduce the polygon count (decimate) the model using Quadric Decimation. The final result is the best simplification of the mesh, preserving topology.
 
void clusterDecimate ()
 Reduce the polygon count (decimate) the model using Quadric Clustering Decimation. The final result is the best simplification of the mesh, preserving topology.
 
void renameScalars (QString newName="")
 Rename the scalars on the mesh. More...
 
void threshold (double lowValue=0.0, double upValue=0.0)
 Clip the mesh based on scalar values on the mesh. More...
 
void thresholdScalars (double lowValue=0.0, double upValue=0.0, double outsideVal=0.0)
 Threshold scalar values on the mesh. Geometry and topology is unchanged.
 
void thresholdScalarsBinary (double lowValue=0.0, double upValue=0.0, double insideVal=1.0, double outsideVal=0.0)
 Binary threshold scalar values on the mesh. Geometry and topology is unchanged, and scalars become two-valued, inside and outside.
 
void maskScalars (QString filename="")
 Mask scalar values on the mesh using scalars on another mesh. Assumes point correspondence between meshes.
 
void gradient ()
 Compute the gradient of the scalar field on the model.
 
void smooth (int iterations=0)
 Smooth the model using the standard Laplacian approach. Iterations to smooth by is acquired by input a dialog.
 
void smoothSinc (int iterations=0)
 Smooth the model using the Windowed Sinc approach of Taubin et al. Iterations to smooth by is acquired by input a dialog. More...
 
void curvature ()
 Compute the mean curvature of mesh and place the curvature as scalars on mesh.
 
void transform (QString filename="", bool inverse=false)
 Transform the model using a loaded affine transform file. File is asked for within this member. More...
 
void loadScalars (QString filename="")
 Loads the scalars from another model, where both models must have the same number of points.
 
void removeScalars ()
 Removes all the scalars from the model.
 
void append (milxQtModel *mdl)
 Appends the provided model to current model.
 
void modelInfo ()
 Computes and prints the centroid, centroid size and covariance matrix to standard out.
 
void matchInfo (QString filename="", bool rescale=true, double factor=1.0)
 Loads another model and matches its centroid and (optionally) scales this model to match. More...
 
void registerICP (QString filename="", bool similarity=false)
 Register or align current mesh to another mesh using Iterative Closest Point algorithm, whose filename is provided. If not provided, then Open File dialog will apear.
 
void registerLandmarks (QString filename="", bool similarity=false)
 Register or align current mesh to another mesh using the landmark transform, whose filename is provided. If not provided, then Open File dialog will apear. More...
 
void voxelise ()
 Convert surface to an image volume.
 
virtual void contour ()
 Draw contour interactively.
 
virtual void selectPointsInContour ()
 Select model points inside contour and compute distance map.
 
virtual void weightGaussianFromContour (float stddev=-1.0, float clampValue=-1.0)
 Select model points inside contour, compute distance map and Gaussian weight the result.
 
void texture ()
 Emit texture of the model.
 
void changeColour (float red=-1, float green=-1, float blue=-1)
 Changes the colour of the model if no scalars are present.
 
void changeOpacity (float opacity=-1)
 Changes the opacity/transparency of the model. You should use the changeColour() member and set its alpha channel. More...
 
void normals (const bool turnOn=false)
 Shows the point normals of the model. More...
 
void rotate (bool xAxis=false, bool yAxis=false, bool zAxis=false, float angle=90)
 Rotate model along any axis, useful for matching orientation with ITK etc.
 
void flip (bool xAxis=false, bool yAxis=false, bool zAxis=false)
 Flip model along any axis, useful for matching coordinate systems with ITK or flipping left to right.
 
void background (bool white=false)
 Changes background to white.
 
void enableOutline (vtkDataObject *dataOutline=NULL)
 Display outline box of data.
 
void disableOutline ()
 Disables the outline box display.
 
void outlineDisplay ()
 Toggles the outline box display.
 
void enableCubeAxes (double *range=NULL, double *bounds=NULL)
 Display cube (plot) axes of data.
 
void disableCubeAxes ()
 Disables the cube axes display.
 
void cubeAxesDisplay (double *range=NULL)
 Toggles the cube (plot) axes display.
 
void removeOverlays ()
 Removes all actors that are overlaid with the model.
 
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. More...
 
virtual void scaleDisplay (const bool forceDisplay=false)
 Toggles the scale bar display. More...
 
void outputScalars (QString filename="")
 Output the scalars of model to file.
 
virtual void viewToXYPlane ()
 Change view to xy-plane.
 
virtual void viewToZXPlane ()
 Change view to zx-plane.
 
virtual void viewToZYPlane ()
 Change view to zy-plane.
 
void showArray (QAction *action)
 Change scalars on model to one given by string or action.
 
void showArray (const QString arrayName)
 
virtual void updateLookupTable ()
 Sets the necessary LUTs to model view. More...
 
virtual void createMenu (QMenu *menu)
 Create the menu for the data in this object. Used for context menu and file menus. More...
 
void generateDelaunayGraph (float red=defaultColour, float green=defaultColour, float blue=defaultColour)
 Generates the Delaunay 3D graph for the dataset. Arguments provided are for the colours of the edges of the graph. More...
 
void generateDelaunay2DTriangulation ()
 Generates the Delaunay 2D Triangulation (resulting in triangulated cells) for the model.
 
void generateDelaunayTriangulation (float red=defaultColour, float green=defaultColour, float blue=defaultColour)
 Generates the Delaunay 3D Triangulation (resulting in tetrahdral cells) for the dataset. Arguments provided are for the colours of the cells of the model. More...
 
void generateVertices (float red=defaultColour, float green=defaultColour, float blue=defaultColour)
 Generates the vertices for the dataset. Arguments provided are for the colours of the vertices. More...
 
void generateVerticesAs (const GlyphType glyphType=Circle, float red=defaultColour, float green=defaultColour, float blue=defaultColour)
 Generates the vertices as 2D circles for the dataset. Arguments provided are for the colours of the vertices. More...
 
void generateTubes (float red=defaultColour, float green=defaultColour, float blue=defaultColour)
 Generates the tubes for the dataset. Arguments provided are for the colours of the tubes. More...
 
void generateEdges (float red=defaultColour, float green=defaultColour, float blue=defaultColour)
 Generates the tubes for the dataset. Arguments provided are for the colours of the tubes. Same as generateTubes, alias for convenience. More...
 
void generatePointModel (double newScale=1.0, float red=defaultColour, float green=defaultColour, float blue=defaultColour)
 Generates a point model, i.e. glyphs at each point for the dataset. Arguments provided are for the colours of the edges of the graph. More...
 
void generateSampledPoints (float distance=0.0, float red=defaultColour, float green=defaultColour, float blue=defaultColour)
 Generates points sampled "distance" apart on the model with glyphs at each point. More...
 
void generateVectorField (double newScale=0.0, float red=defaultColour, float green=defaultColour, float blue=defaultColour)
 Generates a vector field model, i.e. arrows at each point for the dataset. Arguments provided are for the colours of the vectors. More...
 
void generateTensorField (double newScale=0.0, float red=defaultColour, float green=defaultColour, float blue=defaultColour)
 Generates a tensor field model, i.e. ellipses at each point for the dataset. Arguments provided are for the colours of the ellipses. More...
 
void generateStreamLines (vtkSmartPointer< vtkImageData > seeds, float timestep=0.0)
 Generates stream lines i.e. integrates a vector field starting at seed points. More...
 
void generateHedgehog (double newScale=0.0, float red=defaultColour, float green=defaultColour, float blue=defaultColour)
 Generates a hedgehog model, i.e. lines at each point for the dataset whose lengths are given by the vector magnitudes. Arguments provided are for the scale and colours of the lines. More...
 
void generateNormals (int pointNormals=0)
 Generates normals of the model, with point normals being default. More...
 
void generateModel (float red=defaultColour, float green=defaultColour, float blue=defaultColour)
 Generates the model so that its ready for display. It requires that data has been set or assigned already. More...
 
void generateLabels ()
 Generates the model vertices with labels. It requires that data has been set or assigned already.
 
void generatePointIDsScalars ()
 Generates scalars for the vertices in the model based on their point IDs. It requires that model has been set or assigned already. More...
 
void generatePoints (float red=defaultColour, float green=defaultColour, float blue=defaultColour)
 Generates points display of the model, i.e. points at each point for the dataset. Arguments provided are for the colours of the points. More...
 
void generateWireframe (float red=defaultColour, float green=defaultColour, float blue=defaultColour)
 Generates the 3D graph for the dataset. Arguments provided are for the colours of the edges of the graph. More...
 
void generateSurface (float red=defaultColour, float green=defaultColour, float blue=defaultColour)
 Generates a surface display of the model, i.e. points at each point for the dataset. Arguments provided are for the colours of the points. More...
 
void generateIsoSurface (vtkSmartPointer< vtkImageData > img, int contourNumber=-1, double value=0.0)
 Generates a iso surface or contour from image data, i.e. the result of Marching Cubes algorithm at value.
 
void generatePolyDataFromImage (vtkSmartPointer< vtkImageData > img)
 Generates polygonal data from image data, i.e. the result is a surface.
 
void generateKMeansClustering (int numberOfClusters=0)
 Generates K-means clustering of the points in the model with the number of clusters provided.
 
void generateQuantisedPoints (float quantiseFactor=0.0)
 Generates points that are snapped to a grid given by factor.
 
void generateCappedBoundaries ()
 Generates capped boundaries for meshes with boundaries (such as large holes or voids). More...
 
void generateRegionLabels ()
 Generates scalars for unconnected regions of the mesh.
 
void generateElevation ()
 Generates scalars based on the elevation from the bounding box extremes of the mesh.
 
virtual void updateCoords (vtkObject *obj)
 Picks the coordinates and pixel value from the current mouse position in the window. More...
 
- Public Slots inherited from milxQtRenderWindow
void addModelActor (vtkSmartPointer< vtkActor > mdlActor)
 Directly add model actor to generic view. More...
 
void removeModelActor (vtkSmartPointer< vtkActor > mdlActor)
 Directly remove model actor from generic view. More...
 
void addActor (vtkSmartPointer< vtkActor > imgActor, vtkMatrix4x4 *transformMatrix=NULL)
 Directly add actor to generic view with transform matrix. More...
 
void addImageActor (vtkSmartPointer< vtkImageActor > imgActor, vtkMatrix4x4 *transformMatrix=NULL)
 Directly add image actor to generic view. More...
 
void removeImageActor (vtkSmartPointer< vtkImageActor > imgActor)
 Directly remove image actor from generic view. More...
 
void importFrom (milxQtRenderWindow *windowToImportFrom)
 Import actors/scene directly from another renderwindow. More...
 
void importViewFrom (milxQtRenderWindow *windowToImportFrom)
 Same as importFrom()
 
virtual void updateTextActor (vtkObject *obj, unsigned long, void *client_data, void *, vtkCommand *command)
 Update any text actors in display to current slice.
 
virtual void updateImageActor (vtkObject *obj, unsigned long, void *client_data, void *, vtkCommand *command)
 Update any image actors in display to current slice when slice number changes.
 
virtual void updateImageActor (vtkSmartPointer< vtkImageActor > actor)
 
void userEvent (QMouseEvent *event=NULL)
 
void userEvent (QKeyEvent *event)
 
void userEvent (QWheelEvent *event)
 
void refresh ()
 Refresh the display of the model including widgets. Camera remains as is.
 
vtkSmartPointer< vtkMatrix4x4 > getTransformMatrix ()
 Internal transform matrix used to transform actors appropriately for direction and coordinate systems.
 
void reset ()
 Reset the rendering, camera and windowing.
 
bool isLoaded ()
 Is the data successfully loaded? Use this to check if all is ok with data display.
 
void linkProgressEventOf (vtkObject *obj)
 Link the progress of filters etc to keep the UI responsive.
 
virtual void updateCoords (vtkObject *obj)
 Picks the coordinates and pixel value from the current mouse position in the window. More...
 
virtual void contour ()
 Draw contour interactively.
 
void contourAsPolyData ()
 Save contour as polydata/model. This saves all intermediate points, not just what the user places.
 
void contourAsNodePolyData ()
 Save contour as polydata/model. This only saves the points the user has placed.
 
void contourInitFromPolyData (QString filename="")
 Load contour from polydata/model. More...
 
void enableAxes (float xScale=1.0, float yScale=1.0, float zScale=1.0)
 Enable axes display with each arrow for dimension scaled as provided.
 
void disableAxes ()
 Disables the axes display.
 
void axesDisplay ()
 Toggles the axes display.
 
void disableOrient ()
 Disables orientation marker.
 
void orientDisplay ()
 Toggles orientation marker.
 
virtual void background (bool white=false)
 Changes background to white.
 
void lighting ()
 Toggles two sided lighting in display.
 
void textDisplay ()
 Toggles text in display.
 
void crosshair ()
 Toggles corsshair.
 
virtual void viewToXYPlane ()
 Change view to xy-plane.
 
void viewToAxial ()
 
virtual void viewToZXPlane ()
 Change view to zx-plane.
 
void viewToCoronal ()
 
virtual void viewToZYPlane ()
 Change view to zy-plane.
 
void viewToSagittal ()
 
int getDefaultOrientation ()
 Get the orientation mode to one of the supported standards. More...
 
void setDefaultOrientation (int orientMode)
 Change orientation mode to one of the supported standards. Default: Radiological. More...
 
int getView ()
 Return current view mode identified by number. 0-axial, 1-coronal, 2-sagittal.
 
void setView (int viewMode)
 Change view to view mode identified by number. 0-axial, 1-coronal, 2-sagittal. More...
 
void enableActionBasedOnView ()
 Enables the view actions corresponding to current view set.
 
void disableDefaultView ()
 Disables the default view whenever data is process or displayed. Enabled by default. More...
 
void enableDefaultView ()
 
void setDefaultView (int viewMode)
 Change default view to view mode identified by number. 0-axial, 1-coronal, 2-sagittal.
 
void saveView (QString filename="")
 
void saveViewFile ()
 
void loadView (QString filename="")
 Saves the camera details to internal variables that can be restore anytime with loadView().
 
void loadViewFile ()
 
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. More...
 
virtual void disableScale ()
 Disables the scale bar display.
 
virtual void enableCrosshair ()
 Enables the mouse pointer as a crosshair instead. Scene must be rendered before calling.
 
virtual void disableCrosshair ()
 Restores the mouse pointer to default.
 
virtual void scaleDisplay (const bool forceDisplay=false)
 Toggles the scale bar display. More...
 
virtual void colourMapToRainbow (double minRange=0.0, double maxRange=0.0)
 Change the colour map to default VTK which is rainbow.
 
virtual void colourMapToVTK (double minRange=0.0, double maxRange=0.0)
 Change the colour map to inverse of default VTK.
 
virtual void colourMapToGray (double minRange=0.0, double maxRange=0.0)
 Change the colour map to Gray.
 
virtual void colourMapToSeismic (double minRange=0.0, double maxRange=0.0)
 Change the colour map to Seismic.
 
virtual void colourMapToLogGray (double minRange=0.0, double maxRange=0.0)
 Change the colour map to Logarithmic (base 10) Gray.
 
virtual void colourMapToJet (double minRange=0.0, double maxRange=0.0)
 Change the colour map to Jet.
 
virtual void colourMapToNIH (double minRange=0.0, double maxRange=0.0)
 Change the colour map to NIH.
 
virtual void colourMapToNIH_Fire (double minRange=0.0, double maxRange=0.0)
 Change the colour map to NIH Fire.
 
virtual void colourMapToAAL (double minRange=0.0, double maxRange=0.0)
 Change the colour map to AAL.
 
virtual void colourMapToFS (double minRange=0.0, double maxRange=0.0)
 Change the colour map to FS (FreeSurfer)
 
virtual void colourMapToHOT (double minRange=0.0, double maxRange=0.0)
 Change the colour map to HOT.
 
virtual void colourMapToCOOL (double minRange=0.0, double maxRange=0.0)
 Change the colour map to COOL.
 
virtual void colourMapToCOOLWARM (double minRange=0.0, double maxRange=0.0)
 Change the colour map to COOL.
 
virtual void colourMapToKnee (double minRange=0.0, double maxRange=0.0)
 Change the colour map to Knee.
 
virtual void colourMapToBone (double minRange=0.0, double maxRange=0.0)
 Change the colour map to Bone.
 
virtual void colourMapToSpectral (double minRange=0.0, double maxRange=0.0)
 Change the colour map to Spectral.
 
virtual void colourMapToGNUPlot (double minRange=0.0, double maxRange=0.0)
 Change the colour map to GNUPlot.
 
virtual void colourMapToCubeHelix (double minRange=0.0, double maxRange=0.0)
 Change the colour map to CubeHelix.
 
virtual void colourMapToHSV (double minRange=0.0, double maxRange=0.0)
 Change the colour map to HSV.
 
virtual void updateLookupTable ()
 Implement this into your derived class to ensure the new colourmap is passed on to your viewing data (image, model etc.)
 
void generateRender ()
 Generate the render so it is ready for display. Should be called before showing the window. More...
 
void setCustomActionGroup (QActionGroup *actionGrp)
 Set the action group for the menu with custom connections.
 
void createCustomConnections (QList< QAction *> actionsInMenu)
 
void createCustomConnections (QMenu *fromMenu)
 Create a series of connections on each action in group which will be placed into the context menu.
 
virtual void customOperation ()
 Custom operation, data dependent for viewing in unified environment. By default, this allows importing of actors into the current views. More...
 
virtual void createMenu (QMenu *menu)
 Create the menu for the data in this object. Used for context menu and file menus. More...
 
bool openModelUsingQt (const QString filename, vtkSmartPointer< vtkPolyData > &data)
 Opens a model file using Qt file objects, which can be a Wavefront Object file (*.obj) only. This member is intended to be used with the Qt resource system. More...
 
- Public Slots inherited from milxQtWindow
void setName (const QString filename)
 Set the name of the data.
 
QString getName ()
 Returns the name of the data.
 
void rename ()
 Renames the data.
 
QString strippedName ()
 Returns the stripped (path removed) name of the data.
 
QString strippedBaseName ()
 Returns the stripped (path removed) base (no suffix) name of the data.
 
void setNamePrefix (const QString newPrefix)
 Sets the prefix of the name of the data provided.
 
void addToContextMenu (QAction *act)
 Adds (prepends) the action to the context menu. Connections are assumed to be made before hand.
 
void appendToContextMenu (QAction *act)
 Adds (appends) the action to the context menu. Connections are assumed to be made before hand.
 
void addToContextMenu (QMenu *newMenu)
 Adds the menu to the context menu. Connections are assumed to be made before hand.
 
void addExtensionAction (QAction *act)
 Adds (in extension section) the action as an extension action. Connections are assumed to be made before hand.
 
void addMenuToContextMenu (QMenu *newMenu)
 Adds (prepends) the menu to the context menu. Connections are assumed to be made before hand.
 
void appendMenuToContextMenu (QMenu *newMenu)
 Adds (appends) the menu to the context menu. Connections are assumed to be made before hand.
 
virtual void copyToContextMenu (QMenu *copyMenu)
 Copies the menu, by duplicating the entries, to the context menu. Connections are assumed to be made before hand.
 
void setVerboseMode (bool verbose)
 Verbose mode for message output.
 
void setDeletableOnClose (bool delOnClose)
 Set if the window deletable on close. Default is true.
 
bool isDeletableOnClose ()
 Is the window deletable on close?
 
void setConsole (milxQtConsole *con)
 Set the console for log output.
 
void consumeVTKEvent (vtkObject *obj, unsigned long, void *client_data, void *, vtkCommand *command)
 Consume the event so that VTK interactor style doesn't get it. Safeguard for if remove observer directives have missed some bindings.
 
void updateQtEvents ()
 Update the Qt events, used to keep UI responsive.
 

Signals

void surfaceToImage (vtkSmartPointer< vtkPolyData >)
 Emit signal to compute surface to image process.
 
void resultAvailable (milxQtRenderWindow *)
 Send signal that Resultant render window is available for showing.
 
void resultAvailable (milxQtModel *)
 Send signal that Resultant model is available for showing.
 
- Signals inherited from milxQtRenderWindow
void imageAvailable (vtkImageData *, QString)
 Send signal that an image is available for showing.
 
void modelAvailable (vtkPolyData *, QString)
 Send signal that an surface etc. is available for showing.
 
void tableToPlot (vtkSmartPointer< vtkTable >, QString)
 Emit signal to show the table as a plot.
 
void modified (vtkSmartPointer< vtkImageActor >)
 Emit signal to allow updating of image actors if present.
 
- Signals inherited from milxQtWindow
void closing (QWidget *win)
 Send signal that the window is closing.
 
void nameChanged (const QString newName)
 Send signal that the data has been renamed.
 
void working (int value)
 Send signal that computation is in progress. Value carries the progress,.
 
void done (int value)
 Send signal that computation is done. Value carries the progress,.
 

Public Member Functions

 milxQtModel (QWidget *theParent=0, bool contextSystem=true)
 The standard constructor. More...
 
virtual ~milxQtModel ()
 The standard destructor. More...
 
QString strippedNamePrefix ()
 Returns the stripped (path removed) name of the data with "Model" prefix.
 
void AddInput (vtkSmartPointer< vtkPolyData > mesh)
 Assigns and coninually appends meshes provided to the class, preparing for display. Call generateModel() and then show() to display.
 
void AddArray (vtkSmartPointer< vtkDataArray > array)
 Adds an array to the model, appending it to the current list of arrays.
 
void SetInput (vtkSmartPointer< vtkPolyData > mesh)
 Assigns the mesh provided to the class, preparing for display. Call generateModel() and then show() to display. More...
 
void SetPoints (vtkSmartPointer< vtkPoints > modelPoints)
 Sets the points for the model to be generated. Must pass a vtkPoints objects, which is easy to use.
 
void SetPolys (vtkSmartPointer< vtkCellArray > modelPolys)
 Sets the polygons for the model to be generated. Must pass a vtkCellArray objects, which is easy to use.
 
void SetScalars (vtkSmartPointer< vtkDataArray > modelScalars)
 Sets the scalars for the model to be generated. Must pass a vtkDataArray or its derivatives (such as a vtkFloatArray) objects, which is easy to use.
 
void SetActiveScalars (std::string nameOfArray)
 Sets the array of name as scalars for the model to be generated.
 
void RemoveScalars ()
 Removes the scalars of the model.
 
void SetVectors (vtkSmartPointer< vtkDataArray > modelVectors)
 Sets the vectors for the model to be generated. Must pass a vtkFloatArray objects, which is easy to use.
 
void SetTransform (vtkSmartPointer< vtkTransform > transform)
 Sets the transform for the model that will be generated. Must pass a vtkTransform objects, which is easy to use. More...
 
void SetGraph (vtkSmartPointer< vtkMutableUndirectedGraph > graph)
 Assigns the graph provided to the class, preparing for display. Call generateModel() and then show() to display the graph in 3D.
 
void SetOpacity (double opacity)
 Adjusts the opacity of the model in the display. 1.0 is totally opaque and 0.0 is completely transparent. More...
 
vtkSmartPointer< vtkPolyData > GetPolyDataInput ()
 Returns the original mesh data object (PolyData) used internally VTK style. More...
 
vtkSmartPointer< vtkPolyData > GetOutput ()
 Returns the mesh data object (PolyData) used internally VTK style.
 
vtkSmartPointer< vtkAlgorithmOutput > GetOutputPort ()
 Returns the connection to the mesh data object (PolyData) used internally VTK style. Call after generate functions. EXPERIMENTAL.
 
vtkSmartPointer< vtkLODActor > GetActor ()
 Returns the VTK actor used.
 
vtkSmartPointer< vtkActor2D > GetActor2D ()
 Returns the VTK actor 2D used.
 
vtkSmartPointer< vtkPolyDataMapper > GetMapper ()
 Returns the VTK mapper used.
 
vtkIdType GetNumberOfPoints ()
 Returns the total number of points of the model currently held.
 
vtkIdType GetNumberOfArrays ()
 Returns the total number of arrays in the model.
 
vtkSmartPointer< vtkPoints > GetPoints ()
 Returns the points of the model currently held.
 
vtkSmartPointer< vtkDataArray > GetScalars ()
 Returns the scalars of the model currently held.
 
vtkSmartPointer< vtkDataArray > GetVectors ()
 Returns the vectors of the model currently held.
 
vtkSmartPointer< vtkDataArray > GetNormals ()
 Returns the normals of the model currently held.
 
vtkSmartPointer< vtkDataArray > GetTensors ()
 Returns the tensors (3x3 matrix per vertex) of the model currently held.
 
virtual vtkDataSet * GetDataSet ()
 Get the polydata data, return the vtkImageData object downcast to vtkDataSet, useful for getting scalar range etc.
 
void SetScalarRange (double range[2])
 Set the scalar range of the model currently held.
 
void GetScalarRange (double range[2])
 Get the scalar range of the model currently held.
 
void resetScalarRange ()
 Restores the scalar range of the model currently held to current max range for display. More...
 
double * GetPoint (vtkIdType id)
 Returns the point with id of the model currently held.
 
vtkSmartPointer< vtkAbstractTransform > GetTransform ()
 Returns the transform of the model currently held.
 
double GetOpacity ()
 Returns the opacity of the model in the display. 1.0 is totally opaque and 0.0 is completely transparent. More...
 
void Update ()
 Update the model currently held.
 
void setLargeDataSetMode (bool large)
 Set display mode to memory conserving and fast rendering (in most cases).
 
void ImmediateModeRenderingOn ()
 Improve rendering performance for large datasets. Assumes generateModel() has already been called.
 
milxQtModeloperator= (const milxQtModel &operand)
 Assignment operator for models. Only copies the data as given by GetOutput() of operand. EXPERIMENTAL. More...
 
- Public Member Functions inherited from milxQtRenderWindow
 milxQtRenderWindow (QWidget *theParent=0, bool contextSystem=true)
 The standard constructor. More...
 
virtual ~milxQtRenderWindow ()
 The standard destructor.
 
void contextMenuSystem (bool context)
 Disable/enable context menu system, should be on by default otherwise VTK will steal all right click events. More...
 
void AddActor (vtkSmartPointer< vtkProp > actor)
 Add a VTK actor to this window.
 
void AddVolume (vtkSmartPointer< vtkVolume > actor)
 Add a VTK volume to this window.
 
void AddActor2D (vtkSmartPointer< vtkProp > actor)
 Add a VTK actor to this window.
 
void SetActor (vtkSmartPointer< vtkProp > actor)
 Add a VTK actor to this window. Alias for AddActor.
 
void SetActor2D (vtkSmartPointer< vtkProp > actor)
 Add a VTK actor to this window. Alias for AddActor2D.
 
void SetBackground (double red, double green, double blue)
 Set the background of the display window.
 
void SetSize (int height, int width)
 Set the size of the display window.
 
void SetLookupTable (vtkSmartPointer< vtkLookupTable > lut)
 Set the lookup table of the colours in display window.
 
void RemoveAllActors ()
 Remove all VTK actors from this window.
 
void RemoveActor (vtkSmartPointer< vtkProp > actor)
 Remove the VTK actor from this window.
 
void RemoveActor2D (vtkSmartPointer< vtkProp > actor)
 Remove the VTK 2D actor from this window.
 
vtkActorCollection * GetActors ()
 Get all the actors in the render window.
 
vtkVolumeCollection * GetVolumes ()
 Get all the actors in the render window.
 
virtual vtkImageActor * GetImageActor ()
 Get the image actors, Implement in derived class that uses images.
 
vtkLookupTable * GetLookupTable ()
 Get the lookup table of the colours in display window.
 
void SetScalarBar (vtkScalarBarActor *bar)
 Get the scalar bar of the display window.
 
vtkScalarBarActor * GetScalarBar ()
 Get the scalar bar of the display window.
 
void GetBackground (double &red, double &green, double &blue)
 Get the background of the display window.
 
void SetRenderer (vtkRenderer *rnder)
 Assigns a VTK Renderer object.
 
vtkRenderer * GetRenderer ()
 Returns the VTK Renderer object.
 
virtual vtkRenderWindowInteractor * GetVTKInteractor ()
 Get the interactor associated with the view rendering.
 
void OffScreenRenderingOn ()
 Enable off-screen rendering, which is faster for large datasets in some instances.
 
void OffScreenRenderingOff ()
 Disable off-screen rendering, which is faster for large datasets in some instances.
 
void Render ()
 Force Render or Update of the display.
 
void enableUpdates (QStatusBar *bar)
 Enables the update of coordinates to the status bar provided directly. Update is done on mouse movement.
 
- Public Member Functions inherited from milxQtWindow
 milxQtWindow (QWidget *theParent=0)
 The standard constructor. More...
 
virtual ~milxQtWindow ()
 The standard destructor.
 

Protected Member Functions

void resetFlags ()
 Reset the flags for pointers and computations. Useful when the data changes and all previous results need updating.
 
void createActions ()
 Create the actions for context menu etc.
 
void createConnections ()
 Create the connections for context menu etc.
 
void setupTooltips ()
 Assign tooltips to each action for users benefit. The tooltips explains the function of each action.
 
void contextMenuEvent (QContextMenuEvent *event)
 The context menu setup member.
 
QMenu * basicContextMenu ()
 Return the basic context menu with the milxQtModel class ordering. This is for the benefit of derived class context menus and/or extensions. More...
 
QMenu * generationMenu ()
 Return the generate menu with the milxQtModel class ordering. This is for the benefit of derived class context menus and/or extensions.
 
QMenu * operationsMenu ()
 Return the operations menu with the milxQtModel class ordering. This is for the benefit of derived class context menus and/or extensions.
 
QMenu * transformsMenu ()
 Return the transform menu with the milxQtModel class ordering. This is for the benefit of derived class context menus and/or extensions.
 
QMenu * scalarsMenu ()
 Return the scalars menu with the milxQtModel class ordering. This is for the benefit of derived class context menus and/or extensions.
 
QMenu * arraysMenu ()
 Return the arrays menu with the milxQtModel class ordering. This is for the benefit of derived class context menus and/or extensions.
 
- Protected Member Functions inherited from milxQtRenderWindow
void createActions ()
 Create the actions for context menu etc.
 
void createConnections ()
 Create the connections for context menu etc.
 
void contextMenuEvent (QContextMenuEvent *event)
 The context menu setup member. More...
 
QMenu * colourMapsMenu ()
 Return the colourmaps menu with the milxQtRenderWindow class ordering. This is for the benefit of derived class context menus and/or extensions.
 
void dragMoveEvent (QDragMoveEvent *event)
 Part of the Drag and Drop feature members. Accepts drags.
 
void dragLeaveEvent (QDragLeaveEvent *event)
 Part of the Drag and Drop feature members. Accepts drags.
 
void dragEnterEvent (QDragEnterEvent *event)
 Part of the Drag and Drop feature members. Tells what drags to accept.
 
void mouseDoubleClickEvent (QMouseEvent *event)
 Part of the Drag and Drop feature members. Triggers the dragging on double click.
 
void dropEvent (QDropEvent *event)
 Part of the Drag and Drop feature members. Opens the dropped files.
 
virtual void SetupWidgets (vtkRenderWindowInteractor *interactor)
 Update the interactor so that the widgets are usable. Call this if you change the render window or interator manually.
 
void setupHumanGlyph (vtkSmartPointer< vtkMatrix4x4 > mat=NULL)
 Setup the human orientation glyph even if some transform if present between glyph and view.
 
- Protected Member Functions inherited from milxQtWindow
void createConnections ()
 Create the connections for context menu etc.
 
void closeEvent (QCloseEvent *clEvent)
 When closing, execute this member.
 
void printError (QString msg)
 Error message wrapper for console.
 
void printWarning (QString msg)
 Warning message wrapper for console.
 
void printDebug (QString msg)
 Debug message wrapper for console.
 
void printInfo (QString msg)
 Info message wrapper for console.
 

Protected Attributes

bool appended
 Appended data present?
 
bool modelled
 Model has been generated?
 
bool labelled
 Labels generated?
 
bool scalarsSet
 Scalars set to points of mesh?
 
bool transformed
 Transformed?
 
bool computedCentroid
 Computed centroid already?
 
bool computedCovariance
 Computed covariance matrix already?
 
bool largeMode
 Large Data set mode enabled?
 
bool outlineBefore
 scale displayed?
 
bool cubeAxesBefore
 scale displayed?
 
bool undidProcess
 Undid a process?
 
float colourRed
 Saved colour, used for refresh etc.
 
float colourGreen
 Saved colour, used for refresh etc.
 
float colourBlue
 Saved colour, used for refresh etc.
 
milx::Model model
 Actual model and its operations (from SMILI)
 
coordinate modelCentroid
 Centroid coordinate of the model.
 
vnl_matrix< double > modelCovarianceMatrix
 Covariance matrix of the model.
 
vtkSmartPointer< vtkPolyDataMapper > modelMapper
 Model mapper.
 
vtkSmartPointer< vtkLODActor > modelActor
 Model actor.
 
vtkSmartPointer< vtkLODActor > delaunayActor
 Delaunay triangulator actor.
 
vtkSmartPointer< vtkActor2D > modelLabelsActor
 Label Actor.
 
vtkSmartPointer< vtkActor > outlineActor
 Outline box actor.
 
vtkSmartPointer< vtkOutlineFilter > outlineMesh
 outline box
 
vtkSmartPointer< vtkCubeAxesActor > cubeAxesActor
 outline box
 
QMenu * generateMenu
 Menu for generating viewing options.
 
QAction * genModelAct
 Action for generating model.
 
QAction * genVerticesAct
 Action for generating vertices.
 
QAction * genNormalsAct
 Action for generating normals.
 
QAction * genVectorsAct
 Action for generating vector fields.
 
QAction * genTensorsAct
 Action for generating vector fields.
 
QAction * genHedgehogAct
 Action for generating Hedgehog fields.
 
QAction * genDelaunayAct
 Action for generating Delaunay graphs.
 
QAction * genDelaunayTri2DAct
 Action for generating Delaunay triangulation.
 
QAction * genDelaunayTriAct
 Action for generating Delaunay triangulation.
 
QAction * genLabelsAct
 Action for generating labels.
 
QAction * genPointIDsAct
 Action for generating labels.
 
QAction * genPointModelAct
 Action for generating labels.
 
QAction * genSamplesAct
 Action for generating sampled points on mesh.
 
QAction * genKmeansAct
 Action for calculating k-means clustering of points in a model.
 
QAction * genQuantiseAct
 Action for quantising points in a model.
 
QAction * genCapBoundaries
 Action for capping the boundaries of a open mesh.
 
QAction * genRegionLabels
 Action for labelling unconnected regions of mesh.
 
QAction * genElevation
 Action for elevation scalars of mesh.
 
QAction * genReebGraph
 Action for Reeb graphs of mesh.
 
QMenu * operateMenu
 Operate Menu.
 
QAction * cleanAct
 Action for cleaning model.
 
QAction * triAct
 Action for triangulate model.
 
QAction * decimateAct
 Action for decimating model.
 
QAction * quadricDecimateAct
 Action for Quadric decimating model.
 
QAction * clusterDecimateAct
 Action for Cluster decimating model.
 
QAction * smoothAct
 Action for smooth model.
 
QAction * smoothSincAct
 Action for smooth model.
 
QAction * curvatureAct
 Action for calculating mean curvation of a model.
 
QMenu * transformMenu
 Transform Menu.
 
QAction * transformAct
 Action for transforming model.
 
QAction * matchAct
 Action for matching scale and centroids of two models.
 
QAction * registerAct
 Action for registering two models.
 
QAction * registerLandmarkAct
 Action for registering two models via landmark transform.
 
QAction * voxeliseAct
 Action for voxelising surface.
 
QMenu * scalarMenu
 Context Menu.
 
QActionGroup * scalarsGroup
 Grouping for scalars.
 
QAction * renameScalarsAct
 Action for renaming scalars array.
 
QAction * thresholdAct
 Action for thresholding model.
 
QAction * thresholdScalarsAct
 Action for thresholding scalar values on model.
 
QAction * thresholdScalarsBinaryAct
 Action for binary thresholding scalar values on model.
 
QAction * maskScalarsAct
 Action for masking scalar values on model.
 
QAction * gradientAct
 Action for calculating gradient of the scalars of a model.
 
QAction * removeScalarsAct
 Action for removing scalars from model.
 
QAction * scalarsAct
 Action for loading scalars from another model.
 
QAction * outScalarsAct
 Action for output of scalars.
 
QMenu * showMenu
 Camera Menu.
 
QAction * normalsAct
 Action for showing the normals of a model.
 
QAction * centroidAct
 show centroid action
 
QAction * outlineAct
 show outline action
 
QAction * cubeAxesAct
 show cube axes action
 
QAction * overlaysAct
 removes actors/overlays action
 
QAction * selectPointsAct
 select points within contour
 
QAction * weightAct
 produce Gaussian weights from contour
 
QAction * doAct
 Action for undoing and redoing actions.
 
QAction * infoAct
 Action for showing the model info.
 
QAction * textureAct
 Action for extracting texture.
 
QAction * flipAct
 Action for flipping surface.
 
QAction * rotateAct
 Action for rotating surface.
 
QAction * colourAct
 Action for changing colours of a model.
 
QAction * interpAct
 Action for changing the interpolation of a model.
 
QAction * specularAct
 Action for changing the specular of a model to flat.
 
QActionGroup * displayGroup
 Grouping for check boxes.
 
QAction * pointsAct
 Show points.
 
QAction * wireframeAct
 Show wireframe.
 
QAction * surfaceAct
 Show surface.
 
QActionGroup * arrayGroup
 Grouping for check boxes.
 
QMenu * arrayMenu
 arrays Menu
 
- Protected Attributes inherited from milxQtRenderWindow
bool loaded
 Loaded Image from file?
 
bool rendered
 Scene as been setup for rendering? (by generateRender())
 
bool axesBefore
 Axes displayed?
 
bool scaleBefore
 scale displayed?
 
bool customScalarBar
 
bool logScale
 Using custom scalar bar?
 
bool useDefaultView
 Using log scalar map? More...
 
bool orientationAxes
 Display orientation (posterior etc.) axes?
 
bool contextMenuEnabled
 Display orientation (posterior etc.) axes?
 
int defaultView
 Default view for data (default is axial)
 
int currentView
 Current view for data.
 
int orientationView
 view orientation standard
 
QMenu * windowPropertiesMenu
 Context Menu.
 
QAction * backgroundAct
 Action for axes of the display.
 
QAction * axesAct
 Action for axes of the display.
 
QAction * lightingAct
 Action for two-sided lighting of the display.
 
QAction * lineAct
 Action for distance measuring display.
 
QAction * distanceAct
 Action for distance measuring display.
 
QAction * biDirectionAct
 Action for cross distance measuring display.
 
QAction * angleAct
 Action for angle measuring display.
 
QAction * planeAct
 Action for drawing planes.
 
QAction * boxAct
 Action for box drawing display.
 
QAction * sphereAct
 Action for sphere annotate display.
 
QAction * humanAct
 Show human view orientation glyph?
 
QAction * textAct
 Action for angle measuring display.
 
QAction * crosshairAct
 Action for crosshair.
 
QMenu * contourMenu
 Contour Menu.
 
QAction * contourAct
 Action for contouring surface points using Dijkstras algorithm.
 
QAction * contourPolyDataAct
 Save contour surface points as polydata.
 
QAction * contourNodePolyDataAct
 Save contour surface nodes as polydata.
 
QAction * contourInitAct
 Load contour surface points from polydata.
 
QMenu * viewMenu
 Context Menu.
 
QActionGroup * viewGroup
 Grouping for check boxes.
 
QAction * viewXY
 Change view to xy-plane (Axial)
 
QAction * viewZY
 Change view to zy-plane (Coronal)
 
QAction * viewZX
 Change view to zx-plane (Sagittal)
 
QAction * saveViewAct
 Save camera view.
 
QAction * loadViewAct
 Load camera view.
 
QAction * saveViewFileAct
 Save camera view to file.
 
QAction * loadViewFileAct
 Load camera view to file.
 
QAction * scaleAct
 Action for the scale bar of the display.
 
QMenu * colourMapMenu
 Colour map menu.
 
QActionGroup * mapGroup
 Grouping for check boxes.
 
QAction * actionDefault
 Default colours.
 
QAction * actionJet
 Jet colours.
 
QAction * actionRainbow
 Default colours.
 
QAction * actionInvRainbow
 Inv Default colours.
 
LabelledActionactionGray
 Gray colours.
 
LabelledActionactionSeismic
 Gray2 colours.
 
QAction * actionLogGray
 Logarithmic Gray colours.
 
QAction * actionNIH
 NIH colours.
 
QAction * actionNIH_FIRE
 NIH_FIRE colours.
 
QAction * actionAAL
 AAL colours.
 
QAction * actionFS
 FS colours.
 
LabelledActionactionHOT
 HOT colours.
 
QAction * actionCOOL
 COOL colours.
 
LabelledActionactionCOOLWARM
 COOL colours.
 
QAction * actionKnee
 Knee colours.
 
LabelledActionactionBone
 Spectral colours.
 
LabelledActionactionSpectral
 Spectral colours.
 
LabelledActionactionGNUPlot
 GNUPlot colours.
 
LabelledActionactionCubeHelix
 Cube Helix colours.
 
LabelledActionactionHSV
 Cube Helix colours.
 
QAction * resetAct
 Action for refreshing the display.
 
QAction * refreshAct
 Action for refreshing the display.
 
QPoint dragStartPosition
 Dragging helper variable.
 
vtkSmartPointer< vtkEventQtSlotConnect > Connector
 VTK Events to slots convertor.
 
vtkSmartPointer< vtkMatrix4x4 > transformMatrix
 Transform matrix for actor(s)
 
vtkSmartPointer< vtkRenderer > renderer
 Renderer for the data.
 
vtkSmartPointer< vtkRenderWindow > renderWindow
 Render Window used if no other set, only for deletion, access through QVTKWidget members.
 
vtkSmartPointer< vtkLookupTable > lookupTable
 Lookup table for the shapes/images, base class is used to allow references to different look up table types.
 
vtkSmartPointer< vtkCamera > camera
 camera for the view
 
vtkSmartPointer< vtkScalarBarActor > scale
 Scale for the display.
 
vtkSmartPointer< vtkScalarBarWidget > scalarBar
 Scalar Bar Widget for the display.
 
vtkSmartPointer< vtkAxesActor > axes
 Axes for the model.
 
vtkSmartPointer< vtkAxesActor > orientAxes
 Orientation (posterior etc.) axes for the orientation marker.
 
vtkSmartPointer< vtkPointPicker > dataPicker
 For determining coordinates and points from the window.
 
vtkSmartPointer< vtkContourWidget > contourWidget
 contour interaction
 
vtkSmartPointer< vtkLineWidget2 > lineWidget
 Used for drawing lines.
 
vtkSmartPointer< vtkDistanceWidget > distanceWidget
 Used for measuring distances.
 
vtkSmartPointer< vtkBiDimensionalWidget > biDirectionWidget
 Used for measuring cross distances.
 
vtkSmartPointer< vtkAngleWidget > angleWidget
 Used for measuring angles.
 
vtkSmartPointer< vtkPlaneWidget > planeWidget
 Used for drawing planes.
 
vtkSmartPointer< vtkBoxWidget2 > boxWidget
 Used for measuring angles.
 
vtkSmartPointer< vtkSphereRepresentation > sphereRep
 Sphere for widgets.
 
vtkSmartPointer< vtkSphereWidget2 > sphereWidget
 Used for measuring angles.
 
vtkSmartPointer< vtkOrientationMarkerWidget > humanGlyph
 Glyph for showing equivalent view on human.
 
QList< vtkSmartPointer< vtkTextWidget > > textWidgets
 Used for displaying movable texts in render window.
 
QList< vtkSmartPointer< vtkTextActor > > textActors
 text actors for text widgets
 
QList< ImageActorItemimageActors
 Images actors being displayed in model view.
 
QStatusBar * updateBar
 Pointer to bar, not allocated or deleted. To be passed to only.
 
QActionGroup * windowActionGroup
 used for the custom menu
 
- Protected Attributes inherited from milxQtWindow
QString name
 Name of the data.
 
QString prefix
 Prefix of the data.
 
bool verboseMode
 Verbose message output mode.
 
bool deletableOnClose
 Delete on close allowed? Allowed by default.
 
bool consoleAssigned
 Console assigned for output?
 
QMenu * contextMenu
 Context Menu.
 
QList< QAction * > actionsToAdd
 Context actions to add.
 
QList< QAction * > actionsToAppend
 Context actions to append.
 
QList< QAction * > extActionsToAdd
 Extension actions to add.
 
QList< QMenu * > menusToAdd
 Context Menu's to add.
 
QList< QMenu * > menusToAppend
 Context Menu's to append.
 
milxQtConsoleconsole
 Console for log outputs.
 

Detailed Description

This class represents the MILX Qt Model/Mesh Display object using VTK.

Author
Shekhar S. Chandra, 2013

The class displays models from polygonal values using OpenGL via the VTK library. The rendering is encapsulated within a QVTK widget. It is important to generateModel(), after setting the polydata or when loading the model in a different way. This ensures everything needed to display has been updated.

Controls:

Usage Examples: Loading a model

const QString filename = "model.vtk";
QPointer<milxQtFile> reader = new milxQtFile;
QPointer<milxQtModel> model = new milxQtModel;
bool success = reader->openModel(filename, model);
//If loaded, set attributes and generate.
if(success)
{
model->setName(filename);
model->setConsole(console);
model->setDefaultView(defaultViewBox->currentIndex());
model->generateModel();
}

Displaying a sphere

vtkSmartPointer<vtkSphereSource> sphere = vtkSmartPointer<vtkSphereSource>::New();
sphere->SetThetaResolution(32);
sphere->SetPhiResolution(32);
sphere->SetRadius(10.0);
sphere->Update();
model->setName("Sphere");
model->SetInput(sphere->GetOutput());
model->generateModel(0.5, 0.5, 0.5); //Grey model
model->show();

Delaunay Graph from points

QPointer< milxQtModel > model = new milxQtModel;
model->setName("Original Model");
model->SetPoints(modelPoints);
model->generateDelaunayGraph();
model->generateLabels();
model->show();

Point Model from points

QPointer< milxQtModel > centroidModel = new milxQtModel;
centroidModel->SetPoints(centroidPoints);
centroidModel->generatePointModel(0.25, 0.5, 0.5, 1.0); //!< Graph in grey

Definition at line 115 of file milxQtModel.h.

Constructor & Destructor Documentation

◆ milxQtModel()

milxQtModel::milxQtModel ( QWidget *  theParent = 0,
bool  contextSystem = true 
)

The standard constructor.

milxQtModel

Initialise variables

Set internals to zero

Connect Model Object for progress updates

Set strings

Allocate critical aspects

Definition at line 56 of file milxQtModel.cpp.

◆ ~milxQtModel()

milxQtModel::~milxQtModel ( )
virtual

The standard destructor.

Smart pointers handle deletion

Definition at line 91 of file milxQtModel.cpp.

Member Function Documentation

◆ basicContextMenu()

QMenu * milxQtModel::basicContextMenu ( )
protected

Return the basic context menu with the milxQtModel class ordering. This is for the benefit of derived class context menus and/or extensions.

< Only exists for the duration of the context selection

< Only exists for the duration of the context selection

Definition at line 2945 of file milxQtModel.cpp.

◆ centroid

coordinate & milxQtModel::centroid ( )
slot

Computes and returns the centroid of the model currently held.

Does not re-compute unless the model has been changed.

Definition at line 294 of file milxQtModel.cpp.

◆ changeOpacity

void milxQtModel::changeOpacity ( float  opacity = -1)
slot

Changes the opacity/transparency of the model. You should use the changeColour() member and set its alpha channel.

Action for this member has been removed because changeColour() provides this functionality.

Definition at line 1872 of file milxQtModel.cpp.

◆ copyToContextMenu

void milxQtModel::copyToContextMenu ( QMenu *  copyMenu)
virtualslot

Copies the menu, by duplicating the entries, to the context menu. Connections are assumed to be made before hand.

This virtual implementation accounts for menus with custom connections.

Definition at line 2567 of file milxQtModel.cpp.

◆ createMenu

void milxQtModel::createMenu ( QMenu *  menu)
virtualslot

Create the menu for the data in this object. Used for context menu and file menus.

Todo:
contour init doesn't work. VTK bug?

Definition at line 2476 of file milxQtModel.cpp.

◆ enableScale

void milxQtModel::enableScale ( QString  title = "",
const bool  quiet = false,
double  minRange = 0.0,
double  maxRange = 0.0,
int  noOfLabels = 3 
)
virtualslot

Enable scale bar display with the title provided.

Quiet Boolean is to prevent possible popups to ask user parameters.

Ask if use default scalar LUT

Definition at line 2204 of file milxQtModel.cpp.

◆ generateCappedBoundaries

void milxQtModel::generateCappedBoundaries ( )
slot

Generates capped boundaries for meshes with boundaries (such as large holes or voids).

This is useful to cap holes in an open mesh so it can be voxelised among other things.

Definition at line 962 of file milxQtModel.cpp.

◆ generateDelaunayGraph

void milxQtModel::generateDelaunayGraph ( float  red = defaultColour,
float  green = defaultColour,
float  blue = defaultColour 
)
slot

Generates the Delaunay 3D graph for the dataset. Arguments provided are for the colours of the edges of the graph.

Warning
Modifies the PolyData pipeline so that GetOutput() will return the graph.

Generate the model

Definition at line 343 of file milxQtModel.cpp.

◆ generateDelaunayTriangulation

void milxQtModel::generateDelaunayTriangulation ( float  red = defaultColour,
float  green = defaultColour,
float  blue = defaultColour 
)
slot

Generates the Delaunay 3D Triangulation (resulting in tetrahdral cells) for the dataset. Arguments provided are for the colours of the cells of the model.

Generate Delaunay Graph

Definition at line 380 of file milxQtModel.cpp.

◆ generateEdges

milxQtModel::generateEdges ( float  red = defaultColour,
float  green = defaultColour,
float  blue = defaultColour 
)
inlineslot

Generates the tubes for the dataset. Arguments provided are for the colours of the tubes. Same as generateTubes, alias for convenience.

Warning
Modifies the PolyData pipeline so that GetOutput() will return the graph.

Definition at line 800 of file milxQtModel.h.

◆ generateHedgehog

void milxQtModel::generateHedgehog ( double  newScale = 0.0,
float  red = defaultColour,
float  green = defaultColour,
float  blue = defaultColour 
)
slot

Generates a hedgehog model, i.e. lines at each point for the dataset whose lengths are given by the vector magnitudes. Arguments provided are for the scale and colours of the lines.

Warning
Modifies the PolyData pipeline so that GetOutput() will return the vectors.

You should have set the points and vectors (using SetPoints() and SetVectors()) before call this member.

Generate the model

Definition at line 687 of file milxQtModel.cpp.

◆ generateModel

void milxQtModel::generateModel ( float  red = defaultColour,
float  green = defaultColour,
float  blue = defaultColour 
)
slot

Generates the model so that its ready for display. It requires that data has been set or assigned already.

By default, the display is a surface. Use generatePoints() or generateWireframe() before this call to generate those displays of the model.

Setup actor for rendering

keep view that may be set by user

Definition at line 724 of file milxQtModel.cpp.

◆ generateNormals

void milxQtModel::generateNormals ( int  pointNormals = 0)
slot

Generates normals of the model, with point normals being default.

Warning
Modifies the PolyData pipeline so that GetOutput() will return the normals. Use normals() member to see these normals.

Definition at line 713 of file milxQtModel.cpp.

◆ generatePointIDsScalars

void milxQtModel::generatePointIDsScalars ( )
slot

Generates scalars for the vertices in the model based on their point IDs. It requires that model has been set or assigned already.

Generate the model

Definition at line 815 of file milxQtModel.cpp.

◆ generatePointModel

void milxQtModel::generatePointModel ( double  newScale = 1.0,
float  red = defaultColour,
float  green = defaultColour,
float  blue = defaultColour 
)
slot

Generates a point model, i.e. glyphs at each point for the dataset. Arguments provided are for the colours of the edges of the graph.

Warning
Modifies the PolyData pipeline so that GetOutput() will return the glyphs. Use generatePoints() to avoid changing the pipeline.

You should have set the points (using SetPoints()) before call this member.

Generate the model

Definition at line 474 of file milxQtModel.cpp.

◆ generatePoints

void milxQtModel::generatePoints ( float  red = defaultColour,
float  green = defaultColour,
float  blue = defaultColour 
)
slot

Generates points display of the model, i.e. points at each point for the dataset. Arguments provided are for the colours of the points.

You should have set the points (using SetPoints()) before call this member.

Definition at line 462 of file milxQtModel.cpp.

◆ generateSampledPoints

void milxQtModel::generateSampledPoints ( float  distance = 0.0,
float  red = defaultColour,
float  green = defaultColour,
float  blue = defaultColour 
)
slot

Generates points sampled "distance" apart on the model with glyphs at each point.

Warning
Modifies the PolyData pipeline so that GetOutput() will return the glyphs.

You should have set the points (using SetPoints()) before call this member.

Generate the model

Definition at line 496 of file milxQtModel.cpp.

◆ generateStreamLines

void milxQtModel::generateStreamLines ( vtkSmartPointer< vtkImageData >  seeds,
float  timestep = 0.0 
)
slot

Generates stream lines i.e. integrates a vector field starting at seed points.

Warning
Modifies the PolyData pipeline so that GetOutput() will return the lines.

You should have set the seeds as the model/surface (via SetInput()) before call this member.

Not that in order for the stream lines to work, one requires both cell and point data. For the seeds one only needs point data.

Generate the model

Definition at line 625 of file milxQtModel.cpp.

◆ generateSurface

void milxQtModel::generateSurface ( float  red = defaultColour,
float  green = defaultColour,
float  blue = defaultColour 
)
slot

Generates a surface display of the model, i.e. points at each point for the dataset. Arguments provided are for the colours of the points.

You should have set the points (using SetPoints()) before call this member.

Definition at line 701 of file milxQtModel.cpp.

◆ generateTensorField

void milxQtModel::generateTensorField ( double  newScale = 0.0,
float  red = defaultColour,
float  green = defaultColour,
float  blue = defaultColour 
)
slot

Generates a tensor field model, i.e. ellipses at each point for the dataset. Arguments provided are for the colours of the ellipses.

Warning
Modifies the PolyData pipeline so that GetOutput() will return the ellipses.

You should have set the points and tensors (using SetPoints() and SetTensors()) before call this member.

Generate the model

Definition at line 581 of file milxQtModel.cpp.

◆ generateTubes

void milxQtModel::generateTubes ( float  red = defaultColour,
float  green = defaultColour,
float  blue = defaultColour 
)
slot

Generates the tubes for the dataset. Arguments provided are for the colours of the tubes.

Warning
Modifies the PolyData pipeline so that GetOutput() will return the graph.

Generate the model

Definition at line 449 of file milxQtModel.cpp.

◆ generateVectorField

void milxQtModel::generateVectorField ( double  newScale = 0.0,
float  red = defaultColour,
float  green = defaultColour,
float  blue = defaultColour 
)
slot

Generates a vector field model, i.e. arrows at each point for the dataset. Arguments provided are for the colours of the vectors.

Warning
Modifies the PolyData pipeline so that GetOutput() will return the vectors.

You should have set the points and vectors (using SetPoints() and SetVectors()) before call this member.

Use Glyphs (vtkGlyph3D) at each point in the set with normals

Use Glyphs (vtkGlyph3D) at each point in the set

Generate the model

Definition at line 522 of file milxQtModel.cpp.

◆ generateVertices

void milxQtModel::generateVertices ( float  red = defaultColour,
float  green = defaultColour,
float  blue = defaultColour 
)
slot

Generates the vertices for the dataset. Arguments provided are for the colours of the vertices.

Warning
Modifies the PolyData pipeline so that GetOutput() will return the vertices.

Generate the model

Definition at line 423 of file milxQtModel.cpp.

◆ generateVerticesAs

void milxQtModel::generateVerticesAs ( const GlyphType  glyphType = Circle,
float  red = defaultColour,
float  green = defaultColour,
float  blue = defaultColour 
)
slot

Generates the vertices as 2D circles for the dataset. Arguments provided are for the colours of the vertices.

Warning
Modifies the PolyData pipeline so that GetOutput() will return the vertices.

Generate the model

Definition at line 436 of file milxQtModel.cpp.

◆ generateWireframe

void milxQtModel::generateWireframe ( float  red = defaultColour,
float  green = defaultColour,
float  blue = defaultColour 
)
slot

Generates the 3D graph for the dataset. Arguments provided are for the colours of the edges of the graph.

Warning
Modifies the PolyData pipeline so that GetOutput() will return the wireframe.

Definition at line 411 of file milxQtModel.cpp.

◆ GetOpacity()

milxQtModel::GetOpacity ( )
inline

Returns the opacity of the model in the display. 1.0 is totally opaque and 0.0 is completely transparent.

The model should have been generated for this member to have any effect.

Definition at line 385 of file milxQtModel.h.

◆ GetPolyDataInput()

vtkSmartPointer< vtkPolyData > milxQtModel::GetPolyDataInput ( )

Returns the original mesh data object (PolyData) used internally VTK style.

This is different to VTK in the sense that it may return a PolyData set by SetGraph() or SetInput().

Definition at line 248 of file milxQtModel.cpp.

◆ matchInfo

void milxQtModel::matchInfo ( QString  filename = "",
bool  rescale = true,
double  factor = 1.0 
)
slot

Loads another model and matches its centroid and (optionally) scales this model to match.

The (optional) factor is how much (or the factor) of the rescaling to apply, e.g. 0.9 would be 90% of the rescaling.

Definition at line 1556 of file milxQtModel.cpp.

◆ normals

void milxQtModel::normals ( const bool  turnOn = false)
slot

Shows the point normals of the model.

Argument provided to bypass GUI/checked action

Definition at line 1929 of file milxQtModel.cpp.

◆ operator=()

milxQtModel & milxQtModel::operator= ( const milxQtModel operand)

Assignment operator for models. Only copies the data as given by GetOutput() of operand. EXPERIMENTAL.

Copy Flags' States

Copy internal computed variables

Definition at line 259 of file milxQtModel.cpp.

◆ registerLandmarks

void milxQtModel::registerLandmarks ( QString  filename = "",
bool  similarity = false 
)
slot

Register or align current mesh to another mesh using the landmark transform, whose filename is provided. If not provided, then Open File dialog will apear.

Warning: This registration method assumes meshes have the same number of points and point to point correspondence.

Definition at line 1670 of file milxQtModel.cpp.

◆ renameScalars

void milxQtModel::renameScalars ( QString  newName = "")
slot

Rename the scalars on the mesh.

The main reason you would rename scalars array is to label the scalar bar.

Definition at line 1141 of file milxQtModel.cpp.

◆ resetScalarRange()

milxQtModel::resetScalarRange ( )
inline

Restores the scalar range of the model currently held to current max range for display.

Affects display only.

Definition at line 358 of file milxQtModel.h.

◆ scaleDisplay

void milxQtModel::scaleDisplay ( const bool  forceDisplay = false)
virtualslot

Toggles the scale bar display.

forceDisplay Boolean is to overide possible previous settings and display bar.

Definition at line 2309 of file milxQtModel.cpp.

◆ SetInput()

void milxQtModel::SetInput ( vtkSmartPointer< vtkPolyData >  mesh)

Assigns the mesh provided to the class, preparing for display. Call generateModel() and then show() to display.

Assigns the mesh provided to the class to index, preparing for display. Call generateModel() and then show() to display. UNTESTED.

Ensure the number of inputs (via SetNumberOfInputs()) is set before calling this member.

Definition at line 116 of file milxQtModel.cpp.

◆ SetOpacity()

milxQtModel::SetOpacity ( double  opacity)
inline

Adjusts the opacity of the model in the display. 1.0 is totally opaque and 0.0 is completely transparent.

WARNING: The model should have been generated for this member to have any effect.

Definition at line 219 of file milxQtModel.h.

◆ SetTransform()

void milxQtModel::SetTransform ( vtkSmartPointer< vtkTransform >  transform)

Sets the transform for the model that will be generated. Must pass a vtkTransform objects, which is easy to use.

Transform this model

Definition at line 219 of file milxQtModel.cpp.

◆ showArray

void milxQtModel::showArray ( const QString  arrayName)
slot

Check if array has scalars or vectors

Definition at line 2431 of file milxQtModel.cpp.

◆ smoothSinc

void milxQtModel::smoothSinc ( int  iterations = 0)
slot

Smooth the model using the Windowed Sinc approach of Taubin et al. Iterations to smooth by is acquired by input a dialog.

A pass band of 0.1 is used internally with all settings at default for the vtkWindowedSincPolyDataFilter filter. Paper: "Optimal Surface Smoothing as Filter Design" G. Taubin, T. Zhang and G. Golub

Definition at line 1342 of file milxQtModel.cpp.

◆ threshold

void milxQtModel::threshold ( double  lowValue = 0.0,
double  upValue = 0.0 
)
slot

Clip the mesh based on scalar values on the mesh.

Threshold based on scalars

Definition at line 1166 of file milxQtModel.cpp.

◆ transform

void milxQtModel::transform ( QString  filename = "",
bool  inverse = false 
)
slot

Transform the model using a loaded affine transform file. File is asked for within this member.

< Use VTK transform function

< Use ITK to VTK transform function

Definition at line 1382 of file milxQtModel.cpp.

◆ updateCoords

void milxQtModel::updateCoords ( vtkObject *  obj)
virtualslot

Picks the coordinates and pixel value from the current mouse position in the window.

Get interactor

Get event position Code initial by Mark Wyszomierski 2003-2007 @ devsample Modified by Shekhar Chandra Do the pick. It will return a non-zero value if we intersected the bounding box.

Write message to status bar

Definition at line 2519 of file milxQtModel.cpp.

◆ updateLookupTable

void milxQtModel::updateLookupTable ( )
virtualslot

Sets the necessary LUTs to model view.

Todo:
Force Opacity to 1.0 here, better more clearer way? Alpha channel for colormap not allow for models

Definition at line 2452 of file milxQtModel.cpp.


The documentation for this class was generated from the following files: