Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrockhill committed Jul 28, 2021
1 parent e250f2a commit 35d2df2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions mne/gui/_ieeg_locate_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,13 @@ def _load_image(img, name, verbose=True):
orig_data = np.array(img.dataobj)
orig_mgh = nib.MGHImage(orig_data, img.affine)
vox_ras_t = orig_mgh.header.get_vox2ras_tkr()
img_canonical = nib.as_closest_canonical(img_mgh)
img_data, vox_ras_t = _reorient_image(img_data, vox_ras_t)
return img_data, vox_ras_t
canonical_img = nib.as_closest_canonical(orig_mgh)
# canonical voxels->real world->original voxels
canonical_ras_t = canonical_img.affine
canonical_orig_t = np.dot(canonical_ras_t, np.linalg.inv(orig_mgh.affine))
canonical_fs_t = np.dot(canonical_orig_t, vox_ras_t)
img_data = np.array(canonical_img.dataobj)
return img_data, canonical_fs_t


class ComboBox(QComboBox):
Expand Down

0 comments on commit 35d2df2

Please sign in to comment.