Skip to content
This repository has been archived by the owner on Mar 7, 2022. It is now read-only.

Commit

Permalink
Hopefully fix indexing error
Browse files Browse the repository at this point in the history
  • Loading branch information
lukassnoek committed Feb 26, 2017
1 parent e465e6a commit 14d9870
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion skbold/core/mvp.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def update_mask(self, mask, threshold=0):
i = it

fids = np.unique(self.featureset_id)
posidx = np.where(i == fids)[0]
posidx = np.where(i == fids)[0][0]
tmp = np.zeros(self.data_shape[posidx]).ravel()
fidx = self.featureset_id == i
tmp[self.voxel_idx[fidx]] = 1
Expand Down
2 changes: 1 addition & 1 deletion skbold/core/mvp_between.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ def write_4D(self, path=None, return_nimg=False):

nimgs = []
for i, fid in enumerate(fids):
pos_idx = np.where(i == fids)[0]
pos_idx = np.where(i == fids)[0][0]
s = self.data_shape[pos_idx]
to_write = np.zeros((np.prod(s), self.X.shape[0]))
X_to_write = self.X[:, self.featureset_id == fid]
Expand Down
4 changes: 2 additions & 2 deletions skbold/postproc/mvp_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def write(self, feature_viz=True, confmat=True, to_tstat=True,

for i in fids:

pos_idx = np.where(i == fids)[0]
pos_idx = np.where(i == fids)[0][0]
img = np.zeros(self.data_shape[pos_idx]).ravel()
subset = values[self.featureset_id == i]

Expand All @@ -190,7 +190,7 @@ def write(self, feature_viz=True, confmat=True, to_tstat=True,
img = np.zeros(self.data_shape[pos_idx]).ravel()

else:
pos_idx = np.where(i == fids)[0]
pos_idx = np.where(i == fids)[0][0]
img[self.voxel_idx[self.featureset_id == i]] = subset
img = nib.Nifti1Image(img.reshape(self.data_shape[pos_idx]),
affine=self.affine[pos_idx])
Expand Down
2 changes: 1 addition & 1 deletion skbold/utils/parse_roi_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def parse_roi_labels(atlas_type='Talairach', lateralized=False, debug=False):
else:
xml = op.join(roidata_root, atlas_type, atlas_type + '.xml')

with open(xml, 'rb') as fin:
with open(xml, 'r') as fin:
doc = fin.readlines()

if atlas_type == 'Talairach':
Expand Down

0 comments on commit 14d9870

Please sign in to comment.