Skip to content

Commit

Permalink
Fixed issue with category exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Alexander committed Dec 4, 2023
1 parent c2ddd49 commit 115e102
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion data_functions/bidsFilename.m
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@
if ~folderOnly
bids.directory = sprintf('%1$sderivatives\\%2$s\\sub-%3$s\\',bids.directory,cfg.category,bids.sub);
else
bids.directory = sprintf('%1$sderivatives\\sub-%3$s\\',bids.directory,bids.sub);
if (~isfield(cfg,'category') || isempty(cfg.category))
bids.directory = sprintf('%1$sderivatives\\sub-%2$s\\',bids.directory,bids.sub);
else
bids.directory = sprintf('%1$sderivatives\\%2$s\\sub-%3$s\\',bids.directory,cfg.category,bids.sub);
end
end

% Check that directory exists with the derivative folder
Expand Down

0 comments on commit 115e102

Please sign in to comment.