File: OneViewAndTrackingUsingQTWidgetAndMicronTrackerGUI.h

package info (click to toggle)
igstk 4.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 36,940 kB
  • ctags: 6,895
  • sloc: cpp: 70,958; makefile: 99; xml: 70
file content (102 lines) | stat: -rwxr-xr-x 3,317 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*=========================================================================

  Program:   Image Guided Surgery Software Toolkit
  Module:    $RCSfile: OneViewAndTrackingUsingQTWidgetAndMicronTrackerGUI.h,v $
  Language:  C++
  Date:      $Date: 2009-06-12 15:23:31 $
  Version:   $Revision: 1.1 $

  Copyright (c) ISC  Insight Software Consortium.  All rights reserved.
  See IGSTKCopyright.txt or http://www.igstk.org/copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#ifndef __OneViewAndTrackingUsingQTWidgetAndMicronTrackerGUI_h
#define __OneViewAndTrackingUsingQTWidgetAndMicronTrackerGUI_h

#include <QtGui>

#include "igstkEllipsoidObject.h"
#include "igstkCylinderObject.h"
#include "igstkEllipsoidObjectRepresentation.h"
#include "igstkCylinderObjectRepresentation.h"
#include "igstkMicronTracker.h"
#include "igstkMicronTrackerTool.h"
#include "igstkView.h"
#include "igstkTransform.h"
#include "igstkSerialCommunication.h"
#include "igstkLogger.h"
#include "itkStdStreamLogOutput.h"

#include "ui_OneViewAndTrackingUsingQTWidgetAndMicronTrackerGUI.h"

class OneViewAndTrackingUsingQTWidgetAndMicronTrackerGUI : public QMainWindow
{
  Q_OBJECT

  typedef igstk::Object::LoggerType            LoggerType; 
  typedef itk::StdStreamLogOutput              LogOutputType;

  typedef igstk::MicronTracker                 TrackerType;
  typedef igstk::MicronTrackerTool             TrackerToolType;
  typedef TrackerToolType::TransformType       TransformType;
  typedef igstk::SerialCommunication           CommunicationType;

public:
  OneViewAndTrackingUsingQTWidgetAndMicronTrackerGUI();
  ~OneViewAndTrackingUsingQTWidgetAndMicronTrackerGUI();
  void AttachObjectToTrackerTool( int trackerToolNumber,
                                  igstk::SpatialObject * objectToTrack );
  void InitializeTracker( std::string InitializationFile,
                          std::string CameraCalibrationFileDirectory,
                          std::string markerTemplateDirectory );
  void ConfigureTrackerToolsAndAttachToTheTracker();
  void SetView( igstk::View * view );
  bool IsTrackingTurnedOn()
    {
    return m_Tracking;
    }

  void AttachTrackerToView( igstk::View * view);
 
  bool HasQuitted();

public slots:
  void OnQuitAction();
  void OnTrackingAction( int state);
  void OnInteractionAction( int state);

private:
  void CreateActions();

  Ui::MainWindow          m_GUI;

  LoggerType::Pointer     m_Logger;
  LogOutputType::Pointer  m_LogOutput;
  TrackerType::Pointer    m_Tracker;

  TrackerToolType::Pointer    m_TrackerTool;
  TrackerToolType::Pointer    m_TrackerTool2;

  CommunicationType::Pointer m_Communication;

  bool                    m_Tracking;
  
  std::ofstream           m_LogFile;

  bool                    m_GUIQuit;

  typedef itk::ReceptorMemberCommand < 
       OneViewAndTrackingUsingQTWidgetAndMicronTrackerGUI > ObserverType;
  ObserverType::Pointer                       m_ViewPickerObserver;


  /** Callback functions for picking */ 
  void ParsePickedPoint( const itk::EventObject & event );

};

#endif