Movie from .mat file

41 views
Skip to first unread message

Mathew Cherian Carathedathu

unread,
Feb 10, 2014, 1:54:19 PM2/10/14
to psychop...@googlegroups.com
Hello,

I am a relatively new user of psychopy. I am using the coder to display my stimuli. I am glad to say that it has worked out relatively well so far.

However, I have a movie that is stored as a .mat file. Previously, I used to use psychtoolbox to display it. Is there a way to use psychopy to display the movie? The .mat file is 3000 frames long and is of dimensions 60x60x3000.

Thanks

Matt

Michael MacAskill

unread,
Feb 10, 2014, 4:26:31 PM2/10/14
to psychop...@googlegroups.com
Hi Matt,

Your best bet would be to export the matrix from Matlab to a standard movie file (e.g. .mov, .avi), which PsychoPy can deal with directly. No doubt there is some sort of Python package out there that can read .mat files but that will create a lot more technical difficulty for you. And you will then have to construct the movie frame-by-frame from its constituent numbers, which again is a pain, as opposed to simply opening a movie file and playing it.

e.g. if it is a movie object inside Matlab:
<http://www.mathworks.com/help/matlab/ref/movie2avi.html>

or a simple matrix:
<http://www.mathworks.com/matlabcentral/newsreader/view_thread/270039>

Regards,

Michael

Mathew Cherian Carathedathu

unread,
Feb 10, 2014, 8:03:48 PM2/10/14
to psychop...@googlegroups.com
Thanks Michael.

I will let you know how it turns out.

Matt
Reply all
Reply to author
Forward
0 new messages