Stimfit @PACKAGE_VERSION@
Loading...
Searching...
No Matches
stfio.h
Go to the documentation of this file.
1// This program is free software; you can redistribute it and/or
2// modify it under the terms of the GNU General Public License
3// as published by the Free Software Foundation; either version 2
4// of the License, or (at your option) any later version.
5
6// This program is distributed in the hope that it will be useful,
7// but WITHOUT ANY WARRANTY; without even the implied warranty of
8// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9// GNU General Public License for more details.
10
11// You should have received a copy of the GNU General Public License
12// along with this program; if not, write to the Free Software
13// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
14
23
24#ifndef _STFIO_H_
25#define _STFIO_H_
26
27#include <iostream>
28
29#include "./core.h"
30
31#include "./recording.h"
32#include "./channel.h"
33#include "./section.h"
34
35/* class Recording; */
36/* class Channel; */
37/* class Section; */
38
40
43namespace stfio {
44
48
50
52
54
56
58
60
62
64
66
70 public:
72
77 ProgressInfo(const std::string&, const std::string&, int, bool) {};
78
80
85 virtual bool Update(int value, const std::string& newmsg="", bool* skip=NULL) = 0;
86 };
87
88
90
93 public:
94 StdoutProgressInfo(const std::string& title, const std::string& message, int maximum, bool verbose);
95 bool Update(int value, const std::string& newmsg="", bool* skip=NULL);
96 private:
97 bool verbosity;
98};
99
103 sr(20),yUnits("mV"),yUnitsCh2("pA"),xUnits("ms") {}
104
105 int hLines;
109 double sr;
110 std::string yUnits;
111 std::string yUnitsCh2;
112 std::string xUnits;
113};
114
131
132
133#ifndef TEST_MINIMAL
135
139findType(const std::string& ext);
140#endif // TEST_MINIMAL
141
143
146StfioDll std::string
148
150
157StfioDll bool
159 const std::string& fName,
160 stfio::filetype type,
161 Recording& ReturnData,
162 const stfio::txtImportSettings& txtImport,
163 stfio::ProgressInfo& progDlg
164);
165
167
173StfioDll bool
174exportFile(const std::string& fName, stfio::filetype type, const Recording& Data,
175 ProgressInfo& progDlg);
176
178
184concatenate(const Recording& src, const std::vector<std::size_t>& sections,
185 ProgressInfo& progDlg);
186
188
195multiply(const Recording& src, const std::vector<std::size_t>& sections,
196 std::size_t channel, double factor);
198
199} // end of namespace
200
201typedef std::vector< std::string >::iterator sst_it;
202typedef std::vector< std::string >::const_iterator c_sst_it;
203typedef std::vector< std::size_t >::const_iterator c_st_it;
204typedef std::vector< int >::iterator int_it;
205typedef std::vector< int >::const_iterator c_int_it;
206typedef std::deque< Channel >::iterator ch_it;
207typedef std::deque< Channel >::const_iterator c_ch_it;
208typedef std::deque< Section >::iterator sec_it;
209typedef std::deque< Section >::const_iterator c_sec_it;
210
211#endif
short channel
Definition cfs.h:173
Declares the Channel class.
Represents the data within a file.
Definition recording.h:44
ProgressInfo class.
Definition stfio.h:69
Lightweight core definitions shared by libstfio model classes.
std::vector< double > Vector_double
Definition core.h:55
#define StfioDll
Defines dll export or import functions for Windows.
Definition core.h:49
filetype
File types.
Definition stfio.h:116
StfioDll Vector_double vec_vec_minus(const Vector_double &vec1, const Vector_double &vec2)
StfioDll std::string findExtension(stfio::filetype ftype)
Returns file extension for a file type.
ProgressInfo(const std::string &, const std::string &, int, bool)
Constructor.
Definition stfio.h:77
virtual bool Update(int value, const std::string &newmsg="", bool *skip=NULL)=0
Updates the progress info.
StfioDll bool exportFile(const std::string &fName, stfio::filetype type, const Recording &Data, ProgressInfo &progDlg)
Generic file export.
StdoutProgressInfo(const std::string &title, const std::string &message, int maximum, bool verbose)
StfioDll Recording multiply(const Recording &src, const std::vector< std::size_t > &sections, std::size_t channel, double factor)
Produce new recording with multiplied sections.
StfioDll Vector_double vec_vec_plus(const Vector_double &vec1, const Vector_double &vec2)
StfioDll Vector_double vec_scal_minus(const Vector_double &vec, double scalar)
StfioDll Vector_double vec_scal_plus(const Vector_double &vec, double scalar)
StfioDll bool importFile(const std::string &fName, stfio::filetype type, Recording &ReturnData, const stfio::txtImportSettings &txtImport, stfio::ProgressInfo &progDlg)
Generic file import.
StfioDll Vector_double vec_vec_div(const Vector_double &vec1, const Vector_double &vec2)
StfioDll Recording concatenate(const Recording &src, const std::vector< std::size_t > &sections, ProgressInfo &progDlg)
Produce new recording with concatenated sections.
StfioDll Vector_double vec_scal_div(const Vector_double &vec, double scalar)
std::string xUnits
Definition stfio.h:112
bool Update(int value, const std::string &newmsg="", bool *skip=NULL)
Updates the progress info.
std::string yUnits
Definition stfio.h:110
StfioDll Vector_double vec_vec_mul(const Vector_double &vec1, const Vector_double &vec2)
std::string yUnitsCh2
Definition stfio.h:111
StfioDll stfio::filetype findType(const std::string &ext)
Attempts to determine the filetype from the filter extension.
StfioDll Vector_double vec_scal_mul(const Vector_double &vec, double scalar)
@ tdms
Definition stfio.h:127
@ none
Definition stfio.h:129
@ igor
Definition stfio.h:122
@ ascii
Definition stfio.h:120
@ biosig
Definition stfio.h:126
@ intan
Definition stfio.h:128
@ abf
Definition stfio.h:118
@ son
Definition stfio.h:123
@ axg
Definition stfio.h:119
@ atf
Definition stfio.h:117
@ hdf5
Definition stfio.h:124
@ cfs
Definition stfio.h:121
@ heka
Definition stfio.h:125
The stfio namespace.
Definition abflib.h:27
Declares the Recording class.
Declares the Section class.
std::deque< Section >::const_iterator c_sec_it
Definition stfio.h:209
std::deque< Channel >::const_iterator c_ch_it
Definition stfio.h:207
std::vector< std::string >::iterator sst_it
Definition stfio.h:201
std::vector< int >::iterator int_it
Definition stfio.h:204
std::deque< Channel >::iterator ch_it
Definition stfio.h:206
std::vector< int >::const_iterator c_int_it
Definition stfio.h:205
std::vector< std::size_t >::const_iterator c_st_it
Definition stfio.h:203
std::vector< std::string >::const_iterator c_sst_it
Definition stfio.h:202
std::deque< Section >::iterator sec_it
Definition stfio.h:208
Text file import filter settings.
Definition stfio.h:101