Skip to content

Commit

Permalink
fix finding modality for some files
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi-Gau committed Apr 9, 2024
1 parent 5cca412 commit a4fef1e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion +bids/File.m
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,11 @@
obj.path = args.Results.input;
end
f_struct = bids.internal.parse_filename(args.Results.input);
obj.modality = obj.get_modality(f_struct.entities);

obj.modality = '';
if isfield(f_struct, 'entities')
obj.modality = obj.get_modality(f_struct.entities);
end
elseif isstruct(args.Results.input)
f_struct = args.Results.input;
end
Expand Down
6 changes: 6 additions & 0 deletions tests/test_bids_file.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@

end

function test_no_entity

bf = bids.File(fullfile(pwd, 'con_0001.niii'));

end

function test_participants

pth_bids_example = get_test_data_dir();
Expand Down

0 comments on commit a4fef1e

Please sign in to comment.