<div dir="ltr"><div>Hi FieldTrip Experts,</div><div><br></div><div>I am trying to perform source reconstruction, and I am having trouble with coregistering my anatomical with the sensors. The MEG system we're using is Yokogawa and the anatomical is a NIFTI file. I get some errors when using ft_sensorrealign and ft_electroderealign. I will go through the steps I took before getting to this stage, as maybe I have done something wrong. </div><div><br></div><div>first I read in my MRI and determine the coordinate system which is LPS.</div><div><br></div><div><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier">mriunknown = ft_read_mri(<span style="color:rgb(178,69,243)">'WMCP1011+22+t1mprage.nii'</span>);</p>
<p style="margin:0px;font-size:10px;line-height:normal;font-family:courier">mri = ft_determine_coordsys(mriunknown, <span style="color:rgb(178,69,243)">'interactive'</span>,<span style="color:rgb(178,69,243)">'yes'</span>)</p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier"><br></p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier"><span style="font-family:arial,sans-serif;font-size:small"> next I realign to the CTF coordinate system by marking the NAS LPA, RPA </span><br></p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier"><span style="font-family:arial,sans-serif;font-size:small"><br></span></p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier">cfg = [];</p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier">cfg.method = <span style="color:rgb(178,69,243)">'interactive'</span>;</p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier">cfg.coordsys = <span style="color:rgb(178,69,243)">'ctf'</span>;</p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier">
</p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier">mri_ctf = ft_volumerealign(cfg, mir);</p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier"><br></p><p style="margin:0px;line-height:normal">I read in the sensor information and added in the coordinates for the marker positions. we have five marker positions, the three I picked were the left and right ear markers and the middle forehead marker. </p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier"><span style="color:rgb(0,0,0)"><br></span></p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier"><span style="color:rgb(0,0,0)">grad=ft_read_sens(</span><span style="color:rgb(178,69,243)">'srcLocTest01_FT_01.con'</span><span style="color:rgb(0,0,0)">);</span><br></p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier;min-height:12px"> </p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier;min-height:12px"> </p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier">grad.fid.pnt(1,:) = [96.07 3.11 -5.32]./10;</p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier">grad.fid.pnt(2,:) = [11.13 75.50 -78.23]./10;</p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier">grad.fid.pnt(3,:) = [8.50 -75.09 -64.60]./10;</p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier;min-height:12px"> </p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier">grad.fid.label = {<span style="color:rgb(178,69,243)">'NAS'</span> <span style="color:rgb(178,69,243)">'LPA'</span> <span style="color:rgb(178,69,243)">'RPA'</span>};</p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier"><br></p><p style="margin:0px;line-height:normal;min-height:12px">I then put the template marker point cordinates into the configuration which were taken from the mri_ctf <br></p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier"><br></p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier">cfg = [];</p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier">cfg.method = <span style="color:rgb(178,69,243)">'fiducial'</span>;</p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier">cfg.target.pnt(1,:) = [91.1 3.0 49.2]./10;</p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier">cfg.target.pnt(2,:) = [-0.1 70.5 0.0]./10;</p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier">cfg.target.pnt(3,:) = [0.1 -70.5 0.0]./10;</p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier;min-height:12px"> </p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier">cfg.target.label = {<span style="color:rgb(178,69,243)">'NAS'</span> <span style="color:rgb(178,69,243)">'LPA'</span> <span style="color:rgb(178,69,243)">'RPA'</span>};</p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier;min-height:12px"> </p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier">
</p><p style="margin:0px;font-size:10px;line-height:normal;font-family:courier">grad_aligned = ft_sensorrealign(cfg, grad);</p></div><div><br></div><div>when I use ft_sensorrealign I get the following errors :</div><div><br></div><div><div>Undefined function or variable 'lab'.</div><div><br></div><div>Error in channelposition (line 314)</div><div>n = size(lab,2);</div><div><br></div><div>Error in ft_datatype_sens (line 328)</div><div> [chanpos, chanori, lab] = channelposition(sens);</div><div><br></div><div>Error in ft_sensorrealign (line 212)</div><div>elec_original = ft_datatype_sens(elec_original); % ensure up-to-date sensor description (Oct 2011)</div></div><div><br></div><div><br></div><div>when I use ft_electroderealign I get the following errors: </div><div><br></div><div><div>Error using ft_fetch_sens (line 192)</div><div>no electrodes or gradiometers specified.</div><div><br></div><div>Error in ft_electroderealign (line 195)</div><div> elec_original = ft_fetch_sens(cfg);</div></div><div><br></div><div><br></div><div>Hope you can help me figure out why I'm getting these errors.</div><div>Thanks,</div><div>Ainsley </div>
</div>