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

parham hashemzadeh ph442 at cam.ac.uk
Wed Apr 13 18:01:02 EDT 2016
Search archives:

  Thank you for your email. But actually no I am not using that tutorial. 
I am using this tutorial which is focused on the Volume Source Space.


All I am doing is that I am turning off the MEG and just want to use the 

In theory it should work even with this reduced leadfield matrix. Before 
it was 366 rows but now only 60 rows (Just EEG).

So my volume (source space) does not change. It is exactly the same 
thing. My number of sensors are reduced.

The error happens at the line below:
mne.save_stc_as_volume('lcmv_inverse.nii.gz', stc, fwd['src'], 

""Only volume source estimates can be saved as volumes"" can be saved

Any help will be appreciated.
besst regards parham

On 2016-04-13 21:41, dgw wrote:
> 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.
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis

best regards
Parham Hashemzadeh
Research Associate
Department of Applied Mathematics and Theoretical Physics
University of Cambridge, UK.
email: hashemzadeh at damtp.cam.ac.uk

More information about the Mne_analysis mailing list