-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExperiment.h
140 lines (122 loc) · 4.05 KB
/
Experiment.h
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/* Experiment.h
* ----------
* Header file for the Experiment class. The Experiment object handles a single
* worm behavior experiment.
*
* Created by John Whitworth on 8/26/14.
* Copyright 2015 Eileen Mazzochette, et al <[email protected]>
*/
#pragma once
#pragma managed(push,off)
#include <cv.h>
#pragma managed(pop)
#include "DataManagement.h"
#include "Stimulus.h"
#include "Worm.h"
using namespace std;
class Experiment {
//properties
public:
//experiment states:
bool experimentSetUp;
bool stimulusReady;
bool trackingReady;
bool trackingActive;
bool stimulusActive;
bool postStimulusRecording;
int stimulusNumber;
//the percentage of body length from the head that should be targeted
double targetLocation;
//path to data output location
string dataOutputLocation;
//force or displacement clamp
string experimentMode;
//user given title for data output
string experimentTitle;
//any extra pre-experiment notes
string otherInfo;
//any extra post-experiment notes
string postExpNotes;
//the DataManager for this experiment
DataManager dataManager;
// Decide whether or not to print the overlays on the worm in the output video. true = yes, print overlays
bool printOverlays;
// amount of time to record frames (converts to the number of frames to have in the dataManager's buffer) before stimulus is applied
int waitingBufferSize;
// amount of time to record frames (converts to the number of frames) to record after stimulus is applied
int postWaitingBufferSize;
// counter for the number of experiments done on a particular slide
int experimentPerSlideNumber;
// counter for the number of slides experimented in this session.
int slideNumber;
//user defined properties of the worm
struct WormProperties{
string wormStrain;
string wormTreatments;
string wormGender;
string wormAge;
int percentAgar;
string foodStatus;
} wormProperties;
//user defined properties of the cantilever
struct CantileverProperties{
string serialNumber;
//include control parameters
double frequency;
double stiffness;
double sensitivity;
cv::Point positionInImageSpace;
double P_parameter;
double I_parameter;
double D_parameter;
} cantileverProperties;
//stimulus associated with experiment
Stimulus stim;
//user defined ambient parameters
struct AmbientParameters{
double temperature;
double humidity;
} ambientParameters;
struct ReportedFPGAParameters{
double P_Parameter;
double I_Parameter;
double D_Parameter;
double clampModeParameter;
double triggerModeParameter;
double acquisitionFreqParameter;
double actuatorFreqParameter;
double waveTablePresentParameter;
} reportedFPGAParameters;
//prototypes
public:
Experiment();
/* Function: setUpDataOutput
* -------------------------
* Sets up the data writers and then writes out all the header information for the
* experiment.
*/
int setUpDataOutput(void);
/* Function: writeFrameToDisk
* --------------------------
* Writes a frame of information to disk. This includes raw data on the YAML side and
* the video to the AVI file.
*/
void writeFrameToDisk(WormOutputData data);
/* Function: getfpgaData
* --------------------------
* Get the data from the FPGA to be written to disk.
*/
//void getfpgaData(int stimNum, vector<double> piezoSignalData, vector<double> actuatorPositionData, vector<double> actuatorCommandData, vector<double> desiredSignalData);
/* Function: write fpga data to disk
* -------------------------------------------
* writes the data from the fpga to the data writer in the data manager.
*/
void writefpgaDataToDisk(int stimNum, vector<double> piezoSignalData, vector<double> actuatorPositionData, vector<double> actuatorCommandData, vector<double> desiredSignalData);
//void writefpgaDataToDisk();
/* Function: endExperiment
* -----------------------
* Writes the post-experiment notes and timing data to disk. Then closes the data
* writers.
*/
void endExperiment(void);
};