• 买房怎么看风水这个真的实在是太重要了 ——凤凰网房产北京 2019-06-11
  • 6月14日凤凰直通车:茅台再开市场化招聘大门,32个部门要285人葡萄 种植 2019-06-07
  • 习近平为传统文化“代言” 2019-05-27
  • 中巴建交一周年 一系列庆祝活动在巴拿马举行 2019-05-24
  • 招聘启事丨西部网诚聘新媒体编辑记者、实习编辑等人员 2019-05-23
  • A title= href=httpwww.snrtv.comlivech=8 target= 2019-05-23
  • 不止消灭刘海屏 vivo NEX发布会看点汇总 2019-05-22
  • 世相【镜头中的陕西人】 2019-05-20
  • 邓紫棋首任明星制作人 吴亦凡身兼二职 2019-05-20
  • 陶昕然女儿正面照曝光 吃蛋糕萌到爆 2019-05-19
  • 科学健身有原则 牢记要点是关键 2019-05-19
  • 土地是国有财产,是全民的财产,理应有全民共享。现在拿土地来赚老百姓的钱,说得过去吗? 2019-05-17
  • 台当局污蔑大陆“金钱外交”是自欺欺人 2019-05-17
  • 深圳市低碳产业投资商会来保定市考察 2019-05-15
  • 专注声乐培训 CZ昕格音乐基地为热爱音乐的你而生 2019-05-15
  • Python + GestaltReVision logo

    11选5任2神号期期必中:Python for Vision Research

    500元 倍投方案 稳赚 www.gvqn.net Welcome to the introductory series to using Python in vision research brought to you by the GestaltReVision group (KU Leuven, Belgium).

    The series consist of seven IPython notebooks meant as a three-day crash course for vision researchers in programming with Python, building experiments with PsychoPy and psychopy_ext, learning the fMRI multi-voxel pattern analysis with PyMVPA, and understading image processing in Python.

    There are more extensive resources for vision scientists on our GestaltReVision wiki.

    Please report any bugs or share ideas on our GitHub repo.

    Available tutorials

    License

    Authors: Maarten Demeyer, Jonas Kubilius
    Year: 2014
    Copyright: Public Domain as in CC0 (except where noted otherwise). Feel free to reuse these materials for your teaching or any other purposes.

    Contents of this notebook

    What you'll need

    Unfortunately, getting Python and all necessary packages is one of the major difficulties for beginners. So please be patient and try to get everything in order because once you get it running, magic can start.

    Tutorial code

    All materials, including this notebook, are available here.

    Python and its packages

    Windows

    The easiest method is to install our own Python distribution that has all necessary packages included.

    Linux

    Linux user? Awesome! Go to the NeuroDebian website, follow the instructions on how to add their repositories, and just sit back and relax while your system installs packages through sudo apt-get install <package_name> and sudo pip install <package_name>, as listed below:

    sudo apt-get install python-pip python-numpy python-scipy python-imaging python-matplotlib
    sudo apt-get install psychopy spyder ipython-notebook
    sudo apt-get install python-pandas python-docutils python-nibabel python-mvpa2 python-h5py
    sudo pip install pillow
    sudo pip install seaborn svgwrite
    sudo pip install psychopy_ext
    

    Mac OS

    Unfortunately, we have a very limited in-house Mac experience. We do offer instructions how to install most packages but you may (or are quite likely to) run into problems and we will probably not know how to help you.

    What? I don't want to mess with my machine!

    If you are having troubles installing Python and its packages, or you just don't want to change anything in your current setup, an excellent alternative is to install the NeuroDebian Virtual Machine. This will create a Linux desktop environment within your operating system, allowing you to follow the much simpler Linux installation procedures instead. Moreover, this Linux environment will be entirely separate from any other Python installation you may have on your machine, so you won't mess anything up by trying. Detailed instructions can be found here.

    Alternatively, if you are only interested in Scietific Python and or PsychoPy (sessions 1-4 and 7), the Standalone PsychoPy installation will largely suffice. You will not have IPython installed, but all examples should be working otherwise.

    For even more options, check our wiki.

    Checking your installation

    Run the following cell (by pressing the ? button above or Ctrl+Enter) to check whether your computer contains all needed packages. This will generate a txt output file which you can e-mail to us, should a problem arise. Press a key when asked to, and close the new IPython Notebook window that will be opened. If the cell keeps running for up to 10 seconds after closing the notebook, just wait; this is normal.

    In [2]:
    import os
    
    os.system('python check_install.py')
    
    try:
        f = open('workshop_req_check.txt','r')
        for line in f.readlines():
            print line,
        f.close()
    except IOError:
        print 'The script could not be executed!'
    
    win32
    ['D:\\Dropbox\\Destymas\\python_for_visres', 'C:\\Miniconda32\\lib\\site-packages\\pymvpa2-2.3.1-py2.7-win32.egg', 'C:\\Miniconda32\\lib\\site-packages\\tabular-0.1-py2.7.egg', 'C:\\Miniconda32\\lib\\site-packages\\psychopy-1.80.06-py2.7.egg', 'C:\\Miniconda32\\python27.zip', 'C:\\Miniconda32\\DLLs', 'C:\\Miniconda32\\lib', 'C:\\Miniconda32\\lib\\plat-win', 'C:\\Miniconda32\\lib\\lib-tk', 'C:\\Miniconda32', 'C:\\Miniconda32\\lib\\site-packages', 'C:\\Miniconda32\\lib\\site-packages\\PIL', 'C:\\Miniconda32\\lib\\site-packages\\win32', 'C:\\Miniconda32\\lib\\site-packages\\win32\\lib', 'C:\\Miniconda32\\lib\\site-packages\\Pythonwin', 'C:\\Miniconda32\\lib\\site-packages\\setuptools-3.6-py2.7.egg', 'C:\\Miniconda32\\lib\\site-packages\\wx-3.0-msw']
    
    ===============================================================================
    MODULE CHECK
    
        Python: base installation
            OK
        Spyder: IDE
            OK
        NumPy: numerical computing
            OK
        SciPy: scientific functions
            OK
        Matplotlib: plot graphs
            OK
        PsychoPy_ext: streamline research
            OK
        Seaborn: statistical data visualization
            OK
        Docutils: documentation utilities
            OK
        Svgwrite: create svg images
            OK
        Pandas: data analysis toolkit
            OK
        NiBabel: access neuroimaging files
            OK
        h5py: store huge amounts of numerical data
            OK
        PyMVPA: fMRI MVPA package
            OK
        Pillow: handle images
            OK
        PsychoPy: build experiments
    C:\Miniconda32\lib\site-packages\psychopy-1.80.06-py2.7.egg\psychopy\preferences\configobj.py:28: DeprecationWarning: The compiler package is deprecated and removed in Python 3.x.
      import compiler
    
    *************************************************************
    *                                                           *
    * A new window will open. Please follow instructions on it. *
    *                                                           *
    *************************************************************
    
    0.0716 	WARNING 	Creating new monitor...
    0.0718 	WARNING 	Creating new monitor...
            OK
        IPython: interactive notebooks
    
    *************************************************************
    *                                                           *
    * An IPython notebook should open in your browser.          *
    * Please wait for this test to finish. Do not hit Control-C *
    *                                                           *
    *************************************************************
    
            OK
    
    ===============================================================================
    HOW WELL ARE YOU PREPARED?
    
    Session: Introduction to Python
        FULLY PREPARED
    
    Session: Introduction to PsychoPy
        FULLY PREPARED
    
    Session: Transitioning from MATLAB to Python
        FULLY PREPARED
    
    Session: More practice with PsychoPy
        FULLY PREPARED
    
    Session: Streamline research with psychopy_ext
        FULLY PREPARED
    
    Session: Natural image statistics
        FULLY PREPARED
    
    Session: Multi-voxel pattern analysis
        FULLY PREPARED
    
    ===============================================================================
    WHAT TO DO NOW?
    
    1. Check in the list above how well you're prepared for the sessions
       you signed up.
    2. Ideally, you should be fully prepared. Mostly prepared might
       still suffice but not everything may work. Minimally prepared means
       you will not be able to execute significant parts of the code.
    3. If you're underprepared, download and install missing packages,
       and rerun this script. You may find information at
       //gestaltrevision.be/wiki/python/check_install useful.
    4. A file `workshop_req_check.txt` was generated in the same folder
       where this script is. When ready, please **email** it to 
       <[email protected]> so that we can verify that 
       you're ready for the workshop.
    
    ===============================================================================
    
    

    Getting started

    Opening IPython notebooks

    Windows

    1. Open command-line (Start button > Type cmd > Enter)
    2. Navigate to the folder where the IPython notebook is using the cd command e.g. cd C:\Users\u000001\Documents\python_for_visres.

      Tip: if you need to switch partitions, first type partition letter (no cd) and hit enter, e.g., D:

    Mac OS / Linux

    1. Open command line (look for Terminal.app or xterm, or similar)
    2. Navigate to the folder where the IPython notebook is using the cd command, e.g. cd ~/python_for_visres.

    Then:

    1. Type ipython notebook and hit enter. A new tab on your default browser should open with notebook choices listed. Doesn't work properly? Make sure you're not using an outdated or ridiculous browser (like some old Internet Explorer).
    2. Click on the notebook you want to open and play with.

    Editing Python scripts

    Python scripts are just text files. If you want, you can open them using any text editor, even Notepad. However, it is best to use specialized text editors for the task because they help you to code. Although in this tutorial we rely exclusively on IPython to write and run our scripts, in real life people usually use other text editors or integrated developments environments (IDEs) to create and run their scripts. Here is a list of some of our favorites:

  • 买房怎么看风水这个真的实在是太重要了 ——凤凰网房产北京 2019-06-11
  • 6月14日凤凰直通车:茅台再开市场化招聘大门,32个部门要285人葡萄 种植 2019-06-07
  • 习近平为传统文化“代言” 2019-05-27
  • 中巴建交一周年 一系列庆祝活动在巴拿马举行 2019-05-24
  • 招聘启事丨西部网诚聘新媒体编辑记者、实习编辑等人员 2019-05-23
  • A title= href=httpwww.snrtv.comlivech=8 target= 2019-05-23
  • 不止消灭刘海屏 vivo NEX发布会看点汇总 2019-05-22
  • 世相【镜头中的陕西人】 2019-05-20
  • 邓紫棋首任明星制作人 吴亦凡身兼二职 2019-05-20
  • 陶昕然女儿正面照曝光 吃蛋糕萌到爆 2019-05-19
  • 科学健身有原则 牢记要点是关键 2019-05-19
  • 土地是国有财产,是全民的财产,理应有全民共享。现在拿土地来赚老百姓的钱,说得过去吗? 2019-05-17
  • 台当局污蔑大陆“金钱外交”是自欺欺人 2019-05-17
  • 深圳市低碳产业投资商会来保定市考察 2019-05-15
  • 专注声乐培训 CZ昕格音乐基地为热爱音乐的你而生 2019-05-15
  • 轩辕帝传注册 蒙彼利埃纬度 上海快三多少时间表 手机能用的快三计划软件下载 火影忍者羁绊 pk101000本金怎么玩 古怪猴子注册 m6锁子甲制作方法 炉石传说盒子记牌器不显示 003期白小姐玄机 江西快三今日预测号码推荐 陕西快乐10分预测 猎鱼达人h5怎么打火龙 自古弓兵多近战 中世纪那不勒斯 韦斯卡巴塞罗那视频直播