Use the matlab ind2sub command
doug

On 12/18/2012 12:38 PM, octavian lie wrote:
> Dear Douglas,
>
>
> How do I convert the index to its CRS correspondent?
> I could think of using in matlab something like
> ind=c+r*255+s* 255^2
> then using floor () to obtain c,r,s, but seems convoluted, is there 
> any code written on this that you can share?
> Thank you again,
>
> Octavian.
>
>
>
> On Tue, Dec 18, 2012 at 11:06 AM, Douglas N Greve 
> <gr...@nmr.mgh.harvard.edu <mailto:gr...@nmr.mgh.harvard.edu>> wrote:
>
>
>     If you load the volume in with MRIread
>     a = MRIread('yourvolume.mgz');
>     a.vox2ras1 is the one-based vox2ras matrix which takes a 1-based
>     column, row, slice and converts it to RAS. So you just need to
>     convert your indices to col, row, slice and apply this matrix.
>
>     doug
>
>
>
>     On 12/17/2012 06:53 PM, octavian lie wrote:
>
>         Dear Douglas,
>
>         Thank you very much for your input.
>
>         1. I generated the ind matrix as per your script, but what I
>         wanted is to get a matrix with the RAS coordinates for the
>         pixels indexed in ind. Is there a way to do this?
>
>         Thank you,
>
>         Octavian
>
>
>     -- 
>     Douglas N. Greve, Ph.D.
>     MGH-NMR Center
>     gr...@nmr.mgh.harvard.edu <mailto:gr...@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: 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/
>
>
>
>     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.
>
>

-- 
Douglas N. Greve, Ph.D.
MGH-NMR Center
gr...@nmr.mgh.harvard.edu
Phone Number: 617-724-2358
Fax: 617-726-7422

Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
FileDrop: 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

Reply via email to