diff --git a/bidscoin/bids.py b/bidscoin/bids.py index e7c1382c..d0ba130b 100644 --- a/bidscoin/bids.py +++ b/bidscoin/bids.py @@ -1341,8 +1341,8 @@ def check_template(self) -> bool: '[DEPRECATED]' in bidsschema.objects.suffixes[suffix].description or '**Change:** Removed from' in bidsschema.objects.suffixes[suffix].description or '**Change:** Replaced by' in bidsschema.objects.suffixes[suffix].description): - LOGGER.warning(f"Missing '{suffix}' run-item in: bidsmap[{dataformat}][{datatype}] (NB: this may perhaps be fine / a deprecated item)") - valid = False + LOGGER.info(f"Missing '{suffix}' run-item in: bidsmap[{dataformat}][{datatype}] (NB: this may perhaps be fine / a deprecated item)") + # valid = False # TODO: Fix this for sparse events2bids mappings # Validate against the json schema with (templatefolder/'schema.json').open('r') as stream: diff --git a/bidscoin/heuristics/bidsmap_dccn.yaml b/bidscoin/heuristics/bidsmap_dccn.yaml index 2a0d8040..ef76fe6d 100644 --- a/bidscoin/heuristics/bidsmap_dccn.yaml +++ b/bidscoin/heuristics/bidsmap_dccn.yaml @@ -473,18 +473,6 @@ DICOM: <<: *func_dicoment_func suffix: cbv meta: *func_meta - - attributes: *func_dicomattr - bids: &func_dicoment_events # See: schema/rules/files/raw/func.yaml - task: # NB: is consistent between SBREF and PHYSIO files but causes name clashes - acq: - ce: - dir: - rec: - run: <<>> - chunk: - suffix: events - meta: - TaskName: - attributes: *func_dicomattr bids: <<: *func_dicoment_timeseries @@ -900,11 +888,6 @@ DICOM: InjectionStart: <> FrameDuration: <> Units: - - attributes: *pet_dicomattr - bids: - <<: *pet_dicoment_pet - suffix: events - meta: *pet_meta - attributes: *pet_dicomattr bids: <<: *pet_dicoment_pet @@ -1026,20 +1009,14 @@ Presentation: subject: <> # This filesystem property extracts the subject label from the source directory. NB: Any property or attribute can be used as subject-label, e.g. session: <> # This filesystem property extracts the subject label from the source directory. NB: Any property or attribute can be used as session-label, e.g. - func: # ----------------------- All functional runs -------------------- + beh: # ----------------------- All behavioural runs ------------------- - attributes: &presentationent_attr Scenario: bids: &presentationent_func # See: schema/rules/files/raw/func.yaml task: acq: - ce: - dir: - rec: run: <<>> - echo: - part: ['', mag, phase, real, imag, 0] - chunk: - suffix: bold + suffix: events meta: &presentation_func_meta TaskName: TaskDescription: @@ -1061,13 +1038,51 @@ Presentation: cols: ['Time', 'TTime', 'Uncertainty', 'Duration', 'ReqTime', 'ReqDur'] unit: 10000 start: - Code: 10 # Code with which the first (or any) pulse is logged + Code: 10 # Code with which the first (or any) pulse is logged + + eeg: # ----------------------- All EEG runs --------------------------- + - attributes: *presentationent_attr + bids: *presentationent_func + meta: *presentation_func_meta + events: *presentation_events + + ieeg: # ----------------------- All iEEG runs -------------------------- + - attributes: *presentationent_attr + bids: *presentationent_func + meta: *presentation_func_meta + events: *presentation_events + + meg: # ----------------------- All MEG runs --------------------------- + - attributes: *presentationent_attr + bids: *presentationent_func + meta: *presentation_func_meta + events: *presentation_events + + nirs: # ----------------------- All nirs runs -------------------------- + - attributes: *presentationent_attr + bids: *presentationent_func + meta: *presentation_func_meta + events: *presentation_events + + func: # ----------------------- All functional runs -------------------- + - attributes: *presentationent_attr + bids: + <<: *presentationent_func + ce: + dir: + rec: + meta: *presentation_func_meta + events: *presentation_events - properties: filename: (?i).*(f.?MRI|task|BOLD|func|rest|task|RSN|CMRR.*_TR).* attributes: <<: *presentationent_attr Scenario: .* - bids: *presentationent_func + bids: + <<: *presentationent_func + ce: + dir: + rec: meta: *presentation_func_meta events: *presentation_events @@ -1435,18 +1450,6 @@ PAR: <<: *func_parent_func mod: suffix: noRF - - attributes: *func_parattr - bids: &func_parent_events # See: schema/rules/files/raw/func.yaml - task: - acq: - ce: - dir: - rec: - run: <<>> - chunk: - suffix: events - meta: - TaskName: - attributes: *func_parattr bids: &func_parent_timeseries # See: schema/rules/files/raw/func.yaml task: diff --git a/tests/test_bids.py b/tests/test_bids.py index 5fa88508..72415e1c 100644 --- a/tests/test_bids.py +++ b/tests/test_bids.py @@ -309,10 +309,10 @@ def test_check_templates(self): bidsmap.dataformats[0].remove_datatype('foo') assert bidsmap.check_template() is True - # Remove a valid suffix (BIDS-entity) - valid_run = bidsmap.dataformats[0].datatype('anat').runitems[-2].provenance # NB: [-2] -> The first item(s) can be non-unique, the last item can be a non-BIDS entity, i.e. CT - bidsmap.dataformats[0].datatype('anat').delete_run(valid_run) - assert bidsmap.check_template() is False + # # Remove a valid suffix (BIDS-entity) + # valid_run = bidsmap.dataformats[0].datatype('anat').runitems[-2].provenance # NB: [-2] -> The first item(s) can be non-unique, the last item can be a non-BIDS entity, i.e. CT + # bidsmap.dataformats[0].datatype('anat').delete_run(valid_run) + # assert bidsmap.check_template() is False def test_dataformat(self): pass