python程序设计与实验_用于创建实验的Python应用程序和库
python程序設計與實驗
In this post, I will describe the existing free Python applications and libraries for creating experiments.? So far, I have only used PsychoPy but I plan to test most of them. At least the ones that seem to still be maintained. All applications and libraries are open-source which makes it possible to download the source code and add your own stuff to it.
在這篇文章中,我將描述現有的免費Python應用程序和庫來創建實驗。 到目前為止,我僅使用PsychoPy,但我計劃測試其中的大多數。 至少那些似乎仍然得到維護的。 所有應用程序和庫都是開源的,這使得下載源代碼和向其中添加自己的東西成為可能。
實驗建設者 (Experiment builders)
PsychoPy and OpenSesame are two applications for creating psychology, neuroscience, and psychophysics experiments. Both applications are free, open source, alternatives? to Presentation? or e-Prime?. Judging by the number of citations in Google Scholar, PsychoPy seems to be the most frequently used.
PsychoPy和OpenSesame是創建心理學,神經科學和心理物理學實驗的兩個應用程序。 兩種應用程序都是免費的,開源的,是Presentation?或e-Prime?的替代產品。 從Google Scholar中的引用次數來看,PsychoPy似乎是最常用的。
精神病學 (PsychoPy)
PsychoPy is simple to install and? is cross-platform (works on Linux, OS-X, and Windows).? It promises precision timing and it? has a lot of different types of stimuli ready to use.? An important aspect of PsychoPy is that if you prefer to write code you can do that using the Application Programming Interface (API). However, if you do not want to write code you can use the builder view. You can see PsychoPy – free software to use in Research for a more extensive post on PsychoPy. If you are interested in an example program you can have a look at? Sustained Attention Task In PsychoPy.
PsychoPy易于安裝且跨平臺(可在Linux,OS-X和Windows上運行)。 它保證了精確的計時,并且有許多不同類型的刺激可供使用。 PsychoPy的一個重要方面是,如果您喜歡編寫代碼,則可以使用應用程序編程接口(API)進行操作。 但是,如果您不想編寫代碼,則可以使用構建器視圖。 您可以看到PsychoPy –可在Research中使用的免費軟件,以獲取有關PsychoPy的更廣泛的文章。 如果您對示例程序感興趣,可以查看PsychoPy中的Sustained Attention Task 。
Builder View of PsychoPy GUI PsychoPy GUI的構建器視圖芝麻開門 (OpenSesame)
OpenSesame is also easy to install and? works on Linux, OS-X, Windows, and Android (both tablets, phones, and computers). OpenSesame is based on PsychoPy and the library Expyriment. As far as I can see you are not able to choose to write your own script (i.e., it does not have a coding interface). However, you are probably able to use your own editor and write a script. It is also possible to choose back-end (see About back-ends). That is, you can choose to use xpyriment (Expyriment), psycho (PsychoPy),? legacy, opengl, and droid. It seems that xpyriment has replaced the opengl back-end. Much like E-prime, it is possible to write in-line scripts when needed. One interesting option in OpenSesame is that you seem to be able to test your experiment using auto responses. Another interesting feature of OpenSesame is that you seem to be able to create your own plug-ins and extensions.
OpenSesame還易于安裝,并且可在Linux,OS-X,Windows和Android(平板電腦,手機和計算機)上使用。 OpenSesame基于PsychoPy和庫Expyriment。 據我所知,您不能選擇編寫自己的腳本(即,它沒有編碼接口)。 但是,您可能可以使用自己的編輯器并編寫腳本。 也可以選擇后端(請參閱關于后端 )。 也就是說,您可以選擇使用xpyriment(Expyriment),psycho(PsychoPy),legacy,opengl和droid。 看來xpyriment已經取代了opengl后端。 與E-prime一樣,可以在需要時編寫內聯腳本。 OpenSesame中一個有趣的選項是,您似乎可以使用自動響應來測試實驗。 OpenSesame的另一個有趣的功能是您似乎能夠創建自己的插件和擴展。
Experiment Builder OpenSesame 實驗構建器OpenSesameThere are a lot of example experiments on both applications websites as well as in the interfaces. Furthermore, you can also find a lot of guides and tutorials on their websites. OpenSesames website also offer some standard tasks. For instance, you can find a Conjunctive Continuous Performance Task.
在應用程序網站和界面上都有很多示例實驗。 此外,您還可以在他們的網站上找到很多指南和教程。 OpenSesames網站還提供一些標準任務。 例如,您可以找到一個連續性連續表現任務。
Python庫 (Python Libraries)
報酬 (Expyriment)
Expyriment, The Vision Egg, and PyEPL are Python libraries. That is, while PsychoPy and OpenSesame offer graphical interfaces where you can create your experiment with minimal knowledge of Python programming the libraries requires you to write scripts. However, their aim seems to be to decrease scripting and seems to be relatively easy to use.
Expyriment,Vision Egg和PyEPL是Python庫。 就是說,盡管PsychoPy和OpenSesame提供了圖形界面,但您可以在其中使用Python編程的最少知識來創建實驗,而庫則需要您編寫腳本。 但是,它們的目的似乎是減少腳本編寫,并且似乎相對易于使用。
Expyriment is an open-source library and is, of course, also platform independent. Actually, this library is very promising since it also works on Android systems. This library takes cares of the presentation of stimuli. It can handle the recording of both input and output events, communication with other devices, and the collection and preprocessing of data. On the library’s website, it is stated that it suitable for researchers and students with little experience of programming.
Expyriment是一個開放源代碼庫,并且當然也是與平臺無關的。 實際上,該庫非常有前途,因為它也可以在Android系統上運行。 該庫負責刺激的呈現。 它可以處理輸入和輸出事件的記錄,與其他設備的通信以及數據的收集和預處理。 在圖書館的網站上說,它適合沒有編程經驗的研究人員和學生。
視覺蛋 (The Vision Egg)
The Vision Egg is a Python library. The purpose of the library seems to be the production of visual stimuli (the clue might be in its name). Judging from the library’s GitHub page, it has not been updated for roughly 3 years.
Vision Egg是一個Python庫。 該庫的目的似乎是視覺刺激的產生(線索可能就是它的名字)。 從庫的GitHub頁面來看,它大約三年沒有更新。
PyEPL (PyEPL)
PyEPL (the Python Experiment-Programming Library) is the last Python library, I have found, for coding psychology experiments. PyEPL can be used to create both visual and auditory stimuli. It supports both manual (keyboard/joystick) and sound (microphone) input as responses.
我發現PyEPL(Python實驗編程庫)是最后一個用于對心理學實驗進行編碼的Python庫。 PyEPL可用于創建視覺和聽覺刺激。 它支持手動(鍵盤/操縱桿)和聲音(麥克風)輸入作為響應。
Note that for timing critical experiments it is probably wise to write your own scripts PsychoPy API or Expyriment.? This will let you use system specific (e.g., Linux specific if using Linux) settings and optimize your experiment based on the hardware available (see Garaizar & Vadillo, 2014 for tests and comparisons of PsychoPy, E-prime, and DMDX).
請注意,對于定時關鍵實驗,編寫自己的腳本PsychoPy API或Expyriment可能是明智的。 這將使您可以使用特定于系統的設置(例如,如果使用Linux,則為特定于Linux的設置),并根據可用的硬件優化實驗(有關PsychoPy,E-prime和DMDX的測試和比較,請參閱Garaizar &Vadillo,2014年)。
To summarize,? PsychoPy seem to be the only application that offers both coding and builder interfaces. I am, therefore, suggesting that undergraduate students, as well as graduate students and researchers uses it. Naturally, that it is free and not dependent on windows also make it a really strong alternative to proprietary software such as E-prime and Presentation. However, this is true for all the Python based applications and libraries.? It might be worth end this post with noting that Python is also a free alternative to Matlab. Personally, I did find Python easier to learn compared to Matlab.
總而言之,PsychoPy似乎是唯一提供編碼和構建器界面的應用程序。 因此,我建議本科生以及研究生和研究人員使用它。 自然,它是免費的并且不依賴于Windows,這也使其成為專有軟件(例如E-prime和Presentation)的強大替代品。 但是,對于所有基于Python的應用程序和庫都是如此。 值得一提的是,本文還是指出Python也是Matlab的免費替代品。 我個人確實發現,與Matlab相比,Python更易于學習。
相關文章: (Related posts:)
How to Install Psychopy on LMDE.
如何在LMDE上安裝Psychopy。
Python script for trial randomization making use of PsychoPy’s TrialHandler.
利用PsychoPy的TrialHandler 進行隨機試驗的Python腳本 。
參考資料 (References)
Garaizar, P., & Vadillo, M. A. (2014). Accuracy and Precision of Visual Stimulus Timing in PsychoPy: No Timing Errors in Standard Usage. PLoS ONE, 9(11), e112033. http://doi.org/10.1371/journal.pone.0112033
Garaizar,P.&Vadillo,MA(2014)。 PsychoPy中視覺刺激計時的準確性和準確性:標準用法中沒有計時錯誤。 公共科學圖書館,9(11),e112033。 http://doi.org/10.1371/journal.pone.0112033
Garaizar, P., Vadillo, M. A., López-de-Ipi?a, D., & Matute, H. (2014). Measuring Software Timing Errors in the Presentation of Visual Stimuli in Cognitive Neuroscience Experiments. PLoS ONE, 9(1), e85108. http://doi.org/10.1371/journal.pone.0085108
Garaizar,P.,Vadillo,MA,López-de-Ipi?a,D.,&Matute,H.(2014年)。 在認知神經科學實驗中測量視覺刺激演示中的軟件計時錯誤。 PLoS ONE,9(1),e85108。 http://doi.org/10.1371/journal.pone.0085108
Krause, F. & Lindemann, O. (2014). Expyriment: A Python library for cognitive and neuroscientific experiments. Behavior Research Methods, 46(2), 416-428. doi:10.3758/s13428-013-0390-6.
Krause,F.&Lindemann,O.(2014年)。 Expyriment:用于認知和神經科學實驗的Python庫。 行為研究方法,46(2),416-428。 doi:10.3758 / s13428-013-0390-6。
Math?t, S., Schreij, D., & Theeuwes, J. (2012). OpenSesame: An open-source, graphical experiment builder for the social sciences. Behavior Research Methods, 44(2), 314-324. doi:10.3758/s13428-011-0168-7
Math?t,S.,Schreij,D.和Theeuwes,J.(2012年)。 OpenSesame:社會科學的開源,圖形化實驗構建器。 行為研究方法,44(2),314-324。 doi:10.3758 / s13428-011-0168-7
Peirce, J. (2010). PsychoPy – Psychology software for Python. Integration The Vlsi Journal.
Peirce,J.(2010年)。 PsychoPy –適用于Python的心理學軟件。 集成Vlsi Journal。
Peirce, J. W. (2007). PsychoPy-Psychophysics software in Python. Journal of Neuroscience Methods, 162(1-2), 8–13. http://doi.org/10.1016/j.jneumeth.2006.11.017
Peirce,JW(2007)。 Python中的PsychoPy-Psychophysics軟件。 神經科學方法雜志,162(1-2),8-13。 http://doi.org/10.1016/j.jneumeth.2006.11.017
翻譯自: https://www.pybloggers.com/2015/12/python-apps-and-libraries-for-creating-experiments/
python程序設計與實驗
總結
以上是生活随笔為你收集整理的python程序设计与实验_用于创建实验的Python应用程序和库的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 洛克菲勒:一部西方石油工业的传奇史
- 下一篇: 【信息融合】基于matlab BP神经网