Error occurs when converting muse file to MATLAB format


#1

Exception in thread Thread-2:
Traceback (most recent call last):
File “E:\Program Files (x86)\Python27\lib hreading.py”, line 810, in __bootst
rap_inner
self.run()
File “E:\Program Files (x86)\Python27\lib hreading.py”, line 763, in run
self.__target(*self.__args, **self.__kwargs)
File “E:\Program Files (x86)\Muse\output_handler.py”, line 73, in start
self.broadcast_message(msg)
File “E:\Program Files (x86)\Muse\output_handler.py”, line 35, in broadcast_me
ssage
listener.receive_msg(msg)
File “E:\Program Files (x86)\Muse\output_handler.py”, line 185, in receive_msg

self.write_array()

File “E:\Program Files (x86)\Muse\output_handler.py”, line 165, in write_array

scipy.io.savemat(file_name, result, oned_as='column')

File “E:\Program Files (x86)\Python27\lib\site-packages\scipy\io\matlab\mio.py
”, line 207, in savemat
MW.put_variables(mdict)
File “E:\Program Files (x86)\Python27\lib\site-packages\scipy\io\matlab\mio5.p
y”, line 876, in put_variables
self._matrix_writer.write_top(var, asbytes(name), is_global)
File “E:\Program Files (x86)\Python27\lib\site-packages\scipy\io\matlab\mio5.p
y”, line 626, in write_top
self.write(arr)
File “E:\Program Files (x86)\Python27\lib\site-packages\scipy\io\matlab\mio5.p
y”, line 653, in write
self.write_struct(narr)
File “E:\Program Files (x86)\Python27\lib\site-packages\scipy\io\matlab\mio5.p
y”, line 764, in write_struct
self._write_items(arr)
File “E:\Program Files (x86)\Python27\lib\site-packages\scipy\io\matlab\mio5.p
y”, line 782, in _write_items
self.write(el[f])
File “E:\Program Files (x86)\Python27\lib\site-packages\scipy\io\matlab\mio5.p
y”, line 644, in write
narr = to_writeable(arr)
File “E:\Program Files (x86)\Python27\lib\site-packages\scipy\io\matlab\mio5.p
y”, line 486, in to_writeable
narr = np.asanyarray(source)
File “E:\Program Files (x86)\Python27\lib\site-packages
umpy\core
umeric.py
, line 336, in asanyarray
return array(a, dtype, copy=False, order=order, subok=True)
ValueError: setting an array element with a sequence


#2

Hi tsubasa,

Can you provide more information about where the Muse File is from and how it was recorded. Alternatively attach it here for analysis. From this error log I don’t have enough information to understand the cause of the error.

Thanks


#3

thanks for your reply. I just used muselab to record it, and used museplayer to convert. to CSV file is successful, but to MATLAB file is not. when I attached the .muse file, the system shows it’s invalid.


#4

Hi tsubasa,

I tried to repeat these steps personally and I am not having any issues, it’s writing it fine.

Can you confirm your SDK version? Have you installed the latest, 2.4.2?
Can you confirm your the OS you’re using? (OSX, Windows, Linux)

If you’re on 2.4.2, are you able to provide the actual file that is causing the crash?


#5

the file is attached at https://drive.google.com/file/d/0B9yqaOsR4PIiMFZIN3Q2SUN5TWc/edit?usp=sharing

Then, muse-player.py -f data.muse -M data.mat, the error occurs.


#6

Hi tsubasa,

I’ve parsed your file into Matlab without any issues. Can you verify your OS and your SDK version for me?


#7

Win 8, SDK version is 2.4.2. how do you parse the file into Matlab, is my command line correct?


#8

Hmm, very confusing. Are you sure it’s the correct file? I tried on Windows 8 with 2.4.2 and it worked fine without any errors.

It won’t let me upload a .mat file, but it seems to contain the data. Does this happen to every file you record?

One possibility is that you’ve installed the wrong version of scipy. Can you confirm what you installed here?
[SIZE=12px]2.3) Download SciPy installation for Python 2.7:
http://sourceforge.net/projects/scip…/scipy/0.14.0/

Run the executable and it will find your Python installation path and install for you.
Follow wizard to the end and finish installation.

2.4) Download NumPy installation for Python 2.7:[/SIZE]
[SIZE=12px]http://sourceforge.net/projects/nump…d?source=files[/SIZE]


#9

I installed a wrong NumPy version, now correct! Thanks a lot.


#10

But when converted to MATLAB file, dsp elements are lost, than means there is no alpha, beta… band information


#11

Hi tsubasa,

I apologize about that. We will release a version in the near future that will properly add these values to your Matlab output.

In the meantime, you can feel free to use the CSV output version. (-C) to write out these values and import them into Matlab. This should achieve the same result, although a little bit less convenient, you won’t have to wait for a new release of the SDK.

Worth mentioning you can also filter the output data so you can write out only the band information into the csv, individually or collectively.
(ie. ./museplayer -f yourdata.muse -C banddata.csv -i alpha beta delta theta gamma) Will write only alpha, beta, delta, theta and gamma messages

Hope that helps for now.