[Mne_analysis] MNE python group data

Stephen Politzer-Ahles spa268 at nyu.edu
Tue May 20 22:45:34 EDT 2014
Search archives:

Hi Peter,

Here's some sample code that grand-averages stc files from one hemisphere
(I imagine it should work the same for e.g. evoked sensor data; I haven't
tried it for this, though; also note that here my stc files are all morphed
to fsaverage, hence the last line):

# path to data
stcdir = <path to where stc files are saved>

# participant list
participants = <list of participant IDs>

# template for the filenames
fname = os.path.join( stcdir, '%s-' + '-lh.stc' )

# read all subjects' stc files into a big list of stc files
stcs = [mne.read_source_estimate(fname % subject) for subject in
participants]

# average (by summing the stcs and then dividing by the number of subjects
stc_avg = reduce(add, stcs)
stc_avg /= len(stcs)

stc_avg.subject = 'fsaverage'

The output of this can then be plotted the same way as a single-participant
stc could be.

Best,
Steve





Stephen Politzer-Ahles
New York University, Abu Dhabi
Neuroscience of Language Lab
http://www.nyu.edu/projects/politzer-ahles/


On Wed, May 21, 2014 at 6:29 AM, Peter Goodin <pgoodin at swin.edu.au> wrote:

> Hi MNE list,
>
> I'm working with group data that's been preprocessed in MNE then grand
> averaged into a numpy array and am interested in using some of the plotting
> methods available, however none seem to take plain numpy array data. Is
> there any way to copy over relevant information from say an individual's
> object (like times, channel listings etc) and "wrap" it to the array?
>
> Thanks and my apologies if this is a relatively simple question.
>
> Peter
>
>
> __________________________
> Peter Goodin,
> BSc (Hons), Ph.D Candidate.
>
> Brain and Psychological Sciences Research Centre (BPsych)
> Swinburne University,
> Hawthorn, Vic, 3122
>
> http://www.swinburne.edu.au/swinburneresearchers/index.php?fuseaction=profile&pid=4149
>
> Monash Alfred Psychiatry Research Centre (MAPrc)
> Level 4, 607 St Kilda Road,
> Melbourne 3004
>
> _______________________________________________
> 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/20140521/d1441f43/attachment.html 


More information about the Mne_analysis mailing list