One thing I hate is heisenbugs. One recent one is that some of the triggers being sent by E-prime to our EEG systems have been incorrect. For instance, the first four triggers should be 1, 5, 6, 2. But in two of the last five participants, they've been 1, 5, 7, 3. There are no methods that I know of that would lead E-prime to send anything other that the trigger codes that I provide it. No changes were made to the E-prime program, and I confirmed that the timing files generated by E-prime show that the correct codes should have been sent. I dug in a little more, and…
-
-
Python Image2PDF
While running participants, we use multi-page logs (e.g. arrival time, researchers present, start time of each run of each task). After a session is over, we scan these to save on the server for easy reference later. However, with the most recent round of computer upgrades, the scanner functionality has decreased. Specifically, saving multiple images to a single PDF no longer works. Opening multiple image files is a pain, so I wanted to find a quick way to convert the combine the images into a PDF. My solution was to use the img2pdf package and some Python3 code. The script I came up with does 4 things: Read in all…
-
Utilities: Python and xjView reports
I use xjView to visualize statistical maps most of the time. One reason why, is that it's report function generates a lot of useful information, including not only the peak MNI coordinates and peak intensity, but also a breakdown of the number of voxels within each cluster than within specific AAL labels (is that parahippocampal or amgydala?). I also use these reports when I need to generate tables for manuscripts. The processes isn't overly elegant, but it's functional: Load the stats image. Generate the xjView report. Paste the report from the MATLAB command window into a *.txt document. Convert the *.txt document into a comma-separated table. Open the CSV tables…