Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] Encode mutually exclusive extensions in schema with sub-lists #1492

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
3c72014
group extension
Remi-Gau May 18, 2023
13eabdd
add comment
Remi-Gau May 18, 2023
d3594e7
put all extension for data in list
Remi-Gau May 18, 2023
b0d5dd5
rename some funtions
Remi-Gau May 20, 2023
160b9c5
minor fixes
Remi-Gau May 20, 2023
1eb0f63
fx rendering
Remi-Gau May 20, 2023
bcf5ebc
attempt at fixing rules
Remi-Gau May 20, 2023
9708eb3
properly combine extensions
Remi-Gau May 20, 2023
e4b2922
add doc
Remi-Gau May 20, 2023
f28d3c2
import annotation for backward compatibility
Remi-Gau May 20, 2023
cd1da9d
add type hints
Remi-Gau May 20, 2023
0b05f28
Merge remote-tracking branch 'upstream/master' into one_extension
effigies May 26, 2023
341f7ae
RF: Fix extension list combination, remove some indirection
effigies May 29, 2023
d8e3ec6
update README
Remi-Gau May 29, 2023
e383905
TEST: Fix rendering tests
effigies May 31, 2023
a8bd1c3
RF: Convert extensions to lists-of-lists-of-strings
effigies May 30, 2023
586cd18
FIX: .mhd files are actually .raw.mhd
effigies May 31, 2023
d7e3f89
Merge remote-tracking branch 'upstream/master' into one_extension
effigies Jun 6, 2023
1fbb60b
MNT: Bump schema minor version to mark change to structure
effigies Jun 6, 2023
f693273
Merge branch 'master' into one_extension
effigies Jun 28, 2023
0d291c9
Merge branch 'master' into one_extension
effigies Jul 2, 2023
53c4fd3
Update src/schema/rules/files/raw/photo.yaml
Remi-Gau Jul 3, 2023
da67b35
remove digitizer
Remi-Gau Aug 10, 2023
6c092d8
fix some failing tests
Remi-Gau Aug 10, 2023
2ba8439
Merge branch 'master' into one_extension
effigies Aug 8, 2024
f297c30
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 8, 2024
3958ac0
fix: Adapt to extensions being list[list[str]]
effigies Aug 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/appendices/meg-file-formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ A guide for using macros can be found at
"sub-control01_ses-001_task-rest_run-01_meg": "",
"sub-control01_ses-001_task-rest_run-01_meg.json": "",
"sub-control01_ses-001_task-rest_run-01_channels.tsv": "",
"sub-control01_ses-001_task-rest[_acq-<label>]_run-01_markers.<mrk,sqd>": "",
"sub-control01_ses-001_task-rest_run-01_meg.<con,sqd>": "",
"sub-control01_ses-001_task-rest[_acq-<label>]_run-01_markers.<mrk|sqd>": "",
"sub-control01_ses-001_task-rest_run-01_meg.<con|sqd>": "",
},
},
},
Expand Down
4 changes: 4 additions & 0 deletions src/schema/objects/suffixes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,10 @@ defacemask:
description: |
A binary mask that was used to remove facial features from an anatomical MRI
image.
digitizer:
value: digitizer
display_name: Digitizer
description: Digitized positions of the head points.
Remi-Gau marked this conversation as resolved.
Show resolved Hide resolved
dseg:
value: dseg
display_name: Discrete Segmentation
Expand Down
5 changes: 1 addition & 4 deletions src/schema/rules/files/common/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ README:
level: recommended
stem: README
extensions:
- ''
- .md
- .rst
- .txt
- ['', .md, .rst, .txt]
CHANGES:
level: optional
path: CHANGES
Expand Down
12 changes: 4 additions & 8 deletions src/schema/rules/files/deriv/imaging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ anat_parametric_discrete_segmentation:
density: optional
description: optional
extensions:
- .nii.gz
- .nii
- [.nii.gz, .nii]
- .json
- .tsv

Expand All @@ -110,8 +109,7 @@ anat_nonparametric_discrete_segmentation:
density: optional
description: optional
extensions:
- .nii.gz
- .nii
- [.nii.gz, .nii]
- .json
- .tsv

Expand Down Expand Up @@ -190,8 +188,7 @@ anat_parametic_discrete_surface:
suffixes:
- dseg
extensions:
- .label.gii
- .dlabel.nii
- [.label.gii, .dlabel.nii]
- .json
- .tsv
entities:
Expand All @@ -207,8 +204,7 @@ anat_nonparametic_discrete_surface:
suffixes:
- dseg
extensions:
- .label.gii
- .dlabel.nii
- [.label.gii, .dlabel.nii]
- .json
- .tsv
entities:
Expand Down
27 changes: 9 additions & 18 deletions src/schema/rules/files/raw/anat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ nonparametric:
- FLASH # deprecated
- PD # deprecated
extensions:
- .nii.gz
- .nii
- [.nii.gz, .nii]
- .json
datatypes:
- anat
Expand Down Expand Up @@ -48,8 +47,7 @@ parametric:
- S0map
- M0map
extensions:
- .nii.gz
- .nii
- [.nii.gz, .nii]
- .json
datatypes:
- anat
Expand All @@ -66,8 +64,7 @@ defacemask:
suffixes:
- defacemask
extensions:
- .nii.gz
- .nii
- [.nii.gz, .nii]
- .json
datatypes:
- anat
Expand All @@ -86,8 +83,7 @@ multiecho:
- MESE
- MEGRE
extensions:
- .nii.gz
- .nii
- [.nii.gz, .nii]
- .json
datatypes:
- anat
Expand All @@ -106,8 +102,7 @@ multiflip:
suffixes:
- VFA
extensions:
- .nii.gz
- .nii
- [.nii.gz, .nii]
- .json
datatypes:
- anat
Expand All @@ -127,8 +122,7 @@ multiinversion:
suffixes:
- IRT1
extensions:
- .nii.gz
- .nii
- [.nii.gz, .nii]
- .json
datatypes:
- anat
Expand All @@ -147,8 +141,7 @@ mp2rage:
suffixes:
- MP2RAGE
extensions:
- .nii.gz
- .nii
- [.nii.gz, .nii]
- .json
datatypes:
- anat
Expand All @@ -170,8 +163,7 @@ vfamt:
- MPM
- MTS
extensions:
- .nii.gz
- .nii
- [.nii.gz, .nii]
- .json
datatypes:
- anat
Expand All @@ -192,8 +184,7 @@ mtr:
suffixes:
- MTR
extensions:
- .nii.gz
- .nii
- [.nii.gz, .nii]
- .json
datatypes:
- anat
Expand Down
6 changes: 2 additions & 4 deletions src/schema/rules/files/raw/dwi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ dwi:
suffixes:
- dwi
extensions:
- .nii.gz
- .nii
- [.nii.gz, .nii]
- .json
- .bvec
- .bval
Expand All @@ -23,8 +22,7 @@ sbref:
suffixes:
- sbref
extensions:
- .nii.gz
- .nii
- [.nii.gz, .nii]
- .json
datatypes:
- dwi
Expand Down
7 changes: 3 additions & 4 deletions src/schema/rules/files/raw/eeg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ eeg:
- eeg
extensions:
- .json
- .edf
- [.bdf, .edf, .eeg, .set]
# .vhdr, .vmrk, .eeg must work as triplet
- .vhdr
- .vmrk
- .eeg
- .set
# .set file with an OPTIONAL .fdt
- .fdt
- .bdf
datatypes:
- eeg
entities:
Expand Down
21 changes: 7 additions & 14 deletions src/schema/rules/files/raw/fmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ fieldmaps:
- magnitude
- fieldmap
extensions:
- .nii.gz
- .nii
- [.nii.gz, .nii]
- .json
datatypes:
- fmap
Expand All @@ -25,8 +24,7 @@ pepolar:
- epi
- m0scan
extensions:
- .nii.gz
- .nii
- [.nii.gz, .nii]
- .json
datatypes:
- fmap
Expand All @@ -42,8 +40,7 @@ TB1DAM:
suffixes:
- TB1DAM
extensions:
- .nii.gz
- .nii
- [.nii.gz, .nii]
- .json
datatypes:
- fmap
Expand All @@ -62,8 +59,7 @@ TB1EPI:
suffixes:
- TB1EPI
extensions:
- .nii.gz
- .nii
- [.nii.gz, .nii]
- .json
datatypes:
- fmap
Expand All @@ -86,8 +82,7 @@ RFFieldMaps:
- TB1RFM
- RB1COR
extensions:
- .nii.gz
- .nii
- [.nii.gz, .nii]
- .json
datatypes:
- fmap
Expand All @@ -107,8 +102,7 @@ TB1SRGE:
suffixes:
- TB1SRGE
extensions:
- .nii.gz
- .nii
- [.nii.gz, .nii]
- .json
datatypes:
- fmap
Expand All @@ -129,8 +123,7 @@ parametric:
- TB1map
- RB1map
extensions:
- .nii.gz
- .nii
- [.nii.gz, .nii]
- .json
datatypes:
- fmap
Expand Down
6 changes: 2 additions & 4 deletions src/schema/rules/files/raw/func.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ func:
- cbv
- sbref
extensions:
- .nii.gz
- .nii
- [.nii.gz, .nii]
- .json
datatypes:
- func
Expand All @@ -26,8 +25,7 @@ phase:
suffixes:
- phase # deprecated
extensions:
- .nii.gz
- .nii
- [.nii.gz, .nii]
- .json
datatypes:
- func
Expand Down
8 changes: 3 additions & 5 deletions src/schema/rules/files/raw/ieeg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ ieeg:
suffixes:
- ieeg
extensions:
- .mefd/
- [.nwb, .edf, .mefd/, .eeg, .set]
- .json
- .edf
# .vhdr, .vmrk, .eeg must work as triplet
- .vhdr
- .eeg
- .vmrk
- .set
# .set file with an OPTIONAL .fdt
- .fdt
- .nwb
datatypes:
- ieeg
entities:
Expand Down
40 changes: 25 additions & 15 deletions src/schema/rules/files/raw/meg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,31 @@ meg:
suffixes:
- meg
extensions:
- / # corresponds to BTi/4D data
- .ds/
- .json
- .fif
- .sqd
- .con
- .raw
- .ave
- .mrk
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.mrk seems to only exist for markers suffix

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, some context in this thread: #638 (comment) and in particular this reponse (i.e., why .mrk is only for the markers suffix, but .sqd can also be used for the brain data): #653 (comment)

- .kdf
- .mhd
effigies marked this conversation as resolved.
Show resolved Hide resolved
- .trg
# / corresponds to BTi/4D data
- [/, .ds/, .fif, .sqd, .con, .raw, .kdf]
- .ave # mentioned once in the appendix
# .raw and .raw.mhd work as a pair
- .raw.mhd
# .kdf with possible additional files .chn, .trg and _digitizer.txt (see other suffix group below)
- .chn
- .trg
datatypes:
- meg
entities:
subject: required
session: optional
task: required
acquisition: optional
run: optional
processing: optional
split: optional

headpoints:
suffixes:
- digitizer
extensions:
- .txt
datatypes:
- meg
entities:
Expand Down Expand Up @@ -61,8 +73,7 @@ headshape:
suffixes:
- headshape
extensions:
- .*
- .pos
- [.*, .pos]
datatypes:
- meg
entities:
Expand All @@ -74,8 +85,7 @@ markers:
suffixes:
- markers
extensions:
- .sqd
- .mrk
- [.sqd, .mrk]
datatypes:
- meg
entities:
Expand Down
6 changes: 1 addition & 5 deletions src/schema/rules/files/raw/micr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ microscopy:
- OCT
- SPIM
extensions:
- .ome.tif
- .ome.btf
- .ome.zarr/
- .png
- .tif
- [.ome.tif, .ome.btf, .ome.zarr/, .png, .tif]
- .json
datatypes:
- micr
Expand Down
3 changes: 1 addition & 2 deletions src/schema/rules/files/raw/perf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ asl:
- asl
- m0scan
extensions:
- .nii.gz
- .nii
- [.nii.gz, .nii]
- .json
datatypes:
- perf
Expand Down
Loading