|
32 | 32 | # ------------- |
33 | 33 |
|
34 | 34 | # path of the data directory |
35 | | -import os |
36 | 35 | from voxelwise_tutorials.io import get_data_home |
37 | | -directory = os.path.join(get_data_home(), "vim-2") |
| 36 | +directory = get_data_home(dataset="vim-2") |
38 | 37 | print(directory) |
39 | 38 |
|
40 | 39 | # modify to use another subject |
41 | 40 | subject = "subject1" |
42 | 41 |
|
43 | 42 | ############################################################################### |
44 | 43 | # Here the data is not loaded in memory, we only take a peek at the data shape. |
| 44 | +import os |
45 | 45 | import h5py |
46 | | -import os.path as op |
47 | 46 |
|
48 | | -with h5py.File(op.join(directory, f'VoxelResponses_{subject}.mat'), 'r') as f: |
| 47 | +file_name = os.path.join(directory, f'VoxelResponses_{subject}.mat') |
| 48 | +with h5py.File(file_name, 'r') as f: |
49 | 49 | print(f.keys()) # Show all variables |
50 | 50 | for key in f.keys(): |
51 | 51 | print(f[key]) |
|
57 | 57 |
|
58 | 58 | from voxelwise_tutorials.io import load_hdf5_array |
59 | 59 |
|
60 | | -file_name = op.join(directory, f'VoxelResponses_{subject}.mat') |
| 60 | +file_name = os.path.join(directory, f'VoxelResponses_{subject}.mat') |
61 | 61 | Y_train = load_hdf5_array(file_name, key='rt') |
62 | 62 | Y_test_repeats = load_hdf5_array(file_name, key='rva') |
63 | 63 |
|
|
90 | 90 | # Here we load the motion-energy features, that are going to be used for the |
91 | 91 | # linear regression model. |
92 | 92 |
|
93 | | -file_name = op.join(directory, "features", "motion_energy.hdf") |
| 93 | +file_name = os.path.join(directory, "features", "motion_energy.hdf") |
94 | 94 | X_train = load_hdf5_array(file_name, key='X_train') |
95 | 95 | X_test = load_hdf5_array(file_name, key='X_test') |
96 | 96 |
|
|
0 commit comments