From 721e7288366200545c10fd9d9f860541a0a014e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Victor=20F=C3=A9rat?= Date: Mon, 7 Aug 2023 19:01:32 +0200 Subject: [PATCH] Added deriv_root argument to CLI (#773) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Richard Höchenberger --- docs/source/v1.5.md.inc | 1 + mne_bids_pipeline/_main.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/docs/source/v1.5.md.inc b/docs/source/v1.5.md.inc index 234232028..af661698d 100644 --- a/docs/source/v1.5.md.inc +++ b/docs/source/v1.5.md.inc @@ -2,6 +2,7 @@ ### :new: New features & enhancements +- Added `deriv_root` argument to CLI (#773 by @vferat) - Added support for annotating bad segments based on head movement velocity (#757 by @larsoner) - Added examples of T1 and FLASH BEM to website (#758 by @larsoner) - Added support for extended SSS (eSSS) in Maxwell filtering (#762 by @larsoner) diff --git a/mne_bids_pipeline/_main.py b/mne_bids_pipeline/_main.py index cd9ee1037..9489a2cca 100755 --- a/mne_bids_pipeline/_main.py +++ b/mne_bids_pipeline/_main.py @@ -59,6 +59,18 @@ def main(): default=None, help="BIDS root directory of the data to process.", ) + parser.add_argument( + "--deriv_root", + dest="deriv_root", + default=None, + help=dedent( + """\ + The root of the derivatives directory + in which the pipeline will store the processing results. + If unspecified, this will be derivatives/mne-bids-pipeline + inside the BIDS root.""" + ), + ), parser.add_argument( "--subject", dest="subject", default=None, help="The subject to process." ) @@ -115,6 +127,7 @@ def main(): ) steps = options.steps root_dir = options.root_dir + deriv_root = options.deriv_root subject, session = options.subject, options.session task, run = options.task, options.run n_jobs = options.n_jobs @@ -148,6 +161,10 @@ def main(): overrides = SimpleNamespace() if root_dir: overrides.bids_root = pathlib.Path(root_dir).expanduser().resolve(strict=True) + if deriv_root: + overrides.deriv_root = ( + pathlib.Path(deriv_root).expanduser().resolve(strict=False) + ) if subject: overrides.subjects = [subject] if session: