Exemplo n.º 1
0
import os

import numpy.random as rnd  # for random number generators

from psychopy import visual, core, event
from psychopy_ext import exp

from collections import OrderedDict

import fix
import computer
PATHS = exp.set_paths('change_detection', computer)
PATHS['images'] = '../Part2/images/'


class ChangeDet(fix.Experiment):
    """
    Change Detection Experiment
    ===========================

    In this experiment you will see photographs flickering with a tiny detail in them changing.
    Your task is to detect where the change is occuring.
    To make it harder, there are bubbles randomly covering the part of the photos.

    Hit **spacebar to begin**. When you detect a change, hit **spacebar** again.
    """
    def __init__(self,
                 name='exp',
                 info=OrderedDict([('exp_name', 'Change Detection'),
                                   ('subjid', 'cd_'),
                                   ('gender', ('male', 'female')), ('age', 18),
Exemplo n.º 2
0
# people from running the experiment
try:
    import pandas
except:
    pass

from psychopy_ext import exp, ui, stats, plot

# some modules are only available in Python 2.6
try:
    from collections import OrderedDict
except:
    from exp import OrderedDict

import computer
PATHS = exp.set_paths('twotasks', computer)


class TwoTasks(exp.Experiment):
    """
    A perceptual learning experiment
    ================================

    This experiment is composed of four parts. Each part consists of
    **training** for 1 min (for this demo purposes only) and
    **testing** for 5 min.

    **Press spacebar to continue.**

    *(Use 'Left Shift + Esc' to exit.)*
    """
Exemplo n.º 3
0
# people from running the experiment
try:
    import pandas
except:
    pass

from psychopy_ext import exp, ui, stats, plot

# some modules are only available in Python 2.6
try:
    from collections import OrderedDict
except:
    from exp import OrderedDict

import computer
PATHS = exp.set_paths('perclearn', computer)


class PercLearn(exp.Experiment):
    """
    A perceptual learning experiment
    ================================

    This experiment is composed of **four parts**. Each part consists of
    **training** for 1 min (for presentation purposes only) and
    **testing** for 5 min.

    **Press spacebar to continue.**

    *(Use 'Left Shift + Esc' to exit.)*
    """
Exemplo n.º 4
0
from psychopy_ext import exp, stats, plot

# some modules are only available in Python 2.6
try:
    from collections import OrderedDict
except:
    from exp import OrderedDict

import computer  # for monitor size, paths etc settings across computers
# set up where all data, logs etc are stored for this experiment
# for a single experiment, '' is fine -- it means data is stored in the 'data'
# folder where the 'run.py' file is, for example
# if you have more than one experiment, 'confsup' would be better -- data for
# this experiment will be in the 'data' folder inside the 'confsup' folder
PATHS = exp.set_paths(exp_root='confsup', computer=computer)

class Confsup(exp.Experiment):
    """
    The configural superiority effect experiment
    ============================================

    Task
    ----

    Indicate which shape is different. Use the numeric pad to respond:

    - Top left: 4
    - Top right: 5
    - Bottom left: 1
    - Bottom right: 2
Exemplo n.º 5
0
    import pandas
except:
    pass

from psychopy import visual
from psychopy_ext import exp

# some modules are only available in Python 2.6
try:
    from collections import OrderedDict
except:
    from exp import OrderedDict


import computer
PATHS = exp.set_paths('trivial', computer)

class Exp1(exp.Experiment):
    """
    Instructions (in reST format)
    =============================

    **Hit 'j'** to advance to the next trial, *Left-Shift + Esc* to exit.
    """
    def __init__(self,
                 name='exp',
                 info=OrderedDict([('subjid', 'quick_'),
                                  ('session', 1),
                                  ]),
                 rp=None,
                 actions='run'
Exemplo n.º 6
0
try:
    import pandas
except:
    pass

from psychopy import visual
from psychopy_ext import exp

# some modules are only available in Python 2.6
try:
    from collections import OrderedDict
except:
    from exp import OrderedDict

import computer
PATHS = exp.set_paths('trivial', computer)


class Exp1(exp.Experiment):
    """
    Instructions (in reST format)
    =============================

    **Hit 'j'** to advance to the next trial, *Left-Shift + Esc* to exit.
    """
    def __init__(self,
                 name='exp',
                 info=OrderedDict([
                     ('subjid', 'quick_'),
                     ('session', 1),
                 ]),
Exemplo n.º 7
0
# some modules are only available in Python 2.6
try:
    from collections import OrderedDict
except:
    from exp import OrderedDict

import computer  # for monitor size, paths etc settings across computers
# set up where all data, logs etc are stored for this experiment
# for a single experiment, '.' is fine -- it means data is stored in the 'data'
# folder where the 'run.py' file is, for example
# if you have more than one experiment, 'confsup' would be better -- data for
# this experiment will be in the 'data' folder inside the 'confsup' folder

# store fmri data in the Download folder in your home folder
computer.root = os.path.join(os.path.expanduser('~'), 'Downloads', 'fmri_demo/')
PATHS = exp.set_paths('fmri', computer, fmri_rel='%s/')

class Analysis(fmri.Analysis):
    def __init__(self,
                 name='analysis',
                 info=OrderedDict([
                    ('subjid', 'subj_'),
                    ('runtype', 'main'),
                    ('runno', 1),
                    ]),
                 rp=OrderedDict([
                    ('no_output', False),
                    ('force', False),
                    ('all', True),
                    ('rois', [(['rh_V1d','rh_V1v'],'V1'), 'rh_LO']),
                    ('reuserois', False),
Exemplo n.º 8
0
import os

import numpy.random as rnd  # for random number generators

from psychopy import visual, core, event
from psychopy_ext import exp

from collections import OrderedDict

import fix
import computer

PATHS = exp.set_paths("change_detection", computer)
PATHS["images"] = "../Part2/images/"


class ChangeDet(fix.Experiment):
    """
    Change Detection Experiment
    ===========================

    In this experiment you will see photographs flickering with a tiny detail in them changing.
    Your task is to detect where the change is occuring.
    To make it harder, there are bubbles randomly covering the part of the photos.

    Hit **spacebar to begin**. When you detect a change, hit **spacebar** again.
    """

    def __init__(
        self,
        name="exp",
Exemplo n.º 9
0
from psychopy import visual
from psychopy_ext import exp

from collections import OrderedDict

import computer

PATHS = exp.set_paths("trivial", computer)


class Exp1(exp.Experiment):
    """
    Instructions (in reST format)
    =============================

    **Hit 'j'** to advance to the next trial, *Left-Shift + Esc* to exit.
    """

    def __init__(self, name="exp", info=OrderedDict([("subjid", "quick_"), ("session", 1)]), rp=None, actions="run"):
        super(Exp1, self).__init__(name=name, info=info, rp=rp, actions=actions, paths=PATHS, computer=computer)

        # user-defined parameters
        self.ntrials = 8
        self.stimsize = 2  # in deg

    def create_stimuli(self):
        """Define your stimuli here, store them in self.s
        """
        self.create_fixation()
        self.s = {}
        self.s["fix"] = self.fixation
Exemplo n.º 10
0
from psychopy import visual
from psychopy_ext import exp, stats, plot

# some modules are only available in Python 2.6
try:
    from collections import OrderedDict
except:
    from exp import OrderedDict

import computer  # for monitor size, paths etc settings across computers
# set up where all data, logs etc are stored for this experiment
# for a single experiment, '' is fine -- it means data is stored in the 'data'
# folder where the 'run.py' file is, for example
# if you have more than one experiment, 'confsup' would be better -- data for
# this experiment will be in the 'data' folder inside the 'confsup' folder
PATHS = exp.set_paths(exp_root='mouse_resp', computer=computer)


class Confsup(exp.Experiment):
    """
    The configural superiority effect experiment
    ============================================

    Task
    ----

    Indicate which shape is different by clicking on it!

    Please remember to fixate on the central dot.

    **Please press spacebar to begin.**
Exemplo n.º 11
0
# people from running the experiment
try:
    import pandas
except:
    pass

from psychopy_ext import exp, ui, stats, plot

# some modules are only available in Python 2.6
try:
    from collections import OrderedDict
except:
    from exp import OrderedDict

import computer
PATHS = exp.set_paths('staircase', computer)


class Staircase(exp.Experiment):
    """
    A perceptual learning experiment
    ================================

    Your task
    ---------

    **Fixate** on the central fixation spot. Two stimuli will briefly flash.
    If they appear to be the same, **hit 'f'**.
    If they appear to be different, **hit 'j'**.
    Please remember to fixate throughout the experiment!
Exemplo n.º 12
0
from psychopy import visual
from psychopy_ext import exp, stats, plot

# some modules are only available in Python 2.6
try:
    from collections import OrderedDict
except:
    from exp import OrderedDict

import computer  # for monitor size, paths etc settings across computers
# set up where all data, logs etc are stored for this experiment
# for a single experiment, '' is fine -- it means data is stored in the 'data'
# folder where the 'run.py' file is, for example
# if you have more than one experiment, 'confsup' would be better -- data for
# this experiment will be in the 'data' folder inside the 'confsup' folder
PATHS = exp.set_paths(exp_root='mouse_resp', computer=computer)

class Confsup(exp.Experiment):
    """
    The configural superiority effect experiment
    ============================================

    Task
    ----

    Indicate which shape is different by clicking on it!

    Please remember to fixate on the central dot.

    **Please press spacebar to begin.**
Exemplo n.º 13
0
# people from running the experiment
try:
    import pandas
except:
    pass

from psychopy_ext import exp, ui, stats, plot

# some modules are only available in Python 2.6
try:
    from collections import OrderedDict
except:
    from exp import OrderedDict

import computer
PATHS = exp.set_paths('twotasks', computer)


class TwoTasks(exp.Experiment):
    """
    A perceptual learning experiment
    ================================

    This experiment is composed of four parts. Each part consists of
    **training** for 1 min (for this demo purposes only) and
    **testing** for 5 min.

    **Press spacebar to continue.**

    *(Use 'Left Shift + Esc' to exit.)*
    """
Exemplo n.º 14
0
from psychopy_ext import exp, stats, plot

# some modules are only available in Python 2.6
try:
    from collections import OrderedDict
except:
    from exp import OrderedDict

import computer  # for monitor size, paths etc settings across computers
# set up where all data, logs etc are stored for this experiment
# for a single experiment, '' is fine -- it means data is stored in the 'data'
# folder where the 'run.py' file is, for example
# if you have more than one experiment, 'confsup' would be better -- data for
# this experiment will be in the 'data' folder inside the 'confsup' folder
PATHS = exp.set_paths(exp_root='confsup', computer=computer)


class Confsup(exp.Experiment):
    """
    The configural superiority effect experiment
    ============================================

    Task
    ----

    Indicate which shape is different. Use the numeric pad to respond:

    - Top left: 4
    - Top right: 5
    - Bottom left: 1
Exemplo n.º 15
0
from psychopy_ext import exp, ui, stats, plot

# some modules are only available in Python 2.6
try:
    from collections import OrderedDict
except:
    from exp import OrderedDict

import computer  # for monitor size, paths etc settings across computers
# set up where all data, logs etc are stored for this experiment
# for a single experiment, '.' is fine -- it means data is stored in the 'data'
# folder where the 'run.py' file is, for example
# if you have more than one experiment, 'confsup' would be better -- data for
# this experiment will be in the 'data' folder inside the 'confsup' folder
PATHS = exp.set_paths('.', computer)

class Confsup(exp.Experiment):
    """
    The configural superiority effect experiment
    """
    def __init__(self,
            name='exp',
            extraInfo=OrderedDict([  # these get printed in the output data file
                ('subjID', 'confsup_')
                ]),
            runParams=OrderedDict([  # these control how the experiment is run
                ('noOutput', False),  # do you want output? or just playing around?
                ('debug', False),  # not fullscreen presentation etc
                ('autorun', 0),  # if >0, will autorun at the specified speed
                ('push', False),  # commit and push to a hg repo?