-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref+tst: some refactoring, intial testing
- Loading branch information
Showing
4 changed files
with
128 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import os | ||
|
||
def create_key(template, outtype=('nii.gz',), annotation_classes=None): | ||
if template is None or not template: | ||
raise ValueError('Template must be a valid format string') | ||
return template, outtype, annotation_classes | ||
|
||
def infotodict(seqinfo): | ||
"""Heuristic evaluator for determining which runs belong where | ||
allowed template fields - follow python string module: | ||
item: index within category | ||
subject: participant id | ||
seqitem: run number during scanning | ||
subindex: sub index within group | ||
""" | ||
bold = create_key('sub-{subject}/func/sub-{subject}_task-test_run-{item}_bold') | ||
|
||
info = {bold: []} | ||
for s in seqinfo: | ||
if '_ME_' in s.series_description: | ||
info[bold].append(s.series_id) | ||
return info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters