[Mne_analysis] a junior question on mne_setup_source_space

dgw dgwakeman at gmail.com
Fri Mar 28 16:42:14 EDT 2014
Search archives:

Hi Peng,

I think you missed a step or two when trying to do the alignment. First you
select all three positions(LAP, RAP, and Nasion) on the bem surface. Follow
these sentences exactly:

You push LAP then select the point on the surface (matching your digitized
location). Next,
You push Nasion then select the point on the surface (matching your
digitized location). Next,
You push RAP then select the point on the surface (matching your digitized
location). Next,
You push align using fiducials.

You must change all three first then push align using fiducials only then
will you be able to get a good initial fit.

HTH,
D

On Fri, Mar 28, 2014 at 3:53 PM, peng <prion.w at gmail.com> wrote:

> Thanks, junpeng, though I am not familiar with python.
> Thanks, dgw,  I will try your way, perhaps also with combination of <
> fiff_write_coord_trans>.
> The reason I don't use the GUI is that it did not work well in my
> environment. For example, when I re-set the location of LAP by clicking, I
> saw the coordinates changed (e.g. 10 mm),  but not in the graphics, the
> green label was still in the original location. Then I used the button to
> move the fiducials, this time, Nasion, LAP and RAP always moved together,
> although I only chose one... If I accepted this unsatisfied alignment,
> later automatic alignment only  made it worse. I am using the latest MNE
> and freesurfer, in MacOS 10.9.2 on a macbook pro. Maybe there are some
> dependency problems with the version of libraries...
> So I plan to output a transform matrix generated by other software to
> -trans.fif format, and then load it to visualize in mne_analyze. Modify it
> outside if not appropriate (it is quite possible that different software
> define XYZ in a different way.), then visualize in mne_analyze again. It
> sound painful, but I don't have better solutions other than that.
>
>
> On Fri, Mar 28, 2014 at 5:24 PM, dgw <dgwakeman at gmail.com> wrote:
>
>> presently in the matlab toolbox there is not a single function for
>> reading a trans.fif file, but you can easily string together a couple of
>> commands to do this. This should work on your file. I do recommend
>> familiarizing yourself with the gui (using the sample data) as manually
>> adjusting the transformation matrix in matlab is a highly risky business:
>>
>> [fid, tree, dir] = fiff_open('test-trans.fif')
>> for t = 1:length(dir)
>>     if dir(t).kind == FIFF.FIFF_COORD_TRANS
>>         tag = fiff_read_tag(fid,dir(t).pos)
>>         break
>>     end
>> end
>> trans = tag.data
>>
>> Your code did not work, because your fid was not a fif fid (as described
>> in fiff_write_coord_trans).
>>
>> HTH
>> D
>>
>>
>>
>> On Fri, Mar 28, 2014 at 11:40 AM, peng <prion.w at gmail.com> wrote:
>>
>>> Thanks, dgw and junpeng for your feedback. I did read the manual before
>>> asking:)
>>>
>>> I am sorry '-src.fif' was a typo, I wanted to read -trans.fif. I did not
>>> find a proper function in the manual.
>>>
>>> To write it, <fiff_write_coord_trans> seem to be the correct function.
>>> According to the manual, I set
>>> ==
>>> t.from = 4 %(head);
>>> t.to = 5 %(mri);
>>> t.trans = M; %(4x4 matrix).
>>> x = fopen('t.fif', 'w');
>>> fiff_write_coord_trans(x, t);
>>> fclose(x);
>>> ==
>>> No complains from matlab in writing.
>>> But mne_analyze complain that the file "does not start properly"...
>>>
>>>
>>>
>>>
>>> On Fri, Mar 28, 2014 at 3:10 PM, dgw <dgwakeman at gmail.com> wrote:
>>>
>>>> Hi Peng,
>>>>
>>>> The matlab toolbox chapter in the manual specifies how you read each
>>>> file type. The function to read a "-src.fif" file is
>>>> mne_read_source_spaces.
>>>>
>>>> D
>>>>
>>>> On Fri, Mar 28, 2014 at 9:14 AM, peng <prion.w at gmail.com> wrote:
>>>> > Thank you Martin for the help.
>>>> > 1. I re-run the command "mne_setup_forward_model" and it seemed
>>>> working this
>>>> > time (maybe I did not set the environment correctly). Sorry for the
>>>> > confusion.
>>>> > 2. I tried with MNE_analyze GUI and it was not easy for me. But I
>>>> saved
>>>> > results from one subject successfully and it could be load by
>>>> MNE_analyze.
>>>> > However I wanted to read it in matlab to check the real contents
>>>> (which I
>>>> > assume is a structure with the transformation matrix). I failed with
>>>> "x =
>>>> > fiff_read_mri(fname, 0). It complained "Could not find MRI data"...
>>>> Would
>>>> > please let me know the function name to read and write *-src.fif file
>>>> in
>>>> > matlab?
>>>> >
>>>> >
>>>> >
>>>> > On Wed, Mar 26, 2014 at 9:28 PM, Martin Luessi <
>>>> mluessi at nmr.mgh.harvard.edu>
>>>> > wrote:
>>>> >>
>>>> >> On 03/26/14 16:00, peng wrote:
>>>> >> > Thank you for the answers.
>>>> >> > 1. Surprisingly I did not find any files were generated/saved after
>>>> >> > running mne_setup_forward_model.
>>>> >>
>>>> >> I assume there was an error, can you post the program output?
>>>> >>
>>>> >> > 2. I don't have a -trans.fif file. I tried to do it in GUI of
>>>> >> > MNE_analyze, it was quite complicated. If I have a co-registered
>>>> mri
>>>> >> > file (generated by CTF software with .mri extension), can it be
>>>> >> > converted to fif format? If not, I can read the 4x4 head2mri
>>>> matrix via
>>>> >> > matlab, can this information be written to fif format with certain
>>>> tools
>>>> >> > in MNE?
>>>> >>
>>>> >> There is also a coreg GUI in MNE-Python, have a look here
>>>> >>
>>>> >> http://www.slideshare.net/mne-python/mnepython-coregistration
>>>> >>
>>>> >> You could write a .fif file with the transform in Matlab, but it
>>>> seems
>>>> >> to me that this wouldn't be easier than using the coregistration
>>>> tools
>>>> >> in mne_analyze or MNE-Python.
>>>> >>
>>>> >> HTH,
>>>> >>
>>>> >> Martin
>>>> >>
>>>> >>
>>>> >> > Thanks again!
>>>> >> >
>>>> >> >
>>>> >> > On Tue, Mar 25, 2014 at 11:39 PM, Alexandre Gramfort
>>>> >> > <alexandre.gramfort at telecom-paristech.fr
>>>> >> > <mailto:alexandre.gramfort at telecom-paristech.fr>> wrote:
>>>> >> >
>>>> >> >     hi,
>>>> >> >
>>>> >> >     >  Some additional questions.
>>>> >> >     > 1 After I ran mne_setup_forward_model, I have no feedback
>>>> from the
>>>> >> >     command
>>>> >> >     > line, is it normal?
>>>> >> >
>>>> >> >     it should print that it saved a file to disk
>>>> >> >
>>>> >> >     > 2 I am using CTF data, thus I converted the .ds folder from
>>>> CTF to
>>>> >> > fif
>>>> >> >     > format with mne_ctf2fiff command, with option --infoonly.
>>>> Here I
>>>> >> >     only want
>>>> >> >     > to get the Leadfield thus I suppose data is not necessary.
>>>> However
>>>> >> >     when I
>>>> >> >     > try mne_do_forward_solution, it asked for mri description
>>>> file,
>>>> >> >     which I
>>>> >> >     > haven't. I have only a series of dicom files or the .mri file
>>>> >> >     generated by
>>>> >> >     > ctf software from them. Can I still move on?
>>>> >> >
>>>> >> >     you need to do the coregistration and get a -trans.fif file.
>>>> >> >
>>>> >> >     A
>>>> >> >     _______________________________________________
>>>> >> >     Mne_analysis mailing list
>>>> >> >     Mne_analysis at nmr.mgh.harvard.edu
>>>> >> >     <mailto:Mne_analysis at nmr.mgh.harvard.edu>
>>>> >> >     https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>>> >> >
>>>> >> >
>>>> >> >     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.
>>>> >> >
>>>> >> >
>>>> >> >
>>>> >> >
>>>> >> > _______________________________________________
>>>> >> > Mne_analysis mailing list
>>>> >> > Mne_analysis at nmr.mgh.harvard.edu
>>>> >> > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>>> >> >
>>>> >>
>>>> >> _______________________________________________
>>>> >> Mne_analysis mailing list
>>>> >> Mne_analysis at nmr.mgh.harvard.edu
>>>> >> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>>> >
>>>> >
>>>> >
>>>> > _______________________________________________
>>>> > Mne_analysis mailing list
>>>> > Mne_analysis at nmr.mgh.harvard.edu
>>>> > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>>> >
>>>> >
>>>> > 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.
>>>> >
>>>> _______________________________________________
>>>> Mne_analysis mailing list
>>>> Mne_analysis at nmr.mgh.harvard.edu
>>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>>>
>>>
>>>
>>> _______________________________________________
>>> Mne_analysis mailing list
>>> Mne_analysis at nmr.mgh.harvard.edu
>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>>
>>>
>>> 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.
>>>
>>>
>>
>> _______________________________________________
>> Mne_analysis mailing list
>> Mne_analysis at nmr.mgh.harvard.edu
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>
>>
>> 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.
>>
>>
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>
>
> 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.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20140328/3f55ed7f/attachment.html 


More information about the Mne_analysis mailing list