User Tools

Site Tools


biac:experimentalcontrol:biac6hardware

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
biac:experimentalcontrol:biac6hardware [2024/04/15 19:23] – [BIAC6 Screen Configuration] cmp12biac:experimentalcontrol:biac6hardware [2024/04/15 19:57] – [BIAC6 Screen Configuration] cmp12
Line 127: Line 127:
 A **CLONED** configuration with goggles off, will result in a single monitor to programs like PsychToolbox and PsychoPy. A **CLONED** configuration with goggles off, will result in a single monitor to programs like PsychToolbox and PsychoPy.
  
 +PTB:
 <code matlab> <code matlab>
  
Line 134: Line 135:
      0      0
            
 +  % there is only a single screen
 +     
 +</code>
 +
 +PsychoPy:
 +<code python>
 +
 +import pyglet
 +
 +display = pyglet.canvas.get_display()
 +screens = display.get_screens()
 +screens
 +>>[Win32Screen(x=0, y=0, width=1920, height=1080)]
 +
 + # screens[0] is the one and only screen
 +
 </code> </code>
  
-Any **EXTENDED** configuration will result in multiple monitors being available  
  
 +Any **EXTENDED** configuration, or configuration with goggles will result in multiple monitors being available.
 +  
 +PTB:
 <code matlab> <code matlab>
  
Line 146: Line 165:
                      
    %in this case    %in this case
-   % 0 - the full display across the extended desktop +   % 0 - the full extended display across the desktop 
-   % 1 - screen #1  +   % 1 - screen #1 only 
-   % 2 - screen #2 +   % 2 - screen #2 only
        
 </code> </code>
  
- +PsychoPy:
-For instance PsychoPy the first screen would be #0 +
 <code python> <code python>
  
Line 160: Line 178:
 display = pyglet.canvas.get_display() display = pyglet.canvas.get_display()
 screens = display.get_screens() screens = display.get_screens()
-screenNum = 0 +screens 
-#get resolution of screen 0 +>>[Win32Screen(x=0y=0width=1920, height=1080)Win32Screen(x=1920y=0, width=1920height=1080)]
-win_res = [screens[screenNum].width, screens[screenNum].height] +
- +
-#set the output to always go to screen 0 +
-win = visual.Window(size=win_resscreen=screenNumallowGUI=True, +
-                    fullscr=True, monitor=exp_mon, units='height', +
-                    color=(0.20.2, 0.2)) +
- +
-msg1 = visual.TextStim(win, text=u"Hello world!"pos=(0,0)) #centered +
-msg1.draw() #draw it +
-win.flip() #put it on the screen +
-core.wait(5) #wait 5 seconds +
-win.close() #close it +
-core.quit() #stop +
- +
-</code> +
- +
-matlab PTB the first screen would be #1 ( matlab is indexed starting at 1 instead of 0 ). +
-<code matlab> +
- +
-%configure the first screen is psychtoolbox +
-screenNumber 1;     +
-[Window,var.winrect] Screen('OpenWindow',screenNumber,0);+
  
 + # screens[0] is the first screen
 + # screens[1] is the second screen because python is zero indexed
  
 </code> </code>
  
 +You need to code your tasks to send to the specific screen you want your subjects to see.  If they are viewing the projector, then they can only single a screen at a time.  The default is to send the first display to the projector. 
 +  * screen 0 in matlab **only** if its a **cloned** display only, or screen 1 if it is extended/goggles
 +  * screen 0 in PTB
  
  
biac/experimentalcontrol/biac6hardware.txt · Last modified: 2024/06/21 15:44 by 127.0.0.1