NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
SurfaceReconView.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef SurfaceReconView_h
16 #define SurfaceReconView_h
17 
18 #include <niftkBaseView.h>
20 #include <service/event/ctkEvent.h>
21 #include "ui_SurfaceReconViewWidget.h"
22 #include <QFuture>
23 #include <QFutureWatcher>
24 
25 
31 class SurfaceReconView : public niftk::BaseView, public Ui::SurfaceReconViewWidget
32 {
33  // this is needed for all Qt objects that should have a Qt meta-object
34  // (everything that derives from QObject and wants to have signal/slots)
35  Q_OBJECT
36 
37 public:
38 
40  virtual ~SurfaceReconView();
41 
45  static const char* VIEW_ID;
46 
51  virtual std::string GetViewID() const;
52 
53 protected:
54 
58  virtual void CreateQtPartControl(QWidget *parent) override;
59 
63  virtual void SetFocus() override;
64 
65  // this should probably go into one of our modules, for easier testing and re-use!
67 
69  void WriteCurrentConfig(const QString& directory) const;
70 
71 protected slots:
72 
77 
78 private slots:
79 
83  void OnUpdate(const ctkEvent& event);
84 
85  // we connect the future to this slot
86  void OnBackgroundProcessFinished();
87 
89  void OnRecordingStarted(const ctkEvent& event);
90 
91 private:
92  mitk::BaseData::Pointer RunBackgroundReconstruction(niftk::SurfaceReconstruction::ParamPacket param);
93 
97  void RetrievePreferenceValues();
98 
102  virtual void OnPreferencesChanged(const berry::IBerryPreferences*) override;
103 
107  niftk::SurfaceReconstruction::Pointer m_SurfaceReconstruction;
108 
109 
110  QFuture<mitk::BaseData::Pointer> m_BackgroundProcess;
111  QFutureWatcher<mitk::BaseData::Pointer> m_BackgroundProcessWatcher;
112  std::string m_BackgroundOutputNodeName;
113  std::string m_BackgroundLeftNodeName;
114  std::string m_BackgroundRightNodeName;
115  bool m_BackgroundOutputNodeIsVisible;
116  std::string m_BackgroundErrorMessage;
117 
118  // these are coming from the ctk event bus admin. we use them to explicitly unregister ourself.
119  qlonglong m_IGIUpdateSubscriptionID;
120  qlonglong m_IGIRecordingStartedSubscriptionID;
121 };
122 
123 #endif // SurfaceReconView_h
static const char * VIEW_ID
Static view ID = uk.ac.ucl.cmic.igisurfacerecon.
Definition: SurfaceReconView.h:45
virtual void SetFocus() override
Called by framework, sets the focus on a specific widget.
Definition: SurfaceReconView.cxx:184
Definition: niftkSurfaceReconstruction.h:108
virtual ~SurfaceReconView()
Definition: SurfaceReconView.cxx:56
void WriteCurrentConfig(const QString &directory) const
Definition: SurfaceReconView.cxx:209
User interface to provide a reconstructed surface from video images.
Definition: SurfaceReconView.h:31
SurfaceReconView()
Definition: SurfaceReconView.cxx:42
virtual void CreateQtPartControl(QWidget *parent) override
Called by framework, this method creates all the controls for this view.
Definition: SurfaceReconView.cxx:95
void DoSurfaceReconstruction()
The main method to perform the surface reconstruction.
Definition: SurfaceReconView.cxx:313
Base view component for plugins listening to visibility change events, focus changed events and so on...
Definition: niftkBaseView.h:47
std::string IncrementNodeName(const std::string &name)
Definition: SurfaceReconView.cxx:271
GLuint const GLchar * name
Definition: glew.h:1798
cl_event event
Definition: glew.h:3231
GLfloat param
Definition: glew.h:1514
virtual std::string GetViewID() const
Returns the view ID.
Definition: SurfaceReconView.cxx:88
GLsizei const GLcharARB ** string
Definition: glew.h:5194