-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX: Re-add cohort identifier to template name (#416)
* FIX: Re-add cohort identifier to template name * FIX: XFM io * FIX: Query data with nipreps config Also rename variables to play nice with pdb * TST: Add test for derivatives ingestion * PIN: niworkflows latest * MAINT: Update ruff settings * STY: ruff fixes * TST: Ensure config is string * Apply suggestions from code review Co-authored-by: Chris Markiewicz <effigies@gmail.com> --------- Co-authored-by: Chris Markiewicz <effigies@gmail.com>
- Loading branch information
Showing
7 changed files
with
183 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from niworkflows.data import Loader | ||
|
||
load_data = Loader(__package__) | ||
|
||
DERIV_SKELETON = load_data('derivatives.yml') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
dataset_description: | ||
Name: smriprep-outputs | ||
BIDSVersion: 1.9.0 | ||
DatasetType: derivative | ||
'01': | ||
anat: | ||
- suffix: mask | ||
desc: brain | ||
- suffix: T1w | ||
desc: preproc | ||
- suffix: dseg | ||
- suffix: probseg | ||
label: CSF | ||
- suffix: probseg | ||
label: GM | ||
- suffix: probseg | ||
label: WM | ||
- suffix: xfm | ||
from: MNI152NLin2009cAsym | ||
to: T1w | ||
mode: image | ||
extension: .h5 | ||
- suffix: xfm | ||
from: T1w | ||
to: MNI152NLin2009cAsym | ||
mode: image | ||
extension: .h5 | ||
- suffix: xfm | ||
from: T1w | ||
to: MNIPediatricAsym+3 | ||
mode: image | ||
extension: .h5 | ||
- suffix: xfm | ||
from: MNIPediatricAsym+3 | ||
to: T1w | ||
mode: image | ||
extension: .h5 | ||
- suffix: white | ||
hemi: L | ||
extension: .surf.gii | ||
- suffix: white | ||
hemi: R | ||
extension: .surf.gii | ||
- suffix: pial | ||
hemi: L | ||
extension: .surf.gii | ||
- suffix: pial | ||
hemi: R | ||
extension: .surf.gii | ||
- suffix: midthickness | ||
hemi: L | ||
extension: .surf.gii | ||
- suffix: midthickness | ||
hemi: R | ||
extension: .surf.gii | ||
- suffix: sphere | ||
hemi: L | ||
extension: .surf.gii | ||
- suffix: sphere | ||
hemi: R | ||
extension: .surf.gii | ||
- suffix: sphere | ||
hemi: L | ||
desc: reg | ||
extension: .surf.gii | ||
- suffix: sphere | ||
hemi: R | ||
desc: reg | ||
extension: .surf.gii | ||
- suffix: sphere | ||
hemi: L | ||
space: fsLR | ||
desc: reg | ||
extension: .surf.gii | ||
- suffix: sphere | ||
hemi: R | ||
space: fsLR | ||
desc: reg | ||
extension: .surf.gii | ||
- suffix: sphere | ||
hemi: L | ||
space: fsLR | ||
desc: msmsulc | ||
extension: .surf.gii | ||
- suffix: sphere | ||
hemi: R | ||
space: fsLR | ||
desc: msmsulc | ||
extension: .surf.gii | ||
- suffix: thickness | ||
hemi: L | ||
extension: .shape.gii | ||
- suffix: thickness | ||
hemi: R | ||
extension: .shape.gii | ||
- suffix: sulc | ||
hemi: L | ||
extension: .shape.gii | ||
- suffix: sulc | ||
hemi: R | ||
extension: .shape.gii |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from niworkflows.utils.testing import generate_bids_skeleton | ||
|
||
from ..bids import collect_derivatives | ||
from . import DERIV_SKELETON | ||
|
||
|
||
def test_collect_derivatives(tmp_path): | ||
deriv_dir = tmp_path / 'derivatives' | ||
generate_bids_skeleton(deriv_dir, str(DERIV_SKELETON)) | ||
output_spaces = ['MNI152NLin2009cAsym', 'MNIPediatricAsym:cohort-3'] | ||
collected = collect_derivatives(deriv_dir, '01', output_spaces) | ||
for suffix in ('preproc', 'mask', 'dseg'): | ||
assert collected[f't1w_{suffix}'] | ||
assert len(collected['t1w_tpms']) == 3 | ||
xfms = collected['transforms'] | ||
for space in output_spaces: | ||
assert xfms[space]['reverse'] | ||
assert xfms[space]['forward'] | ||
for surface in ( | ||
'white', | ||
'pial', | ||
'midthickness', | ||
'sphere', | ||
'thickness', | ||
'sulc', | ||
'sphere_reg', | ||
'sphere_reg_fsLR', | ||
'sphere_reg_msm', | ||
): | ||
assert len(collected[surface]) == 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters