# Error using morph.apply(stc) in MNE v0.18.2

**URL:** <https://mne.discourse.group/t/error-using-morph-apply-stc-in-mne-v0-18-2/2236>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [June 26, 2020, 1:52am UTC](https://mne.discourse.group/t/error-using-morph-apply-stc-in-mne-v0-18-2/2236 "2020-06-26T01:52:50Z")\
**Posts on this page:** 2\
**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:** [June 26, 2020, 1:52am UTC](https://mne.discourse.group/t/error-using-morph-apply-stc-in-mne-v0-18-2/2236/1 "2020-06-26T01:52:50Z")

</div>

External Email - Use Caution

Hi,

I'm using MNE v0.18.2 and there's an error when I try to morph data using  
morph.apply(stc). In accordance with this document  
\<[https://mne.tools/0.18/auto\_examples/inverse/plot\_morph\_surface\_stc.html#sphx-glr-auto-examples-inverse-plot-morph-surface-stc-py](https://mne.tools/0.18/auto_examples/inverse/plot_morph_surface_stc.html#sphx-glr-auto-examples-inverse-plot-morph-surface-stc-py)\>,  
I did:

morph = mne.compute\_source\_morph(stc, subject\_from=subject,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;subject\_to=avgsubject,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;subjects\_dir=subjects\_dir)  
stc\_morphed = morph.apply(stc)

compute\_source\_morph worked, but morph.apply(stc) returned the error:

Traceback (most recent call last):  
&nbsp;&nbsp;File "/autofs/eris/purdongp/users/gladia/anaconda3\_20190708/lib/python3.7/site-packages/IPython/core/interactiveshell.py",  
line 3296, in run\_code  
&nbsp;&nbsp;&nbsp;&nbsp;exec(code\_obj, self.user\_global\_ns, self.user\_ns)  
&nbsp;&nbsp;File "\<ipython-input-68-ae08f53d7c9d\>", line 1, in \<module\>  
&nbsp;&nbsp;&nbsp;&nbsp;stc\_morphed = morph.apply(stc)  
&nbsp;&nbsp;File "\</autofs/eris/purdongp/users/gladia/anaconda3\_20190708/lib/python3.7/site-packages/mne/externals/decorator.py:decorator-gen-281\>",  
line 2, in apply  
&nbsp;&nbsp;File "/autofs/eris/purdongp/users/gladia/anaconda3\_20190708/lib/python3.7/site-packages/mne/utils/\_logging.py",  
line 89, in wrapper  
&nbsp;&nbsp;&nbsp;&nbsp;return function(\*args, \*\*kwargs)  
&nbsp;&nbsp;File "/autofs/eris/purdongp/users/gladia/anaconda3\_20190708/lib/python3.7/site-packages/mne/morph.py",  
line 366, in apply  
&nbsp;&nbsp;&nbsp;&nbsp;out = \_apply\_morph\_data(self, stc)  
&nbsp;&nbsp;File "/autofs/eris/purdongp/users/gladia/anaconda3\_20190708/lib/python3.7/site-packages/mne/morph.py",  
line 1205, in \_apply\_morph\_data  
&nbsp;&nbsp;&nbsp;&nbsp;data = morph\_mat \* data  
&nbsp;&nbsp;File "/autofs/eris/purdongp/users/gladia/anaconda3\_20190708/lib/python3.7/site-packages/scipy/sparse/base.py",  
line 528, in \_\_mul\_\_  
&nbsp;&nbsp;&nbsp;&nbsp;raise ValueError('could not interpret dimensions')  
ValueError: could not interpret dimensions

Is there anything else I need to set up to use the morph.apply function?

Thanks and Best,  
Gladia  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20200625/12e8301d/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200625/12e8301d/attachment.html)

---

<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:** [June 26, 2020, 7:50pm UTC](https://mne.discourse.group/t/error-using-morph-apply-stc-in-mne-v0-18-2/2236/2 "2020-06-26T19:50:20Z")

</div>

External Email - Use Caution

hi Gladia,

can you try with a more recent version of MNE if the problem persists?

Alex
