Skip to content

Commit 97b125f

Browse files
committed
add space to fname, fix tau computation
1 parent a763e32 commit 97b125f

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,6 @@ var/
6262
**.pyc
6363
**.egg*
6464
**/__pycache__/**
65+
idconn/connectivity/__pycache__/__init__.cpython-37.pyc
66+
__pycache__/versioneer.cpython-37.pyc
67+
idconn/__pycache__/_version.cpython-37.pyc

idconn/connectivity/build_networks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def task_connectivity(layout, subject, session, task, atlas, confounds, connecti
113113
ex_bold = image.index_img(bold_file[0], 2)
114114
display = plotting.plot_epi(ex_bold)
115115
display.add_contours(atlas)
116-
display.savefig(join(deriv_dir, f'sub-{subject}', f'ses-{session}', 'func', f'sub-{subject}_ses-{session}_task-{task}_run-{run}_desc-{atlas_name}_overlay.png'))
116+
display.savefig(join(deriv_dir, f'sub-{subject}', f'ses-{session}', 'func', f'sub-{subject}_ses-{session}_task-{task}_run-{run}_space-MNI152NLin2009cAsym_space-{atlas_name}_overlay.png'))
117117

118118
print(f'BOLD file located at {bold_file}\nTR = {tr}s')
119119

@@ -156,7 +156,7 @@ def task_connectivity(layout, subject, session, task, atlas, confounds, connecti
156156
corrmat_df = pd.DataFrame(index=np.arange(1, avg_corrmat.shape[0]+1), columns=np.arange(1, avg_corrmat.shape[0]+1),data=avg_corrmat)
157157
avg_corrmats[condition] = corrmat_df
158158
corrmat_file = join(deriv_dir,
159-
f'sub-{subject}', f'ses-{session}', 'func', f'sub-{subject}_ses-{session}_task-{task}_condition-{condition}_desc-{atlas_name}_corrmat.tsv')
159+
f'sub-{subject}', f'ses-{session}', 'func', f'sub-{subject}_ses-{session}_task-{task}_desc-{condition}_space-MNI152NLin2009cAsym_atlas-{atlas_name}_corrmat.tsv')
160160
try:
161161
corrmat_df.to_csv(corrmat_file, sep='\t')
162162
files.append(corrmat_file)

idconn/connectivity/estimate_thresh.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def connected_tau(corrmat, proportional=True):
4747
tau : float
4848
Highest vaue of tau (threshold) at which network becomes node-connected.
4949
'''
50-
tau = 1
50+
tau = 0.01
5151
connected = False
5252
while connected == False:
5353
if proportional:
@@ -56,5 +56,5 @@ def connected_tau(corrmat, proportional=True):
5656
w = bct.threshold_absolute(corrmat, tau)
5757
w_nx = nx.convert_matrix.from_numpy_array(w)
5858
connected = nx.algorithms.components.is_connected(w_nx)
59-
tau -= 0.01
59+
tau += 0.01
6060
return tau

0 commit comments

Comments
 (0)