<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; }--></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi Vitória,<br>
</p>
<p><br>
</p>
<p>I would just add that there is a provision in SPM's normalization procedure to weight or mask areas of your patient's MRI, which you can take advantage of to get much better results. (FieldTrip calls SPM functions behind-the-scenes to implement normalization.)<br>
</p>
<p><br>
</p>
<p>First, you might want to see how 'strange' the default normalization looks. Right before running 'ft_volumenormalise', just run:<br>
</p>
<p>spm_figure('Create','Graphics');<br>
</p>
<p><br>
</p>
<p>Then, after ft_volumenormalise finishes, you should see the normalization results compared against the MNI template image. Probably, you will see that they don't match very well.<br>
</p>
<p><br>
</p>
<p>I'm not sure yet how to implement this in your FieldTrip workflow, but you can get started by working with SPM8 directly. <span style="font-size: 12pt;">Several years ago, we managed to successfully normalize MRIs of patients with brain tumors. We did this
 by 'painting' the pathological areas with MRIcro to create a mask, saving this mask into its own (binary) </span><span style="font-size: 12pt;">MRI file. This masked MRI can then be used by SPM as a 'weight' during the normalization process. You'll want normal
 brain to have a weight of 1 and the tumor zone to have a weight of 0. </span></p>
<p><span style="font-size: 12pt;"><br>
</span></p>
<p>Probably this can be converted into command-line functions, but if you use the SPM8 GUI, you would go to "Normalise (Estimate and Write)", select your patient's MRI as the 'Source Image' and 'Images to Write', and the tumor mask as 'Source Weighting Image'.
 You probably have a T1 MRI, so under 'Template Image' you would select T1.nii.<br>
</p>
<p><br>
</p>
<p>Again, it'll show you the normalized result compared with the template at the end of the process, and hopefully it will have gone better this time. :-)<br>
</p>
<p><br>
</p>
<p>Note that SPM will want to work with Analyze (hdr/img) or Nifti (nii) files, so you'll have to convert them as appropriate.<br>
</p>
<p><br>
</p>
<p>Maybe somebody else can fill you in on the best way to import the resulting normalized MRI back into your FieldTrip pipeline.<br>
</p>
<p><br>
</p>
<p>Cheers<br>
</p>
<p>Sarang<br>
</p>
<p><br>
</p>
<p><br>
</p>
<div style="word-wrap:break-word">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> fieldtrip-bounces@science.ru.nl <fieldtrip-bounces@science.ru.nl> on behalf of Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen@donders.ru.nl><br>
<b>Sent:</b> Tuesday, June 14, 2016 9:31 AM<br>
<b>To:</b> FieldTrip discussion list<br>
<b>Subject:</b> Re: [FieldTrip] help diagnosing issues with source analysis (pathological brain)</font>
<div> </div>
</div>
<div>Hi Vitória,
<div class=""><br class="">
</div>
<div class="">To me it looks as if most of the stuff you describe works as expected, i.e. it works well or it gives funny results, apart from the non-linear normalisation. The extremely distorted warped grid points may be due to the patient’s anatomical being
 pathological, causing the normalisation to converge to a very strange solution.</div>
<div class=""><br class="">
</div>
<div class="">Now, with respect to the plotting/interpolation: if the coordinate systems of the objects you are overlaying don’t match, you get funny results. This is the case for the sourceplot with the surface method (where the default cortical surface is
 in MNI-RAS), and your functional image is in CTF’s ALS, as well as for the sourceplot with the ortho method, using the blurry template from SPM (which is also in MNI-RAS). If you want these to match up, you could replace the source positions in your functional
 image with the ones from the standard grid, because you assume topological equivalence as per the inverse warping strategy applied in the creation of the beamformer grid.</div>
<div class=""><br class="">
</div>
<div class="">So, long story short: it seems that your source analysis just went fine, but you are confused by the different coordinate systems.</div>
<div class=""><br class="">
</div>
<div class="">Best,</div>
<div class="">JM</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 13 Jun 2016, at 11:02, Vitoria Piai <<a href="mailto:v.piai.research@gmail.com" class="">v.piai.research@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div class="">Hi Cris, </div>
<div class=""><br class="">
</div>
<div class="">that makes sense, except that the .mri file I'm getting from the hospital should already contain the right fiducial coordinates (or so I was told by the MEG technician). Maybe the issue is that FieldTrip is not getting these coordinates right
 from the .mri file if I don't run it through ft_volumerealign first. </div>
<div class="">Any thoughts anyone?</div>
<div class=""><br class="">
</div>
<div class="">Thanks again</div>
</div>
<div class="gmail_extra"><br class="">
<div class="gmail_quote">On 12 June 2016 at 13:55, Cristiano Micheli <span dir="ltr" class="">
<<a href="mailto:michelic72@gmail.com" target="_blank" class="">michelic72@gmail.com</a>></span> wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr" class="">Dear Vitoria
<div class=""><br class="">
</div>
<div class="">I had the same problem when I tried to coregister functional and anatomical data without transitioning through a head-referenced coordinates system.</div>
<div class="">I solved the problem by using ft_volumerealign and selecting comparable anatomical fiducials for different subjects (nasion, left, right,..) BEFORE volume normalization.</div>
<div class=""><br class="">
</div>
<div class="">Maybe a hint towards the solution?</div>
<div class=""><br class="">
</div>
<div class="">Cheers</div>
<div class="">Cris</div>
<div class=""><br class="">
</div>
</div>
<div class="gmail_extra"><br class="">
<div class="gmail_quote">
<div class="">
<div class="h5">On Sat, Jun 11, 2016 at 8:50 PM, Vitória Piai <span dir="ltr" class="">
<<a href="mailto:v.piai.research@gmail.com" target="_blank" class="">v.piai.research@gmail.com</a>></span> wrote:<br class="">
</div>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; padding-left:1ex; border-left-color:rgb(204,204,204); border-left-width:1px; border-left-style:solid">
<div class="">
<div class="h5">
<div bgcolor="#FFFFFF" class="">Hi everyone, <br class="">
<br class="">
I was hoping someone could help me figure out where my source analysis is going wrong.
<br class="">
I have data on brain tumour patients (MRIs are from prior to tumour resection). From the hospital (using CTF), I receive .mri files that already have fiducial points saved as far as I was told. I then reslice and segment the .mri file, after reading it with
 ft_read_mri<br class="">
mri_reslice             = ft_volumereslice([], mri);<br class="">
segmentedmri = ft_volumesegment([], mri_reslice);<br class="">
This seems to be working:<br class="">
<span id="cid:part1.00000907.02010104@gmail.com"><bfejiccb.png></span><br class="">
<br class="">
Plotting headmodel and sensors, it looks like they are aligned:<br class="">
<span id="cid:part2.03070600.04020506@gmail.com"><jidhfdhd.png></span><br class="">
If I compute the source model with MNI-warping (non-linear transformation), I get something that doesn't seem right. I don't know if this is because these are not normal brains to start with:<br class="">
<span id="cid:part3.01010008.01070904@gmail.com"><ebfighdf.png></span><br class="">
With linear transformation, things look better:<br class="">
<span id="cid:part4.02060106.03040100@gmail.com"><ehffjdea.png></span><br class="">
 One of my questions is what the consequences are of using linear transformation for the MNI warping given the pathological nature of these brains.<br class="">
<br class="">
Then, the next issue is this result when projecting the source to the surface:<br class="">
<span id="cid:part5.07080201.03090704@gmail.com"><dffeehgc.png></span><br class="">
This happens regardless of whether I use the MNI-warped grid interpolated to the MNI template, or the patient's individual grid skipping the MNI normalisation step, interpolated to the patient's own T1.<br class="">
But if I plot with 'ortho' method, then I see that the MNI-warped and interpolated source data is misaligned, but the patient-native space one isn't.<br class="">
<span id="cid:part6.06000104.05000506@gmail.com"><dcigdbdi.png></span><br class="">
 <br class="">
I can't make sense of this anymore; I've been trying all kinds of things that don't work, so I was wondering whether anyone has an idea of what could be going on by looking at these figures. Is it an error already at the level of alignment of the fiducials?
 Or is it due to the MNI-warping? Or a combination of issues?<br class="">
<br class="">
Thanks very much for any kind of help!<br class="">
Vitoria<br class="">
</div>
<br class="">
</div>
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank" class="">fieldtrip@donders.ru.nl</a><br class="">
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank" rel="noreferrer" class="">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
</blockquote>
</div>
<br class="">
</div>
<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="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank" rel="noreferrer" class="">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
</blockquote>
</div>
<br class="">
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="mailto:fieldtrip@donders.ru.nl" class="">fieldtrip@donders.ru.nl</a><br class="">
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</body>
</html>