File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change 44
55
66def gen_ras_to_head_trans (head_to_mri_t , t1_img ):
7- mri_to_head_t = invert_transform (head_to_mri_t )
8-
9- # RAS <> VOXEL
7+ # RAS -> VOXEL
108 ras_to_vox_t = Transform (fro = 'ras' , to = 'mri_voxel' ,
119 trans = np .linalg .inv (t1_img .header .get_vox2ras ()))
12- # trans=t1_img.header.get_ras2vox())
10+
11+ # VOXEL -> MRI
1312 vox_to_mri_t = Transform (fro = 'mri_voxel' , to = 'mri' ,
1413 trans = t1_img .header .get_vox2ras_tkr ())
1514
16- # RAS <> MRI
15+ # MRI -> HEAD
16+ mri_to_head_t = invert_transform (head_to_mri_t )
17+
18+ # Now we have generated all the required transformations
19+ # to go from RAS to MNE Head coordinates. Let's combine
20+ # the transforms into a single transform. This requires
21+ # two calls to `combine_transforms()`.
22+
23+ # RAS -> MRI
1724 ras_to_mri_t = combine_transforms (ras_to_vox_t ,
1825 vox_to_mri_t ,
1926 fro = 'ras' , to = 'mri' )
2027
28+ # RAS -> HEAD
2129 ras_to_head_t = combine_transforms (ras_to_mri_t ,
2230 mri_to_head_t ,
2331 fro = 'ras' , to = 'head' )
You can’t perform that action at this time.
0 commit comments