<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hi Parham,
<div class=""><br class="">
</div>
<div class="">Sorry for sounding cryptic earlier, I was just reciprocating the crypticity of the question.</div>
<div class="">I think that the suggestion made in the previous e-mail is an excellent one. </div>
<div class="">With the addition that, rather than using ft_determine_coordsys, you could use ft_plot_ortho to visualize an arbitrary cross-cut through your volumetric image.</div>
<div class="">Note however, that the MR and the sourcespace should be in the same coordinate system for this to work.</div>
<div class=""><br class="">
</div>
<div class="">Best,</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 05 Oct 2016, at 00:47, A. Donda <<a href="mailto:a.donda@hotmail.com" class="">a.donda@hotmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div id="divtagdefaultwrapper" style="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 12pt; font-family: Calibri, Arial, Helvetica, sans-serif;" class="">
<div style="margin-top: 0px; margin-bottom: 0px;" class="">Hi Parham, </div>
<div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class="">
</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class="">if you wanna plot it in FieldTrip, these commands worked well for me, but in my case (MEG data) I had to make sure first that these data were on the same coordinate system (co-registration of MRI and
 MEG sensor-data). If you do not have this issue, then you can simply plot an MRI and a mesh obtained from freesurfer the following way (make sure that both MRI and the mesh are in the same units, e.g. cm or mm):</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class="">
</div>
<p style="margin-top: 0px; margin-bottom: 0px;" class=""></p>
<div class="">    ft_determine_coordsys(mricor_cm, 'interactive', 'no')</div>
<div class="">
<div class="">    hold on</div>
<div class="">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', NotoColorEmoji, 'Segoe UI Symbol', 'Android Emoji', EmojiSymbols; font-size: 16px;" class="">
    ft_plot_mesh(sourcespace);</div>
</div>
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Alternatively, if you want to plot the vertices of the mesh as dots, you can use</div>
<div class=""><br class="">
</div>
<div class=""><span class="">ft_plot_mesh(sourcespace.pnt,'vertexcolor','b');</span><br class="">
</div>
<div class=""><span class=""><br class="">
</span></div>
<div class=""><span class="">sourcespace has the following structure<span class=""> (in case this is helpful for you)</span>:</span></div>
<div class=""><span class=""><br class="">
</span></div>
<div class=""><span class="">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', NotoColorEmoji, 'Segoe UI Symbol', 'Android Emoji', EmojiSymbols; font-size: 16px;" class="">
    pnt: [8196x3 double]</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', NotoColorEmoji, 'Segoe UI Symbol', 'Android Emoji', EmojiSymbols; font-size: 16px;" class="">
     tri: [16384x3 double]</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', NotoColorEmoji, 'Segoe UI Symbol', 'Android Emoji', EmojiSymbols; font-size: 16px;" class="">
    area: [16384x1 double]</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', NotoColorEmoji, 'Segoe UI Symbol', 'Android Emoji', EmojiSymbols; font-size: 16px;" class="">
    orig: [1x1 struct]</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', NotoColorEmoji, 'Segoe UI Symbol', 'Android Emoji', EmojiSymbols; font-size: 16px;" class="">
    unit: 'm'</div>
<br class="">
</span></div>
<div class=""><br class="">
</div>
I obtained sourcespace by loading the <span style="font-size: 12pt;" class="">boundary element model (bem) surface, created with the watershed algorthim of Freesurfer: </span>
<p style="margin-top: 0px; margin-bottom: 0px;" class=""></p>
<div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class="">
</div>
<p style="margin-top: 0px; margin-bottom: 0px;" class=""></p>
<div class=""> <span style="font-size: 12pt;" class="">sourcespace = ft_read_headshape([subjectname/bem/</span><span style="font-size: 12pt;" class="">subjectname</span><span style="font-size: 12pt;" class="">-oct-6-src.fif'], 'format', 'mne_source'); %in meters</span></div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div class=""><span style="font-size: 12pt;" class="">Note that I had to </span><span style="font-size: 12pt;" class="">transform the sourcespace dataset to the right coordinate system and units. </span><br class="">
</div>
</div>
<div class=""><br class="">
</div>
<div class="">Finally I plotted the mri and mesh in cm</div>
<div class=""><br class="">
</div>
<div class="">To convert units in Fieldtrip, as you know, use    <span class="">X_cm = ft_convert_units(X,'cm');</span></div>
<div class=""></div>
<div class="">
<div class=""><br class="">
</div>
<div class="">I hope this is helpful.</div>
</div>
<div class=""><br class="">
</div>
<p style="margin-top: 0px; margin-bottom: 0px;" class=""></p>
<div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class="">
</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class="">
</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class="">Best</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class="">
</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class="">A.Donda</div>
<br class="">
<br class="">
<div style="" class="">
<div class="">
<hr tabindex="-1" style="display: inline-block; width: 617.390625px;" class="">
<div id="x_divRplyFwdMsg" dir="ltr" class=""><font face="Calibri, sans-serif" style="font-size: 11pt;" class=""><b class="">From:</b><span class="Apple-converted-space"> </span><a href="mailto:fieldtrip-bounces@science.ru.nl" class="">fieldtrip-bounces@science.ru.nl</a>
 <<a href="mailto:fieldtrip-bounces@science.ru.nl" class="">fieldtrip-bounces@science.ru.nl</a>> on behalf of parham hashemzadeh <<a href="mailto:ph442@cam.ac.uk" class="">ph442@cam.ac.uk</a>><br class="">
<b class="">Sent:</b><span class="Apple-converted-space"> </span>Tuesday, October 4, 2016 6:08 PM<br class="">
<b class="">To:</b><span class="Apple-converted-space"> </span>FieldTrip discussion list<br class="">
<b class="">Subject:</b><span class="Apple-converted-space"> </span>Re: [FieldTrip] plotting freesurfer mesh on the mri_aligned.</font>
<div class=""> </div>
</div>
</div>
<font size="2" class=""><span style="font-size: 10pt;" class="">
<div class="PlainText">Dear Darren<br class="">
  Thank you very much, and I will try to give it a go.<br class="">
  In the event that I can not. You are a life saver if you can help me<span class="Apple-converted-space"> </span><br class="">
out. Everything is in place except this incredibly important item. I<span class="Apple-converted-space"> </span><br class="">
have noticed that you are in Cambridge, maybe we can meet at some point.<span class="Apple-converted-space"> </span><br class="">
I am close by at the mathematics department.<br class="">
  Many many thanks<br class="">
best regards parham<br class="">
<br class="">
On 2016-10-04 17:45, Darren Price wrote:<br class="">
> Hi Parham<br class="">
><span class="Apple-converted-space"> </span><br class="">
> For a non-linear interpolation onto a regular grid, spm_mesh_to_grid<br class="">
> might be ideal (from the spm package of course). I don't have  a<br class="">
> working example to hand, but I may be able to dig one out if you can't<br class="">
> get it working.<br class="">
><span class="Apple-converted-space"> </span><br class="">
> Darren<br class="">
><span class="Apple-converted-space"> </span><br class="">
><span class="Apple-converted-space"> </span><br class="">
> -------------------------------------------------------<br class="">
> Dr. Darren Price<br class="">
> Investigator Scientist and Cam-CAN Data Manager<br class="">
> MRC Cognition & Brain Sciences Unit<br class="">
> 15 Chaucer Road<br class="">
> Cambridge, CB2 7EF<br class="">
> England<br class="">
> EMAIL:  <a href="mailto:darren.price@mrc-cbu.cam.ac.uk" class="">darren.price@mrc-cbu.cam.ac.uk</a><br class="">
> URL:   <span class="Apple-converted-space"> </span><a href="http://www.mrc-cbu.cam.ac.uk/people/darren.price" id="LPlnk457978" previewremoved="true" class="">http://www.mrc-cbu.cam.ac.uk/people/darren.price</a><br class="">
> TEL     +44 (0)1223 355 294 x202<br class="">
> FAX     +44 (0)1223 359 062<br class="">
> MOB     +44 (0)7717822431<br class="">
> -------------------------------------------------------<br class="">
><span class="Apple-converted-space"> </span><br class="">
><span class="Apple-converted-space"> </span><br class="">
> -----Original Message-----<br class="">
> From: <a href="mailto:fieldtrip-bounces@science.ru.nl" class="">fieldtrip-bounces@science.ru.nl</a><br class="">
> [<a href="mailto:fieldtrip-bounces@science.ru.nl" class="">mailto:fieldtrip-bounces@science.ru.nl</a>] On Behalf Of parham<br class="">
> hashemzadeh<br class="">
> Sent: 04 October 2016 16:59<br class="">
> To: FieldTrip discussion list <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>><br class="">
> Subject: Re: [FieldTrip] plotting freesurfer mesh on the mri_aligned.<br class="">
><span class="Apple-converted-space"> </span><br class="">
> Hi Jan<br class="">
>   Thank you, my functional data are the function values of some<br class="">
> function (irrotational component of the current). From my limited<br class="">
> experience of Fieldtrip, your explanation feels (to myself) a bit<br class="">
> cryptic at the moment.<br class="">
><span class="Apple-converted-space"> </span><br class="">
>       You see if my inversion strategy was one of the classical ones<br class="">
> such as the ones provided by "ft_sourceanalysis" lcmv,sam,..., eloreta<br class="">
>            then the available fieldtrip tutorials are great in showing<br class="">
> how to plot functional values on the top of anatomical values.<br class="">
>   But, since, I work on inversion methods, then I need a hacking<br class="">
> strategy to be able to plot functional values of "some<br class="">
> function"(estimated) on top of anatomical data MRI.<br class="">
><span class="Apple-converted-space"> </span><br class="">
>   I would appreciate if you would kindly let me know, if there is hack<br class="">
> to it such that<br class="">
>   ft_sourceplot can accept the input.<br class="">
> best regards parham<br class="">
><span class="Apple-converted-space"> </span><br class="">
><span class="Apple-converted-space"> </span><br class="">
><span class="Apple-converted-space"> </span><br class="">
><span class="Apple-converted-space"> </span><br class="">
><span class="Apple-converted-space"> </span><br class="">
> On 2016-10-04 16:29, Schoffelen, J.M. (Jan Mathijs) wrote:<br class="">
>> Hi Parham,<br class="">
>><span class="Apple-converted-space"> </span><br class="">
>> It is possible, but certainly not pain free, nor straightforward.<br class="">
>> I think this is not really a fieldtrip question, but more a general<br class="">
>> matlab related issue.<br class="">
>><span class="Apple-converted-space"> </span><br class="">
>> It should be possible to plot a slice through an MRI volume as a<br class="">
>> MATLAB patch, where the coordinates of the voxels are expressed in<br class="">
>> some coordinate system. Then, it is possible to generate and<br class="">
>> intersection of the freesurfer mesh through the plane of<br class="">
>> visualization.<br class="">
>><span class="Apple-converted-space"> </span><br class="">
>> Best,<br class="">
>> Jan-Mathijs<br class="">
>><span class="Apple-converted-space"> </span><br class="">
>><span class="Apple-converted-space"> </span><br class="">
>><span class="Apple-converted-space"> </span><br class="">
>>> On 04 Oct 2016, at 16:41, parham hashemzadeh <<a href="mailto:ph442@cam.ac.uk" class="">ph442@cam.ac.uk</a>> wrote:<br class="">
>>><span class="Apple-converted-space"> </span><br class="">
>>> Dear Fieldtrippers<br class="">
>>> Is there a straightforward pain free method ( I appreciate if you can<br class="">
>>> give me the command)<br class="">
>>> to plot arbitrary points such as the vertices of the freesurfer<span class="Apple-converted-space"> </span><br class="">
>>> output<br class="">
>>> (mesh) onto the MRI image?<br class="">
>>> The reason that I ask is that I would like to plot my solution on the<br class="">
>>> MRI image.<br class="">
>>> Unfortunately I do not use dipoles. In EEG, I model the irrotational<br class="">
>>> component of the current as a scalar function and therefore I am<span class="Apple-converted-space"> </span><br class="">
>>> doing<br class="">
>>> function estimation.<br class="">
>>>  IF you use dipoles, it is straightforward because you follow one of<br class="">
>>> the tutorials.<br class="">
>>>  But if you do not use dipoles and model the current as the gradient<br class="">
>>> of the irrotational component of the current in EEG then one can get<br class="">
>>> lost.<br class="">
>>> Any help would be appreciated.<br class="">
>>> Many thanks<br class="">
>>><span class="Apple-converted-space"> </span><br class="">
>>> --<br class="">
>>> best regards<br class="">
>>> Parham Hashemzadeh<br class="">
>>> Research Associate<br class="">
>>> Department of Applied Mathematics and Theoretical Physics<br class="">
>>> University of Cambridge, UK.<br class="">
>>> email: <a href="mailto:hashemzadeh@damtp.cam.ac.uk" class="">hashemzadeh@damtp.cam.ac.uk</a><br class="">
>>> _______________________________________________<br class="">
>>> fieldtrip mailing list<br class="">
>>> <a href="mailto:fieldtrip@donders.ru.nl" class="">fieldtrip@donders.ru.nl</a><br class="">
>>><span class="Apple-converted-space"> </span><a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
>><span class="Apple-converted-space"> </span><br class="">
>><span class="Apple-converted-space"> </span><br class="">
>> _______________________________________________<br class="">
>> fieldtrip mailing list<br class="">
>> <a href="mailto:fieldtrip@donders.ru.nl" class="">fieldtrip@donders.ru.nl</a><br class="">
>><span class="Apple-converted-space"> </span><a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
><span class="Apple-converted-space"> </span><br class="">
> --<br class="">
> best regards<br class="">
> Parham Hashemzadeh<br class="">
> Research Associate<br class="">
> Department of Applied Mathematics and Theoretical Physics<br class="">
> University of Cambridge, UK.<br class="">
> email: <a href="mailto:hashemzadeh@damtp.cam.ac.uk" class="">hashemzadeh@damtp.cam.ac.uk</a><br class="">
> _______________________________________________<br class="">
> fieldtrip mailing list<br class="">
> <a href="mailto:fieldtrip@donders.ru.nl" class="">fieldtrip@donders.ru.nl</a><br class="">
><span class="Apple-converted-space"> </span><a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
><span class="Apple-converted-space"> </span><br class="">
> _______________________________________________<br class="">
> fieldtrip mailing list<br class="">
> <a href="mailto:fieldtrip@donders.ru.nl" class="">fieldtrip@donders.ru.nl</a><br class="">
><span class="Apple-converted-space"> </span><a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
<br class="">
--<span class="Apple-converted-space"> </span><br class="">
best regards<br class="">
Parham Hashemzadeh<br class="">
Research Associate<br class="">
Department of Applied Mathematics and Theoretical Physics<br class="">
University of Cambridge, UK.<br class="">
email: <a href="mailto:hashemzadeh@damtp.cam.ac.uk" class="">hashemzadeh@damtp.cam.ac.uk</a><br class="">
<br class="">
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="mailto:fieldtrip@donders.ru.nl" class="">fieldtrip@donders.ru.nl</a><br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></div>
</span></font></div>
</div>
<span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">fieldtrip
 mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<a href="mailto:fieldtrip@donders.ru.nl" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">fieldtrip@donders.ru.nl</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>