From bea0640871a408cbf2a1e83129bd5c4d373b04ed Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sat, 13 Jul 2024 18:49:52 +0200 Subject: [PATCH] [FIX] run test create roi octave (#1285) * run test create roi octave * fix several tests in cpp roi * reset submod * update CPP_ROI * fix default path output create roi * fix typo --- lib/CPP_ROI | 2 +- src/bidspm/bidspm.py | 2 +- src/workflows/roi/bidsCreateROI.m | 2 +- .../tests_cli/test_bidspm_create_roi.m | 26 +++++-------------- 4 files changed, 9 insertions(+), 23 deletions(-) diff --git a/lib/CPP_ROI b/lib/CPP_ROI index 4b4f7f2b5..b3cd28214 160000 --- a/lib/CPP_ROI +++ b/lib/CPP_ROI @@ -1 +1 @@ -Subproject commit 4b4f7f2b5614fc2b30d807a2e05b73baa2a34c0f +Subproject commit b3cd28214430e33dc4f3c1ad32a1ba325a711a9c diff --git a/src/bidspm/bidspm.py b/src/bidspm/bidspm.py index 62fd4e6f2..d591db9ce 100755 --- a/src/bidspm/bidspm.py +++ b/src/bidspm/bidspm.py @@ -186,7 +186,7 @@ def create_roi( ) -> str: roi_name = "{ '" + "', '".join(roi_name) + "' }" if roi_name is not None else None # type: ignore if roi_dir is None: - roi_dir = Path() + roi_dir = output_dir cmd = generate_cmd( bids_dir=bids_dir, diff --git a/src/workflows/roi/bidsCreateROI.m b/src/workflows/roi/bidsCreateROI.m index 6ba1bf998..f7cb9f0a9 100644 --- a/src/workflows/roi/bidsCreateROI.m +++ b/src/workflows/roi/bidsCreateROI.m @@ -14,7 +14,7 @@ function bidsCreateROI(opt) % opt.roi.atlas = 'wang'; % opt.roi.hemi = {'L', 'R'}; % opt.roi.name = {'V1v', 'V1d'}; - % opt.roi.space = {'IXI549Space''}; + % opt.roi.space = {'IXI549Space'}; % % bidsCreateROI(opt); % diff --git a/tests/tests_slow/tests_cli/test_bidspm_create_roi.m b/tests/tests_slow/tests_cli/test_bidspm_create_roi.m index 039b41405..7bca3de11 100644 --- a/tests/tests_slow/tests_cli/test_bidspm_create_roi.m +++ b/tests/tests_slow/tests_cli/test_bidspm_create_roi.m @@ -13,10 +13,6 @@ function test_bidsCreateROI_boilerplate_only() markTestAs('slow'); - if bids.internal.is_octave - moxunit_throw_test_skipped_exception('Need bug fix in CPP ROI extractRoiFromAtlas.'); - end - outputPath = tempName(); bidspm(pwd, outputPath, ... @@ -40,10 +36,6 @@ function test_bidsCreateROI_glasser() markTestAs('slow'); - if bids.internal.is_octave - moxunit_throw_test_skipped_exception('Need bug fix in CPP ROI extractRoiFromAtlas.'); - end - outputPath = tempName(); bidspm(pwd, outputPath, ... @@ -54,6 +46,12 @@ function test_bidsCreateROI_glasser() 'space', {'IXI549Space'}, ... 'verbosity', 3); + assert(exist(fullfile(outputPath, ... + 'derivatives', ... + 'bidspm-roi', ... + 'reports', ... + 'create_roi_atlas-glasser_citation.md'), 'file') == 2); + rois = spm_select('FPList', fullfile(outputPath, ... 'derivatives', ... 'bidspm-roi', 'group'), '.*glasser.*_mask\.nii'); @@ -65,10 +63,6 @@ function test_bidsCreateROI_wang() markTestAs('slow'); - if bids.internal.is_octave - moxunit_throw_test_skipped_exception('Need bug fix in CPP ROI extractRoiFromAtlas.'); - end - outputPath = tempName(); bidspm(pwd, outputPath, ... @@ -90,10 +84,6 @@ function test_bidsCreateROI_neuromorphometrics() markTestAs('slow'); - if bids.internal.is_octave - moxunit_throw_test_skipped_exception('Need bug fix in CPP ROI extractRoiFromAtlas.'); - end - outputPath = tempName(); bidspm(pwd, outputPath, ... @@ -133,10 +123,6 @@ function test_bidsCreateROI_one_hemisphere() markTestAs('slow'); - if bids.internal.is_octave - moxunit_throw_test_skipped_exception('Need bug fix in CPP ROI extractRoiFromAtlas.'); - end - outputPath = tempName(); bidspm(pwd, outputPath, 'subject', ...