Skip to content

Commit

Permalink
[ENH][SCHEMA] Allow .bval and .bvec files for pepolar fmaps (bids-sta…
Browse files Browse the repository at this point in the history
…ndard#1754)

* add epi.bval, epi.bvec

* update contributors.md

* add lines for sentence

Co-authored-by: Taylor Salo <[email protected]>

* update preprocessed_data.yaml

* override for m0scan

* Update src/schema/rules/files/deriv/preprocessed_data.yaml

Co-authored-by: Taylor Salo <[email protected]>

* Whitespace and table pipes

* remove ref

* Add EPI-with-b[val|vec] suffix checks.

* Add EPI+bval check.

* Remove Latin phrase.

* Update src/schema/rules/checks/fmap.yaml

Co-authored-by: Chris Markiewicz <[email protected]>

* Change max to min.

* Address review.

* Bump schema version.

---------

Co-authored-by: Taylor Salo <[email protected]>
Co-authored-by: Taylor Salo <[email protected]>
Co-authored-by: Chris Markiewicz <[email protected]>
  • Loading branch information
4 people authored Apr 24, 2024
1 parent 5ed9030 commit b5fd938
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1254,6 +1254,7 @@ EPI scans with different phase encoding directions to estimate the distortion
map corresponding to the nonuniformities of the *B<sub>0</sub>* field.
These `*_epi.nii[.gz]` - or `*_m0scan.nii[.gz]` for arterial spin labeling perfusion data - files can be 3D or 4D --
in the latter case, all timepoints share the same scanning parameters.
Some 4D scans intended for correcting DWIs may have accompanying `*_epi.bval` and `*_epi.bvec` files.
Examples of software tools using these kinds of images are FSL TOPUP and
AFNI `3dqwarp`.

Expand Down
2 changes: 1 addition & 1 deletion src/schema/SCHEMA_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.8.1-dev
0.8.2-dev
4 changes: 2 additions & 2 deletions src/schema/meta/associations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ magnitude1:

bval:
selectors:
- suffix == 'dwi'
- intersects([suffix], ['dwi', 'epi'])
- match(extension, '\.nii(\.gz)?$')
target:
extension: .bval
inherit: true

bvec:
selectors:
- suffix == 'dwi'
- intersects([suffix], ['dwi', 'epi'])
- match(extension, '\.nii(\.gz)?$')
target:
extension: .bvec
Expand Down
5 changes: 5 additions & 0 deletions src/schema/meta/context.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@ context:
n_rows:
description: 'Number of rows in bval file'
type: integer
values:
description: 'B-values contained in bval file'
type: array
items:
type: number
bvec:
description: 'B vector file'
type: object
Expand Down
6 changes: 3 additions & 3 deletions src/schema/rules/checks/dwi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DWIVolumeCount:
associated '.bvec' and '.bval' files.
level: error
selectors:
- suffix == "dwi"
- intersects([suffix], ["dwi", "epi"])
- '"bval" in associations'
- '"bvec" in associations'
- type(nifti_header) != "null"
Expand All @@ -25,7 +25,7 @@ DWIBvalRows:
'.bval' files should contain exactly one row of values.
level: error
selectors:
- suffix == "dwi"
- intersects([suffix], ["dwi", "epi"])
- '"bval" in associations'
checks:
- associations.bval.n_rows == 1
Expand All @@ -38,7 +38,7 @@ DWIBvecRows:
'.bvec' files should contain exactly three rows of values.
level: error
selectors:
- suffix == "dwi"
- intersects([suffix], ["dwi", "epi"])
- '"bvec" in associations'
checks:
- associations.bvec.n_rows == 3
Expand Down
13 changes: 13 additions & 0 deletions src/schema/rules/checks/fmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,16 @@ MagnitudeFileWithTooManyDimensions:
- nifti_header != null
checks:
- nifti_header.dim[0] == 3

EPISmallBVals:
issue:
code: EPI_WITH_BVALS_NEEDS_SMALL_BVALS
message: |
EPI field maps with b-values should include small (b<100) values.
level: error
selectors:
- datatype == "fmap"
- suffix == "epi"
- '"bval" in associations'
checks:
- min(associations.bval.values) < 100
7 changes: 7 additions & 0 deletions src/schema/rules/files/deriv/preprocessed_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ fmap_pepolar_common:
space: optional
description: optional

fmap_pepolar_m0scan:
$ref: rules.files.raw.fmap.pepolar_m0scan
entities:
$ref: rules.files.raw.fmap.pepolar.entities
space: optional
description: optional

fmap_TB1DAM_common:
$ref: rules.files.raw.fmap.TB1DAM
entities:
Expand Down
20 changes: 20 additions & 0 deletions src/schema/rules/files/raw/fmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,26 @@ fieldmaps:
pepolar:
suffixes:
- epi
extensions:
- .nii.gz
- .nii
- .json
- .bval
- .bvec
datatypes:
- fmap
entities:
subject: required
session: optional
acquisition: optional
ceagent: optional
direction: required
run: optional
part: optional
chunk: optional

pepolar_m0scan:
suffixes:
- m0scan
extensions:
- .nii.gz
Expand Down

0 comments on commit b5fd938

Please sign in to comment.