# saving an stc file with mne-python

**URL:** <https://mne.discourse.group/t/saving-an-stc-file-with-mne-python/722>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [May 2, 2014, 6:55pm UTC](https://mne.discourse.group/t/saving-an-stc-file-with-mne-python/722 "2014-05-02T18:55:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [May 2, 2014, 6:55pm UTC](https://mne.discourse.group/t/saving-an-stc-file-with-mne-python/722/1 "2014-05-02T18:55:07Z")

</div>

Hi MNE Experts,

In trying to use mne-python to save an stc file, I used to use  
mne.write\_stc(), but that seems to be deprecated in the latest version. So  
now I'm trying to save my output at an stc file this way:

sources = mne.SourceEstimate(data=cond1\_subj\_stc,  
vertices=cond1\_subj\_stc.vertno, tmin=cond1\_subj\_stc.tmin,  
tstep=cond1\_subj\_stc.tstep)

filename = (data\_path + 'w\_nw\_dSPM\_0p1\_40Hz')

sources.save(filename, ftype='stc')

But when I do that, the last step gives this error:

In [69]: sources.save(filename, ftype='stc')

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [May 2, 2014, 6:59pm UTC](https://mne.discourse.group/t/saving-an-stc-file-with-mne-python/722/2 "2014-05-02T18:59:23Z")

</div>

Hey Will,

You should just be able to do "cond1\_subj\_stc.save(...)" directly, as it  
looks like it is itself a SourceEstimate (what mne-python turns .stc files  
into when you read them). When manually constructing a SourceEstimate  
(which I don't think is what you want to do), the first argument needs to  
be a `numpy.ndarray`, not another SourceEstimate (which I think is what  
"cond1\_subj\_stc" is).

Cheers,  
Eric

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [May 2, 2014, 8:05pm UTC](https://mne.discourse.group/t/saving-an-stc-file-with-mne-python/722/3 "2014-05-02T20:05:55Z")

</div>

Yes, that worked perfectly, Eric. Thank you!

-Will
