[Mne_analysis] plot_label_from_stc.py: Exception: The source space does not appear to be an ico surface

David I Leitman leitman at mail.med.upenn.edu
Sun Jan 5 15:08:11 EST 2014
Search archives:

HI here is what I do:

########################### Step-4: FORWARD MODEL SETUP ###########################
echo ++++++++++++++++++++++++++++++++++++Step-4:  FORWARD MODEL SETUP
echo ++++++++++++++++++++++++++++++++++++Step-4:  FORWARD MODEL SETUP
echo ++++++++++++++++++++++++++++++++++++Step-4:  FORWARD MODEL SETUP

# ## for meg only model use:
#mne_setup_forward_model --subject $SUBJECT --surf --ico 4 --homog --overwrite

# ## alternatively use below
mne_setup_forward_model --subject $SUBJECT --surf --ico 4 --overwrite

# ## create bem 3 shell models for eeg as well as model for meg 
# ## sometimes misalignment of surfaces can give the following error:
# ## "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 = 1.8995e-16 * 4*PI).
# ## Could't create the geometry file"
# ## in such a case att eh following 
if [ $? == 1 ]; then
	mne_setup_forward_model --subject $SUBJECT --surf --ico 4 --overwrite --outershift 2.0
	if [ $? == 1 ]; then
	mne_setup_forward_model --subject $SUBJECT --surf --ico 4 --overwrite --outershift 2.0	--innershift 1.0
	fi
fi


to do the forward solution I do:


for file in $SUBJECTS_DIR/$SUBJECT/meg/${SUBJECT}_AR-epoched.fif;
 do
  echo $file
  	echo +++++++++++++++++++++++ doing Forward solution epoched fiffile
	echo +++++++++++++++++++++++ doing Forward solution epoched fiffile
 	echo +++++++++++++++++++++++ doing Forward solutionepoched fiffile
   
   # for MEG only
   mne_do_forward_solution \
   	--subject $SUBJECT \
   	--src $SUBJECT-5-src.fif \
    	--bem $SUBJECT-5120-5120-5120-bem-sol.fif \
    	--meas $file \
    	--megonly \
    	--fwd ${SUBJECT}_AR-epoched-${SUBJECT}-5-meg-src-fwd.fif \
    	--overwrite
   
    # for EEG only
   mne_do_forward_solution \
   	--subject $SUBJECT \
   	--src $SUBJECT-5-src.fif \
   	--bem $SUBJECT-5120-5120-5120-bem-sol.fif \
   	--meas $file \
   	--eegonly \
   	--fwd ${SUBJECT}_AR-epoched-${SUBJECT}-5-eeg-src-fwd.fif \
   	--overwrite
   
   # for EEG & MEEG only
    mne_do_forward_solution \
    	--subject $SUBJECT \
    	--src $SUBJECT-5-src.fif \
    	--bem $SUBJECT-5120-5120-5120-bem-sol.fif \
    	--meas $file \
    	--fwd ${SUBJECT}_AR-epoched-${SUBJECT}-5-meg_eeg-src-fwd.fif \
    	--overwrite
    done


so I am still not sure why I get the ico surface error. BTW I am using mne 2.7.4

thanks //dave
On Jan 5, 2014, at 2:31 PM, Alexandre Gramfort wrote:

> hi David,
> 
> how do you generate your source spaces? To use this tool, you should
> use the -ico option.
> 
> Something like:
> 
> mne_setup_source_space --oct 6 --subject sample
> 
> for an oct 6 source space with approx 8000 locations or
> 
> mne_setup_source_space --ico 5 --subject sample
> 
> for an ico 5 source space with approx 20000 locations.
> 
> If you have an old MNE version use:
> 
> mne_setup_source_space --ico -6 --subject sample
> 
> for the oct 6.
> 
> Hope this helps,
> 
> Alex
> 
> 
> 
> On Sun, Jan 5, 2014 at 2:02 PM, David I Leitman
> <leitman at mail.med.upenn.edu> wrote:
>> Hi all
>> 
>> I have been trying to run portions of the code contained in the example
>> "plot_label_from_stc.py" going through line by line thing are well until
>> this command:
>> 
>> func_labels, _ = mne.stc_to_label(stc_mean_label, src=src, smooth=5,
>>                                 subjects_dir=subjects_dir, connected=True)
>> 
>> at this point i get the following output errors:
>> 
>> 
>> 
>> 
>> 
>> Reading labels from parcellation..
>> Triangle file: created by neuromag on Wed Feb 20 19:45:05 2013 nvert =
>> 136162 ntri = 272320
>>  read 34 labels from
>> /mnt/thothdisk1/K_AWARD/K_DATA/MEG_DATA/L7689/label/lh.aparc.annot
>> Triangle file: created by neuromag on Wed Feb 20 22:57:01 2013 nvert =
>> 138400 ntri = 276796
>>  read 34 labels from
>> /mnt/thothdisk1/K_AWARD/K_DATA/MEG_DATA/L7689/label/rh.aparc.annot
>> [done]
>> ---------------------------------------------------------------------------
>> Exception                                 Traceback (most recent call last)
>> <ipython-input-223-de7294e7cf08> in <module>()
>>     6
>>     7 func_labels, _ = mne.stc_to_label(stc_mean_label, src=src, smooth=5,
>> ----> 8                                   subjects_dir=subjects_dir,
>> connected=True)
>>     9
>> 
>> /home/leitman/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/mne-0.7.1-py2.7.egg/mne/label.pyc
>> in stc_to_label(stc, src, smooth, connected, subjects_dir)
>>   642         rr = [1e3 * src[0]['rr'], 1e3 * src[1]['rr']]
>>   643         tris = [src[0]['tris'], src[1]['tris']]
>> --> 644         src_conn = spatial_src_connectivity(src).tocsr()
>>   645
>>   646     labels = []
>> 
>> /home/leitman/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/mne-0.7.1-py2.7.egg/mne/utils.pyc
>> in dec(*args, **kwargs)
>>   378             return ret
>>   379         else:
>> --> 380             return function(*args, **kwargs)
>>   381
>>   382     # set __wrapped__ attribute so ?? in IPython gets the right
>> source
>> 
>> /home/leitman/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/mne-0.7.1-py2.7.egg/mne/source_estimate.pyc
>> in spatial_src_connectivity(src, dist, verbose)
>>  2216         The connectivity matrix describing the spatial graph
>> structure.
>>  2217     """
>> -> 2218     return spatio_temporal_src_connectivity(src, 1, dist)
>>  2219
>>  2220
>> 
>> /home/leitman/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/mne-0.7.1-py2.7.egg/mne/utils.pyc
>> in dec(*args, **kwargs)
>>   378             return ret
>>   379         else:
>> --> 380             return function(*args, **kwargs)
>>   381
>>   382     # set __wrapped__ attribute so ?? in IPython gets the right
>> source
>> 
>> /home/leitman/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/mne-0.7.1-py2.7.egg/mne/source_estimate.pyc
>> in spatio_temporal_src_connectivity(src, n_times, dist, verbose)
>>  2072     if dist is None:
>>  2073         if src[0]['use_tris'] is None:
>> -> 2074             raise Exception("The source space does not appear to be
>> an ico "
>>  2075                             "surface. Connectivity cannot be
>> extracted from "
>>  2076                             "non-ico source spaces.")
>> 
>> Exception: The source space does not appear to be an ico surface.
>> Connectivity cannot be extracted from non-ico source spaces.
>> 
>> 
>> Do you have any suggestions when query
>> inverse_operator['src']
>> Out[227]: <SourceSpaces: [<'surf', n_vertices=136162, n_used=5759>, <'surf',
>> n_vertices=138400, n_used=5838>]>
>> 
>> so I think the space should be an ico surface
>> 
>> thanks //dave
>> David I. Leitman PhD
>> 
>> Research Assistant Professor
>> Department of Psychiatry-
>> Neuropsychiatry program
>> Perelman School of Medicine
>> University of Pennsylvania
>> Gates Pavilion 10th floor room 1042
>> 3400 Spruce St
>> Philadelphia, PA 19104-4283
>> P: (215) 662-7389
>> F: (215) 662-7903
>> E: leitman at mail.med.upenn.edu
>> Faculty page: http://www.med.upenn.edu/apps/faculty/index.php/g275/p8174343
>> Lab website:
>> http://davidileitman.com
>> 
>> The information contained in this e-mail message is intended only for the
>> personal and confidential use of the recipient(s) named above.  If the
>> reader of this message is not the intended recipient or an agent responsible
>> for delivering it to the intended recipient, you are hereby notified that
>> you have received this document in error and that any review, dissemination,
>> distribution, or copying of this message is strictly prohibited.  If you
>> have received this communication in error, please notify the the
>> Neuropsychiatry Section immediately by e-mail, and delete the original
>> message.
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 

David I. Leitman PhD

Research Assistant Professor
Department of Psychiatry-
Neuropsychiatry program
Perelman School of Medicine
University of Pennsylvania
Gates Pavilion 10th floor room 1042
3400 Spruce St
Philadelphia, PA 19104-4283
P: (215) 662-7389
F: (215) 662-7903
E: leitman at mail.med.upenn.edu
Faculty page:	http://www.med.upenn.edu/apps/faculty/index.php/g275/p8174343
Lab website:
 http://davidileitman.com

The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above.  If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited.  If you have received this communication in error, please notify the the Neuropsychiatry Section immediately by e-mail, and delete the original message.















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


More information about the Mne_analysis mailing list