Medical Imaging Interaction Toolkit  2018.4.99-7e02155b
Medical Imaging Interaction Toolkit
mitkOphirPyro.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 
14 #ifndef MITKOPHIRPYRO_H_HEADER_INCLUDED
15 #define MITKOPHIRPYRO_H_HEADER_INCLUDED
16 
17 #include "itkObject.h"
18 #include "mitkCommon.h"
19 
20 #include "vector"
21 #include "MitkPhotoacousticsHardwareExports.h"
22 
23 #include "OphirPyroWrapper.h"
24 
25 #include <usModule.h>
26 #include <usModuleResource.h>
27 #include <usGetModuleContext.h>
28 #include <usModuleContext.h>
29 #include <usModuleResourceStream.h>
30 #include <iostream>
31 #include <fstream>
32 #include <chrono>
33 #include <thread>
34 
35 namespace mitk {
36 
37  class MITKPHOTOACOUSTICSHARDWARE_EXPORT OphirPyro : public itk::Object
38  {
39  public:
41  itkFactorylessNewMacro(Self);
42 
43  virtual bool OpenConnection();
44  virtual bool CloseConnection();
45  virtual bool StartDataAcquisition();
46  virtual bool StopDataAcquisition();
47  unsigned int GetDataFromSensor();
48  void GetDataFromSensorThread();
49  void SaveData();
50 
51  virtual double LookupCurrentPulseEnergy();
52  virtual double GetNextPulseEnergy();
53  virtual double LookupCurrentPulseEnergy(double* timestamp, int* status);
54  virtual double GetNextPulseEnergy(double* timestamp, int* status);
55 
56  virtual double GetClosestEnergyInmJ(long long ImageTimeStamp, double interval=20);
57  virtual double GetNextEnergyInmJ(long long ImageTimeStamp, double interval = 20);
58  virtual void SetSyncDelay(long long FirstImageTimeStamp);
59  virtual bool IsSyncDelaySet();
60 
61 
62  protected:
63  OphirPyro();
64  virtual ~OphirPyro();
65  void SaveCsvData();
66  OphirPyroWrapper ophirAPI;
71  std::vector<double> m_PulseEnergy;
72  std::vector<double> m_PulseTime;
73  std::vector<int> m_PulseStatus;
74  std::vector<long long> m_TimeStamps;
75 
76  std::vector<double> m_PulseEnergySaved;
77  std::vector<double> m_PulseTimeSaved;
78  std::vector<int> m_PulseStatusSaved;
79  std::vector<long long> m_TimeStampsSaved;
80 
83  long long m_ImagePyroDelay;
85 
86  std::thread m_GetDataThread;
87  };
88 } // namespace mitk
89 
90 #endif /* MITKOPHIRPYRO_H_HEADER_INCLUDED */
double m_CurrentWavelength
Definition: mitkOphirPyro.h:81
std::vector< double > m_PulseTime
Definition: mitkOphirPyro.h:72
std::vector< double > m_PulseEnergySaved
Definition: mitkOphirPyro.h:76
char * m_SerialNumber
Definition: mitkOphirPyro.h:67
DataCollection - Class to facilitate loading/accessing structured data.
double m_CurrentEnergyRange
Definition: mitkOphirPyro.h:82
float m_EnergyMultiplicator
Definition: mitkOphirPyro.h:84
std::thread m_GetDataThread
Definition: mitkOphirPyro.h:86
long long m_ImagePyroDelay
Definition: mitkOphirPyro.h:83
std::vector< int > m_PulseStatus
Definition: mitkOphirPyro.h:73
std::vector< double > m_PulseTimeSaved
Definition: mitkOphirPyro.h:77
std::vector< long long > m_TimeStampsSaved
Definition: mitkOphirPyro.h:79
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:49
std::vector< int > m_PulseStatusSaved
Definition: mitkOphirPyro.h:78
OphirPyroWrapper ophirAPI
Definition: mitkOphirPyro.h:66
std::vector< long long > m_TimeStamps
Definition: mitkOphirPyro.h:74
std::vector< double > m_PulseEnergy
Definition: mitkOphirPyro.h:71