Provide data in all spaces for AOMIC datasets #405

Merged
fraimondo merged 5 commits from enh/aomic_native_all into main 2024-11-29 14:24:16 +00:00
11 changed files with 477 additions and 228 deletions

View file

@ -0,0 +1 @@
``native_t1w`` parameter has been replaced with ``space`` to allow :class:`.DataladAOMICID1000`, :class:`.DataladAOMICPIOP1` and :class:`.DataladAOMICPIOP2` to fetch data in all available spaces by `Fede Raimondo`_

View file

@ -0,0 +1 @@
Update :class:`.DataladAOMICID1000`, :class:`.DataladAOMICPIOP1` and :class:`.DataladAOMICPIOP2` to fetch data in all available spaces by `Fede Raimondo`_

View file

@ -11,6 +11,7 @@ from pathlib import Path
from typing import Union
from ...api.decorators import register_datagrabber
from ...utils import raise_error
from ..pattern_datalad import PatternDataladDataGrabber
@ -31,8 +32,8 @@ class DataladAOMICID1000(PatternDataladDataGrabber):
"FreeSurfer"} or list of the options, optional
AOMIC data types. If None, all available data types are selected.
(default None).
native_t1w : bool, optional
Whether to use T1w in native space (default False).
space : {"native", "MNI152NLin2009cAsym"}, optional
The space to use for the data (default "MNI152NLin2009cAsym").
"""
@ -40,25 +41,40 @@ class DataladAOMICID1000(PatternDataladDataGrabber):
self,
datadir: Union[str, Path, None] = None,
types: Union[str, list[str], None] = None,
native_t1w: bool = False,
space: str = "MNI152NLin2009cAsym",
) -> None:
valid_spaces = ["native", "MNI152NLin2009cAsym"]
if space not in ["native", "MNI152NLin2009cAsym"]:
raise_error(
f"Invalid space {space}. Must be one of {valid_spaces}"
)
# Descriptor for space in `anat`
sp_anat_desc = (
"" if space == "native" else "space-MNI152NLin2009cAsym_"
)
# Descriptor for space in `func`
sp_func_desc = (
"space-T1w_" if space == "native" else "space-MNI152NLin2009cAsym_"
)
# The patterns
patterns = {
"BOLD": {
"pattern": (
"derivatives/fmriprep/{subject}/func/"
"{subject}_task-moviewatching_"
"space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz"
f"{sp_func_desc}"
"desc-preproc_bold.nii.gz"
),
"space": "MNI152NLin2009cAsym",
"space": space,
"mask": {
"pattern": (
"derivatives/fmriprep/{subject}/func/"
"{subject}_task-moviewatching_"
"space-MNI152NLin2009cAsym_"
f"{sp_func_desc}"
"desc-brain_mask.nii.gz"
),
"space": "MNI152NLin2009cAsym",
"space": space,
},
"confounds": {
"pattern": (
@ -68,46 +84,59 @@ class DataladAOMICID1000(PatternDataladDataGrabber):
),
"format": "fmriprep",
},
"reference": {
"pattern": (
"derivatives/fmriprep/{subject}/func/"
"{subject}_task-moviewatching_"
f"{sp_func_desc}"
"boldref.nii.gz"
),
},
},
"T1w": {
"pattern": (
"derivatives/fmriprep/{subject}/anat/"
"{subject}_space-MNI152NLin2009cAsym_"
"{subject}_"
f"{sp_anat_desc}"
"desc-preproc_T1w.nii.gz"
),
"space": "MNI152NLin2009cAsym",
"space": space,
"mask": {
"pattern": (
"derivatives/fmriprep/{subject}/anat/"
"{subject}_space-MNI152NLin2009cAsym_"
"{subject}_"
f"{sp_anat_desc}"
"desc-brain_mask.nii.gz"
),
"space": "MNI152NLin2009cAsym",
"space": space,
},
},
"VBM_CSF": {
"pattern": (
"derivatives/fmriprep/{subject}/anat/"
"{subject}_space-MNI152NLin2009cAsym_label-"
"CSF_probseg.nii.gz"
"{subject}_"
f"{sp_anat_desc}"
"label-CSF_probseg.nii.gz"
),
"space": "MNI152NLin2009cAsym",
"space": space,
},
"VBM_GM": {
"pattern": (
"derivatives/fmriprep/{subject}/anat/"
"{subject}_space-MNI152NLin2009cAsym_label-"
"GM_probseg.nii.gz"
"{subject}_"
f"{sp_anat_desc}"
"label-GM_probseg.nii.gz"
),
"space": "MNI152NLin2009cAsym",
"space": space,
},
"VBM_WM": {
"pattern": (
"derivatives/fmriprep/{subject}/anat/"
"{subject}_space-MNI152NLin2009cAsym_label-"
"WM_probseg.nii.gz"
"{subject}_"
f"{sp_anat_desc}"
"label-WM_probseg.nii.gz"
),
"space": "MNI152NLin2009cAsym",
"space": space,
},
"DWI": {
"pattern": (
@ -148,27 +177,6 @@ class DataladAOMICID1000(PatternDataladDataGrabber):
)
},
},
}
# Use native T1w assets
self.native_t1w = False
if native_t1w:
self.native_t1w = True
patterns.update(
{
"T1w": {
"pattern": (
"derivatives/fmriprep/{subject}/anat/"
"{subject}_desc-preproc_T1w.nii.gz"
),
"space": "native",
"mask": {
"pattern": (
"derivatives/fmriprep/{subject}/anat/"
"{subject}_desc-brain_mask.nii.gz"
),
"space": "native",
},
},
"Warp": [
{
"pattern": (
@ -192,7 +200,15 @@ class DataladAOMICID1000(PatternDataladDataGrabber):
},
],
}
)
if space == "native":
patterns["BOLD"]["prewarp_space"] = "MNI152NLin2009cAsym"
else:
patterns["BOLD"]["prewarp_space"] = "native"
# Use native T1w assets
self.space = space
# Set default types
if types is None:
types = list(patterns.keys())

View file

@ -37,8 +37,8 @@ class DataladAOMICPIOP1(PatternDataladDataGrabber):
"gstroop", "workingmemory"} or list of the options, optional
AOMIC PIOP1 task sessions. If None, all available task sessions are
selected (default None).
native_t1w : bool, optional
Whether to use T1w in native space (default False).
space : {"native", "MNI152NLin2009cAsym"}, optional
The space to use for the data (default "MNI152NLin2009cAsym").
Raises
------
@ -52,8 +52,13 @@ class DataladAOMICPIOP1(PatternDataladDataGrabber):
datadir: Union[str, Path, None] = None,
types: Union[str, list[str], None] = None,
tasks: Union[str, list[str], None] = None,
native_t1w: bool = False,
space: str = "MNI152NLin2009cAsym",
) -> None:
valid_spaces = ["native", "MNI152NLin2009cAsym"]
if space not in ["native", "MNI152NLin2009cAsym"]:
raise_error(
f"Invalid space {space}. Must be one of {valid_spaces}"
)
# Declare all tasks
all_tasks = [
"restingstate",
@ -78,22 +83,32 @@ class DataladAOMICPIOP1(PatternDataladDataGrabber):
" dataset!"
)
self.tasks = tasks
# Descriptor for space in `anat`
sp_anat_desc = (
"" if space == "native" else "space-MNI152NLin2009cAsym_"
)
# Descriptor for space in `func`
sp_func_desc = (
"space-T1w_" if space == "native" else "space-MNI152NLin2009cAsym_"
)
# The patterns
patterns = {
"BOLD": {
"pattern": (
"derivatives/fmriprep/{subject}/func/"
"{subject}_task-{task}_"
"space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz"
f"{sp_func_desc}"
"desc-preproc_bold.nii.gz"
),
"space": "MNI152NLin2009cAsym",
"space": space,
"mask": {
"pattern": (
"derivatives/fmriprep/{subject}/func/"
"{subject}_task-{task}_"
"space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz"
f"{sp_func_desc}"
"desc-brain_mask.nii.gz"
),
"space": "MNI152NLin2009cAsym",
"space": space,
},
"confounds": {
"pattern": (
@ -103,46 +118,59 @@ class DataladAOMICPIOP1(PatternDataladDataGrabber):
),
"format": "fmriprep",
},
"reference": {
"pattern": (
"derivatives/fmriprep/{subject}/func/"
"{subject}_task-{task}_"
f"{sp_func_desc}"
"boldref.nii.gz"
),
},
},
"T1w": {
"pattern": (
"derivatives/fmriprep/{subject}/anat/"
"{subject}_space-MNI152NLin2009cAsym_"
"{subject}_"
f"{sp_anat_desc}"
"desc-preproc_T1w.nii.gz"
),
"space": "MNI152NLin2009cAsym",
"space": space,
"mask": {
"pattern": (
"derivatives/fmriprep/{subject}/anat/"
"{subject}_space-MNI152NLin2009cAsym_"
"{subject}_"
f"{sp_anat_desc}"
"desc-brain_mask.nii.gz"
),
"space": "MNI152NLin2009cAsym",
"space": space,
},
},
"VBM_CSF": {
"pattern": (
"derivatives/fmriprep/{subject}/anat/"
"{subject}_space-MNI152NLin2009cAsym_label-"
"CSF_probseg.nii.gz"
"{subject}_"
f"{sp_anat_desc}"
"label-CSF_probseg.nii.gz"
),
"space": "MNI152NLin2009cAsym",
"space": space,
},
"VBM_GM": {
"pattern": (
"derivatives/fmriprep/{subject}/anat/"
"{subject}_space-MNI152NLin2009cAsym_label-"
"GM_probseg.nii.gz"
"{subject}_"
f"{sp_anat_desc}"
"label-GM_probseg.nii.gz"
),
"space": "MNI152NLin2009cAsym",
"space": space,
},
"VBM_WM": {
"pattern": (
"derivatives/fmriprep/{subject}/anat/"
"{subject}_space-MNI152NLin2009cAsym_label-"
"WM_probseg.nii.gz"
"{subject}_"
f"{sp_anat_desc}"
"label-WM_probseg.nii.gz"
),
"space": "MNI152NLin2009cAsym",
"space": space,
},
"DWI": {
"pattern": (
@ -183,27 +211,6 @@ class DataladAOMICPIOP1(PatternDataladDataGrabber):
)
},
},
}
# Use native T1w assets
self.native_t1w = False
if native_t1w:
self.native_t1w = True
patterns.update(
{
"T1w": {
"pattern": (
"derivatives/fmriprep/{subject}/anat/"
"{subject}_desc-preproc_T1w.nii.gz"
),
"space": "native",
"mask": {
"pattern": (
"derivatives/fmriprep/{subject}/anat/"
"{subject}_desc-brain_mask.nii.gz"
),
"space": "native",
},
},
"Warp": [
{
"pattern": (
@ -227,7 +234,15 @@ class DataladAOMICPIOP1(PatternDataladDataGrabber):
},
],
}
)
if space == "native":
patterns["BOLD"]["prewarp_space"] = "MNI152NLin2009cAsym"
else:
patterns["BOLD"]["prewarp_space"] = "native"
# Use native T1w assets
self.space = space
# Set default types
if types is None:
types = list(patterns.keys())

View file

@ -37,8 +37,8 @@ class DataladAOMICPIOP2(PatternDataladDataGrabber):
list of the options, optional
AOMIC PIOP2 task sessions. If None, all available task sessions are
selected (default None).
native_t1w : bool, optional
Whether to use T1w in native space (default False).
space : {"native", "MNI152NLin2009cAsym"}, optional
The space to use for the data (default "MNI152NLin2009cAsym").
Raises
------
@ -52,8 +52,13 @@ class DataladAOMICPIOP2(PatternDataladDataGrabber):
datadir: Union[str, Path, None] = None,
types: Union[str, list[str], None] = None,
tasks: Union[str, list[str], None] = None,
native_t1w: bool = False,
space: str = "MNI152NLin2009cAsym",
) -> None:
valid_spaces = ["native", "MNI152NLin2009cAsym"]
if space not in ["native", "MNI152NLin2009cAsym"]:
raise_error(
f"Invalid space {space}. Must be one of {valid_spaces}"
)
# Declare all tasks
all_tasks = [
"restingstate",
@ -76,22 +81,32 @@ class DataladAOMICPIOP2(PatternDataladDataGrabber):
" dataset!"
)
self.tasks = tasks
# Descriptor for space in `anat`
sp_anat_desc = (
"" if space == "native" else "space-MNI152NLin2009cAsym_"
)
# Descriptor for space in `func`
sp_func_desc = (
"space-T1w_" if space == "native" else "space-MNI152NLin2009cAsym_"
)
# The patterns
patterns = {
"BOLD": {
"pattern": (
"derivatives/fmriprep/{subject}/func/"
"{subject}_task-{task}_"
"space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz"
f"{sp_func_desc}"
"desc-preproc_bold.nii.gz"
),
"space": "MNI152NLin2009cAsym",
"space": space,
"mask": {
"pattern": (
"derivatives/fmriprep/{subject}/func/"
"{subject}_task-{task}_"
"space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz"
f"{sp_func_desc}"
"desc-brain_mask.nii.gz"
),
"space": "MNI152NLin2009cAsym",
"space": space,
},
"confounds": {
"pattern": (
@ -101,46 +116,59 @@ class DataladAOMICPIOP2(PatternDataladDataGrabber):
),
"format": "fmriprep",
},
"reference": {
"pattern": (
"derivatives/fmriprep/{subject}/func/"
"{subject}_task-{task}_"
f"{sp_func_desc}"
"boldref.nii.gz"
),
},
},
"T1w": {
"pattern": (
"derivatives/fmriprep/{subject}/anat/"
"{subject}_space-MNI152NLin2009cAsym_"
"{subject}_"
f"{sp_anat_desc}"
"desc-preproc_T1w.nii.gz"
),
"space": "MNI152NLin2009cAsym",
"space": space,
"mask": {
"pattern": (
"derivatives/fmriprep/{subject}/anat/"
"{subject}_space-MNI152NLin2009cAsym_"
"{subject}_"
f"{sp_anat_desc}"
"desc-brain_mask.nii.gz"
),
"space": "MNI152NLin2009cAsym",
"space": space,
},
},
"VBM_CSF": {
"pattern": (
"derivatives/fmriprep/{subject}/anat/"
"{subject}_space-MNI152NLin2009cAsym_label-"
"CSF_probseg.nii.gz"
"{subject}_"
f"{sp_anat_desc}"
"label-CSF_probseg.nii.gz"
),
"space": "MNI152NLin2009cAsym",
"space": space,
},
"VBM_GM": {
"pattern": (
"derivatives/fmriprep/{subject}/anat/"
"{subject}_space-MNI152NLin2009cAsym_label-"
"GM_probseg.nii.gz"
"{subject}_"
f"{sp_anat_desc}"
"label-GM_probseg.nii.gz"
),
"space": "MNI152NLin2009cAsym",
"space": space,
},
"VBM_WM": {
"pattern": (
"derivatives/fmriprep/{subject}/anat/"
"{subject}_space-MNI152NLin2009cAsym_label-"
"WM_probseg.nii.gz"
"{subject}_"
f"{sp_anat_desc}"
"label-WM_probseg.nii.gz"
),
"space": "MNI152NLin2009cAsym",
"space": space,
},
"DWI": {
"pattern": (
@ -181,27 +209,6 @@ class DataladAOMICPIOP2(PatternDataladDataGrabber):
)
},
},
}
# Use native T1w assets
self.native_t1w = False
if native_t1w:
self.native_t1w = True
patterns.update(
{
"T1w": {
"pattern": (
"derivatives/fmriprep/{subject}/anat/"
"{subject}_desc-preproc_T1w.nii.gz"
),
"space": "native",
"mask": {
"pattern": (
"derivatives/fmriprep/{subject}/anat/"
"{subject}_desc-brain_mask.nii.gz"
),
"space": "native",
},
},
"Warp": [
{
"pattern": (
@ -225,7 +232,15 @@ class DataladAOMICPIOP2(PatternDataladDataGrabber):
},
],
}
)
if space == "native":
patterns["BOLD"]["prewarp_space"] = "MNI152NLin2009cAsym"
else:
patterns["BOLD"]["prewarp_space"] = "native"
# Use native T1w assets
self.space = space
# Set default types
if types is None:
types = list(patterns.keys())

View file

@ -18,20 +18,25 @@ URI = "https://gin.g-node.org/juaml/datalad-example-aomic1000"
@pytest.mark.parametrize(
"type_, nested_types",
"type_, nested_types, space",
[
("BOLD", ["confounds", "mask"]),
("T1w", ["mask"]),
("VBM_CSF", None),
("VBM_GM", None),
("VBM_WM", None),
("DWI", None),
("FreeSurfer", None),
("BOLD", ["confounds", "mask", "reference"], "MNI152NLin2009cAsym"),
("BOLD", ["confounds", "mask", "reference"], "native"),
("T1w", ["mask"], "MNI152NLin2009cAsym"),
("T1w", ["mask"], "native"),
("VBM_CSF", None, "MNI152NLin2009cAsym"),
("VBM_CSF", None, "native"),
("VBM_GM", None, "MNI152NLin2009cAsym"),
("VBM_GM", None, "native"),
("VBM_WM", None, "MNI152NLin2009cAsym"),
("DWI", None, "MNI152NLin2009cAsym"),
("FreeSurfer", None, "MNI152NLin2009cAsym"),
],
)
def test_DataladAOMICID1000(
type_: str,
nested_types: Optional[list[str]],
space: str,
) -> None:
"""Test DataladAOMICID1000 DataGrabber.
@ -41,9 +46,11 @@ def test_DataladAOMICID1000(
The parametrized type.
nested_types : list of str or None
The parametrized nested types.
space: str
The parametrized space.
"""
dg = DataladAOMICID1000(types=type_)
dg = DataladAOMICID1000(types=type_, space=space)
# Set URI to Gin
dg.uri = URI

View file

@ -18,30 +18,62 @@ URI = "https://gin.g-node.org/juaml/datalad-example-aomicpiop1"
@pytest.mark.parametrize(
"type_, nested_types, tasks",
"type_, nested_types, tasks, space",
[
("BOLD", ["confounds", "mask"], None),
("BOLD", ["confounds", "mask"], ["anticipation"]),
("BOLD", ["confounds", "mask"], ["emomatching", "faces"]),
("BOLD", ["confounds", "mask"], ["restingstate"]),
("BOLD", ["confounds", "mask"], ["workingmemory", "gstroop"]),
(
"BOLD",
["confounds", "mask"],
["anticipation", "faces", "restingstate"],
["confounds", "mask", "reference"],
None,
"MNI152NLin2009cAsym",
),
("T1w", ["mask"], None),
("VBM_CSF", None, None),
("VBM_GM", None, None),
("VBM_WM", None, None),
("DWI", None, None),
("FreeSurfer", None, None),
("BOLD", ["confounds", "mask", "reference"], None, "native"),
(
"BOLD",
["confounds", "mask", "reference"],
["anticipation"],
"MNI152NLin2009cAsym",
),
(
"BOLD",
["confounds", "mask", "reference"],
["emomatching", "faces"],
"MNI152NLin2009cAsym",
),
(
"BOLD",
["confounds", "mask", "reference"],
["restingstate"],
"MNI152NLin2009cAsym",
),
(
"BOLD",
["confounds", "mask", "reference"],
["workingmemory", "gstroop"],
"MNI152NLin2009cAsym",
),
(
"BOLD",
["confounds", "mask", "reference"],
["anticipation", "faces", "restingstate"],
"MNI152NLin2009cAsym",
),
("T1w", ["mask"], None, "MNI152NLin2009cAsym"),
("T1w", ["mask"], None, "native"),
("VBM_CSF", None, None, "MNI152NLin2009cAsym"),
("VBM_CSF", None, None, "native"),
("VBM_GM", None, None, "MNI152NLin2009cAsym"),
("VBM_GM", None, None, "native"),
("VBM_WM", None, None, "MNI152NLin2009cAsym"),
("VBM_WM", None, None, "native"),
("DWI", None, None, "MNI152NLin2009cAsym"),
("FreeSurfer", None, None, "MNI152NLin2009cAsym"),
],
)
def test_DataladAOMICPIOP1(
type_: str,
nested_types: Optional[list[str]],
tasks: Optional[list[str]],
space: str,
) -> None:
"""Test DataladAOMICPIOP1 DataGrabber.
@ -53,9 +85,11 @@ def test_DataladAOMICPIOP1(
The parametrized nested types.
tasks : list of str or None
The parametrized task values.
space: str
The parametrized space.
"""
dg = DataladAOMICPIOP1(types=type_, tasks=tasks)
dg = DataladAOMICPIOP1(types=type_, tasks=tasks, space=space)
# Set URI to Gin
dg.uri = URI

View file

@ -18,25 +18,56 @@ URI = "https://gin.g-node.org/juaml/datalad-example-aomicpiop2"
@pytest.mark.parametrize(
"type_, nested_types, tasks",
"type_, nested_types, tasks, space",
[
("BOLD", ["confounds", "mask"], None),
("BOLD", ["confounds", "mask"], ["restingstate"]),
("BOLD", ["confounds", "mask"], ["restingstate", "stopsignal"]),
("BOLD", ["confounds", "mask"], ["workingmemory", "stopsignal"]),
("BOLD", ["confounds", "mask"], ["workingmemory"]),
("T1w", ["mask"], None),
("VBM_CSF", None, None),
("VBM_GM", None, None),
("VBM_WM", None, None),
("DWI", None, None),
("FreeSurfer", None, None),
(
"BOLD",
["confounds", "mask", "reference"],
None,
"MNI152NLin2009cAsym",
),
("BOLD", ["confounds", "mask", "reference"], None, "native"),
(
"BOLD",
["confounds", "mask", "reference"],
["restingstate"],
"MNI152NLin2009cAsym",
),
(
"BOLD",
["confounds", "mask", "reference"],
["restingstate", "stopsignal"],
"MNI152NLin2009cAsym",
),
(
"BOLD",
["confounds", "mask", "reference"],
["workingmemory", "stopsignal"],
"MNI152NLin2009cAsym",
),
(
"BOLD",
["confounds", "mask", "reference"],
["workingmemory"],
"MNI152NLin2009cAsym",
),
("T1w", ["mask"], None, "MNI152NLin2009cAsym"),
("T1w", ["mask"], None, "native"),
("VBM_CSF", None, None, "MNI152NLin2009cAsym"),
("VBM_CSF", None, None, "native"),
("VBM_GM", None, None, "MNI152NLin2009cAsym"),
("VBM_GM", None, None, "native"),
("VBM_WM", None, None, "MNI152NLin2009cAsym"),
("VBM_WM", None, None, "native"),
("DWI", None, None, "MNI152NLin2009cAsym"),
("FreeSurfer", None, None, "MNI152NLin2009cAsym"),
],
)
def test_DataladAOMICPIOP2(
type_: str,
nested_types: Optional[list[str]],
tasks: Optional[list[str]],
space: str,
) -> None:
"""Test DataladAOMICPIOP2 DataGrabber.
@ -48,9 +79,11 @@ def test_DataladAOMICPIOP2(
The parametrized nested types.
tasks : list of str or None
The parametrized task values.
space: str
The parametrized space.
"""
dg = DataladAOMICPIOP2(types=type_, tasks=tasks)
dg = DataladAOMICPIOP2(types=type_, tasks=tasks, space=space)
# Set URI to Gin
dg.uri = URI

View file

@ -4,6 +4,7 @@
# Vera Komeyer <v.komeyer@fz-juelich.de>
# Xuan Li <xu.li@fz-juelich.de>
# License: AGPL
from pathlib import Path
from tempfile import TemporaryDirectory
@ -39,30 +40,70 @@ with TemporaryDirectory() as tmpdir_name:
(sub_dir / dname).mkdir()
fnames = [
# T1w native
f"anat/{t_sub}_desc-preproc_T1w.nii.gz",
# T1w MNI152NLin2009cAsym
(
f"anat/{t_sub}_space-MNI152NLin2009cAsym_desc-preproc"
"_T1w.nii.gz"
),
# T1w brain mask native
f"anat/{t_sub}_desc-brain_mask.nii.gz",
# T1w brain mask MNI152NLin2009cAsym
(
f"anat/{t_sub}_space-MNI152NLin2009cAsym_"
"desc-brain_mask.nii.gz"
),
# CSF native
f"anat/{t_sub}_label-CSF_probseg.nii.gz",
# CSF MNI152NLin2009cAsym
(
f"anat/{t_sub}_space-MNI152NLin2009cAsym_label-"
"CSF_probseg.nii.gz"
),
# GM native
f"anat/{t_sub}_label-GM_probseg.nii.gz",
# GM MNI152NLin2009cAsym
(
f"anat/{t_sub}_space-MNI152NLin2009cAsym_label-"
"GM_probseg.nii.gz"
),
# WM native
f"anat/{t_sub}_label-WM_probseg.nii.gz",
# WM MNI152NLin2009cAsym
(
f"anat/{t_sub}_space-MNI152NLin2009cAsym_label-"
"WM_probseg.nii.gz"
),
# BOLD native
(
f"func/{t_sub}_task-moviewatching_space-"
"T1w_desc-preproc_bold.nii.gz"
),
# BOLD MNI152NLin2009cAsym
(
f"func/{t_sub}_task-moviewatching_space-"
"MNI152NLin2009cAsym_desc-preproc_bold.nii.gz"
),
# BOLD brain mask native
(
f"func/{t_sub}_task-moviewatching_"
"space-T1w_desc-brain_mask.nii.gz"
),
# BOLD brain mask MNI152NLin2009cAsym
(
f"func/{t_sub}_task-moviewatching_"
"space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz"
),
(
f"func/{t_sub}_task-moviewatching_space-"
"T1w_desc-preproc_bold.json"
),
(
f"func/{t_sub}_task-moviewatching_space-"
"MNI152NLin2009cAsym_desc-preproc_bold.json"
),
# BOLD confounds
(
f"func/{t_sub}_task-moviewatching_desc-confounds"
"_regressors.tsv"
@ -71,13 +112,15 @@ with TemporaryDirectory() as tmpdir_name:
f"func/{t_sub}_task-moviewatching_desc-confounds"
"_regressors.json"
),
# BOLD reference native
(
f"func/{t_sub}_task-moviewatching_"
"space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz"
"space-T1w_boldref.nii.gz"
),
# BOLD reference MNI152NLin2009cAsym
(
f"anat/{t_sub}_space-MNI152NLin2009cAsym_"
"desc-brain_mask.nii.gz"
f"func/{t_sub}_task-moviewatching_"
"space-MNI152NLin2009cAsym_boldref.nii.gz"
),
]

View file

@ -5,6 +5,7 @@
# Xuan Li <xu.li@fz-juelich.de>
# Leonard Sasse <l.sasse@fz-juelich.de>
# License: AGPL
from pathlib import Path
from tempfile import TemporaryDirectory
@ -35,22 +36,37 @@ with TemporaryDirectory() as tmpdir_name:
(sub_dir / dname).mkdir()
fnames = [
# T1w native
f"anat/{t_sub}_desc-preproc_T1w.nii.gz",
# T1w MNI152NLin2009cAsym
(
f"anat/{t_sub}_space-MNI152NLin2009cAsym_desc-preproc"
"_T1w.nii.gz"
),
# T1w brain mask native
f"anat/{t_sub}_desc-brain_mask.nii.gz",
# T1w brain mask MNI152NLin2009cAsym
(
f"anat/{t_sub}_space-MNI152NLin2009cAsym_"
"desc-brain_mask.nii.gz"
),
# CSF native
f"anat/{t_sub}_label-CSF_probseg.nii.gz",
# CSF MNI152NLin2009cAsym
(
f"anat/{t_sub}_space-MNI152NLin2009cAsym_label-"
"CSF_probseg.nii.gz"
),
# GM native
f"anat/{t_sub}_label-GM_probseg.nii.gz",
# GM MNI152NLin2009cAsym
(
f"anat/{t_sub}_space-MNI152NLin2009cAsym_label-"
"GM_probseg.nii.gz"
),
# WM native
f"anat/{t_sub}_label-WM_probseg.nii.gz",
# WM MNI152NLin2009cAsym
(
f"anat/{t_sub}_space-MNI152NLin2009cAsym_label-"
"WM_probseg.nii.gz"
@ -66,18 +82,35 @@ with TemporaryDirectory() as tmpdir_name:
"workingmemory_acq-seq",
]
for t in tasks:
# BOLD native
fnames.append(
f"func/{t_sub}_task-{t}_space-"
"T1w_desc-preproc_bold.nii.gz"
)
# BOLD MNI152NLin2009cAsym
fnames.append(
f"func/{t_sub}_task-{t}_space-"
"MNI152NLin2009cAsym_desc-preproc_bold.nii.gz"
)
fnames.append(
f"func/{t_sub}_task-{t}_space-"
"T1w_desc-preproc_bold.json"
)
fnames.append(
f"func/{t_sub}_task-{t}_space-"
"MNI152NLin2009cAsym_desc-preproc_bold.json"
)
# BOLD brain mask native
fnames.append(
f"func/{t_sub}_task-{t}_space-"
"T1w_desc-brain_mask.nii.gz"
)
# BOLD brain mask MNI152NLin2009cAsym
fnames.append(
f"func/{t_sub}_task-{t}_space-"
"MNI152NLin2009cAsym_desc-brain_mask.nii.gz"
)
# BOLD confounds
fnames.append(
f"func/{t_sub}_task-{t}_desc-confounds"
"_regressors.tsv"
@ -86,6 +119,15 @@ with TemporaryDirectory() as tmpdir_name:
f"func/{t_sub}_task-{t}_desc-confounds"
"_regressors.json"
)
# BOLD reference native
fnames.append(
f"func/{t_sub}_task-{t}_" "space-T1w_boldref.nii.gz"
)
# BOLD reference MNI152NLin2009cAsym
fnames.append(
f"func/{t_sub}_task-{t}_"
"space-MNI152NLin2009cAsym_boldref.nii.gz"
)
elif dtype == "dwipreproc":
dname = "dwi"

View file

@ -5,6 +5,7 @@
# Xuan Li <xu.li@fz-juelich.de>
# Leonard Sasse <l.sasse@fz-juelich.de>
# License: AGPL
from pathlib import Path
from tempfile import TemporaryDirectory
@ -35,22 +36,37 @@ with TemporaryDirectory() as tmpdir_name:
(sub_dir / dname).mkdir()
fnames = [
# T1w native
f"anat/{t_sub}_desc-preproc_T1w.nii.gz",
# T1w MNI152NLin2009cAsym
(
f"anat/{t_sub}_space-MNI152NLin2009cAsym_desc-preproc"
"_T1w.nii.gz"
),
# T1w brain mask native
f"anat/{t_sub}_desc-brain_mask.nii.gz",
# T1w brain mask MNI152NLin2009cAsym
(
f"anat/{t_sub}_space-MNI152NLin2009cAsym"
"_desc-brain_mask.nii.gz"
),
# CSF native
f"anat/{t_sub}_label-CSF_probseg.nii.gz",
# CSF MNI152NLin2009cAsym
(
f"anat/{t_sub}_space-MNI152NLin2009cAsym_label-"
"CSF_probseg.nii.gz"
),
# GM native
f"anat/{t_sub}_label-GM_probseg.nii.gz",
# GM MNI152NLin2009cAsym
(
f"anat/{t_sub}_space-MNI152NLin2009cAsym_label-"
"GM_probseg.nii.gz"
),
# WM native
f"anat/{t_sub}_label-WM_probseg.nii.gz",
# WM MNI152NLin2009cAsym
(
f"anat/{t_sub}_space-MNI152NLin2009cAsym_label-"
"WM_probseg.nii.gz"
@ -64,18 +80,35 @@ with TemporaryDirectory() as tmpdir_name:
"workingmemory_acq-seq",
]
for t in tasks:
# BOLD native
fnames.append(
f"func/{t_sub}_task-{t}_space-"
"T1w_desc-preproc_bold.nii.gz"
)
# BOLD MNI152NLin2009cAsym
fnames.append(
f"func/{t_sub}_task-{t}_space-"
"MNI152NLin2009cAsym_desc-preproc_bold.nii.gz"
)
fnames.append(
f"func/{t_sub}_task-{t}_space-"
"T1w_desc-preproc_bold.json"
)
fnames.append(
f"func/{t_sub}_task-{t}_space-"
"MNI152NLin2009cAsym_desc-preproc_bold.json"
)
# BOLD brain mask native
fnames.append(
f"func/{t_sub}_task-{t}_space-"
"T1w_desc-brain_mask.nii.gz"
)
# BOLD brain mask MNI152NLin2009cAsym
fnames.append(
f"func/{t_sub}_task-{t}_space-"
"MNI152NLin2009cAsym_desc-brain_mask.nii.gz"
)
# BOLD confounds
fnames.append(
f"func/{t_sub}_task-{t}_desc-confounds"
"_regressors.tsv"
@ -84,6 +117,15 @@ with TemporaryDirectory() as tmpdir_name:
f"func/{t_sub}_task-{t}_desc-confounds"
"_regressors.json"
)
# BOLD reference native
fnames.append(
f"func/{t_sub}_task-{t}_" "space-T1w_boldref.nii.gz"
)
# BOLD reference MNI152NLin2009cAsym
fnames.append(
f"func/{t_sub}_task-{t}_"
"space-MNI152NLin2009cAsym_boldref.nii.gz"
)
elif dtype == "dwipreproc":
dname = "dwi"