Stimfit @PACKAGE_VERSION@
Loading...
Searching...
No Matches
intanlib.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
20
21/*
22Mostly a Python version of read_Intan_CLP_file.m from
23http://www.intantech.com/files/Intan_CLAMP_software_compiled_v1_0.zip
24as of 2016-11-05
25
26Example:
27>>> import matplotlib.pyplot as plt
28>>> import intan
29>>> intan_file = intan.IntanFile('myexperiment_A_160916_142731.clp')
30>>> plt.plot(intan_file.data["Time"], intan_file.data["Measured"])
31>>> intan_file = intan.IntanFile('myexperiment_AUX_160916_142731.clp')
32>>> plt.plot(intan_file.data["Time"], intan_file.data["ADC"][1])
33*/
34#ifndef INTANLIB_H
35#define INTANLIB_H
36
37#if __cplusplus > 199711L
38#include <cstdint>
39#else
40#include <boost/cstdint.hpp>
41#endif
42
43#include "./../stfio.h"
44
45#if defined(_MSC_VER) && (_MSC_VER < 1600)
46typedef __int8 int8_t;
47typedef __int16 int16_t;
48typedef __int32 int32_t;
49typedef __int64 int64_t;
50typedef unsigned __int8 uint8_t;
51typedef unsigned __int16 uint16_t;
52typedef unsigned __int32 uint32_t;
53typedef unsigned __int64 uint64_t;
54#endif
55
56class Recording;
57
58static const int MAX_REGISTERS = 14;
59static const uint32_t MAGIC_NUMBER = 0xf3b1a481;
60
61struct Segment {
63 uint32_t tOffset;
64 uint32_t startIndex;
65 uint32_t endIndex;
67};
68
76
81
97
99 uint8_t coarse;
100 uint8_t fine;
101};
102
111
113 std::vector<ChannelHeader> channels;
114 uint16_t chipRegisters[4];
115};
116
120 int16_t datatype;
121 int16_t date_Year;
122 int16_t date_Month;
123 int16_t date_Day;
124 int16_t date_Hour;
125 int16_t date_Minute;
126 int16_t date_Second;
127 std::vector<ChipHeader> Chips;
129 uint16_t numADCs;
130
131};
132
133namespace stfio {
134
136
141 void importIntanFile(const std::string &fName, Recording &ReturnData, ProgressInfo& progDlg);
142
143}
144#endif
Represents the data within a file.
Definition recording.h:44
ProgressInfo class.
Definition stfio.h:69
static const uint32_t MAGIC_NUMBER
Definition intanlib.h:59
static const int MAX_REGISTERS
Definition intanlib.h:58
The stfio namespace.
Definition abflib.h:27
void importIntanFile(const std::string &fName, Recording &ReturnData, ProgressInfo &progDlg)
Open an Intan file and store its contents to a Recording object.
header file for libstfio
uint8_t fine
Definition intanlib.h:100
uint8_t coarse
Definition intanlib.h:99
uint32_t differenceAmpResidual
Definition intanlib.h:105
uint16_t registers[MAX_REGISTERS]
Definition intanlib.h:104
Calibration bestCalibration[2][4]
Definition intanlib.h:107
uint32_t voltageAmpResidual
Definition intanlib.h:106
float rFeedback[5]
Definition intanlib.h:108
float desiredBandwidth
Definition intanlib.h:109
uint16_t chipRegisters[4]
Definition intanlib.h:114
std::vector< ChannelHeader > channels
Definition intanlib.h:113
std::vector< Segment > waveform
Definition intanlib.h:95
uint8_t vClampX2Mode
Definition intanlib.h:92
uint8_t isVoltageClamp
Definition intanlib.h:91
uint8_t enableCapacitiveCompensation
Definition intanlib.h:83
float samplingRate
Definition intanlib.h:87
float capCompensationMagnitude
Definition intanlib.h:84
float filterCutoff
Definition intanlib.h:85
float pipetteOffset
Definition intanlib.h:86
CurrentClampSettings ccSettings
Definition intanlib.h:94
VoltageClampSettings vcSettings
Definition intanlib.h:93
int16_t date_Month
Definition intanlib.h:122
uint16_t numADCs
Definition intanlib.h:129
int16_t date_Second
Definition intanlib.h:126
int16_t datatype
Definition intanlib.h:120
int16_t date_Day
Definition intanlib.h:123
int16_t date_Minute
Definition intanlib.h:125
int16_t version_major
Definition intanlib.h:118
HeaderSettings Settings
Definition intanlib.h:128
int16_t date_Year
Definition intanlib.h:121
std::vector< ChipHeader > Chips
Definition intanlib.h:127
int16_t date_Hour
Definition intanlib.h:124
int16_t version_minor
Definition intanlib.h:119
uint8_t waveformNumber
Definition intanlib.h:62
uint32_t endIndex
Definition intanlib.h:65
uint32_t startIndex
Definition intanlib.h:64
float appliedValue
Definition intanlib.h:66
uint32_t tOffset
Definition intanlib.h:63