SMILX  1.01
milxQtRobustShapeModel.h
1 /*=========================================================================
2  The Software is copyright (c) Commonwealth Scientific and Industrial Research Organisation (CSIRO)
3  ABN 41 687 119 230.
4  All rights reserved.
5 
6  Licensed under the CSIRO BSD 3-Clause License
7  You may not use this file except in compliance with the License.
8  You may obtain a copy of the License in the file LICENSE.md or at
9 
10  https://stash.csiro.au/projects/SMILI/repos/smili/browse/license.txt
11 
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  See the License for the specific language governing permissions and
16  limitations under the License.
17 =========================================================================*/
18 #ifndef milxQtRobustShapeModel_H
19 #define milxQtRobustShapeModel_H
20 
21 //milxSSM3D
22 #include <itkRobustStatisticalShapeModel.h>
23 
24 #include <milxQtAliases.h>
25 #include <milxQtShapeModel.h>
26 
27 typedef itk::RobustStatisticalShapeModel<double> RobustShapeModelType;
28 
30 {
31  Q_OBJECT
32 
33 public:
35  milxQtRobustShapeModel(QWidget *theParent = 0, bool contextSystem = true);
37  virtual ~milxQtRobustShapeModel();
38 
39 public slots:
46  void LoadModel(const QString filename);
53  inline virtual void openModel(const QString filename)
54  {
55  LoadModel(filename);
56  }
63  inline virtual void SaveModel(const QString filename)
64  {
65  m_RobustSSM->Update();
66  m_RobustSSM->SaveCompactModel(filename.toStdString().c_str());
67  }
74  inline virtual void saveModel(const QString filename)
75  {
76  SaveModel(filename);
77  }
78 
83  virtual void SetInputCollection(vtkPolyDataCollection* meshes);
90  virtual void SetInputCollection(vtkPolyDataCollection* meshes, QStringList &filenames);
97  virtual void SetInputCollection(vtkPolyDataCollection* meshes, vtkPolyData *atlasSurface, QStringList &filenames);
98 
103  virtual void createMenu(QMenu *menu);
104 
109  virtual void generateSSM();
114  virtual void generateMeanModel(vtkSmartPointer<vtkPolyData> shape = NULL);
121  virtual void generateModes();
122  virtual void generateCollectionBasedOnMode();
127  virtual void generateCorrespondences();
128 
136  void compactness();
143  void specificity();
150  void generalisability();
155  void eigenvalues();
160  void eigenmodes();
165  void parameters();
166 
167 signals:
172  void collectionAvailable(vtkPolyDataCollection*, QStringList&);
183 
184 protected:
185  RobustShapeModelType::Pointer m_RobustSSM;
186  QList< int > m_caseIDs;
187 
188  virtual void reset();
193  void createActions();
198  void contextMenuEvent(QContextMenuEvent *event);
199 
200 private:
201 
202 };
203 
204 #endif // milxQtRobustShapeModel_H
void compactness()
Plot the compactness of the SSM.
virtual void generateSSM()
virtual void SetInputCollection(vtkPolyDataCollection *meshes)
Uses the collection of polydata to create shape model.
This file defines all the defines, aliases and frequently used functions and variables.
void parameters()
Plot the training shape parameters of the model for each training shape (leave 1 out).
This class represents the MILX Qt Render Window Display object using QVTK.
QList< int > m_caseIDs
A list of case IDs corresponding to the models in the SSM.
void contextMenuEvent(QContextMenuEvent *event)
The context menu setup member.
void specificity()
Plot the specificity of the SSM.
void createActions()
Create the actions for context menu etc.
virtual void openModel(const QString filename)
Loads a robust model as an SSM (*.rssm) file. Alias same as LoadModel().
This class represents the MILX Qt Model/Mesh Display object using VTK.
Definition: milxQtModel.h:115
virtual void SaveModel(const QString filename)
Saves a robust model as an SSM (*.rssm) file. MILX-MSK like call.
void resultAvailable(milxQtRenderWindow *)
Send signal that Resultant render window is available for showing.
virtual void generateMeanModel(vtkSmartPointer< vtkPolyData > shape=NULL)
void generalisability()
Plot the generalisability of the SSM.
virtual void createMenu(QMenu *menu)
Create the menu for the data in this object. Used for context menu and file menus.
virtual void saveModel(const QString filename)
Saves a robust model as an SSM (*.rssm) file.
RobustShapeModelType::Pointer m_RobustSSM
The Statistical Shape Model.
void eigenmodes()
Plot the primary eigenmodes of the model for each training shape.
#define MILXQT_PLUGIN_EXPORT
Define Windows Plugin DLL importing.
void LoadModel(const QString filename)
Loads a model as an SSM (*.ssm) file. MILX-MSK like call.
virtual void generateModes()
void eigenvalues()
Plot the eigenvalues of the model.
virtual void generateCollectionBasedOnMode()
virtual void SaveModel(const QString filename)
Saves a model as an SSM (*.ssm) file. MILX-MSK like call.