Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi-Gau committed Jul 13, 2024
1 parent 193c3f3 commit 61aa65f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/run_tests_octave.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
name: tests and coverage with octave

env:
OCTFLAGS: --no-gui --no-window-system --silent

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -18,7 +21,7 @@ on:
workflow_dispatch:

jobs:
tests_matlab:
tests_octave:
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -66,7 +69,6 @@ jobs:
octave $OCTFLAGS --eval "addpath(fullfile(pwd, 'tests', 'utils')); savepath();"
octave $OCTFLAGS --eval "cd(fullfile(getenv('GITHUB_WORKSPACE'), '.github', 'workflows')); run tests_matlab;"
- name: Code coverage
uses: codecov/codecov-action@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tests_matlab.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
addpath(fullfile(root_dir, 'MOcov', 'MOcov'));

cd(fullfile(root_dir, 'MOxUnit', 'MOxUnit'));
pwd;
run moxunit_set_path();

cd(fullfile(root_dir));
Expand Down
13 changes: 11 additions & 2 deletions src/atlas/extractRoiFromAtlas.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
args = inputParser;

addRequired(args, 'outputDir', isChar);
addRequired(args, 'atlasName', @(x) isAKnownAtlas(x));
addRequired(args, 'atlasName');
addRequired(args, 'roiName', isChar);
addRequired(args, 'hemisphere', @(x) ismember(x, {'L', 'R'}));
addRequired(args, 'hemisphere');

parse(args, varargin{:});

Expand All @@ -50,6 +50,15 @@
roiName = args.Results.roiName;
hemisphere = args.Results.hemisphere;

if ~ismember(hemisphere, {'L', 'R'})
msg = sprintf('"hemisphere must be "L" or "R"": %s\nGot: "%s"', ...
hemisphere);
bids.internal.error_handling(mfilename(), ...
'invalidHemisphere', msg, false);
end

isAKnownAtlas(atlasName);

[atlasFile, lut] = getAtlasAndLut(atlasName);

switch lower(atlasName)
Expand Down

0 comments on commit 61aa65f

Please sign in to comment.