From cd55bf0a953dd28668335df42a49848e6213c9b6 Mon Sep 17 00:00:00 2001 From: Stefano Moia Date: Fri, 10 Apr 2020 19:57:18 +0200 Subject: [PATCH 01/20] Start from 1 in run numeration --- phys2bids/heuristics/heur_test_acq.py | 2 +- phys2bids/heuristics/heur_tutorial.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phys2bids/heuristics/heur_test_acq.py b/phys2bids/heuristics/heur_test_acq.py index eb8ba67d1..d065451db 100644 --- a/phys2bids/heuristics/heur_test_acq.py +++ b/phys2bids/heuristics/heur_test_acq.py @@ -18,7 +18,7 @@ def heur(physinfo, name, task='', acq='', direct='', rec='', run=''): if fnmatch.fnmatchcase(physinfo, '*samefreq*'): task = 'test' - run = '00' + run = '01' rec = 'biopac' elif physinfo == 'Example': task = 'rest' diff --git a/phys2bids/heuristics/heur_tutorial.py b/phys2bids/heuristics/heur_tutorial.py index e4fad14e7..4a6855444 100644 --- a/phys2bids/heuristics/heur_tutorial.py +++ b/phys2bids/heuristics/heur_tutorial.py @@ -18,7 +18,7 @@ def heur(physinfo, name, task='', acq='', direct='', rec='', run=''): if fnmatch.fnmatchcase(physinfo, '*tutorial*'): task = 'test' - run = '00' + run = '01' rec = 'labchart' elif physinfo == 'Example': task = 'rest' From 38a7142b69875007630014b7bf06fa06c7ee8ca6 Mon Sep 17 00:00:00 2001 From: Stefano Moia Date: Fri, 10 Apr 2020 20:00:05 +0200 Subject: [PATCH 02/20] Delete heur_ex and heur --- phys2bids/heuristics/heur.py | 73 --------------------------------- phys2bids/heuristics/heur_ex.py | 57 ------------------------- 2 files changed, 130 deletions(-) delete mode 100644 phys2bids/heuristics/heur.py delete mode 100644 phys2bids/heuristics/heur_ex.py diff --git a/phys2bids/heuristics/heur.py b/phys2bids/heuristics/heur.py deleted file mode 100644 index 0091a0b1f..000000000 --- a/phys2bids/heuristics/heur.py +++ /dev/null @@ -1,73 +0,0 @@ -# import sys -import fnmatch - - -def heur(physinfo, name, task='', acq='', direct='', rec='', run=''): - # ############################## # - # ## Modify here! ## # - # ## ## # - # ## Possible variables are: ## # - # ## -task (required) ## # - # ## -run ## # - # ## -rec ## # - # ## -acq ## # - # ## -direct ## # - # ## ## # - # ## ## # - # ## See example below ## # - # ############################## # - - if physinfo == 'origfilename1': - task = 'newname1' - elif physinfo == 'origfilename2': - task = 'newname2' - run = 'runnum' - elif physinfo == 'BH4': - task = 'breathhold' - elif fnmatch.fnmatchcase(physinfo, 'MOTOR?'): - task = 'motor' - elif fnmatch.fnmatchcase(physinfo, 'LOCALIZER?'): - task = 'pinel' - elif fnmatch.fnmatchcase(physinfo, 'SIMON?'): - task = 'simon' - elif physinfo == 'RS1': - task = 'rest' - run = '01' - elif physinfo == 'RS2': - task = 'rest' - run = '02' - elif physinfo == 'RS3': - task = 'rest' - run = '03' - elif physinfo == 'RS4': - task = 'rest' - run = '04' - # ############################## # - # ## Don't modify below this! ## # - # ############################## # - else: - # #!# Transform sys.exit in debug warnings or raiseexceptions! - # #!# Make all of the above a dictionary - raise Warning(f'The heuristic {__file__} could not deal with {physinfo}') - - if not task: - raise KeyError(f'No "task" attribute found') - - name = name + '_task-' + task - - # filename spec: sub-