This looks wrong: W = TalXFM * Norig * inv(Torig); If RAS = A.vox2ras1 * [i;j;k;1]; (Note: vox2ras = Norig), then just mni305 = TalXFM*A.vox2ras1 * [i;j;k;1]
One way to check is to display the MNI305 and ScannerRAS in the tkmedit control window. Take the RAS from the control window, put it into your formula and see if you the MNI305value.
doug
On 04/24/2013 12:00 PM, Garikoitz Lerma-Usabiaga wrote:
Hi Doug, I try to make the question shorter, hopefully you will be able to give me a hint:
Do you think this method to cut every subjects hippo-subfield according to their MNI305 Y coordinate could be accurate?
(for every voxel in every subfield for every subject, do: )
RAS = A.vox2ras1 * [i;j;k;1];
MNI305 = W * RAS; % W = TalXFM * Norig * inv(Torig);
if MNI305(2) < -20 then A.vol(i,j,k) = 0;
I find that every subject is cut very differently (the Y plane goes usually to the head), where do you think could be the error, in the within subject vox2ras or in the MNI305 transformation? Shouldn't I use this method at all?
many many thanks again, Gari
---------- Forwarded message ---------- From: *Garikoitz Lerma-Usabiaga* <garikoitz@gmail.com mailto:garikoitz@gmail.com> Date: Sat, Apr 20, 2013 at 2:31 AM Subject: Conversion To: Douglas N Greve <greve@nmr.mgh.harvard.edu mailto:greve@nmr.mgh.harvard.edu>
Hi Doug, sorry to bother you again with a direct message, one of your colleagues has been helping out but I don't think he got it right and before posting it publicly I would like to know your opinion.
*OBJECTIVE*: I want to cut hippo-subfields with a vertical plane in Y. That plane is defined by a MNI305 coordinate (Y = -20).
*METHOD*: I created a script in Matlab that reads (per every subject):
TalXFM = xfm_read('talairach.xfm'); ORIG = MRIread('orig.mgz'); Norig = ORIG.vox2ras; Torig = ORIG.tkrvox2ras; W = TalXFM * Norig * inv(Torig);
And reads every hippo_subfield:
A = MRIread('posterior_left_CA1.mgz'); A.vol=permute(A.vol,[2 1 3]);
Then I just loop through every voxel to set to zero all voxels one side of that MNI305 coordinate:
RAS = A.vox2ras1 * [i;j;k;1];
MNI305 = W * RAS;
if MNI305(2) < -20 then A.vol(i,j,k) = 0;
Then I permute and write it again (afterwards I can sum the modified volumes per every subfield).
A.vol=permute(A.vol,[2 1 3]);
MRIwrite(A, 'new_posterior_left_CA1.mgz');
*PROBLEM*: the vertical plane is not ok, usually it goes out of the hippocampus or just touches a bit of it (it should separate the head, so be a quarter of it). But it is a vertical plane.
*QUESTIONS*:
RAS = A.vox2ras1 * [i;j;k;1]; >> Is this Scanner_RAS or Volume_RAS? In any case, it gives wrong results (when I compare to freeview or
tkmedit), is this method of calculating RAS coordinates ok? Is there any other method?
MNI305 = W * RAS; >> What RAS coordinate should I use here? The
obtained in the previous step is OK?
Do you think that these methods are accurate enough to accomplish
what I am trying to do or I should try another approach?
Many many thanks again for your help, I will be happy to make the results available for everybody if this works (I think this makes the second Samuel Adams :) ) br, Gari
freesurfer@nmr.mgh.harvard.edu