[Mne_analysis] forward model having only segmentation files

dgw dgwakeman at gmail.com
Tue May 29 12:21:56 EDT 2012
Search archives:

Ok,

The first thing you could try is to use mne_watershed_bem now. If you 
are happy with those results, you can stop there.

If not the next step would involve using the FreeSurfer MATLAB tools to 
multiply your binary masks to the T1 volume and run mri_watershed step 
by step on each shell. Unfortunately, this requires you to setup fake 
FreeSurfer directories for each shell. Eventually, you will be able to 
get there though.

See if the initial run helps.

D


tokariev at mappi.helsinki.fi wrote:
> Hi Dan,
> 
> Thanx for your reply.
> 
> Re masks:
> 
> Yes, they are binary masks. But I set '1' values to suitable for 
> Freesurfer data (to 110). As far as I know Freesurfer does not work with 
> binary data. 'Skin mask' is a contour of skin: on the black background 
> is a 1 pixel width countour that repeats skin countour (each pixel = 
> 110). 'Skull mask' has the same principle but with other width.
> 
> Re -autorecon1:
> 
> I have done like you wrote. I used 'skin' volume for test. I got in 
> folder 'mri' next files:
> error.log
> mri_nu_correct.mni.log
> nu.mgz
> orig
> orig.mgz
> rawavg.mgz
> T1.mgz
> transforms
> 
> Folder 'transforms' contains files:
> bak
> talairach.auto.xfm
> talairach_avi.log
> talairach_avi_QA.log
> talairach.xfm
> talsrcimg_to_711-2C_as_mni_average_305_t4_vox2vox.txt
> 
> BW,
> Anton
> 
> 
> Lainaus dgw <dgwakeman at gmail.com>:
> 
>> Hi Anton,
>>
>> Well mri_watershed is not designed to deal with segmented data. You 
>> need to trick it.
>>
>> tokariev at mappi.helsinki.fi wrote:
>>> Hello,
>>>
>>> I am trying to create surfaces for BEM. I have done next steps:
>>>
>>> 1. I have raw MRI images (DICOM). I did segmentation of inner/outer 
>>> skull and outer skin manually. After this, I changed the original MRI 
>>> images to segmented volumes (to keep all DICOM headers). In other 
>>> words, I got MRI images, where instead of original MRI I put inner 
>>> skull segmentation (also I have saved files like that to outer skull 
>>> and outer skin). Each value of the segmented volume were set to 110.
>>>
>>> 2. I used mri_convert to get from 3 sets of images in DICOM format, 
>>> those contain segmentations, volumes in .mgz format. So I got 
>>> inner_skull.mgz, outer_skull.mgz and outer_skin.mgz. I put these 
>>> files to the folder: .../freesurfer/subjects/subject/mri/orig
>> Are these binarized masks? Are they masked at all?
>>
>> Regardless, you need to put a raw MRI volume saved as 001.mgz in 
>> /subjects/subject/mri/orig/001.mgz and run autorecon1 (check 
>> freesurfer wiki for details).
>>
>>>
>>> Now I am trying to get surfaces with a help of the command 
>>> 'mri_watershed -surf'. I am using it like this: mri_watershed -surf 
>>> inner_skull.mgz inner_skull_surf... But the program fails to create 
>>> surfaces. What I am doing wrong on this stage? Could anyone give an 
>>> advise?
>> First run the above, and let me know what the files are then we can 
>> look into the subsequent steps (this is a non-standard hack I 
>> developed), so it will take some time to work through.
>>
>> D
>>>
>>> Best wishes,
>>> Anton
>>>
>>> Lainaus dgw <dgwakeman at gmail.com>:
>>>
>>>> The easiest thing to do would be to play around with the FreeSurfer 
>>>> command mri_watershed
>>>>
>>>> use -surf
>>>>
>>>> For each volume you give it the created outer skin surface will be 
>>>> the outermost surface you can use for your bem. Use it serially, 
>>>> re-naming the files for use in your BEM. If this is. You may have to 
>>>> play a while to get it to work. I suspect you will need to apply the 
>>>> mask to your original volume, as it expects non-binary data.
>>>>
>>>> D
>>>>
>>>> tokariev at mappi.helsinki.fi wrote:
>>>>> Hi
>>>>>
>>>>> I have one more question... Is there any function in MNE/Freesurfer 
>>>>> that allows to create automatically inner and outer skull surfaces 
>>>>> from binary skull mask (from FSL)? And the same for the binary skin 
>>>>> mask? I have difficulties with finding the answer for this question 
>>>>> in Internet...
>>>>>
>>>>> Regards,
>>>>> Anton
>>>>>
>>>>> Lainaus "Alexandre Gramfort" <gramfort at nmr.mgh.harvard.edu>:
>>>>>
>>>>>> hi anton,
>>>>>>
>>>>>> for BEM you need inner-skull, outer-skull and outer-skin surfaces
>>>>>>
>>>>>> you need the gray / white interface for a cortically constrained
>>>>>> source space but no need with a volumic source space.
>>>>>>
>>>>>> Alex
>>>>>>
>>>>>> On Mon, Mar 12, 2012 at 10:25 AM,  <tokariev at mappi.helsinki.fi> 
>>>>>> wrote:
>>>>>>> Hi Dan and Alex,
>>>>>>>
>>>>>>> Thank you very much for your advices! I'll try to implement them.
>>>>>>>
>>>>>>> One more question... do I understand correctly that to be able to 
>>>>>>> create
>>>>>>> forward model I will need both boundaries in brain segmentation 
>>>>>>> file: outer
>>>>>>> cortex/CSF boundary and gray/white junction boundary? If I have only
>>>>>>> cortex/CSF boundary I can generate only braine surface but not 
>>>>>>> forward
>>>>>>> model?
>>>>>>>
>>>>>>> Thanks in advance!
>>>>>>>
>>>>>>> BW,
>>>>>>> Anton
>>>>>>>
>>>>>>>
>>>>>>> Lainaus "Alexandre Gramfort" <gramfort at nmr.mgh.harvard.edu>:
>>>>>>>
>>>>>>>
>>>>>>>> Hi Anton,
>>>>>>>>
>>>>>>>> I agree with Dan. You should work with a volume source space.
>>>>>>>>
>>>>>>>> It's not going to be trivial but the way to go is:
>>>>>>>>
>>>>>>>> - extract the BEM surfaces and write them a folder matching
>>>>>>>> ${SUBJECTS_DIR}/${SUBJECT}/bem
>>>>>>>>
>>>>>>>> see the mne-sample-data for an example of database layout
>>>>>>>>
>>>>>>>> you'll probably need to have surface in the
>>>>>>>> ${SUBJECTS_DIR}/${SUBJECT}/mri folder to mne_analyze to be able 
>>>>>>>> to do
>>>>>>>> the coregistration.
>>>>>>>>
>>>>>>>> - then you can run the forward computation see:
>>>>>>>>
>>>>>>>>
>>>>>>>> https://github.com/mne-tools/mne-scripts/blob/master/sample-data/run_meg_volume_tutorial.sh 
>>>>>>>> - then with python you can run an inverse computation. See:
>>>>>>>>
>>>>>>>>
>>>>>>>> http://www.martinos.org/mne/auto_examples/inverse/plot_compute_mne_inverse_volume.html 
>>>>>>>> you should then be able to write a nifty or .mgh file to overlay 
>>>>>>>> the
>>>>>>>> activations on the volume e.g. with freeview shipped with 
>>>>>>>> freesurfer
>>>>>>>>
>>>>>>>> may the force be with you !
>>>>>>>>
>>>>>>>> Alex
>>>>>>>>
>>>>>>>> On Fri, Mar 9, 2012 at 5:59 PM, dgw <dgwakeman at gmail.com> wrote:
>>>>>>>>>
>>>>>>>>> Hi Anton,
>>>>>>>>>
>>>>>>>>> The only thing I can think of would be to use 
>>>>>>>>> mne_volume_source_space.
>>>>>>>>> You
>>>>>>>>> would still need to generate a couple of surfaces for your BEM, 
>>>>>>>>> but this
>>>>>>>>> should not be very difficult. If you need more advice about 
>>>>>>>>> that, please
>>>>>>>>> let
>>>>>>>>> me know.
>>>>>>>>>
>>>>>>>>> D
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> tokariev at mappi.helsinki.fi wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Hello Alex,
>>>>>>>>>>
>>>>>>>>>> Thank you very much for your reply. I completely understand 
>>>>>>>>>> that it is
>>>>>>>>>> better to use Freesurfer first. But I deal with neonatal data. 
>>>>>>>>>> And
>>>>>>>>>> Freesurfer, unfortunately, fails to analyse such kind of data 
>>>>>>>>>> (when I
>>>>>>>>>> tried it even did not create all folders and files, those i 
>>>>>>>>>> could edit
>>>>>>>>>> manually). As far as I got from literature, people (almost) 
>>>>>>>>>> always do
>>>>>>>>>> segmentation of neonatal data manually and then launch 
>>>>>>>>>> Freesurfer. But
>>>>>>>>>> it
>>>>>>>>>> takes a lot of time to do and is not trivial task. But I have  
>>>>>>>>>> already
>>>>>>>>>> segmentation files done in FSL. So, my idea was somehow to 
>>>>>>>>>> use  them in
>>>>>>>>>> MNE
>>>>>>>>>> to get forward model. What would you recommend? What do  you 
>>>>>>>>>> think the
>>>>>>>>>> most
>>>>>>>>>> optimal way to act in my case?
>>>>>>>>>>
>>>>>>>>>> Regards,
>>>>>>>>>> Anton
>>>>>>>>>>
>>>>>>>>>> Цитирую "Alexandre Gramfort" <gramfort at nmr.mgh.harvard.edu>:
>>>>>>>>>>
>>>>>>>>>>> Hello Anton,
>>>>>>>>>>>
>>>>>>>>>>> it's doable but it's far from trivial as it requires you to 
>>>>>>>>>>> understand
>>>>>>>>>>> the
>>>>>>>>>>> internal of the MNE anatomical pipeline (where MNE expects to 
>>>>>>>>>>> find
>>>>>>>>>>> the files etc.). I would seriously consider running 
>>>>>>>>>>> freesurfer on my
>>>>>>>>>>> subject
>>>>>>>>>>> and rely the automatic / standard pipeline. Freesurfer also 
>>>>>>>>>>> gives you
>>>>>>>>>>> all the segmentations including the cortical surface for 
>>>>>>>>>>> sources'
>>>>>>>>>>> locations.
>>>>>>>>>>>
>>>>>>>>>>> Alex
>>>>>>>>>>>
>>>>>>>>>>> On Thu, Mar 8, 2012 at 2:31 PM,  <tokariev at mappi.helsinki.fi> 
>>>>>>>>>>> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Dear all,
>>>>>>>>>>>>
>>>>>>>>>>>> I want to create forward model in MNE software. But I have only
>>>>>>>>>>>> segmentation data (skull.mgz, skin. mgz, brain.ngz) got in FSL
>>>>>>>>>>>> software + EEG electrodes coordinates. Is it possible to do 
>>>>>>>>>>>> at all? If
>>>>>>>>>>>> yes, could anyone give me an advice how to do it or refer to 
>>>>>>>>>>>> some
>>>>>>>>>>>> tutorial where I could read about. I've read how to do it 
>>>>>>>>>>>> having 'raw'
>>>>>>>>>>>> data and using Freesurfer software + MNE. But in my case all 
>>>>>>>>>>>> I have
>>>>>>>>>>>> only are segmentation files and file with electrodes positions.
>>>>>>>>>>>>
>>>>>>>>>>>> Regards,
>>>>>>>>>>>> Anton
>>>>>>>>>>>>
>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>> 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
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
> 
> 




More information about the Mne_analysis mailing list