-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Hello PhysIO Development Team,
First, thank you for developing and maintaining this incredibly useful toolbox.
To give an overview, our physiological signals are recorded in one continuous run, while fMRI sequences are parsed into several runs. Therefore, I am attempting to use the PhysIO toolbox to both time-align the physio & MRI modalities, as well as to convert these to BIDS format. However, I am running into a persistent issue with the BIDS conversion, which appears to be related to the file parsing stage, with different errors occurring depending on the input file type.
Setup
• Scanner & sequence: Siemens 3 T (VB17), multi‑echo EPI (3 echoes/TR), multiband = 2
• ECG, Pulse-oximetry, Respiration data: Manual recording via Telnet MPCU (continuous across several fMRI blocks)
• Software: TAPAS Version 6.0.1, PhysIO Version 9.0, MATLAB R2020b, SPM12 r6685, Windows 10 (Virtual Desktop)
Context:
I initially faced issues related to MATLAB path conflicts between a new TAPAS installation and an older, bundled PhysIO version within a server-based SPM installation. To eliminate these environmental factors, I have since created a clean, local setup by installing the latest versions of both SPM12 and the TAPAS toolbox in my local Documents\MATLAB folder. The errors described below are from this clean, local setup.
Problem Description
When I run a script to perform BIDS conversion using tapas_physio, the process fails with one of two errors, depending on whether I use a .puls or .ecg file for the cardiac data.
Scenario 1: Using .puls and .resp files
The job fails with an "Index exceeds the number of array elements" error. This suggests the file parser is reading a line but failing to extract any data, resulting in an empty array.
Error Log:
29-Sep-2025 11:30:19 - Failed 'TAPAS PhysIO Toolbox'
Index exceeds the number of array elements. Index must not exceed 0.
In file "C:\Users\seo\Documents\MATLAB\spm\toolbox\PhysIO\readin\tapas_physio_siemens_line2table.m", function "tapas_physio_siemens_line2table" at line 71.
In file "C:\Users\seo\Documents\MATLAB\spm\toolbox\PhysIO\readin\tapas_physio_read_physlogfiles_siemens.m", function "tapas_physio_read_physlogfiles_siemens" at line 197.
In file "C:\Users\seo\Documents\MATLAB\spm\toolbox\PhysIO\readin\tapas_physio_read_physlogfiles.m", function "tapas_physio_read_physlogfiles" at line 92.
In file "C:\Users\seo\Documents\MATLAB\spm\toolbox\PhysIO\tapas_physio_main_create_regressors.m", function "tapas_physio_main_create_regressors" at line 138.
In file "C:\Users\seo\Documents\MATLAB\spm\toolbox\PhysIO\tapas_physio_cfg_matlabbatch.m", function "run_physio" at line 1666.
Scenario 2: Using .ecg and .resp files
When I swap the .puls file for the corresponding .ecg file (from the same session), the error changes to a size mismatch error. This "off-by-one" error suggests a subtle difference in how the .ecg file is being parsed compared to the .puls file.
Error Log:
29-Sep-2025 13:34:50 - Failed 'TAPAS PhysIO Toolbox'
Unable to perform assignment because the size of the left side is 918491-by-1 and the size of the right side is 918490-by-1.
In file "C:\Users\seo\Documents\MATLAB\spm\toolbox\PhysIO\readin\tapas_physio_siemens_line2table.m", function "tapas_physio_siemens_line2table" at line 165.
In file "C:\Users\seo\Documents\MATLAB\spm\toolbox\PhysIO\readin\tapas_physio_read_physlogfiles_siemens.m", function "tapas_physio_read_physlogfiles_siemens" at line 197.
In file "C:\Users\seo\Documents\MATLAB\spm\toolbox\PhysIO\readin\tapas_physio_read_physlogfiles.m", function "tapas_physio_read_physlogfiles" at line 92.
In file "C:\Users\seo\Documents\MATLAB\spm\toolbox\PhysIO\tapas_physio_main_create_regressors.m", function "tapas_physio_main_create_regressors" at line 138.
In file "C:\Users\seo\Documents\MATLAB\spm\toolbox\PhysIO\tapas_physio_cfg_matlabbatch.m", function "run_physio" at line 1666.
The following modules did not run:
Failed: TAPAS PhysIO Toolbox
Warning: An error occurred during processing.
Error using MATLABbatch system
Job execution failed. The full log of this run can be found in MATLAB command window, starting
with the lines (look for the line showing the exact #job as displayed in this error message)
Summary & Question
Both errors point towards an issue within the Siemens log file reader. My current guess is that my specific log files may have a subtle formatting anomaly that the parser is not robust to.
Could you please provide any guidance on:
Whether these are known issues with certain Siemens scanner log files (e.g., a software version issue)?
What specific formatting issues should I look for within the raw .puls, .resp, and .ecg files?
Would there be any known work-arounds to debug this file-reading process to get the BIDS conversion working?
Thank you for your time and assistance.
Best,
Angela Seo
In case, it is helpful, I am attaching the following:
- A screenshot of the first and last lines of the .puls file opened as txt
- A screenshot of the first and last lines of the .ecg file opened as txt
