Dicom organization

Hello,
Sorry, I forgot my current problem.

I have a few questions of clarification below and one question that is preventing me from moving forward (under Kept Going).

Previous Questions: I have the MRI data, but I am confused as to how to proceed with the mne_setup_mri for the brain, skull and scalp volume conduction models because the brain and T1 are the defaults. Do I need to add some other slices? And does the subject data need to be placed in /freesurfer/subjects for it to be read by MNE?

Kept Going:
The folder just contains two empty folders after implementing mne_organize_dicom. It seems that the DICOM images are not being read properly. I do not know what is wrong here.

Isaiah

hi Isaiah

I have a few questions of clarification below and one question that is preventing me from moving forward (under Kept Going).

Previous Questions: I have the MRI data, but I am confused as to how to proceed with the mne_setup_mri for the brain, skull and scalp volume conduction models because the brain and T1 are the defaults. Do I need to add some other slices? And does the subject data need to be placed in /freesurfer/subjects for it to be read by MNE?

you should be able to work with just a T1 file. You have run
freesurfer on your T1 image
then you generate the brain, skull and scalp surfaces with mne_watershed_bem

see

for demo scripts of anatomical pipeline.

Kept Going:
The folder just contains two empty folders after implementing mne_organize_dicom. It seems that the DICOM images are not being read properly. I do not know what is wrong here.

I never use mne_organize_dicom or mne_setup_mri.
Just recona-all on my T1 image eventually converted to .nii or .mgz
with freesurfer
mri_convert image.

HTH
Alex

Thanks Alex,
I have completed the mne_watershed, and have the brain_surf, and other surfaces, as well as the head.fif. I used freesurfer and have the T1.mgz file, but I am confused as to the next step as I follow the cookbook. My original images are not in DICOM, but executive document files. I see that the example that you sent went here next

# Make high resolution head surface
HEAD_FNAME=${SUBJECTS_DIR}/${SUBJECT}/bem/${SUBJECT}-head.fif
if [ ! -f ${HEAD_FNAME} ];
then
    mkheadsurf -s ${SUBJECT}
    mne_surf2bem --surf ${SUBJECTS_DIR}/${SUBJECT}/surf/lh.seghead --id 4 --check --fif ${HEAD_FNAME}
fi

# Setup BEM

to create the head surface. Or do I have to create the boundaries?

Isaiah
On Aug 4, 2014, at 11:53 AM, Alexandre Gramfort <alexandre.gramfort at telecom-paristech.fr<mailto:alexandre.gramfort at telecom-paristech.fr>> wrote:,

hi Isaiah

I have a few questions of clarification below and one question that is preventing me from moving forward (under Kept Going).

Previous Questions: I have the MRI data, but I am confused as to how to proceed with the mne_setup_mri for the brain, skull and scalp volume conduction models because the brain and T1 are the defaults. Do I need to add some other slices? And does the subject data need to be placed in /freesurfer/subjects for it to be read by MNE?

you should be able to work with just a T1 file. You have run
freesurfer on your T1 image
then you generate the brain, skull and scalp surfaces with mne_watershed_bem

see

https://github.com/mne-tools/mne-scripts/blob/master/sample-data/run_anatomy_tutorial.sh
https://github.com/mne-tools/mne-scripts/blob/master/spm_face/bootstrap.sh

for demo scripts of anatomical pipeline.

Kept Going:
The folder just contains two empty folders after implementing mne_organize_dicom. It seems that the DICOM images are not being read properly. I do not know what is wrong here.

I never use mne_organize_dicom or mne_setup_mri.
Just recona-all on my T1 image eventually converted to .nii or .mgz
with freesurfer
mri_convert image.

HTH
Alex

Hi Isaiah,

Thanks Alex,
I have completed the mne_watershed, and have the brain_surf, and other
surfaces, as well as the head.fif. I used freesurfer and have the T1.mgz
file, but I am confused as to the next step as I follow the cookbook. My
original images are not in DICOM, but executive document files. I see that
the example that you sent went here next

# Make high resolution head surface
HEAD_FNAME=\{SUBJECTS\_DIR\}/{SUBJECT}/bem/\{SUBJECT\}\-head\.fif if \[ \! \-f {HEAD_FNAME} ];
then
    mkheadsurf -s \{SUBJECT\} &nbsp;&nbsp;&nbsp;&nbsp;mne\_surf2bem \-\-surf {SUBJECTS_DIR}/\{SUBJECT\}/surf/lh\.seghead \-\-id 4 \-\-check \-\-fif {HEAD_FNAME}
fi

# Setup BEM

to create the head surface. Or do I have to create the boundaries?

In cas you're already familiar with the MNE-Python suite (or not:) have a
look at

mne make_scalp_surfaces:

It generates a high-resulution head surfaces and 2 additional decimated
surfaces.
The medium surface is particularly satisfying and useful for coregistration.

Also have a look here:
http://martinos.org/mne/stable/auto_examples/plot_decimate_head_surface.html#example-plot-decimate-head-surface-py

Denis

Isaiah
  On Aug 4, 2014, at 11:53 AM, Alexandre Gramfort <
alexandre.gramfort at telecom-paristech.fr> wrote:,

hi Isaiah

I have a few questions of clarification below and one question that is
preventing me from moving forward (under Kept Going).

Previous Questions: I have the MRI data, but I am confused as to how to
proceed with the mne_setup_mri for the brain, skull and scalp volume
conduction models because the brain and T1 are the defaults. Do I need to
add some other slices? And does the subject data need to be placed in
/freesurfer/subjects for it to be read by MNE?

you should be able to work with just a T1 file. You have run
freesurfer on your T1 image
then you generate the brain, skull and scalp surfaces with
mne_watershed_bem

see

https://github.com/mne-tools/mne-scripts/blob/master/sample-data/run_anatomy_tutorial.sh
https://github.com/mne-tools/mne-scripts/blob/master/spm_face/bootstrap.sh

for demo scripts of anatomical pipeline.

Kept Going:
The folder just contains two empty folders after implementing
mne_organize_dicom. It seems that the DICOM images are not being read
properly. I do not know what is wrong here.

I never use mne_organize_dicom or mne_setup_mri.
Just recona-all on my T1 image eventually converted to .nii or .mgz
with freesurfer
mri_convert image.

HTH
Alex

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

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
MyComplianceReport.com: Compliance and Ethics Reporting . 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
Mne_analysis Info Page

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
MyComplianceReport.com: Compliance and Ethics Reporting . 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/20140804/373d90fa/attachment.html

# Make high resolution head surface
HEAD_FNAME=\{SUBJECTS\_DIR\}/{SUBJECT}/bem/\{SUBJECT\}\-head\.fif if \[ \! \-f {HEAD_FNAME} ];
then
    mkheadsurf -s \{SUBJECT\} &nbsp;&nbsp;&nbsp;&nbsp;mne\_surf2bem \-\-surf {SUBJECTS_DIR}/\{SUBJECT\}/surf/lh\.seghead \-\-id 4 \-\-check \-\-fif {HEAD_FNAME}
fi

# Setup BEM

to create the head surface. Or do I have to create the boundaries?

this sets up the head surface for coregistration with mne_analyze.
It will not be used for forward modeling but just to create the -trans.fif file.

Try what denis suggests if this does not succeed for you.

Alex

Thanks so much for the help but sorry,
I looked at the Python, but I am not really familiar with the format and having a hard time determining how to implement it. The lab I am working in primarily uses MATLAB. Is there a way to form models in MATLAB or the terminal along the same lines as the python attachment? And does the creation of a brain model follow the same procedures as the scalp and skull?
Isaiah

Isahiah,

if you prefer Matlab you can also use `mne_make_scalp_surfaces` which is a
shell script that calls Matlab and is provided by MNE-C.

Thanks so much for the help but sorry,
I looked at the Python, but I am not really familiar with the format and
having a hard time determining how to implement it. The lab I am working in
primarily uses MATLAB. Is there a way to form models in MATLAB or the
terminal along the same lines as the python attachment? And does the
creation of a brain model follow the same procedures as the scalp and skull?

All is absed on your freesurfer segmentation, in that regard things are
similar. The brain model (source space + forward solution) of course are
not generated the same way as the head model.
Hope these vague remarks help ...

Isaiah

>> # Make high resolution head surface
>> HEAD_FNAME=\{SUBJECTS\_DIR\}/{SUBJECT}/bem/\{SUBJECT\}\-head\.fif &gt;&gt; if \[ \! \-f {HEAD_FNAME} ];
>> then
>> mkheadsurf -s \{SUBJECT\} &gt;&gt; mne\_surf2bem \-\-surf {SUBJECTS_DIR}/\{SUBJECT\}/surf/lh\.seghead \-\-id 4 &gt;&gt; \-\-check \-\-fif {HEAD_FNAME}
>> fi
>>
>> # Setup BEM
>>
>> to create the head surface. Or do I have to create the boundaries?
>
> this sets up the head surface for coregistration with mne_analyze.
> It will not be used for forward modeling but just to create the
-trans.fif file.
>
> Try what denis suggests if this does not succeed for you.
>
> Alex
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> Mne_analysis Info Page
>
>
> 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
> MyComplianceReport.com: Compliance and Ethics Reporting . 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
Mne_analysis Info Page

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20140804/aeba04f2/attachment.html

Checking that inner skull surface is inside outer skull surface...[failed]
Surface inner skull is not completely inside surface outer skull(sum of solid angles = 8.85217e-16 * 4*PI).
Could't create the geometry file

Hello All,
This is the error message that I keep getting when trying to create the file. What this a segmentation problem? How would I fix it?
Isaiah

Isahiah,

if you prefer Matlab you can also use `mne_make_scalp_surfaces` which is a shell script that calls Matlab and is provided by MNE-C.

Thanks so much for the help but sorry,
I looked at the Python, but I am not really familiar with the format and having a hard time determining how to implement it. The lab I am working in primarily uses MATLAB. Is there a way to form models in MATLAB or the terminal along the same lines as the python attachment? And does the creation of a brain model follow the same procedures as the scalp and skull?

All is absed on your freesurfer segmentation, in that regard things are similar. The brain model (source space + forward solution) of course are not generated the same way as the head model.
Hope these vague remarks help ...

Isaiah

indeed it seems like a segmentation problem.
have a look to the surfaces with freeview and check the quality of the
freesurfer reconstruction before going further

Alex

Hi Isaiah,

This post probably best fits the MNE list (it takes a bit to track
down which problem relates to which list, but generally, mne_...
commands relate to the MNE list and FreeSurfer commands relate to the
freesurfer list). You are likely getting the error (only visualizing
the surfaces will show this is the reason: the easiest way is with
freeview), because the inner skull surface is crossing the outer skull
surface. MNE checks this because the BEM mathematics don't work when
this happens (they must be concentric). There are many different
potential solutions to this problem, so the easiest way to solve this
problem is to figure out what type of data you are working with (EEG,
MEG, MEEG?; what kind of MR data do you have available for this
participant?) What are you trying to do? We can figure out from that
the easiest/best way to solve this issue.

HTH,
D

P.S. Have you run through the tutorial first (this may help you see
how all the pieces fit together)?

Thank you, D,
What I am trying to do is created the volume conduction models using the MR images that I have. Eventually, I need to use these to find the lead field matrix, and then create a source model as well. I was told that this was a segmentation issue resulting from the freesurfer use (recon-all). I have been going through the tutorials and using the cookbook and was able to see the individual outer_skull_surf, outer_scalp_surf, inner_skull_surf, and brain_surf in XQuartz. The data that we are working with is EEG.
Isaiah

Thank you, D,
What I am trying to do is created the volume conduction models using the MR images that I have. Eventually, I need to use these to find the lead field matrix, and then create a source model as well. I was told that this was a segmentation issue resulting from the freesurfer use (recon-all). I have been going through the tutorials and using the cookbook and was able to see the individual outer_skull_surf, outer_scalp_surf, inner_skull_surf, and brain_surf in XQuartz. The data that we are working with is EEG.

What type of MR data do you have? Do you have any Multi-Echo FLASH
data available (this is strongly recommended for EEG data)? As I
described in my previous post: the issue is that the the
inner_skull_surf and outer_skull_surf cross, which violates an
assumption in the BEM calculations (I recommend you take a look so you
can see where and how severe the crossing is). The best
troubleshooting options will depend on your answers to the above
questions, but if you don't have any more MRI data available for this
participant, then I will suggest you try the following: change the
names of the BEM surfaces (the ones you listed above). Then try some
of the other options with mne_make_watershed_bem (first I would try
using the -atlas option; then you can play around with the -preflood
number (this is a percentage), though I am not terribly familiar with
it's use). There are more options, but I would start with those.

HTH,
D