18 #ifndef MILXQTSHAPEMODEL_H 19 #define MILXQTSHAPEMODEL_H 22 #include <itkStatisticalShapeTimepointModel.h> 25 #include <milxQtRenderWindow.h> 26 #include <milxQtModel.h> 28 typedef itk::StatisticalShapeModelBase<double> ShapeModelBaseType;
29 typedef itk::StatisticalShapeTimepointModel<double> ShapeModelType;
55 void LoadModel(
const QString filename);
62 inline virtual void openModel(
const QString filename)
72 inline virtual void SaveModel(
const QString filename)
74 m_StandardSSM->Update();
75 m_StandardSSM->SaveModel(filename.toStdString().c_str());
83 inline virtual void saveModel(
const QString filename)
92 virtual void SetInputCollection(vtkPolyDataCollection* meshes);
99 virtual void SetInputCollection(vtkPolyDataCollection* meshes, QStringList &filenames);
106 m_SSM->SetPrecision(modePrecision);
113 { m_SSM->AddShape(shape); }
119 {
return m_SSM->GetShape(index); }
125 {
return m_SSM->GetProcrustesAlignedSurface(index); }
131 {
return m_SSM->GetProcrustesAlignedSurface(index); }
139 if(m_modelled)
return m_SSM->GetMeanShape();
146 QPointer<milxQtModel> getMeanModel();
153 if(m_modelled)
return m_SSM->GetNumberOfModes();
161 {
return m_SSM->GetNumberOfShapes(); }
167 {
return m_caseIDs; }
183 virtual void generateSSM();
188 virtual void generateMeanModel(vtkSmartPointer<vtkPolyData> shape = NULL);
193 void generateModels(
const bool display =
true);
200 void generateAlignedModels(
const bool display =
true);
207 virtual void generateModes();
208 virtual void generateCollectionBasedOnMode();
215 void generateVectorField();
222 void generateTensorField();
227 void generateCorrespondences();
248 void modesAsVectors();
253 void modesAsTensors();
258 void modesAsCollection();
273 void alignedMeshes();
278 void originalMeshes();
298 void replaceOriginal();
303 void correspondences();
326 void generalisability();
348 void collectionAvailable(vtkPolyDataCollection*, QStringList&);
420 virtual void reset();
421 void outputSnapshots(
const QString filename);
436 void setupTooltips();
447 #endif // MILXQTSHAPEMODEL_H virtual void createMenu(QMenu *menu)
Create the menu for the data in this object. Used for context menu and file menus.
QPointer< milxQtModel > m_modesVectorModel
Vector Model of the modes.
QAction * actionGeneralise
generalisibility error plot action
QAction * actionAlignment
alignment check action
QAction * actionCoordinates
coordinates check action
QList< int > getCaseIDs()
Returns the case IDs for the SSM. Assumes that an SSM has been loaded.
QAction * actionModesAsCollection
modes collection action
virtual void saveModel(const QString filename)
Saves a model as an SSM (*.ssm) file.
int m_mode
Mode being viewed.
QAction * actionOriginal
original points action
bool m_tensor
Tensors generated?
This file defines all the defines, aliases and frequently used functions and variables.
This class represents the MILX Qt Render Window Display object using QVTK.
bool m_alignedShapesModelled
Shapes were generated?
QMenu * plotMenu
Plot menu for SSM analysis.
QAction * actionModesAsTensors
modes action
QAction * actionReplaceOriginal
correspondence check action
void createConnections()
Create the connections for context menu etc.
QAction * actionSimilarity
similarity Procrustes action
QAction * actionCompact
compactness plot action
vtkPolyData * GetShape(unsigned int index)
Gets the shape at index in the SSM.
QAction * actionAligned
aligned points action
QPointer< milxQtModel > m_modesTensorModel
Tensor Model of the modes.
QActionGroup * alignGroup
Procrustes align gp action.
virtual vtkDataSet * GetDataSet()
Get the data, Implement in derived class that uses data derived from vtkDataSet, like vtkPolyData or ...
bool m_modes
Modes been generated?
QList< QPointer< milxQtModel > > m_models
Original Models in the SSM.
virtual void updateLookupTable()
Implement this into your derived class to ensure the new colourmap is passed on to your viewing data ...
QAction * actionOriginalMeshes
original meshes output action
QAction * actionModesAsVectors
modes action
QAction * actionCorrespond
correspondence check action
bool m_meaned
Mean generated?
bool m_modelled
SSM Modelled?
QAction * actionAlignedMeshes
alignmed meshes output action
QAction * actionModes
primary modes plot action
This class represents the MILX Qt Model/Mesh Display object using VTK.
vtkPolyData * GetProcrustesAlignedSurface(unsigned int index)
Gets the shape at index in the SSM. Same as GetAlignedShape().
QAction * actionRigid
rigid Procrustes action
QPointer< milxQtModel > m_correspondences
Hedgehog display of the correspondences.
int GetNumberOfModes()
Returns the number of modes in the Statistical Shape Model according to the precision set...
void AddShape(vtkPolyData *shape)
Adds the shape to the SSM, once done adding shapes, call generateSSM() to get the SSM...
virtual void openModel(const QString filename)
Loads a model as an SSM (*.ssm) file. Alias same as LoadModel().
bool m_correspond
Hedgehog generated?
void contextMenuEvent(QContextMenuEvent *event)
The context menu setup member.
ShapeModelType::Pointer m_StandardSSM
The Statistical Shape Model.
QAction * actionSpecificity
specificity plot action
void createActions()
Create the actions for context menu etc.
void reset()
Reset the rendering, camera and windowing.
ShapeModelBaseType::Pointer m_SSM
The Statistical Shape Model Base Class.
QMenu * alignMenu
Plot menu for SSM alignment.
int GetNumberOfShapes()
Returns the number of shapes in the Statistical Shape Model. Assumes SSM has been generated (via gene...
QPointer< milxQtModel > m_meanModel
Model of the mean.
bool m_vector
Vectors generated?
QAction * actionPointIDs
point ids check action
void SetPrecision(float modePrecision)
Assigns the reduction factor of the modes, i.e the number of modes required to quantify modePrecision...
#define MILXQT_PLUGIN_EXPORT
Define Windows Plugin DLL importing.
QAction * actionValues
primary modes plot action
QAction * actionMean
mean action
bool m_loaded
Shapes loaded?
virtual bool isLoaded()
Is the model loaded successfully?
vtkPolyData * GetMeanShape()
Returns the mean shape of the Statistical Shape Model. Assumes SSM has been generated (via generateSS...
QAction * actionAffine
affine Procrustes action
QList< QPointer< milxQtModel > > m_alignedModels
Aligned Models in the SSM.
QList< int > m_caseIDs
A list of case IDs corresponding to the models in the SSM.
vtkPolyData * GetAlignedShape(unsigned int index)
Gets the shape at index in the SSM.
QAction * actionParameters
training shape parameters plot action
bool m_shapesModelled
Shapes were generated?
virtual void SaveModel(const QString filename)
Saves a model as an SSM (*.ssm) file. MILX-MSK like call.