junifer 0.0.5.dev240__py3-none-any.whl → 0.0.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- junifer/__init__.py +2 -31
- junifer/__init__.pyi +37 -0
- junifer/_version.py +9 -4
- junifer/api/__init__.py +3 -5
- junifer/api/__init__.pyi +4 -0
- junifer/api/decorators.py +14 -19
- junifer/api/functions.py +165 -109
- junifer/api/py.typed +0 -0
- junifer/api/queue_context/__init__.py +2 -4
- junifer/api/queue_context/__init__.pyi +5 -0
- junifer/api/queue_context/gnu_parallel_local_adapter.py +22 -6
- junifer/api/queue_context/htcondor_adapter.py +23 -6
- junifer/api/queue_context/py.typed +0 -0
- junifer/api/queue_context/tests/test_gnu_parallel_local_adapter.py +3 -3
- junifer/api/queue_context/tests/test_htcondor_adapter.py +3 -3
- junifer/api/tests/test_functions.py +168 -74
- junifer/cli/__init__.py +24 -0
- junifer/cli/__init__.pyi +3 -0
- junifer/{api → cli}/cli.py +141 -125
- junifer/cli/parser.py +235 -0
- junifer/cli/py.typed +0 -0
- junifer/{api → cli}/tests/test_cli.py +8 -8
- junifer/{api/tests/test_api_utils.py → cli/tests/test_cli_utils.py} +5 -4
- junifer/{api → cli}/tests/test_parser.py +2 -2
- junifer/{api → cli}/utils.py +6 -16
- junifer/configs/juseless/__init__.py +2 -2
- junifer/configs/juseless/__init__.pyi +3 -0
- junifer/configs/juseless/datagrabbers/__init__.py +2 -12
- junifer/configs/juseless/datagrabbers/__init__.pyi +13 -0
- junifer/configs/juseless/datagrabbers/ixi_vbm.py +2 -2
- junifer/configs/juseless/datagrabbers/py.typed +0 -0
- junifer/configs/juseless/datagrabbers/tests/test_ucla.py +2 -2
- junifer/configs/juseless/datagrabbers/ucla.py +4 -4
- junifer/configs/juseless/py.typed +0 -0
- junifer/conftest.py +25 -0
- junifer/data/__init__.py +2 -42
- junifer/data/__init__.pyi +29 -0
- junifer/data/_dispatch.py +248 -0
- junifer/data/coordinates/__init__.py +9 -0
- junifer/data/coordinates/__init__.pyi +5 -0
- junifer/data/coordinates/_ants_coordinates_warper.py +104 -0
- junifer/data/coordinates/_coordinates.py +385 -0
- junifer/data/coordinates/_fsl_coordinates_warper.py +81 -0
- junifer/data/{tests → coordinates/tests}/test_coordinates.py +26 -33
- junifer/data/masks/__init__.py +9 -0
- junifer/data/masks/__init__.pyi +6 -0
- junifer/data/masks/_ants_mask_warper.py +177 -0
- junifer/data/masks/_fsl_mask_warper.py +106 -0
- junifer/data/masks/_masks.py +802 -0
- junifer/data/{tests → masks/tests}/test_masks.py +67 -63
- junifer/data/parcellations/__init__.py +9 -0
- junifer/data/parcellations/__init__.pyi +6 -0
- junifer/data/parcellations/_ants_parcellation_warper.py +166 -0
- junifer/data/parcellations/_fsl_parcellation_warper.py +89 -0
- junifer/data/parcellations/_parcellations.py +1388 -0
- junifer/data/{tests → parcellations/tests}/test_parcellations.py +165 -295
- junifer/data/pipeline_data_registry_base.py +76 -0
- junifer/data/py.typed +0 -0
- junifer/data/template_spaces.py +44 -79
- junifer/data/tests/test_data_utils.py +1 -2
- junifer/data/tests/test_template_spaces.py +8 -4
- junifer/data/utils.py +109 -4
- junifer/datagrabber/__init__.py +2 -26
- junifer/datagrabber/__init__.pyi +27 -0
- junifer/datagrabber/aomic/__init__.py +2 -4
- junifer/datagrabber/aomic/__init__.pyi +5 -0
- junifer/datagrabber/aomic/id1000.py +81 -52
- junifer/datagrabber/aomic/piop1.py +83 -55
- junifer/datagrabber/aomic/piop2.py +85 -56
- junifer/datagrabber/aomic/py.typed +0 -0
- junifer/datagrabber/aomic/tests/test_id1000.py +19 -12
- junifer/datagrabber/aomic/tests/test_piop1.py +52 -18
- junifer/datagrabber/aomic/tests/test_piop2.py +50 -17
- junifer/datagrabber/base.py +22 -18
- junifer/datagrabber/datalad_base.py +71 -34
- junifer/datagrabber/dmcc13_benchmark.py +31 -18
- junifer/datagrabber/hcp1200/__init__.py +2 -3
- junifer/datagrabber/hcp1200/__init__.pyi +4 -0
- junifer/datagrabber/hcp1200/datalad_hcp1200.py +3 -3
- junifer/datagrabber/hcp1200/hcp1200.py +26 -15
- junifer/datagrabber/hcp1200/py.typed +0 -0
- junifer/datagrabber/hcp1200/tests/test_hcp1200.py +8 -2
- junifer/datagrabber/multiple.py +14 -9
- junifer/datagrabber/pattern.py +132 -96
- junifer/datagrabber/pattern_validation_mixin.py +206 -94
- junifer/datagrabber/py.typed +0 -0
- junifer/datagrabber/tests/test_datalad_base.py +27 -12
- junifer/datagrabber/tests/test_dmcc13_benchmark.py +28 -11
- junifer/datagrabber/tests/test_multiple.py +48 -2
- junifer/datagrabber/tests/test_pattern_datalad.py +1 -1
- junifer/datagrabber/tests/test_pattern_validation_mixin.py +6 -6
- junifer/datareader/__init__.py +2 -2
- junifer/datareader/__init__.pyi +3 -0
- junifer/datareader/default.py +6 -6
- junifer/datareader/py.typed +0 -0
- junifer/external/nilearn/__init__.py +2 -3
- junifer/external/nilearn/__init__.pyi +4 -0
- junifer/external/nilearn/junifer_connectivity_measure.py +25 -17
- junifer/external/nilearn/junifer_nifti_spheres_masker.py +4 -4
- junifer/external/nilearn/py.typed +0 -0
- junifer/external/nilearn/tests/test_junifer_connectivity_measure.py +17 -16
- junifer/external/nilearn/tests/test_junifer_nifti_spheres_masker.py +2 -3
- junifer/markers/__init__.py +2 -38
- junifer/markers/__init__.pyi +37 -0
- junifer/markers/base.py +11 -14
- junifer/markers/brainprint.py +12 -14
- junifer/markers/complexity/__init__.py +2 -18
- junifer/markers/complexity/__init__.pyi +17 -0
- junifer/markers/complexity/complexity_base.py +9 -11
- junifer/markers/complexity/hurst_exponent.py +7 -7
- junifer/markers/complexity/multiscale_entropy_auc.py +7 -7
- junifer/markers/complexity/perm_entropy.py +7 -7
- junifer/markers/complexity/py.typed +0 -0
- junifer/markers/complexity/range_entropy.py +7 -7
- junifer/markers/complexity/range_entropy_auc.py +7 -7
- junifer/markers/complexity/sample_entropy.py +7 -7
- junifer/markers/complexity/tests/test_complexity_base.py +1 -1
- junifer/markers/complexity/tests/test_hurst_exponent.py +5 -5
- junifer/markers/complexity/tests/test_multiscale_entropy_auc.py +5 -5
- junifer/markers/complexity/tests/test_perm_entropy.py +5 -5
- junifer/markers/complexity/tests/test_range_entropy.py +5 -5
- junifer/markers/complexity/tests/test_range_entropy_auc.py +5 -5
- junifer/markers/complexity/tests/test_sample_entropy.py +5 -5
- junifer/markers/complexity/tests/test_weighted_perm_entropy.py +5 -5
- junifer/markers/complexity/weighted_perm_entropy.py +7 -7
- junifer/markers/ets_rss.py +12 -11
- junifer/markers/falff/__init__.py +2 -3
- junifer/markers/falff/__init__.pyi +4 -0
- junifer/markers/falff/_afni_falff.py +38 -45
- junifer/markers/falff/_junifer_falff.py +16 -19
- junifer/markers/falff/falff_base.py +7 -11
- junifer/markers/falff/falff_parcels.py +9 -9
- junifer/markers/falff/falff_spheres.py +8 -8
- junifer/markers/falff/py.typed +0 -0
- junifer/markers/falff/tests/test_falff_spheres.py +3 -1
- junifer/markers/functional_connectivity/__init__.py +2 -12
- junifer/markers/functional_connectivity/__init__.pyi +13 -0
- junifer/markers/functional_connectivity/crossparcellation_functional_connectivity.py +9 -8
- junifer/markers/functional_connectivity/edge_functional_connectivity_parcels.py +8 -8
- junifer/markers/functional_connectivity/edge_functional_connectivity_spheres.py +7 -7
- junifer/markers/functional_connectivity/functional_connectivity_base.py +13 -12
- junifer/markers/functional_connectivity/functional_connectivity_parcels.py +8 -8
- junifer/markers/functional_connectivity/functional_connectivity_spheres.py +7 -7
- junifer/markers/functional_connectivity/py.typed +0 -0
- junifer/markers/functional_connectivity/tests/test_edge_functional_connectivity_parcels.py +1 -2
- junifer/markers/functional_connectivity/tests/test_edge_functional_connectivity_spheres.py +1 -2
- junifer/markers/functional_connectivity/tests/test_functional_connectivity_parcels.py +6 -6
- junifer/markers/functional_connectivity/tests/test_functional_connectivity_spheres.py +5 -5
- junifer/markers/parcel_aggregation.py +22 -17
- junifer/markers/py.typed +0 -0
- junifer/markers/reho/__init__.py +2 -3
- junifer/markers/reho/__init__.pyi +4 -0
- junifer/markers/reho/_afni_reho.py +29 -35
- junifer/markers/reho/_junifer_reho.py +13 -14
- junifer/markers/reho/py.typed +0 -0
- junifer/markers/reho/reho_base.py +7 -11
- junifer/markers/reho/reho_parcels.py +10 -10
- junifer/markers/reho/reho_spheres.py +9 -9
- junifer/markers/sphere_aggregation.py +22 -17
- junifer/markers/temporal_snr/__init__.py +2 -3
- junifer/markers/temporal_snr/__init__.pyi +4 -0
- junifer/markers/temporal_snr/py.typed +0 -0
- junifer/markers/temporal_snr/temporal_snr_base.py +11 -10
- junifer/markers/temporal_snr/temporal_snr_parcels.py +8 -8
- junifer/markers/temporal_snr/temporal_snr_spheres.py +7 -7
- junifer/markers/tests/test_ets_rss.py +3 -3
- junifer/markers/tests/test_parcel_aggregation.py +24 -24
- junifer/markers/tests/test_sphere_aggregation.py +6 -6
- junifer/markers/utils.py +3 -3
- junifer/onthefly/__init__.py +2 -1
- junifer/onthefly/_brainprint.py +138 -0
- junifer/onthefly/read_transform.py +5 -8
- junifer/pipeline/__init__.py +2 -10
- junifer/pipeline/__init__.pyi +13 -0
- junifer/{markers/collection.py → pipeline/marker_collection.py} +8 -14
- junifer/pipeline/pipeline_component_registry.py +294 -0
- junifer/pipeline/pipeline_step_mixin.py +15 -11
- junifer/pipeline/py.typed +0 -0
- junifer/{markers/tests/test_collection.py → pipeline/tests/test_marker_collection.py} +2 -3
- junifer/pipeline/tests/test_pipeline_component_registry.py +200 -0
- junifer/pipeline/tests/test_pipeline_step_mixin.py +36 -37
- junifer/pipeline/tests/test_update_meta_mixin.py +4 -4
- junifer/pipeline/tests/test_workdir_manager.py +43 -0
- junifer/pipeline/update_meta_mixin.py +21 -17
- junifer/pipeline/utils.py +6 -6
- junifer/pipeline/workdir_manager.py +19 -5
- junifer/preprocess/__init__.py +2 -10
- junifer/preprocess/__init__.pyi +11 -0
- junifer/preprocess/base.py +10 -10
- junifer/preprocess/confounds/__init__.py +2 -2
- junifer/preprocess/confounds/__init__.pyi +3 -0
- junifer/preprocess/confounds/fmriprep_confound_remover.py +243 -64
- junifer/preprocess/confounds/py.typed +0 -0
- junifer/preprocess/confounds/tests/test_fmriprep_confound_remover.py +121 -14
- junifer/preprocess/py.typed +0 -0
- junifer/preprocess/smoothing/__init__.py +2 -2
- junifer/preprocess/smoothing/__init__.pyi +3 -0
- junifer/preprocess/smoothing/_afni_smoothing.py +40 -40
- junifer/preprocess/smoothing/_fsl_smoothing.py +22 -32
- junifer/preprocess/smoothing/_nilearn_smoothing.py +35 -14
- junifer/preprocess/smoothing/py.typed +0 -0
- junifer/preprocess/smoothing/smoothing.py +11 -13
- junifer/preprocess/warping/__init__.py +2 -2
- junifer/preprocess/warping/__init__.pyi +3 -0
- junifer/preprocess/warping/_ants_warper.py +136 -32
- junifer/preprocess/warping/_fsl_warper.py +73 -22
- junifer/preprocess/warping/py.typed +0 -0
- junifer/preprocess/warping/space_warper.py +39 -11
- junifer/preprocess/warping/tests/test_space_warper.py +5 -9
- junifer/py.typed +0 -0
- junifer/stats.py +5 -5
- junifer/storage/__init__.py +2 -10
- junifer/storage/__init__.pyi +11 -0
- junifer/storage/base.py +47 -13
- junifer/storage/hdf5.py +95 -33
- junifer/storage/pandas_base.py +12 -11
- junifer/storage/py.typed +0 -0
- junifer/storage/sqlite.py +11 -11
- junifer/storage/tests/test_hdf5.py +86 -4
- junifer/storage/tests/test_sqlite.py +2 -2
- junifer/storage/tests/test_storage_base.py +5 -2
- junifer/storage/tests/test_utils.py +33 -7
- junifer/storage/utils.py +95 -9
- junifer/testing/__init__.py +2 -3
- junifer/testing/__init__.pyi +4 -0
- junifer/testing/datagrabbers.py +10 -11
- junifer/testing/py.typed +0 -0
- junifer/testing/registry.py +4 -7
- junifer/testing/tests/test_testing_registry.py +9 -17
- junifer/tests/test_stats.py +2 -2
- junifer/typing/__init__.py +9 -0
- junifer/typing/__init__.pyi +31 -0
- junifer/typing/_typing.py +68 -0
- junifer/utils/__init__.py +2 -12
- junifer/utils/__init__.pyi +18 -0
- junifer/utils/_config.py +110 -0
- junifer/utils/_yaml.py +16 -0
- junifer/utils/helpers.py +6 -6
- junifer/utils/logging.py +117 -8
- junifer/utils/py.typed +0 -0
- junifer/{pipeline → utils}/singleton.py +19 -14
- junifer/utils/tests/test_config.py +59 -0
- {junifer-0.0.5.dev240.dist-info → junifer-0.0.6.dist-info}/METADATA +43 -38
- junifer-0.0.6.dist-info/RECORD +350 -0
- {junifer-0.0.5.dev240.dist-info → junifer-0.0.6.dist-info}/WHEEL +1 -1
- junifer-0.0.6.dist-info/entry_points.txt +2 -0
- junifer/api/parser.py +0 -118
- junifer/data/coordinates.py +0 -408
- junifer/data/masks.py +0 -670
- junifer/data/parcellations.py +0 -1828
- junifer/pipeline/registry.py +0 -177
- junifer/pipeline/tests/test_registry.py +0 -150
- junifer-0.0.5.dev240.dist-info/RECORD +0 -275
- junifer-0.0.5.dev240.dist-info/entry_points.txt +0 -2
- /junifer/{api → cli}/tests/data/gmd_mean.yaml +0 -0
- /junifer/{api → cli}/tests/data/gmd_mean_htcondor.yaml +0 -0
- /junifer/{api → cli}/tests/data/partly_cloudy_agg_mean_tian.yml +0 -0
- /junifer/data/{VOIs → coordinates/VOIs}/meta/AutobiographicalMemory_VOIs.txt +0 -0
- /junifer/data/{VOIs → coordinates/VOIs}/meta/CogAC_VOIs.txt +0 -0
- /junifer/data/{VOIs → coordinates/VOIs}/meta/CogAR_VOIs.txt +0 -0
- /junifer/data/{VOIs → coordinates/VOIs}/meta/DMNBuckner_VOIs.txt +0 -0
- /junifer/data/{VOIs → coordinates/VOIs}/meta/Dosenbach2010_MNI_VOIs.txt +0 -0
- /junifer/data/{VOIs → coordinates/VOIs}/meta/Empathy_VOIs.txt +0 -0
- /junifer/data/{VOIs → coordinates/VOIs}/meta/Motor_VOIs.txt +0 -0
- /junifer/data/{VOIs → coordinates/VOIs}/meta/MultiTask_VOIs.txt +0 -0
- /junifer/data/{VOIs → coordinates/VOIs}/meta/PhysioStress_VOIs.txt +0 -0
- /junifer/data/{VOIs → coordinates/VOIs}/meta/Power2011_MNI_VOIs.txt +0 -0
- /junifer/data/{VOIs → coordinates/VOIs}/meta/Power2013_MNI_VOIs.tsv +0 -0
- /junifer/data/{VOIs → coordinates/VOIs}/meta/Rew_VOIs.txt +0 -0
- /junifer/data/{VOIs → coordinates/VOIs}/meta/Somatosensory_VOIs.txt +0 -0
- /junifer/data/{VOIs → coordinates/VOIs}/meta/ToM_VOIs.txt +0 -0
- /junifer/data/{VOIs → coordinates/VOIs}/meta/VigAtt_VOIs.txt +0 -0
- /junifer/data/{VOIs → coordinates/VOIs}/meta/WM_VOIs.txt +0 -0
- /junifer/data/{VOIs → coordinates/VOIs}/meta/eMDN_VOIs.txt +0 -0
- /junifer/data/{VOIs → coordinates/VOIs}/meta/eSAD_VOIs.txt +0 -0
- /junifer/data/{VOIs → coordinates/VOIs}/meta/extDMN_VOIs.txt +0 -0
- {junifer-0.0.5.dev240.dist-info → junifer-0.0.6.dist-info/licenses}/AUTHORS.rst +0 -0
- {junifer-0.0.5.dev240.dist-info → junifer-0.0.6.dist-info/licenses}/LICENSE.md +0 -0
- {junifer-0.0.5.dev240.dist-info → junifer-0.0.6.dist-info}/top_level.txt +0 -0
@@ -8,9 +8,10 @@
|
|
8
8
|
# License: AGPL
|
9
9
|
|
10
10
|
from pathlib import Path
|
11
|
-
from typing import
|
11
|
+
from typing import Union
|
12
12
|
|
13
13
|
from ...api.decorators import register_datagrabber
|
14
|
+
from ...utils import raise_error
|
14
15
|
from ..pattern_datalad import PatternDataladDataGrabber
|
15
16
|
|
16
17
|
|
@@ -31,34 +32,49 @@ class DataladAOMICID1000(PatternDataladDataGrabber):
|
|
31
32
|
"FreeSurfer"} or list of the options, optional
|
32
33
|
AOMIC data types. If None, all available data types are selected.
|
33
34
|
(default None).
|
34
|
-
|
35
|
-
|
35
|
+
space : {"native", "MNI152NLin2009cAsym"}, optional
|
36
|
+
The space to use for the data (default "MNI152NLin2009cAsym").
|
36
37
|
|
37
38
|
"""
|
38
39
|
|
39
40
|
def __init__(
|
40
41
|
self,
|
41
42
|
datadir: Union[str, Path, None] = None,
|
42
|
-
types: Union[str,
|
43
|
-
|
43
|
+
types: Union[str, list[str], None] = None,
|
44
|
+
space: str = "MNI152NLin2009cAsym",
|
44
45
|
) -> None:
|
46
|
+
valid_spaces = ["native", "MNI152NLin2009cAsym"]
|
47
|
+
if space not in ["native", "MNI152NLin2009cAsym"]:
|
48
|
+
raise_error(
|
49
|
+
f"Invalid space {space}. Must be one of {valid_spaces}"
|
50
|
+
)
|
51
|
+
|
52
|
+
# Descriptor for space in `anat`
|
53
|
+
sp_anat_desc = (
|
54
|
+
"" if space == "native" else "space-MNI152NLin2009cAsym_"
|
55
|
+
)
|
56
|
+
# Descriptor for space in `func`
|
57
|
+
sp_func_desc = (
|
58
|
+
"space-T1w_" if space == "native" else "space-MNI152NLin2009cAsym_"
|
59
|
+
)
|
45
60
|
# The patterns
|
46
61
|
patterns = {
|
47
62
|
"BOLD": {
|
48
63
|
"pattern": (
|
49
64
|
"derivatives/fmriprep/{subject}/func/"
|
50
65
|
"{subject}_task-moviewatching_"
|
51
|
-
"
|
66
|
+
f"{sp_func_desc}"
|
67
|
+
"desc-preproc_bold.nii.gz"
|
52
68
|
),
|
53
|
-
"space":
|
69
|
+
"space": space,
|
54
70
|
"mask": {
|
55
71
|
"pattern": (
|
56
72
|
"derivatives/fmriprep/{subject}/func/"
|
57
73
|
"{subject}_task-moviewatching_"
|
58
|
-
"
|
74
|
+
f"{sp_func_desc}"
|
59
75
|
"desc-brain_mask.nii.gz"
|
60
76
|
),
|
61
|
-
"space":
|
77
|
+
"space": space,
|
62
78
|
},
|
63
79
|
"confounds": {
|
64
80
|
"pattern": (
|
@@ -68,46 +84,59 @@ class DataladAOMICID1000(PatternDataladDataGrabber):
|
|
68
84
|
),
|
69
85
|
"format": "fmriprep",
|
70
86
|
},
|
87
|
+
"reference": {
|
88
|
+
"pattern": (
|
89
|
+
"derivatives/fmriprep/{subject}/func/"
|
90
|
+
"{subject}_task-moviewatching_"
|
91
|
+
f"{sp_func_desc}"
|
92
|
+
"boldref.nii.gz"
|
93
|
+
),
|
94
|
+
},
|
71
95
|
},
|
72
96
|
"T1w": {
|
73
97
|
"pattern": (
|
74
98
|
"derivatives/fmriprep/{subject}/anat/"
|
75
|
-
"{subject}
|
99
|
+
"{subject}_"
|
100
|
+
f"{sp_anat_desc}"
|
76
101
|
"desc-preproc_T1w.nii.gz"
|
77
102
|
),
|
78
|
-
"space":
|
103
|
+
"space": space,
|
79
104
|
"mask": {
|
80
105
|
"pattern": (
|
81
106
|
"derivatives/fmriprep/{subject}/anat/"
|
82
|
-
"{subject}
|
107
|
+
"{subject}_"
|
108
|
+
f"{sp_anat_desc}"
|
83
109
|
"desc-brain_mask.nii.gz"
|
84
110
|
),
|
85
|
-
"space":
|
111
|
+
"space": space,
|
86
112
|
},
|
87
113
|
},
|
88
114
|
"VBM_CSF": {
|
89
115
|
"pattern": (
|
90
116
|
"derivatives/fmriprep/{subject}/anat/"
|
91
|
-
"{subject}
|
92
|
-
"
|
117
|
+
"{subject}_"
|
118
|
+
f"{sp_anat_desc}"
|
119
|
+
"label-CSF_probseg.nii.gz"
|
93
120
|
),
|
94
|
-
"space":
|
121
|
+
"space": space,
|
95
122
|
},
|
96
123
|
"VBM_GM": {
|
97
124
|
"pattern": (
|
98
125
|
"derivatives/fmriprep/{subject}/anat/"
|
99
|
-
"{subject}
|
100
|
-
"
|
126
|
+
"{subject}_"
|
127
|
+
f"{sp_anat_desc}"
|
128
|
+
"label-GM_probseg.nii.gz"
|
101
129
|
),
|
102
|
-
"space":
|
130
|
+
"space": space,
|
103
131
|
},
|
104
132
|
"VBM_WM": {
|
105
133
|
"pattern": (
|
106
134
|
"derivatives/fmriprep/{subject}/anat/"
|
107
|
-
"{subject}
|
108
|
-
"
|
135
|
+
"{subject}_"
|
136
|
+
f"{sp_anat_desc}"
|
137
|
+
"label-WM_probseg.nii.gz"
|
109
138
|
),
|
110
|
-
"space":
|
139
|
+
"space": space,
|
111
140
|
},
|
112
141
|
"DWI": {
|
113
142
|
"pattern": (
|
@@ -148,38 +177,38 @@ class DataladAOMICID1000(PatternDataladDataGrabber):
|
|
148
177
|
)
|
149
178
|
},
|
150
179
|
},
|
180
|
+
"Warp": [
|
181
|
+
{
|
182
|
+
"pattern": (
|
183
|
+
"derivatives/fmriprep/{subject}/anat/"
|
184
|
+
"{subject}_from-MNI152NLin2009cAsym_to-T1w_"
|
185
|
+
"mode-image_xfm.h5"
|
186
|
+
),
|
187
|
+
"src": "MNI152NLin2009cAsym",
|
188
|
+
"dst": "native",
|
189
|
+
"warper": "ants",
|
190
|
+
},
|
191
|
+
{
|
192
|
+
"pattern": (
|
193
|
+
"derivatives/fmriprep/{subject}/anat/"
|
194
|
+
"{subject}_from-T1w_to-MNI152NLin2009cAsym_"
|
195
|
+
"mode-image_xfm.h5"
|
196
|
+
),
|
197
|
+
"src": "native",
|
198
|
+
"dst": "MNI152NLin2009cAsym",
|
199
|
+
"warper": "ants",
|
200
|
+
},
|
201
|
+
],
|
151
202
|
}
|
203
|
+
if space == "native":
|
204
|
+
patterns["BOLD"]["prewarp_space"] = "MNI152NLin2009cAsym"
|
205
|
+
|
206
|
+
else:
|
207
|
+
patterns["BOLD"]["prewarp_space"] = "native"
|
208
|
+
|
152
209
|
# Use native T1w assets
|
153
|
-
self.
|
154
|
-
|
155
|
-
self.native_t1w = True
|
156
|
-
patterns.update(
|
157
|
-
{
|
158
|
-
"T1w": {
|
159
|
-
"pattern": (
|
160
|
-
"derivatives/fmriprep/{subject}/anat/"
|
161
|
-
"{subject}_desc-preproc_T1w.nii.gz"
|
162
|
-
),
|
163
|
-
"space": "native",
|
164
|
-
"mask": {
|
165
|
-
"pattern": (
|
166
|
-
"derivatives/fmriprep/{subject}/anat/"
|
167
|
-
"{subject}_desc-brain_mask.nii.gz"
|
168
|
-
),
|
169
|
-
"space": "native",
|
170
|
-
},
|
171
|
-
},
|
172
|
-
"Warp": {
|
173
|
-
"pattern": (
|
174
|
-
"derivatives/fmriprep/{subject}/anat/"
|
175
|
-
"{subject}_from-MNI152NLin2009cAsym_to-T1w_"
|
176
|
-
"mode-image_xfm.h5"
|
177
|
-
),
|
178
|
-
"src": "MNI152NLin2009cAsym",
|
179
|
-
"dst": "native",
|
180
|
-
},
|
181
|
-
}
|
182
|
-
)
|
210
|
+
self.space = space
|
211
|
+
|
183
212
|
# Set default types
|
184
213
|
if types is None:
|
185
214
|
types = list(patterns.keys())
|
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
from itertools import product
|
11
11
|
from pathlib import Path
|
12
|
-
from typing import
|
12
|
+
from typing import Union
|
13
13
|
|
14
14
|
from ...api.decorators import register_datagrabber
|
15
15
|
from ...utils import raise_error
|
@@ -37,8 +37,8 @@ class DataladAOMICPIOP1(PatternDataladDataGrabber):
|
|
37
37
|
"gstroop", "workingmemory"} or list of the options, optional
|
38
38
|
AOMIC PIOP1 task sessions. If None, all available task sessions are
|
39
39
|
selected (default None).
|
40
|
-
|
41
|
-
|
40
|
+
space : {"native", "MNI152NLin2009cAsym"}, optional
|
41
|
+
The space to use for the data (default "MNI152NLin2009cAsym").
|
42
42
|
|
43
43
|
Raises
|
44
44
|
------
|
@@ -50,10 +50,15 @@ class DataladAOMICPIOP1(PatternDataladDataGrabber):
|
|
50
50
|
def __init__(
|
51
51
|
self,
|
52
52
|
datadir: Union[str, Path, None] = None,
|
53
|
-
types: Union[str,
|
54
|
-
tasks: Union[str,
|
55
|
-
|
53
|
+
types: Union[str, list[str], None] = None,
|
54
|
+
tasks: Union[str, list[str], None] = None,
|
55
|
+
space: str = "MNI152NLin2009cAsym",
|
56
56
|
) -> None:
|
57
|
+
valid_spaces = ["native", "MNI152NLin2009cAsym"]
|
58
|
+
if space not in ["native", "MNI152NLin2009cAsym"]:
|
59
|
+
raise_error(
|
60
|
+
f"Invalid space {space}. Must be one of {valid_spaces}"
|
61
|
+
)
|
57
62
|
# Declare all tasks
|
58
63
|
all_tasks = [
|
59
64
|
"restingstate",
|
@@ -78,22 +83,32 @@ class DataladAOMICPIOP1(PatternDataladDataGrabber):
|
|
78
83
|
" dataset!"
|
79
84
|
)
|
80
85
|
self.tasks = tasks
|
86
|
+
# Descriptor for space in `anat`
|
87
|
+
sp_anat_desc = (
|
88
|
+
"" if space == "native" else "space-MNI152NLin2009cAsym_"
|
89
|
+
)
|
90
|
+
# Descriptor for space in `func`
|
91
|
+
sp_func_desc = (
|
92
|
+
"space-T1w_" if space == "native" else "space-MNI152NLin2009cAsym_"
|
93
|
+
)
|
81
94
|
# The patterns
|
82
95
|
patterns = {
|
83
96
|
"BOLD": {
|
84
97
|
"pattern": (
|
85
98
|
"derivatives/fmriprep/{subject}/func/"
|
86
99
|
"{subject}_task-{task}_"
|
87
|
-
"
|
100
|
+
f"{sp_func_desc}"
|
101
|
+
"desc-preproc_bold.nii.gz"
|
88
102
|
),
|
89
|
-
"space":
|
103
|
+
"space": space,
|
90
104
|
"mask": {
|
91
105
|
"pattern": (
|
92
106
|
"derivatives/fmriprep/{subject}/func/"
|
93
107
|
"{subject}_task-{task}_"
|
94
|
-
"
|
108
|
+
f"{sp_func_desc}"
|
109
|
+
"desc-brain_mask.nii.gz"
|
95
110
|
),
|
96
|
-
"space":
|
111
|
+
"space": space,
|
97
112
|
},
|
98
113
|
"confounds": {
|
99
114
|
"pattern": (
|
@@ -103,46 +118,59 @@ class DataladAOMICPIOP1(PatternDataladDataGrabber):
|
|
103
118
|
),
|
104
119
|
"format": "fmriprep",
|
105
120
|
},
|
121
|
+
"reference": {
|
122
|
+
"pattern": (
|
123
|
+
"derivatives/fmriprep/{subject}/func/"
|
124
|
+
"{subject}_task-{task}_"
|
125
|
+
f"{sp_func_desc}"
|
126
|
+
"boldref.nii.gz"
|
127
|
+
),
|
128
|
+
},
|
106
129
|
},
|
107
130
|
"T1w": {
|
108
131
|
"pattern": (
|
109
132
|
"derivatives/fmriprep/{subject}/anat/"
|
110
|
-
"{subject}
|
133
|
+
"{subject}_"
|
134
|
+
f"{sp_anat_desc}"
|
111
135
|
"desc-preproc_T1w.nii.gz"
|
112
136
|
),
|
113
|
-
"space":
|
137
|
+
"space": space,
|
114
138
|
"mask": {
|
115
139
|
"pattern": (
|
116
140
|
"derivatives/fmriprep/{subject}/anat/"
|
117
|
-
"{subject}
|
141
|
+
"{subject}_"
|
142
|
+
f"{sp_anat_desc}"
|
118
143
|
"desc-brain_mask.nii.gz"
|
119
144
|
),
|
120
|
-
"space":
|
145
|
+
"space": space,
|
121
146
|
},
|
122
147
|
},
|
123
148
|
"VBM_CSF": {
|
124
149
|
"pattern": (
|
125
150
|
"derivatives/fmriprep/{subject}/anat/"
|
126
|
-
"{subject}
|
127
|
-
"
|
151
|
+
"{subject}_"
|
152
|
+
f"{sp_anat_desc}"
|
153
|
+
"label-CSF_probseg.nii.gz"
|
128
154
|
),
|
129
|
-
"space":
|
155
|
+
"space": space,
|
130
156
|
},
|
131
157
|
"VBM_GM": {
|
132
158
|
"pattern": (
|
133
159
|
"derivatives/fmriprep/{subject}/anat/"
|
134
|
-
"{subject}
|
135
|
-
"
|
160
|
+
"{subject}_"
|
161
|
+
f"{sp_anat_desc}"
|
162
|
+
"label-GM_probseg.nii.gz"
|
136
163
|
),
|
137
|
-
"space":
|
164
|
+
"space": space,
|
138
165
|
},
|
139
166
|
"VBM_WM": {
|
140
167
|
"pattern": (
|
141
168
|
"derivatives/fmriprep/{subject}/anat/"
|
142
|
-
"{subject}
|
143
|
-
"
|
169
|
+
"{subject}_"
|
170
|
+
f"{sp_anat_desc}"
|
171
|
+
"label-WM_probseg.nii.gz"
|
144
172
|
),
|
145
|
-
"space":
|
173
|
+
"space": space,
|
146
174
|
},
|
147
175
|
"DWI": {
|
148
176
|
"pattern": (
|
@@ -183,38 +211,38 @@ class DataladAOMICPIOP1(PatternDataladDataGrabber):
|
|
183
211
|
)
|
184
212
|
},
|
185
213
|
},
|
214
|
+
"Warp": [
|
215
|
+
{
|
216
|
+
"pattern": (
|
217
|
+
"derivatives/fmriprep/{subject}/anat/"
|
218
|
+
"{subject}_from-MNI152NLin2009cAsym_to-T1w_"
|
219
|
+
"mode-image_xfm.h5"
|
220
|
+
),
|
221
|
+
"src": "MNI152NLin2009cAsym",
|
222
|
+
"dst": "native",
|
223
|
+
"warper": "ants",
|
224
|
+
},
|
225
|
+
{
|
226
|
+
"pattern": (
|
227
|
+
"derivatives/fmriprep/{subject}/anat/"
|
228
|
+
"{subject}_from-T1w_to-MNI152NLin2009cAsym_"
|
229
|
+
"mode-image_xfm.h5"
|
230
|
+
),
|
231
|
+
"src": "native",
|
232
|
+
"dst": "MNI152NLin2009cAsym",
|
233
|
+
"warper": "ants",
|
234
|
+
},
|
235
|
+
],
|
186
236
|
}
|
237
|
+
|
238
|
+
if space == "native":
|
239
|
+
patterns["BOLD"]["prewarp_space"] = "MNI152NLin2009cAsym"
|
240
|
+
else:
|
241
|
+
patterns["BOLD"]["prewarp_space"] = "native"
|
242
|
+
|
187
243
|
# Use native T1w assets
|
188
|
-
self.
|
189
|
-
|
190
|
-
self.native_t1w = True
|
191
|
-
patterns.update(
|
192
|
-
{
|
193
|
-
"T1w": {
|
194
|
-
"pattern": (
|
195
|
-
"derivatives/fmriprep/{subject}/anat/"
|
196
|
-
"{subject}_desc-preproc_T1w.nii.gz"
|
197
|
-
),
|
198
|
-
"space": "native",
|
199
|
-
"mask": {
|
200
|
-
"pattern": (
|
201
|
-
"derivatives/fmriprep/{subject}/anat/"
|
202
|
-
"{subject}_desc-brain_mask.nii.gz"
|
203
|
-
),
|
204
|
-
"space": "native",
|
205
|
-
},
|
206
|
-
},
|
207
|
-
"Warp": {
|
208
|
-
"pattern": (
|
209
|
-
"derivatives/fmriprep/{subject}/anat/"
|
210
|
-
"{subject}_from-MNI152NLin2009cAsym_to-T1w_"
|
211
|
-
"mode-image_xfm.h5"
|
212
|
-
),
|
213
|
-
"src": "MNI152NLin2009cAsym",
|
214
|
-
"dst": "native",
|
215
|
-
},
|
216
|
-
}
|
217
|
-
)
|
244
|
+
self.space = space
|
245
|
+
|
218
246
|
# Set default types
|
219
247
|
if types is None:
|
220
248
|
types = list(patterns.keys())
|
@@ -234,7 +262,7 @@ class DataladAOMICPIOP1(PatternDataladDataGrabber):
|
|
234
262
|
confounds_format="fmriprep",
|
235
263
|
)
|
236
264
|
|
237
|
-
def get_item(self, subject: str, task: str) ->
|
265
|
+
def get_item(self, subject: str, task: str) -> dict:
|
238
266
|
"""Index one element in the dataset.
|
239
267
|
|
240
268
|
Parameters
|
@@ -266,7 +294,7 @@ class DataladAOMICPIOP1(PatternDataladDataGrabber):
|
|
266
294
|
|
267
295
|
return super().get_item(subject=subject, task=new_task)
|
268
296
|
|
269
|
-
def get_elements(self) ->
|
297
|
+
def get_elements(self) -> list:
|
270
298
|
"""Implement fetching list of subjects in the dataset.
|
271
299
|
|
272
300
|
Returns
|