Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Direct MRI trigger-physio computer connection #15

Open
tsalo opened this issue Jul 28, 2020 · 5 comments
Open

Direct MRI trigger-physio computer connection #15

tsalo opened this issue Jul 28, 2020 · 5 comments
Labels
technology-request Tools and hardware for the CIS

Comments

@tsalo
Copy link
Member

tsalo commented Jul 28, 2020

Technology name

Perhaps the best name would be a T-splitter (plus a custom circuit to slow down the trigger signal).

Link to website

Unknown, but I do know that we need to get the T-splitter, the custom circuit to slow down the trigger signal, and perhaps some cords, from Siemens.

Cost information

Unknown

Funding source

The CIS

Additional information (optional)

We currently get trigger information (i.e., scan timing) into the BioPac indirectly from our task scripts. This adds a small, but variable, delay in the trigger signal, and is often corrupted by failed triggers, crashed tasks, etc. Moreover, apparently the direct setup proposed here provides more detailed information, including the exact timing of individual pulses from the scanner.

According to Dr. Cesar Caballero-Gaudes (not @ ing him on purpose), BCBL has the proposed setup, so he may be able to help us figure out the exact configuration and what to ask for from Siemens.

Pinging @ericamusser.

Requesters

@tsalo

@tsalo tsalo added the technology-request Tools and hardware for the CIS label Jul 28, 2020
@ericamusser
Copy link

ericamusser commented Jul 28, 2020 via email

@ericamusser
Copy link

ericamusser commented Jul 28, 2020 via email

@tsalo
Copy link
Member Author

tsalo commented Jul 29, 2022

Here's a schematic of the setup we have been discussing. I just wanted to post it for posterity.
image

@mattfeld
Copy link
Member

mattfeld commented Aug 8, 2022 via email

@tsalo
Copy link
Member Author

tsalo commented Aug 8, 2022

Hi @mattfeld! Rob and @ericamusser are working on getting it set up for an upcoming pilot. I believe they still need to get the TTL pulse duration converter built/bought, although @ericamusser probably knows more than I do.

The current recommendation is to use tasks to send the trigger signal from the task computer to the BioPac box. We used this approach in a PsychoPy math task we have on GitHub.

  1. Initialize the serial port that goes to the BioPac computer after adding subject/session information, but before starting the scanner: https://github.com/NBCLab/arithmetic-task/blob/0678a577b9773f69df23e662a8764800594782cb/arithmetic_task.py#L148-L149
  2. Reset the BioPac signal: https://github.com/NBCLab/arithmetic-task/blob/0678a577b9773f69df23e662a8764800594782cb/arithmetic_task.py#L341-L343
  3. As soon as the scanner sends its trigger pulse at the start of the scan, send a trigger signal from the task script to the serial port: https://github.com/NBCLab/arithmetic-task/blob/0678a577b9773f69df23e662a8764800594782cb/arithmetic_task.py#L350-L352
  4. At the end of each run, turn off the trigger signal: https://github.com/NBCLab/arithmetic-task/blob/0678a577b9773f69df23e662a8764800594782cb/arithmetic_task.py#L575-L576
  5. At the end of the overall task, close the serial port: https://github.com/NBCLab/arithmetic-task/blob/0678a577b9773f69df23e662a8764800594782cb/arithmetic_task.py#L581-L583

This approach requires you to keep a single BioPac recording going for the whole scan session. I believe there is the possibility of BioPac timing out after like an hour, so you may need to use a custom graph template that doesn't time out so quickly. There are also some instructions in the FIU-CIS wiki.

This approach has several drawbacks, though. I'll try to enumerate them here:

  1. With block-like trigger signals (i.e., on for the duration of the run, off for the rest), instead of the waveform triggers you get when you have a direct scanner-BioPac connection, you lose some temporal resolution.
  2. There will be a very small delay by relaying through the task, which I believe is slightly longer than any delay from the direct connection. It may not be noticeable though.
  3. The tasks sometimes don't successfully send the "on" or "off" signal, so we (@62442katieb and myself) ended up having to write custom code to identify each run from the physio data using the trigger signal and the scan DICOMs, with wiggle room for missing trigger blocks.
  4. This is not a common setup, and other folks (e.g., the physiopy dev team) seem to use the direct connection setup instead, so getting help with wrangling the outputs will be harder. That said, our custom code for synchronizing the trigger blocks and the scan data in BIDS format seems to have worked quite well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
technology-request Tools and hardware for the CIS
Projects
None yet
Development

No branches or pull requests

3 participants