warp=Warp.Spherical, # warp=Warp.Disabled ) stimFileDir = r"\\allen\programs\braintv\workgroups\nc-ophys\corbettb\motion stimuli\dot stimfiles" movie_path_list = [os.path.join(stimFileDir,f) for f in os.listdir(stimFileDir) if os.path.isfile(os.path.join(stimFileDir,f))] # set display sequences with open(r"\\allen\programs\braintv\workgroups\nc-ophys\corbettb\motion stimuli\ds_dict_two.pkl", 'rb') as f: ds_dict = pickle.load(f) movielist = [] for i, path in enumerate(movie_path_list): ds = ds_dict[str(i)] movie = Stimulus.from_file(path, window) movie.set_display_sequence(ds) movielist.append(movie) params = { #`'syncsqr': True, 'syncsqrloc': (900,560), 'syncsqrsize': (100,140), 'syncpulse': True, 'syncpulseport': 1, 'syncpulselines': [1, 2], # frame, start/stop 'trigger_delay_sec': 5.0, }
""" #from psychopy import visual from camstim import Stimulus, SweepStim from camstim import Foraging from camstim import Window, Warp import numpy as np # Create display window window = Window(fullscr=True, monitor='Gamma1.Luminance50', screen=0, warp=Warp.Disabled) local_path = r'C:\\ProgramData\AIBS_MPE\camstim\resources\VIPSSN\\' stim_path = local_path + 'VIPSSN_habituation_movie.stim' stim = Stimulus.from_file(stim_path, window) stim_ds = [(0, 600)] stim.set_display_sequence(stim_ds) params = { 'syncsqr': True, #'syncsqrloc': (875,550), #'syncsqrsize': (150,150), 'syncpulse': True, 'syncpulseport': 1, #'syncpulselines': [5, 6], # frame, start/stop 'trigger_delay_sec': 5.0 } # create SweepStim instance
# Create display window window = Window( fullscr=True, monitor='Gamma1.Luminance50', screen=0, warp=Warp.Spherical, ) # Paths for stimulus files dg_path = "drifting_gratings_grid_5.stim" lsn_path = "locally_sparse_noise.stim" # dg_path = r"C:\Users\Public\Desktop\pythondev\cam2p_scripts\tests\openscope_surround\drifting_gratings_grid_5.stim" # Create stimuli dg = Stimulus.from_file(dg_path, window) lsn = Stimulus.from_file(lsn_path, window) # set display sequences dg_ds = [(0, 915), (2735, 3650)] lsn_ds = [(925, 2725)] dg.set_display_sequence(dg_ds) lsn.set_display_sequence(lsn_ds) # kwargs params = { 'syncsqrloc': (510, 360), # added by DM 'syncsqrsize': (50, 140), # added by DM 'syncpulse': True, 'syncpulseport': 1,
monitor='Gamma1.Luminance50', screen=1, #TODO: verify screen number for DeepScope warp=Warp.Spherical, ) # Paths for stimulus files size_by_contrast_path = "size_by_contrast.stim" behavior_flashes_path = "visual_behavior_flashes.stim" size_by_contrast_sequence_path = "size_by_contrast_sequence.npy" behavior_flashes_sequence_path = "visual_behavior_flash_sequence.npy" size_by_contrast_sequence = np.load(size_by_contrast_sequence_path).astype(int) behavior_flashes_sequence = np.load(behavior_flashes_sequence_path).astype(int) size_by_contrast = Stimulus.from_file(size_by_contrast_path, window) behavior_flashes = Stimulus.from_file(behavior_flashes_path, window) size_by_contrast.stim.pos = (posx, posy) size_by_contrast.sweep_order = size_by_contrast_sequence[:, 0].tolist() size_by_contrast._build_frame_list() behavior_flashes.sweep_order = behavior_flashes_sequence.tolist() behavior_flashes._build_frame_list() # set display sequences size_by_contrast_ds = [(0, 1725), (2800, 4525)] behavior_flashes_ds = [(1950, 2565)] size_by_contrast.set_display_sequence(size_by_contrast_ds) behavior_flashes.set_display_sequence(behavior_flashes_ds)
from camstim import Window, Warp import numpy as np # Create display window window = Window( fullscr=True, monitor='Gamma1.Luminance50', screen=1, #TODO: verify screen number for DeepScope warp=Warp.Spherical, ) # Paths for stimulus files sn_path = "sparse_noise_9on4.stim" # Create stimulus sn = Stimulus.from_file(sn_path, window) # set display sequences sn_ds = [(0, 1519), (1819, 3338)] sn.set_display_sequence(sn_ds) # kwargs params = { # 'syncsqrloc': (510,360),#TODO: verify for DeepScope # 'syncsqrsize': (50,140),#TODO: verify for DeepScope 'syncpulse': True, 'syncpulseport': 1, # 'syncpulselines': [1,2],#TODO: verify for DeepScope 'trigger_delay_sec': 5.0, }
import time import datetime # Create display window window = Window( fullscr=True, monitor='Gamma1.Luminance50', screen=1, #0 warp=Warp.Spherical, ) # paths to our stimuli ms_path = r"C:\Users\Public\Desktop\pythondev\cam2p_scripts\tests\motion.stim" # 16 minutes # load our stimuli ms = Stimulus.from_file(ms_path, window) # RF mapping / flashes ms_ds = [(0, 3600)] ms.set_display_sequence(ms_ds) # kwargs #params = { # 'syncpulse': True, # 'syncpulseport': 1, # 'syncpulselines': [4, 7], # frame, start/stop # 'trigger_delay_sec': 0.0, # 'bgcolor': (-1,-1,-1), # 'eyetracker': False, # 'eyetrackerip': "W7DT12722",
from camstim import Foraging from camstim import Window, Warp # Create display window window = Window( fullscr=True, monitor='GammaCorrect30', screen=1, warp=Warp.Spherical, ) # Paths for stimulus files dg_path = r"C:\Users\svc_ncbehavior\Desktop\stimulus\cam2p_scripts\cam_1_0\drifting_gratings.stim" # Create stimuli dg = Stimulus.from_file(dg_path, window) # set display sequences dg_ds = [(0, 1830)] dg.set_display_sequence(dg_ds) # kwargs params = { 'syncsqr': True, 'syncsqrloc': (510, 360), 'syncsqrsize': (50, 140), 'syncpulse': True, 'syncpulseport': 1, 'syncpulselines': [1, 2], # frame, start/stop 'trigger_delay_sec': 5.0,
# Paths for stimulus files center_path = "drifting_gratings_center.stim" surround_path = "drifting_gratings_surround.stim" # annulus_path = "annulus.stim" annulus_1_path = "drifting_gratings_annulus_1.stim" annulus_2_path = "drifting_gratings_annulus_2.stim" annulus_3_path = "drifting_gratings_annulus_3.stim" annulus_4_path = "drifting_gratings_annulus_4.stim" annulus_5_path = "drifting_gratings_annulus_5.stim" lsn_path = "locally_sparse_noise.stim" path = r"C:\Users\Public\Desktop\pythondev\cam2p_scripts\tests\openscope_surround\grating_order.npy" stim_order = np.load(path) lsn = Stimulus.from_file(lsn_path, window) # Create stimuli center = Stimulus.from_file(center_path, window) surround = Stimulus.from_file(surround_path, window) annulus_1 = Stimulus.from_file(annulus_1_path, window) annulus_2 = Stimulus.from_file(annulus_2_path, window) annulus_3 = Stimulus.from_file(annulus_3_path, window) annulus_4 = Stimulus.from_file(annulus_4_path, window) annulus_5 = Stimulus.from_file(annulus_5_path, window) posx = 20 # in degrees posy = 10 # in degrees center.stim.pos = (posx, posy) annulus_1.stim.pos = (posx, posy)