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] Allow .bval and .bvec files for pepolar fmaps #1754

Merged
merged 17 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
effigies marked this conversation as resolved.
Show resolved Hide resolved
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