Print

Print


Hi Mark,
 
Thank you for pointing me to the relevant  conversion tools.
 
Re MATLAB-FSL coordinates: as you mentioned it is problematic.
 I am planning to look into relationship between z-maps (as generated by Feat-gui, so processed by flirt indeed)  and anatomy using Harvard-Oxford -maxprob-thr25-2mm atlas (both cortical and subcortial).
 
I've noticed some differences in point locations using the same voxel coordinates when plotted in Matlab and displayed in Fslview. This is seemingly a shift of a few voxels but crucially may result in pointing to a
different atlas roi as revealed by my test...
Is there any workabout for it?
 
Many thanks,
 
Iwo
From: Mark Jenkinson <[log in to unmask]>
To: [log in to unmask]
Sent: Monday, 5 August 2013, 7:27
Subject: Re: [FSL] MNI: coordinates in voxels to mm

Hi,

There's no need to use this code, as img2stdcoord is a utility in FSL that is designed to do exactly this, and it is more flexible (since it will work with any resolution, not just 2mm).  For this application you use it like this:
  echo X Y Z | img2stdcoord  -img $FSLDIR/data/standard/MNI152_T1_2mm -std $FSLDIR/data/standard/MNI152_T1_2mm -vox -

Here is the documentation: 

If you are trying to do coordinate conversions in MATLAB, and using matrices from FLIRT, then be warned that the FLIRT matrices use an internal FSL coordinate convention that is different from the NIFTI coordinate systems and that this makes working with them much more difficult.  This is why we've provided the above tool (plus img2imgcoord and std2imgcoord).

All the best,
Mark




On 2 Aug 2013, at 17:03, Steffie Tomson <[log in to unmask]> wrote:

Below is code sent out to the FSL listserv by Matt Glaser at some point.  I recently modified it to convert from MNI to XYZ space using the 2mm brain as my standard.  Be sure to check your calculations in FSLview using the standard brain you've used in your analysis.

----------
#Original code sent by Matt Glasser, modified to divide by 2 by Steffie for 2mm standard brain 
# $1 $2 $3 are your input MNI coordinates

x=`echo "($1 * -1 + 90) / 2" | bc`
y=`echo "($2 * 1 + 126) / 2" | bc`
z=`echo "($3 * 1 + 72) / 2 " | bc``
---------

Steffie Tomson, Ph.D.
Postdoctoral Fellow
Bookheimer Lab
Semel Institute for Neuroscience
University of California Los Angeles
760 Westwood Plaza B8-169
Los Angeles CA 90095


On Fri, Aug 2, 2013 at 5:34 AM, Iwo Bohr <[log in to unmask]> wrote:
Dear FSLers,
 
Is there any routine automaticaly doing the above conversion?
I know it should be possible to work it given the origin of the coordinate system (45 63 36 in voxels?)  and voxel size (isotropic 2mm), but I'm afraid I can misdo something in the process.
 
More precisely: I'm doing some processing on NIfTI images converted to Matlab matrices (using load_nii), so I assume that first I should rotate the matrices by 90 degrees to align them to the template orientation?
In general am not sure how to align these matrices...
 
Many thanks in advance,
 
Iwo