Skip to content

Commit a757841

Browse files
authored
Merge pull request #360 from cosanlab/http
Minor bug fixes
2 parents d61473c + 2e5d462 commit a757841

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

nltools/data/adjacency.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,9 @@ def isc(self, n_bootstraps=5000, metric='median', ci_percentile=95, exclude_self
908908
if metric not in ['mean', 'median']:
909909
raise ValueError("metric must be ['mean', 'median']")
910910

911+
if not self.is_single_matrix:
912+
raise NotImplementedError('Currently we can only compute ISC values on single Adjacency matrices')
913+
911914
if metric =='mean':
912915
isc = np.tanh(self.r_to_z().mean())
913916
elif metric =='median':

nltools/data/brain_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def __init__(self, data=None, Y=None, X=None, mask=None, output_file=None,
112112

113113
if data is not None:
114114
if isinstance(data, six.string_types):
115-
if 'http://' in data:
115+
if 'http://' in data or 'https://' in data:
116116
from nltools.datasets import download_nifti
117117
tmp_dir = os.path.join(tempfile.gettempdir(),
118118
str(os.times()[-1]))

nltools/mask.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,11 @@ def roi_to_brain(data, mask_x):
213213
raise ValueError('Data must have the same number of rows as mask has ROIs.')
214214

215215
if isinstance(data, pd.Series):
216-
return Brain_Data([mask_x[x]*data[x] for x in data.keys()]).sum()
216+
out = mask_x[0].copy()
217+
out.data = np.zeros(out.data.shape)
218+
for roi in range(len(mask_x)):
219+
out.data[np.where(mask_x.data[roi,:])] = data[roi]
220+
return out
217221
else:
218222
out = mask_x.copy()
219223
out.data = np.ones((data.shape[1], out.data.shape[1]))

0 commit comments

Comments
 (0)