Skip to content

Commit

Permalink
Merge pull request #742 from oesteban/fix/session-output-dir
Browse files Browse the repository at this point in the history
[FIX] Calculate relative path with sessions
  • Loading branch information
oesteban authored Aug 20, 2018
2 parents 7123c58 + fb7f731 commit d5752fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mriqc/interfaces/bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ def _run_interface(self, runtime):

# Crawl back to the BIDS root
path = Path(self.inputs.in_file)
for i in range(1, 3):
bids_root = path.parents[i]
if str(bids_root).startswith('sub-'):
for i in range(1, 4):
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))
Expand Down

0 comments on commit d5752fa

Please sign in to comment.