问题标签 [psychopy]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
411 浏览

psychopy - 无法在 Mac OSX 10.9.5 上使用 moviestim2

我在装有 OSX 10.9.5、显卡 Intel HD Graphics 4000 1024 MB、VLC 版本 2.0.10 Twoflower(Intel 32 位)的 Macbook Pro 上编写我的实验。我曾经使用最高版本 1.80 的moviestim 成功地呈现视频(avi 和 mp4 文件,每秒 60 帧)。通过安装独立版本升级到 1.81 版后,我尝试使用 moviestim2,调整 Moviestim2.py 中的代码。当我运行下面的代码时:

视频全长显示,输出为

n总计 142

n删除 2

(已删除警告)。当我使用我的一个视频(文件格式 mov,大小调整为 800x800)运行代码时,使用 ffmpeg 从 852 个 png 文件以每秒 60 帧的速度生成 H.264 格式的视频,以显示跟踪任务的移动对象(无音频数据),窗口可能在显示第一帧后立即关闭。输出是

n总计 0

n已删除 0

/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/numpy/core/_methods.py:55:RuntimeWarning:空切片的平均值。warnings.warn(“空切片的平均值。”,RuntimeWarning)/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/numpy/core/_methods.py:67:RuntimeWarning:double_scalars中遇到的无效值ret = ret.dtype.type(ret / rcount)

(其他警告已删除)使用 avi 和 mp4 文件格式的测试生成的 nTotals 为 1 到 2,因此没有运行时警告和相同的结果。

任何帮助都将不胜感激,因为到目前为止,我无法像以前一样使用moviestim和avbin 10(窗口冻结,但PsychoPy不会崩溃)作为解决方法返回到PsychoPy 1.80。

最好的,

直到

0 投票
1 回答
1133 浏览

psychopy - 我无法从构建器视图插入图像作为刺激。

我正在尝试从 Excel 电子表格中导入图像作为刺激。它位于 .tiff 图像上并且收到此错误“targ.setImage(stimuli) NameError:name 'stimuli' is not defined。我在excell'stimuli'中命名了该列并使用'PsychoPy\VisualCC\Stimuli\targ.tiff' (没有引号)。

在图像属性中,我将其命名为 targ 并将图像设置为 $stimuli。据我所知,这是准确的。请指教。

故障_311

0 投票
2 回答
1299 浏览

psychopy - 我想在psychopy中的随机位置生成图像对象

有没有办法生成出现在随机位置的图像对象,但必须是出现在 12 个可能的干扰位置之一的目标?

0 投票
1 回答
2425 浏览

python - 防止全屏图像拉伸心理变态

这是我第一次使用这个软件来创建一个实验。

对于我的实验,我将并排展示两个图像,理想情况下我想全屏运行这个实验,但是当我将值设置为 true 时,图像会被拉伸。如何修复它们的纵横比,以便我可以全屏运行程序而不拉伸图像?

我正在使用 MacBook Pro 和 PsychoPy 编码器。

这是我当前的图像代码:

此外,在我的实验中,其中一张图像将被稍微压缩或拉伸。然后参与者必须选择较胖的脸。这已经设置好了,当在窗口中运行时,图像显示正常,当它们被拉伸以适合显示器尺寸时,它只是处于全屏模式。

0 投票
1 回答
530 浏览

python - Getting dot to move along curved trajectory

I'm trying to create a dot that moves around the screen, bounces off the edges, and curves in a random direction every 50 frames or so.

What I've done so for is get a ball to move constantly and bounce off of the screen edges. Please note that this uses PsychoPy:

#xA;

I imagine that this will require some trig, which I barely understand. Could anyone point me in the right direction? What variables will I need, and how should they be manipulated?

0 投票
1 回答
1521 浏览

psychopy - Psychopy ISI component and how to use it to load stimuli in the Builder

I am having some doubts whether I understand correctly the concept of static component or not.

I am designing an experiment where I am presenting images for certain durations and once an image is gone the participant will have to submit a response.

I am using the builder for this and usually at the end I go on the coder view to make some minor alterations (randomise inter-trial durations etc)

So in the builder, I start a loop where my first routine has an ISI component for 0.5 seconds, then I add an image ad 0.5 seconds, a second routine in the loop records the key response.

What I want to do, in order to avoid lag, is to load the image during the ISI and then display it after the 0.5 seconds have passed. I am ok with the condition file and how to use parameters as variables. So in the Image entry I use $image (as declared in my excel file), I also declare that I want this image to be set "during trial:ISI". Does this do what I have in mind? Load the image during ISI and flip it once ISI finishes?

Secondly, do you think it will be more efficient to have the ISI and the image in different routines inside the same loop?

If you have any other suggestions on how it can be done in a more efficient way please let me know.

Thank you.

0 投票
0 回答
375 浏览

python - 在 Psychopy 中使用声音刺激的记忆错误

我想知道是否有人可以看到错误。我正在进行一项包含大约 220 次试验的实验。有 3 种听觉刺激我想在可变的时间内打开并在按下“空格”时终止(在某些试验中)。在大约试用 148 时,我收到一个错误,表明声音是问题,最后一行是“内存错误”

具体来说:

如果 self.lineRGB!=None 和 self.lineWidth!=0.0:回溯(最近一次调用最后):文件“C:\Users\freemali\Desktop\UGH_lastrun.py”,第 4352 行,在 short_stim3 = sound.Sound(' C', secs=short_dur) 文件“C:\Program Files\PsychoPy2\lib\site-packages\psychopy-1.81.00-py2.7.egg\psychopy\sound.py”,第 217 行,在init self.setSound(value=value, secs=secs, octave=octave) 文件“C:\Program Files\PsychoPy2\lib\site-packages\psychopy-1.81.00-py2.7.egg\psychopy\sound.py” ,第 135 行,在 setSound self._setSndFromNote(value.capitalize(), secs, octave, hamming=hamming) 文件“C:\Program Files\PsychoPy2\lib\site-packages\psychopy-1.81.00-py2.7. egg\psychopy\sound.py”,第 167 行,在 _setSndFromNote self._setSndFromFreq(thisFreq, secs, hamming=hamming) 文件“C:\Program Files\PsychoPy2\lib\site-packages\psychopy-1.81.00-py2. 7.egg\psychopy\sound.py”,第 177 行,在 _setSndFromFreq self._setSndFromArray(outArr) 文件“C:\Program Files\PsychoPy2\lib\site-packages\psychopy-1.81.00-py2.7.egg\ Psychopy\sound.py",第 291 行,在 _setSndFromArray thisArray= (thisArray*2**15).astype(numpy.int16) MemoryError

这是 Psychopy 没有释放听觉刺激的结果吗?因为我希望刺激持续可变的时间段,所以我stimulus.stop()在例程结束时使用。这是一个问题吗?

0 投票
1 回答
4000 浏览

python - PsychoPy 在 64 位操作系统上发送触发器

我在 Win7 64 位操作系统上使用 PsychoPy 独立 v1.81.00 发送 eeg 记录触发器时遇到问题。我按照这里的描述,没有得到任何(更多)错误。但是,触发器不会显示在录制计算机上(Win7 32 位下的 Brainvision Recorder)。

我做了什么:

  1. 通过 InpOutBinaries_1500\Win32\InstallDriver.exe下载并安装InpOutBinaries_1500
  2. 将其他文件(inpout32.dll、.h 和 .lib 以及 vssver2.scc)复制到我的脚本的工作目录
  3. 尝试发送触发代码windll.inpout32.Out32(0x378, triggerCode)

触发代码未显示在 Brainvision Recorder 中,但在调用print str(windll.inpout32.Inp32(0x378)).

感谢您的每一条建议或想法!

0 投票
1 回答
1461 浏览

python - 基于鼠标位置的心理事件

我正在设置一个菲茨定律实验,我希望参与者单击开始按钮,沿直线移动鼠标,然后单击目标。单击开始后,如果参与者在垂直方向上向上或向下移动鼠标太多,我想显示一个白屏 30 秒并且不接受任何输入,然后移动到下一个试验。

目前,无论如何,实验的表现就好像我超出了可接受的范围并始终执行 if 语句。

这是我现在拥有的代码:

我还没有弄清楚嵌套 if 语句下我需要的一切。现在我只是想确保它正常工作。即使查看 csv 文件中收集的 mouse.y 列表数据,它也不会将 if 语句评估为 true,也不会添加惩罚,我可以看到某些情况下 y 超出了我设置的任何范围。

似乎在试验开始后立即收集鼠标位置数据,而不仅仅是在单击多边形之后。但是,开始时间和停止时间似乎确实基于单击多边形和多边形2 的时间。我真的不确定发生了什么。

更新:由于某种原因,直到一天后我才收到有关 Jonas 回复的通知。我希望我有,因为它会让我在几个小时前走上正确的轨道。它是一个构建器代码组件。

我的代码都在运行每一帧。在例程开始时,我添加了:

使用以下代码,每一帧都解决了这个特定问题:

我仍然不知道为什么在单击多边形之前会收集鼠标位置,但这对我来说并不重要。我可以将鼠标单击的帧的数据与开始按钮对应的位置进行匹配,以获取鼠标路径跟踪的开始。

0 投票
1 回答
370 浏览

psychopy - core.wait 命令——我是否使用 pyglet?

我在 Builder 中设置了一个实验,以获得对音频刺激的快速反应时间,随后我一直在使用代码来让实验完全按照我的意愿进行。特别是,我想要非常准确的反应时间,因此该程序理想情况下会从每个刺激开始到之后的固定点占用 CPU,并在此期间记录“w”和“e”的按键。

为了实现这一点,我一直在音频刺激开始时重置时钟,然后占用 CPU 2 秒,如下所示:

这似乎工作正常。但是,我有一个担忧:该core.wait命令的文档说:

如果您想在等待期间获得按键,请务必使用 pyglet。

我怎么知道我是否在使用 pyglet?它是自动的,还是我需要以某种方式更改脚本以确保我正在使用它?