[Mne_analysis] mne.save_stc_as_volume('lcmv_inverse.nii.gz', stc, fwd['src'], mri_resolution=False)

dgw dgwakeman at gmail.com
Wed Apr 13 16:41:55 EDT 2016
Search archives:

Hi Parham,

It sounds like you are using this tutorial:

http://martinos.org/mne/dev/auto_examples/inverse/plot_lcmv_beamformer.html?highlight=beamformer

If that is the case, it uses the cortical surface as the source space
and not a volume, so it doesn't really make sense to save as a nifti.

hth
d

On Wed, Apr 13, 2016 at 3:48 PM, parham hashemzadeh <ph442 at cam.ac.uk> wrote:
> Dear all
>
> I got an error when running a beamforming tutorial script. I modified
> the beamformer such that only the EEG leadfield is used and I just
> wanted to do EEG analysis.
> So I made the following changes:
> (a) meg=False in fwd
> (b) in epochs reject=dict(eog=150e-6)
> When it gets to the function lcm_inverse, it throws an error:
>
> ""Only volume source estimates can be saved as volumes"" can be saved
>
>
>
>   I was wondering, if you would be able to point me in the right
> direction.
> Many thanks
> best regards parham hashemzadeh
>
>
>
> fwd = mne.make_forward_solution(raw_fname, trans, src, bem,
>                                  fname=None, meg=False, eeg=True,
> mindist=5.0,
>                                  n_jobs=2, overwrite=True)
> epochs = mne.Epochs(raw, events, event_id, tmin, tmax, proj=True,
>                      picks=picks, baseline=(None, 0), preload=True,
>                      reject=dict(eog=150e-6))
>
> evoked = epochs.average()
> leadfield = fwd['sol']['data']
> ## Read regularized noise covariance and compute regularized data
> covariance
> noise_cov = mne.read_cov(fname_cov)
> data_cov = mne.compute_covariance(epochs, tmin=0.04,
> tmax=0.15,method='shrunk')
> #
> ## Run free orientation (vector) beamformer. Source orientation can be
> ## restricted by setting pick_ori to 'max-power' (or 'normal' but only
> when
> ## using a surface-based source space)
> stc = lcmv(evoked, fwd, noise_cov, data_cov, reg=0.01, pick_ori=None)
> #
> ## Save result in stc files
> stc.save('lcmv-vol')
> stc.crop(0.0, 0.2)
> ## Save result in a 4D nifti file
> img = mne.save_stc_as_volume('lcmv_inverse.nii.gz',
> stc,fwd['src'],mri_resolution=False)
> _______________________________________________
> 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.
>


More information about the Mne_analysis mailing list