Burke Neurological Institute, White Plains, NY, USA; Blythedale Children's Hospital, Valhalla, NY, USA.
Burke Neurological Institute, White Plains, NY, USA; Blythedale Children's Hospital, Valhalla, NY, USA.
J Neurosci Methods. 2019 May 15;320:79-86. doi: 10.1016/j.jneumeth.2019.03.020. Epub 2019 Apr 1.
Precise definition, rendering and manipulation of visual stimuli are essential in neuroscience. Rather than implementing these tasks from scratch, scientists benefit greatly from using reusable software routines from freely available toolboxes. Existing toolboxes work well when the operating system and hardware are painstakingly optimized, but may be less suited to applications that require multi-tasking (for example, closed-loop systems that involve real-time acquisition and processing of signals).
We introduce a new cross-platform visual stimulus toolbox called Shady (https://pypi.org/project/Shady)-so called because of its heavy reliance on a shader program to perform parallel pixel processing on a computer's graphics processor. It was designed with an emphasis on performance robustness in multi-tasking applications under unforgiving conditions. For optimal timing performance, the CPU drawing management commands are carried out by a compiled binary engine. For configuring stimuli and controlling their changes over time, Shady provides a programmer's interface in Python, a powerful, accessible and widely-used high-level programming language.
Our timing benchmark results illustrate that Shady's hybrid compiled/interpreted architecture requires less time to complete drawing operations, exhibits smaller variability in frame-to-frame timing, and hence drops fewer frames, than pure-Python solutions under matched conditions of resource contention. This performance gain comes despite an expansion of functionality (e.g. "noisy-bit" dithering as standard on all pixels and all frames, to enhance effective dynamic range) relative to previous offerings.
Shady simultaneously advances the functionality and performance available to scientists for rendering visual stimuli and manipulating them in real time.
在神经科学中,精确定义、呈现和操作视觉刺激至关重要。科学家们通过使用可重复使用的软件例程从免费的工具包中受益,而不是从头开始实现这些任务。现有的工具包在操作系统和硬件经过精心优化时效果很好,但可能不太适合需要多任务处理的应用程序(例如,涉及实时采集和处理信号的闭环系统)。
我们引入了一个名为 Shady 的新跨平台视觉刺激工具包(https://pypi.org/project/Shady),之所以这样命名,是因为它严重依赖于着色器程序来在计算机的图形处理器上并行处理像素。它的设计重点是在苛刻条件下的多任务应用程序中具有性能鲁棒性。为了获得最佳的定时性能,CPU 绘图管理命令由编译后的二进制引擎执行。为了配置刺激并控制它们随时间的变化,Shady 在 Python 中提供了一个程序员接口,这是一种功能强大、易于访问且广泛使用的高级编程语言。
我们的定时基准测试结果表明,Shady 的混合编译/解释架构在匹配的资源竞争条件下,与纯 Python 解决方案相比,完成绘图操作所需的时间更少,帧到帧的定时变化更小,因此丢帧率更低。尽管相对于以前的产品,功能(例如在所有像素和所有帧上标准的“噪声位”抖动,以增强有效动态范围)有所扩展,但仍能获得这种性能提升。
Shady 同时提高了科学家渲染视觉刺激和实时操作它们的功能和性能。