Skip to content

[BUG] bids.diagnostic does not properly handle "trial_type_col" argument #745

@kacross

Description

@kacross

Is there an existing issue for this?

  • I have searched the existing issues

Operating system

  • Linux
  • Mac
  • Windows

Operating system version

- Windows 10 Enterprise Version 22H2 OS build 19045.5131

Platform

  • MATLAB
  • Octave

Platform version

- MATLAB 2023a

bids-matlab version

v0.1.0

branch / commit number

Expected Behavior

bids.diagnostic(mybids,'trial_type_col','type')

Use the column "type" to create a diagnostic events table

Current Behavior

Uses the default column "trial_type" even though a trial_type_col argument is provided.

Error message

Warning: Escaped character '\C' is not valid. See 'doc sprintf' for supported special characters. 
> In bids.internal.error_handling (line 51)
In bids.internal.list_all_trial_types (line 101)
In bids.internal.list_events (line 70)
In bids.diagnostic (line 177) 
Warning:
No "trial_type" column found in files:
	- D: 
> In bids.internal.error_handling (line 60)
In bids.internal.list_all_trial_types (line 101)
In bids.internal.list_events (line 70)
In bids.diagnostic (line 177)

Anything else?

I believe this is because the list_events.m does not pass the "trial_type_col" argument to the list_all_trial_types call on line 67:

current line 67 in list_events.m
trial_type_list = bids.internal.list_all_trial_types(BIDS, task, ...
'tolerant', true, 'verbose', true);

should be:
trial_type_list = bids.internal.list_all_trial_types(BIDS, task, ...
'trial_type_col', trial_type_col,...
'tolerant', true, 'verbose', true);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions