1
2
3
4
5
6
7
8
9 """Tiny snippets to interface with FSL easily."""
10
11 __docformat__ = 'restructuredtext'
12
13 from mvpa.misc.io import ColumnData
14
15 if __debug__:
16 from mvpa.base import debug
17
18
20 """IO helper to read BrainVoyager RTC files.
21
22 This is a textfile format that is used to specify stimulation
23 protocols for data analysis in BrainVoyager. It looks like
24
25 FileVersion: 2
26 Type: DesignMatrix
27 NrOfPredictors: 4
28 NrOfDataPoints: 147
29
30 "fm_l_60dB" "fm_r_60dB" "fm_l_80dB" "fm_r_80dB"
31 0.000000 0.000000 0.000000 0.000000
32 0.000000 0.000000 0.000000 0.000000
33 0.000000 0.000000 0.000000 0.000000
34
35 Data is always read as `float` and header is actually ignored
36 """
38 """Read and write BrainVoyager RTC files.
39
40 :Parameter:
41 source: filename of an RTC file
42 """
43
44 ColumnData.__init__(self, source, header=True,
45 sep=None, headersep='"', dtype=float, skiplines=5)
46
47
49 """Returns the data as an array
50 """
51 import numpy as N
52
53
54 return N.array([self[i] for i in self._header_order],
55 dtype='float').T
56