[Mne_analysis] Viewing Head Models

Isaiah C. Smith Isaiah.C.Smith.17 at dartmouth.edu
Mon Aug 18 17:43:12 EDT 2014
Search archives:

Sorry, 

I am having a hard time understanding these programs. Alternatively, would it be possible for me to use Python to find the gain matrix, and then later convert the gain matrix into the matlab format?

Isaiah
On Aug 16, 2014, at 5:54 AM, Alexandre Gramfort <alexandre.gramfort at telecom-paristech.fr> wrote:

> hi,
> 
> you can try to understand:
> 
> the create_info function at:
> 
> https://github.com/mne-tools/mne-python/blob/master/mne/io/meas_info.py#L790
> 
> and use the write_info function at:
> 
> https://github.com/mne-tools/mne-python/blob/master/mne/io/meas_info.py#L631
> 
> to produce a proper measurement info file.
> 
> these functions do not exist out of the box in Matlab.
> 
> HTH
> Alex
> 
> 
> On Sat, Aug 16, 2014 at 12:13 AM, Isaiah C. Smith
> <Isaiah.C.Smith.17 at dartmouth.edu> wrote:
>> Thank you, Matti, for the response,
>> 
>> Would it be possible for me to create the code?; I exactly sure how to do
>> what you are referring to in step 1, however.
>> 
>> Isaiah Smith
>> 
>> On Aug 13, 2014, at 10:01 AM, Matti Hamalainen <msh at nmr.mgh.harvard.edu>
>> wrote:
>> 
>> 
>> Hi Isaiah,
>> 
>> Conceptually what needs to be done is:
>> 
>> 1. Take the ELC file and produce a dummy fif measurement file with
>> measurement info block only. This should contain the electrode locations as
>> digitizer data and channel descriptions for the EEG electrodes with names
>> and locations inserted. Some rough coordinate transformation maybe needed to
>> bring the EEG electrode location data to a RAS-oriented coordinate frame.
>> 
>> 2. Align the coordinate MRI and EEG coordinate systems using mne_analyze.
>> 
>> 3. With help of the dummy measurement file and the coordinate transformation
>> file produced by mne_analyze you can now produce the gain matrix, often
>> called the lead field matrix even though this is technically an inaccurate
>> term.
>> 
>> I do not have time to write for you the Matlab code right now but maybe this
>> message will excite some volunteer to do so.
>> 
>> Best,
>> Matti
>> 
>> 
>> On Aug 12, 2014, at 6:44 PM, Isaiah C. Smith
>> <Isaiah.C.Smith.17 at dartmouth.edu> wrote:
>> 
>> Hello D,
>> A lab in Taiwan sent MRI data to the lab that I am working in to make the
>> head models using the patients’  images.
>> <Screen Shot 2014-08-12 at 2.39.34 PM.png>
>> Using MRICron, I converted the images into .nii, and then using freesurfer
>> get the T1.mgz, which I then use throughout the MNE process.
>> In addition to the MRIs that we were given, the lab also sent us some the
>> locations of the electrodes in the .elc file . This file can be opened in
>> MATLAB and made into a MATLAB file.
>> <Screen Shot 2014-08-12 at 2.48.55 PM.png>
>> 
>> Contents
>> GEOMETRY START  # Do not edit!
>> HELMET_SYSTEM = 0
>> PLANAR_SENSORS = 0
>> SENSOR_SHAPE = 0
>> SENSOR_ORDER = 0
>> SENSOR_DIAMETER_X_MM = 10
>> SENSOR_DIAMETER_Y_MM = 10
>> SYSTEM_CENTER_X_MM = 1000000000#
>> SYSTEM_CENTER_Y_MM = 1000000000#
>> SYSTEM_CENTER_Z_MM = 1000000000#
>> BASELENGTH_MM = -1
>> GEOMETRY END
>> 
>> SENSORS START   # Do not edit!
>> LIST_DESCRIPTION = SENSORS
>> LIST_UNITS = mm
>> LIST_NR_ROWS = 64
>> LIST_NR_COLUMNS = 3
>> LIST_NR_TIMEPTS = 1
>> LIST_VALID = 1
>> LIST_BINARY = 0
>> LIST_TYPE = 1
>> LIST_TRAFO_TYPE = 0
>> LIST_FIRST_COLUMN = 1
>> LIST_INDEX_MIN = -1
>> LIST_INDEX_MAX = -1
>> LIST_INDEX_ABS_MAX = -1
>> SENSORS END
>> 
>> SENSORS START_LIST  # Do not edit!
>> 24.5 -107.6 69.1
>> -8.3 -112 69.1
>> -38.4 -102.2 68.6
>> 74.2 -63.3 57.6
>> 46.9 -62.6 112.7
>> -4.7 -70.2 130.3
>> -56.2 -58.9 114.4
>> -83.2 -59.5 61.4
>> 76.2 -35.3 89.7
>> 28.2 -33.2 140.7
>> -37.8 -32.8 141.4
>> -86.7 -32.8 92.3
>> 77.1 24.5 -8.5
>> 87.6 -4.2 48
>> 61.3 -0.6 126.5
>> -5.2 -2.2 154.7
>> -72.9 2.3 124.5
>> -97.5 2.9 50.6
>> -86.6 26.4 -5.4
>> 76.8 28 85.2
>> 28.7 35.6 139.1
>> -37 35.7 140.6
>> -87.2 34 86.2
>> 68.1 52.3 46.6
>> 46.9 59.7 103.6
>> -5.5 65.8 120
>> -56.1 62.4 100.4
>> -79.2 58.1 46.3
>> -3.7 82.5 88.1
>> 24.8 85.9 50.7
>> -4.1 91.6 52
>> -30.1 89.4 47.9
>> 55.3 -85.8 65.1
>> 33.8 -86.9 98.1
>> -45 -84.4 96.4
>> -65 -82.1 66.3
>> 63.3 -63.1 86.3
>> 25.5 -64.9 124
>> -35.4 -64.4 126.3
>> -71.4 -61.2 90.1
>> 56.3 -30.9 120.6
>> -4.3 -37.7 148.3
>> -64.4 -32.1 121.8
>> 82.4 -3.4 88
>> 29.8 1.9 146.1
>> -38.2 0.2 145.8
>> -91.2 -0.1 88.6
>> 60 34.3 117.4
>> -4.5 36 144.6
>> -68.6 35.4 119.1
>> 63.8 54.5 74.8
>> 25 61.3 117.2
>> -32.1 63.9 115.9
>> -71.2 61.3 74.8
>> 47.3 72.4 67.3
>> 35.8 75 85.7
>> -43.8 78.8 83.4
>> -55.5 78.6 65.1
>> 84.1 -35.9 51.8
>> -93.5 -28.4 55.1
>> 82 25.9 44.1
>> -90 31.2 44.5
>> 48.9 73.7 47.8
>> -55.1 79.8 45.1
>> SENSORS END_LIST
>> 
>> NUMBERS START # Do not edit!
>> LIST_DESCRIPTION = SensorNumbers
>> LIST_UNITS =
>> LIST_NR_ROWS = 64
>> LIST_NR_COLUMNS = 1
>> LIST_NR_TIMEPTS = 1
>> LIST_VALID = 1
>> LIST_BINARY = 0
>> LIST_TYPE = 0
>> LIST_TRAFO_TYPE = 0
>> LIST_FIRST_COLUMN = 1
>> LIST_INDEX_MIN = -1
>> LIST_INDEX_MAX = -1
>> LIST_INDEX_ABS_MAX = -1
>> NUMBERS END
>> 
>> NUMBERS START_LIST # Do not edit!
>> 1
>> 2
>> 3
>> 4
>> 5
>> 6
>> 7
>> 8
>> 9
>> 10
>> 11
>> 12
>> 13
>> 14
>> 15
>> 16
>> 17
>> 18
>> 19
>> 20
>> 21
>> 22
>> 23
>> 24
>> 25
>> 26
>> 27
>> 28
>> 29
>> 30
>> 31
>> 32
>> 33
>> 34
>> 35
>> 36
>> 37
>> 38
>> 39
>> 40
>> 41
>> 42
>> 43
>> 44
>> 45
>> 46
>> 47
>> 48
>> 49
>> 50
>> 51
>> 52
>> 53
>> 54
>> 55
>> 56
>> 57
>> 58
>> 59
>> 60
>> 61
>> 62
>> 63
>> 64
>> NUMBERS END_LIST
>> 
>> LABELS START # Do not edit!
>> LIST_DESCRIPTION = SensorLabels
>> LIST_UNITS =
>> LIST_NR_ROWS = 64
>> LIST_NR_COLUMNS = 40
>> LIST_NR_TIMEPTS = 1
>> LIST_VALID = 1
>> LIST_BINARY = 0
>> LIST_TYPE = 5
>> LIST_TRAFO_TYPE = 0
>> LIST_FIRST_COLUMN = 1
>> LIST_INDEX_MIN = -1
>> LIST_INDEX_MAX = -1
>> LIST_INDEX_ABS_MAX = -1
>> LABELS END
>> 
>> LABELS START_LIST   # Do not edit!
>> FP1
>> FPZ
>> FP2
>> F7
>> F3
>> FZ
>> F4
>> F8
>> FC5
>> FC1
>> FC2
>> FC6
>> M1
>> T7
>> C3
>> CZ
>> C4
>> T8
>> M2
>> CP5
>> CP1
>> CP2
>> CP6
>> P7
>> P3
>> PZ
>> P4
>> P8
>> POZ
>> O1
>> OZ
>> O2
>> AF7
>> AF3
>> AF4
>> AF8
>> F5
>> F1
>> F2
>> F6
>> FC3
>> FCZ
>> FC4
>> C5
>> C1
>> C2
>> C6
>> CP3
>> CPZ
>> CP4
>> P5
>> P1
>> P2
>> P6
>> PO5
>> PO3
>> PO4
>> PO6
>> FT7
>> FT8
>> TP7
>> TP8
>> PO7
>> PO8
>> Labels END_LIST
>> 
>> Can this in MATLAB be converted to .fiff?
>> 
>> The EEG Data is given in the formats shown below. We have not been able to
>> convert the data. But we know that it can be converted to MATLAB through
>> FieldTrip.
>> <Screen Shot 2014-08-12 at 3.21.11 PM.png>
>> 
>> Thank you,
>> Isaiah
>> 
>> 
>> 
>> 
>> On Aug 12, 2014, at 2:03 PM, dgw <dgwakeman at gmail.com> wrote:
>> 
>> On Tue, Aug 12, 2014 at 4:33 PM, Isaiah C. Smith
>> <Isaiah.C.Smith.17 at dartmouth.edu> wrote:
>> 
>> Hello D,
>> What I am trying to say is that I did the tutorial, and I am now trying to
>> do it with other data that I have. I have a file containing the location of
>> the electrodes in a .elc format and I am wondering how to incorporate these
>> electrodes onto my head model.
>> 
>> 
>> I'm not familiar with the .elc format. Were you able to convert the
>> raw EEG file to fiff format? There may be a tool for doing this
>> automatically, in the file conversion. Can you tell me more about your
>> data? What system it was generated by? If you converted the raw EEG
>> data? What tool you used to convert the data?
>> 
>> If there isn't a tool you can always manipulate the raw fif file in
>> MATLAB and add in the necessary fields to your raw file and save it to
>> a new file (but first let's find out if there is an automated tool).
>> 
>> In addition, where can I find the file containing the lead field matrix?
>> Just the matrix.
>> 
>> 
>> The lead field matrix is in the -fwd.fif file you created in the
>> sample tutorial. The MNE matlab toolbox has a function (the manual
>> chapter describes how to read it and what the different fields are) if
>> i remember correctly, it is mne_read_forward_solution(<fname>)).
>> 
>> HTH,
>> D
>> 
>> 
>> Isaiah
>> On Aug 12, 2014, at 5:32 AM, dgw <dgwakeman at gmail.com> wrote:
>> 
>> Hi Isaiah,
>> 
>> I'm not really sure from your email what you are having difficulty
>> with. In "The sample data set" chapter
>> (http://martinos.org/mne/stable/manual/sampledata.html), there is a
>> description of how to perform these steps in the following
>> subsections:
>> 
>> The forward solution
>> 
>> The inverse operator decomposition
>> 
>> Interactive analysis
>> 
>> If there is a particular part of this you are having trouble with, can
>> you describe the problem you are having in more detail.
>> 
>> HTH,
>> D
>> 
>> 
>> On Mon, Aug 11, 2014 at 11:22 PM, Isaiah C. Smith
>> <Isaiah.C.Smith.17 at dartmouth.edu> wrote:
>> 
>> Hello D,
>> 
>> I went through the tutorial and I am wondering how I can find the lead field
>> matrix and create source models from my data in MATLAB after having made the
>> volume conduction models.
>> 
>> Isaiah
>> On Aug 11, 2014, at 6:17 AM, dgw <dgwakeman at gmail.com> wrote:
>> 
>> Hi Isaiah,
>> 
>> It may be helpful to start with the sample data set chapter (and run
>> through that example). This will take you step by step through the
>> basic analysis procedure and show you how to perform each of the
>> checks etc.
>> 
>> HTH,
>> D
>> 
>> On Fri, Aug 8, 2014 at 6:07 PM, Isaiah C. Smith
>> <Isaiah.C.Smith.17 at dartmouth.edu> wrote:
>> 
>> Hello,
>> 
>> I am following the cook book in order to create head models and find the
>> lead field matrix. I have just finished using mne_prepare_model_bem. How do
>> I view my results and how do I prepare this output for
>> mne_do_forward_solution so that I can find the lead field matrix?
>> 
>> Isaiah Smith
>> 
>> _______________________________________________
>> 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
>> 
>> _______________________________________________
>> 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
>> 
>> 
>> _______________________________________________
>> Mne_analysis mailing list
>> Mne_analysis at nmr.mgh.harvard.edu
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>> 
>> 
>> 
>> 
>> ---------
>> 
>> Matti Hamalainen, Ph.D.
>> Athinoula A. Martinos Center for Biomedical Imaging
>> Massachusetts General Hospital
>> 
>> msh at nmr.mgh.harvard.edu
>> mhamalainen at partners.org
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> 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





More information about the Mne_analysis mailing list