The purpose of what I'm trying to do is getting specific points from the CT onto the average surface.These points lie on the surface of the brain.Originally, we were using flirt to register the CT to the MRI, then registering the MRI to the talairach brain, to get the CT into the same space as the surface. This method worked okay, but we were hoping to improve on it.The new method, using robust register and tkregsiter2, produces coordinates that are on the surface of the brain in freeview, but not in matlab (for some subjects).Here is the info for one problem subject:mri_info --vox2ras-tkr [subj]_CT_combined.imgINFO: using NIfTI-1 qform-0.47461 0.00000 0.00000 121.500000.00000 0.00000 0.62634 -69.836360.00000 -0.47461 0.00000 121.500000.00000 0.00000 0.00000 1.00000# transform file reg_avg.lta# created by ---- on Thu Mar 27 15:55:39 2014type = 1nxforms = 1mean = 256.0000 228.0000 111.0000sigma = 10000.00001 4 49.349995851516724e-01 -2.874486744403839e-01 -2.077235281467438e-01 -3.043334960937500e+013.062604963779449e-01 9.497789144515991e-01 6.422379612922668e-02 1.133301696777344e+021.788303703069687e-01 -1.236666887998581e-01 9.760769009590149e-01 -1.039845886230469e+020.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 1.000000000000000e+00src volume infovalid = 1 # volume info validfilename = [subj]_CT_combined.imgvolume = 512 512 223voxelsize = 4.746093750000000e-01 4.746093750000000e-01 6.263351440429688e-01xras = -9.999999403953552e-01 0.000000000000000e+00 0.000000000000000e+00yras = 0.000000000000000e+00 9.703245759010315e-01 2.418061196804047e-01zras = -0.000000000000000e+00 -2.418061196804047e-01 9.703245759010315e-01cras = 7.629394531250000e-06 -1.615307769775391e+02 1.476517486572266e+02dst volume infovalid = 1 # volume info validfilename = /data/eeg/freesurfer/subjects/average/mri/orig.mgzvolume = 256 256 256voxelsize = 1.000000000000000e+00 1.000000000000000e+00 1.000000000000000e+00xras = -1.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00yras = -2.220446049250313e-16 -1.490116119384766e-08 -1.000000000000000e+00zras = 4.440892098500626e-16 1.000000000000000e+00 8.443226899772703e-18cras = 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00Here are a set of eight coordinates, all of which are on the surface in CRS space on the CT:242 267 47241 283 36234 298 28221 313 23203 321 19183 323 24172 312 33164 297 42After applying the transform, these coordinates come out as:5.2486 -168.8798 78.82612.2243 -174.6209 70.87292.5230 -179.4546 62.91216.0596 -183.3221 54.480512.6010 -187.6878 48.839022.2656 -187.3245 46.141929.8070 -184.1168 50.515236.3566 -180.7347 57.0374Those middle coordinates are all off the brain - the coordinates are far too negative.When run through the first method, they come out to:20.6235 -15.8172 -23.136619.041 -5.94338 -28.556720.8091 3.8041 -32.34625.8047 13.9764 -34.443534.3347 20.7722 -36.429444.7823 23.7184 -33.571852.1009 18.1343 -29.108858.3186 10.0044 -24.8649Which are (approximately) on the surface of the brain.However, when I load up the average surface in freeview, and apply reg_avg.lta to the CT, the two overlay exactly.I'm mostly trying to figure out why the coordinates that I get in MATLAB do not agree with the coordinates that I see in freeview.Thanks again for your help,IsaacOn Tue, Apr 29, 2014 at 1:43 PM, Douglas N Greve <greve@nmr.mgh.harvard.edu> wrote:
It sounds like you are doing the right thing with the right equation.
Can you elaborate on what is going wrong?
On 04/28/2014 05:10 PM, ISAAC PEDISICH wrote:
> Sorry - I meant just the matrix.
>
> I'm trying to map from CRS in the CT to tkrRAS in the anatomical, I
> believe. I'm a little unclear as to what exactly anat space means, but
> I know that I'm trying to get it from CRS in the CT to the space in
> which the surface is plotted in MATLAB, which I believe is tkrRAS,
> anatomical. I'm certain it's no longer CRS space, as the x-coordinates
> must contain some negative indices.
>
>
>
> On Mon, Apr 28, 2014 at 5:02 PM, Douglas N Greve
> <mailto:greve@nmr.mgh.harvard.edu> <greve@nmr.mgh.harvard.edu <mailto:greve@nmr.mgh.harvard.edu>> wrote:
>
>
> When you say the content is the same, do you mean exactly the same or
> just the matrix? Also, what coordinate system are you trying to go to?
> The equation you have below takes CRS in the CT and maps it to
> tkrRAS in
> the anatomical. If you want to map the CRS in the anat then use
>
> inv(Tanat) * inv(Reg_avg) * Tmov * CT_coords
>
>
> On 04/28/2014 03:58 PM, ISAAC PEDISICH wrote:
> > Hi Doug,
> > Thanks for the response.
> > I'm not seeing lta_convert as an executable that I can run. I have
> > freesurfer v5.3.0 installed - is there another version that I should
> > be using?
> >
> > For using tkregister2, I'm a bit confused as to what I should be
> > doing. I had assumed (erroneously, it seems) that the .lta and .dat
> > files contained the same information.
> > I just tried re-running tkregister2 with the command:
> > tkregsiter2 --mov [sub_CT].img --reg reg_avg.dat --surf pial --s
> > average --lta reg_avg.lta
> > Such that I can pass in the reg_avg.lta file created from robust
> > register, and have it output a reg_avg.dat file. The contents of
> these
> > two files, however, seem to be exactly the same.
> >
> > I also running tkregister2 with the --fslregout and --freeview
> flags,
> > but neither of those produced a correct transformation either.
> >
> > Martin:
> > We are indeed registering the CT to an average MRI, and for the
> moment
> > we are correcting inaccuracies manually with tkregister2.
> > I just tried bbregister with one of our problem subjects, and it
> still
> > produced a matrix that had to be significantly adjusted in
> > tkregister2. Furthermore, the matrix that it produced still did not
> > transform the coordinates correctly in MATLAB.
> >
> > -Isaac
> >
> >
> > On Mon, Apr 28, 2014 at 2:32 PM, Douglas N Greve
> > <greve@nmr.mgh.harvard.edu <mailto:greve@nmr.mgh.harvard.edu>
> > <mailto:Freesurfer@nmr.mgh.harvard.edu> <mailto:greve@nmr.mgh.harvard.edu>>> wrote:
> >
> >
> > The matrix in the lta is probably not the right one. Try using
> > lta_convert or tkregister2 to change it to a register.dat file
> > (which is
> > what is expected in your formula)
> > doug
> >
> > On 04/25/2014 12:28 PM, ISAAC PEDISICH wrote:
> > > Hi All,
> > >
> > > I am attempting to transform sets of coordinates from
> subject CRS
> > > space into the surfaceRAS space of an average subject,
> made with
> > > make_average_subject.
> > >
> > > By our current method, we register the individual CT to
> the average
> > > surface using mri_robust_register with the command:
> > > mri_robust_register --mov [subj_CT].img --dst
> average_orig.mgz
> > --lta
> > > reg_avg.lta --iscale --satit
> > > and then check and adjust the registration with:
> > > tkregister2 --mov [subj_CT].img --reg reg_avg.lta --surf pial
> > --s average
> > >
> > > These steps work fine, and when I load the average brain in
> > freeview,
> > > then load the subject CT with with the registration file
> reg_avg.lta
> > > applied, the two overlap just as they should.
> > >
> > > However, when I attempt to do the same thing in matlab,
> some (though
> > > not all) of the subjects present a problem.
> > > I do the coordinate transformation (as suggested on
> > > http://freesurfer.net/fswiki/CoordinateSystems) by applying:
> > >
> > > inv(Reg_avg) * Tmov * CT_coords
> > >
> > > with Tmov: mri_info --vox2ras-tkr [subj_CT].img, Reg_avg as
> > > reg_avg.lta, and CT_coords as the relevant coordinates in
> CRS space
> > > from the CT (with a vector of ones appended).
> > >
> > > As I said, some of the scans come out fine, with the
> coordinates in
> > > the correct place on the average surface, while others are
> very far
> > > removed from their correct location. How can I fix this?
> > >
> > > Thanks,
> > > Isaac
> > >
> > >
> > > _______________________________________________
> > > Freesurfer mailing list
> > > Freesurfer@nmr.mgh.harvard.edu
> <mailto:Freesurfer@nmr.mgh.harvard.edu>
> <mailto:Freesurfer@nmr.mgh.harvard.edu>>> <mailto:greve@nmr.mgh.harvard.edu <mailto:greve@nmr.mgh.harvard.edu>>
> > > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
> >
> > --
> > Douglas N. Greve, Ph.D.
> > MGH-NMR Center
> > greve@nmr.mgh.harvard.edu <mailto:greve@nmr.mgh.harvard.edu>
> <tel:617-724-2358 <tel:617-724-2358>>
> > Fax: 617-726-7422 <tel:617-726-7422> <tel:617-726-7422
> <tel:617-726-7422>>> <mailto:Freesurfer@nmr.mgh.harvard.edu
> >
> > Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
> <http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting>
> > <http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting>
> > FileDrop: https://gate.nmr.mgh.harvard.edu/filedrop2
> > www.nmr.mgh.harvard.edu/facility/filedrop/index.html
> <http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>
> > <http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>
> > Outgoing:
> > ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/
> >
> > _______________________________________________
> > Freesurfer mailing list
> > Freesurfer@nmr.mgh.harvard.edu
> <mailto:Freesurfer@nmr.mgh.harvard.edu>
> <mailto:Freesurfer@nmr.mgh.harvard.edu>>
> > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
> >
> >
> > The information in this e-mail is intended only for the
> person to
> > whom it is
> > addressed. If you believe this e-mail was sent to you in
> error and
> > the e-mail
> > contains patient information, please contact the Partners
> > Compliance HelpLine at
> > http://www.partners.org/complianceline . If the e-mail was sent to
> > you in error
> > but does not contain patient information, please contact the
> > sender and properly
> > dispose of the e-mail.
> >
> >
> >
> >
> > _______________________________________________
> > Freesurfer mailing list
> > Freesurfer@nmr.mgh.harvard.edu
> <mailto:Freesurfer@nmr.mgh.harvard.edu>
> > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>
> --
> Douglas N. Greve, Ph.D.
> MGH-NMR Center
> greve@nmr.mgh.harvard.edu <mailto:greve@nmr.mgh.harvard.edu>
> Phone Number: 617-724-2358 <tel:617-724-2358>
> Fax: 617-726-7422 <tel:617-726-7422>
>
> Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
> <http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting>
> FileDrop: https://gate.nmr.mgh.harvard.edu/filedrop2
> www.nmr.mgh.harvard.edu/facility/filedrop/index.html
> <http://www.nmr.mgh.harvard.edu/facility/filedrop/index.html>
> Outgoing:
> ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/
>
> _______________________________________________
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu <mailto:Freesurfer@nmr.mgh.harvard.edu>
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>
>
>
>
> _______________________________________________
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
--
Douglas N. Greve, Ph.D.
MGH-NMR Center
greve@nmr.mgh.harvard.edu
Phone Number: 617-724-2358
Fax: 617-726-7422
Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
FileDrop: https://gate.nmr.mgh.harvard.edu/filedrop2
www.nmr.mgh.harvard.edu/facility/filedrop/index.html
Outgoing: ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/
_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer