# Mesh2voxel, bad coordinate

**URL:** <https://community.mrtrix.org/t/mesh2voxel-bad-coordinate/3635>\
**Category:** Uncategorized\
**Tags:** preprocessing\
**Created:** [May 7, 2020, 1:15pm UTC](https://community.mrtrix.org/t/mesh2voxel-bad-coordinate/3635 "2020-05-07T13:15:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Romain\_Valabregue](https://community.mrtrix.org/user_avatar/community.mrtrix.org/romain_valabregue/32/2691_2.png) [@Romain\_Valabregue](https://community.mrtrix.org/u/Romain_Valabregue)\
**Post date:** [May 7, 2020, 1:15pm UTC](https://community.mrtrix.org/t/mesh2voxel-bad-coordinate/3635/1 "2020-05-07T13:15:19Z")

</div>

Dear All,

I am trying to convert freesurfer surfaces to partial volum with mesh2voxel

I try with the lh.pial surface which I converted to vtk with meshconvert (or mris\_convert from freesurfer)

then when using:  
mesh2voxel surfac.vtk T1.nii pve\_result.nii

the output is shifted compare to the original T1 (whereas it was correct with freeview)

I tried the 4 option -transform for the meshconvert function, but wihtout success : I optained empty results, except with I do not use the -transform argument. In this case I get a shifted pve volume.

Any hints to get a perfect match ?

Many thanks  
Romain

---

<div class="post-metadata">

**Author:** ![Romain\_Valabregue](https://community.mrtrix.org/user_avatar/community.mrtrix.org/romain_valabregue/32/2691_2.png) [@Romain\_Valabregue](https://community.mrtrix.org/u/Romain_Valabregue)\
**Post date:** [May 11, 2020, 1:45pm UTC](https://community.mrtrix.org/t/mesh2voxel-bad-coordinate/3635/2 "2020-05-11T13:45:44Z")

</div>

For those who are interested, we found the problem:  
It seems that freesurfer surfaces does not take into consideration the nifti volume affine and the mm position of the vertex are expressed in a coordinate system where the 0,0,0 mm is at the volume center.  
So changing the nifti affine of the volume, leads to a good match.

This was more a freesurfer issue, sorry for the spam on mrtrix forum

---

<div class="post-metadata">

**Author:** ![jdtournier](https://community.mrtrix.org/user_avatar/community.mrtrix.org/jdtournier/32/2594_2.png) [@jdtournier](https://community.mrtrix.org/u/jdtournier)\
**Post date:** [May 11, 2020, 2:13pm UTC](https://community.mrtrix.org/t/mesh2voxel-bad-coordinate/3635/3 "2020-05-11T14:13:01Z")

</div>

Glad you figured it out, and thanks for keeping us updated!

---

<div class="post-metadata">

**Author:** ![rsmith](https://community.mrtrix.org/user_avatar/community.mrtrix.org/rsmith/32/2672_2.png) [@rsmith](https://community.mrtrix.org/u/rsmith)\
**Post date:** [May 17, 2020, 4:54am UTC](https://community.mrtrix.org/t/mesh2voxel-bad-coordinate/3635/4 "2020-05-17T04:54:02Z")

</div>

With `3.0.0`, `meshconvert` now includes a fifth option for the `-transform` argument, “`fs2real`”, which utilises the T1w image to determine the appropriate transformation from FreeSurfer’s internal representation to _MRtrix3_’s preferred real-space coordinate system. I expect this is the functionality that you actually need.
