Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mock Scanner 2.0

A lightweight, cross-platform tool designed to simulate scanner triggers automatically. It exposes a localhost socket and can optionally display a transparent, always-on-top debugging overlay without intercepting experiment input.

Pass --gui to show the overlay. It shows scan status, elapsed scan time, current/total TR, trigger key, configured TR duration, and a brief green pulse whenever a trigger is emitted.

Installation

You can download from the releases or install from my homebrew tap

brew tap ChengranAA/neuraltools
brew install mock_scanner

Usage

Start the scanner utility first:

mock_scanner --tr 1.5 --volumes 120 --trigger 5 --gui

Omit --gui to run headlessly with no window.

To switch automatically into step mode after a fixed number of TRs:

mock_scanner --tr 1.5 --volumes 120 --pause-after 20 --gui

Add the following snippet to your experiment scripts

For python:

import socket

def start_scanner(host = "127.0.0.1", port = 2333):
    with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
        s.connect((host, port))
        s.sendall(b"Start")

if __name__ == "__main__":
    start_scanner()
    # rest of your code

For MATLAB:

function start_scanner(host, port)
    if nargin < 1
        host = '127.0.0.1';
    end
    if nargin < 2
        port = 2333;
    end

    t = tcpclient(host, port);
    write(t, uint8('Start'));
    clear t;
end

start_scanner();
% rest of your code

About

A mock scanner utility for psychology experiment testing.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages