1 #ifndef _ERPTier_h_
2 #define _ERPTier_h_
3 /* ERPTier.h
4  *
5  * Copyright (C) 2011,2012,2014-2018 Paul Boersma
6  *
7  * This code is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or (at
10  * your option) any later version.
11  *
12  * This code is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15  * See the GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this work. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #include "EEG.h"
22 #include "ERP.h"
23 
24 #include "ERPTier_def.h"
25 
26 integer ERPTier_getChannelNumber (ERPTier me, conststring32 channelName);
ERPTier_checkEventNumber(ERPTier me,integer eventNumber)27 static inline void ERPTier_checkEventNumber (ERPTier me, integer eventNumber) {
28 	if (eventNumber < 1)
29 		Melder_throw (U"The specified event number is ", eventNumber, U" but should have been positive.");
30 	if (eventNumber > my points.size)
31 		Melder_throw (U"The specified event number (", eventNumber, U") exceeds the number of events (", my points.size, U").");
32 }
33 double ERPTier_getMean (ERPTier me, integer pointNumber, integer channelNumber, double tmin, double tmax);
34 double ERPTier_getMean (ERPTier me, integer pointNumber, conststring32 channelName, double tmin, double tmax);
35 void ERPTier_subtractBaseline (ERPTier me, double tmin, double tmax);
36 void ERPTier_rejectArtefacts (ERPTier me, double threshold);
37 autoERP ERPTier_extractERP (ERPTier me, integer pointNumber);
38 autoERP ERPTier_to_ERP_mean (ERPTier me);
39 autoERPTier ERPTier_extractEventsWhereColumn_number (ERPTier me, Table table, integer columnNumber, kMelder_number which, double criterion);
40 autoERPTier ERPTier_extractEventsWhereColumn_string (ERPTier me, Table table, integer columnNumber, kMelder_string which, conststring32 criterion);
41 
42 autoERPTier EEG_to_ERPTier_bit (EEG me, double fromTime, double toTime, int markerBit);
43 autoERPTier EEG_to_ERPTier_marker (EEG me, double fromTime, double toTime, uint16 marker);
44 autoERPTier EEG_to_ERPTier_triggers (EEG me, double fromTime, double toTime,
45 	kMelder_string which, conststring32 criterion);
46 autoERPTier EEG_to_ERPTier_triggers_preceded (EEG me, double fromTime, double toTime,
47 	kMelder_string which, conststring32 criterion,
48 	kMelder_string precededBy, conststring32 criterion_precededBy);
49 
50 /* End of file ERPTier.h */
51 #endif
52