-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathresting_state.py
More file actions
56 lines (49 loc) · 2.2 KB
/
resting_state.py
File metadata and controls
56 lines (49 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
"""
Apply CanICA on sample data
"""
# Author: Gael Varoquaux <[email protected]>
# License: BSD Style.
# Local imports
from canica import canica, canica_split_half
#-------------------------------------------------------------------------
# Constants
#-------------------------------------------------------------------------
N_JOBS = -1
SUBJECTS = range(1, 13)
N_PCA_COMPONENTS = 50
THRESHOLD_P_VALUE = 20e-2
N_ICA_COMPONENTS = 42
INPUT_GLOB = '/volatile/varoquau/data/flore/subject%i_session1.nii'
WORKING_DIR = '/tmp/data/canica/'
#-------------------------------------------------------------------------
# Disk IO
#-------------------------------------------------------------------------
# The super_glob returns a list of globs for each value of subject
session_files = [INPUT_GLOB % i for i in SUBJECTS]
#-------------------------------------------------------------------------
# CanICA estimation
#-------------------------------------------------------------------------
if 0:
# Simply run CanICA
icas, mask, threshold, header = \
canica(session_files,
smooth=2,
n_pca_components=N_PCA_COMPONENTS,
n_ica_components=N_ICA_COMPONENTS,
threshold_p_value=THRESHOLD_P_VALUE,
working_dir=WORKING_DIR,
n_jobs=N_JOBS,
report=True)
else:
# Run CanICA with a split-half cross-validation study
icas, mask, threshold, un_thr_stats, thr_stats, header, reproducibility = \
canica_split_half(session_files,
n_split_half=20,
smooth=2,
n_pca_components=N_PCA_COMPONENTS,
n_ica_components=N_ICA_COMPONENTS,
threshold_p_value=THRESHOLD_P_VALUE,
working_dir=WORKING_DIR,
n_jobs=N_JOBS,
report=True)
# EOF ##########################################################################