From b0c56b91c3afb5ae2a46c31628c66c9f3c71cdaf Mon Sep 17 00:00:00 2001 From: oesteban Date: Sun, 19 Aug 2018 20:27:20 -0700 Subject: [PATCH 1/2] [FIX] Calculate relative path with sessions --- mriqc/interfaces/bids.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mriqc/interfaces/bids.py b/mriqc/interfaces/bids.py index e8e54cb9b..61fca4ced 100644 --- a/mriqc/interfaces/bids.py +++ b/mriqc/interfaces/bids.py @@ -57,7 +57,7 @@ def _run_interface(self, runtime): # Crawl back to the BIDS root path = Path(self.inputs.in_file) - for i in range(1, 3): + for i in range(1, 4): bids_root = path.parents[i] if str(bids_root).startswith('sub-'): break From fb7f731648185ac2113ffd4fa2515f6e7011e895 Mon Sep 17 00:00:00 2001 From: oesteban Date: Sun, 19 Aug 2018 20:35:17 -0700 Subject: [PATCH 2/2] full fix --- mriqc/interfaces/bids.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mriqc/interfaces/bids.py b/mriqc/interfaces/bids.py index 61fca4ced..9c415c66d 100644 --- a/mriqc/interfaces/bids.py +++ b/mriqc/interfaces/bids.py @@ -58,8 +58,8 @@ def _run_interface(self, runtime): # Crawl back to the BIDS root path = Path(self.inputs.in_file) for i in range(1, 4): - bids_root = path.parents[i] - if str(bids_root).startswith('sub-'): + if str(path.parents[i].name).startswith('sub-'): + bids_root = path.parents[i + 1] break self._results['relative_path'] = str(path.relative_to(bids_root))